1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
|
/*
* Mach Operating System
* Copyright (c) 1991,1990,1989 Carnegie Mellon University
* All Rights Reserved.
*
* Permission to use, copy, modify and distribute this software and its
* documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie Mellon
* the rights to redistribute these changes.
*/
/* **********************************************************************
File: blitreg.h
Description: Bell Tech Blit card hardware description
$ Header: $
Copyright Ing. C. Olivetti & C. S.p.A. 1988, 1989.
All rights reserved.
********************************************************************** */
/*
Copyright 1988, 1989 by Olivetti Advanced Technology Center, Inc.,
Cupertino, California.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and
its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appears in all
copies and that both the copyright notice and this permission notice
appear in supporting documentation, and that the name of Olivetti
not be used in advertising or publicity pertaining to distribution
of the software without specific, written prior permission.
OLIVETTI DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
IN NO EVENT SHALL OLIVETTI BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUR OF OR IN CONNECTION
WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/*
* Some code taken from Bob Glossman's 1987 "minimal Blit Express
* driver", copyright unknown. Probably copyright Intel, too.
*/
#ifndef blitreg_DEFINED
#define blitreg_DEFINED
/*
* Registers accessible through AT I/O space. These addresses can be
* changed by changing bits 4-8 of the Blit's DIP switch.
*/
#define BLIT_CONFIG_ADDR 0x304
#define BLIT_DIAG_ADDR 0x306
#if defined(sun386) || defined(i386)
/*
* Layout of Blit control register.
*/
union blit_config_reg {
struct config_bits {
unsigned dos_segment : 4;
unsigned reset : 1;
unsigned mode : 1;
#define BLIT_UNIX_MODE 1
#define BLIT_DOS_MODE 0
unsigned invisible : 1;
#define BLIT_INVISIBLE 1
#define BLIT_VISIBLE 0
unsigned unused : 1;
} reg;
u_char byte;
};
/*
* Blit Diag register.
* The UNIX base address is currently hardwired to BLIT_BASE_ADDR.
*/
#define BLIT_BASE_ADDR 0xd80000 /* base of blit memory (phys addr) */
union blit_diag_reg {
struct diag_bits {
unsigned unix_base_addr : 5; /* phys addr (ignored) */
unsigned led0 : 1;
unsigned led1 : 1;
unsigned led2 : 1;
#define BLIT_LED_ON 1
#define BLIT_LED_OFF 0
} reg;
u_char byte;
};
#endif /* sun386 || i386 */
/*
* Graphics memory, 786 registers, static RAM, and EPROM, all
* accessible through mapped memory.
*/
#define BLIT_MONOWIDTH 1664
#define BLIT_MONOHEIGHT 1200
#define BLIT_MONOFBSIZE ((BLIT_MONOWIDTH*BLIT_MONOHEIGHT)/8)
/* byte size of monochrome fb */
#define BLIT_MEMSIZE 0x100000 /* num bytes mapped graphics memory */
#define BLIT_REGSIZE 128 /* bytes taken by 786 registers */
#define BLIT_REGPAD (0x10000 - BLIT_REGSIZE)
/* padding between reg's and SRAM */
#define BLIT_SRAMSIZE 0x4000 /* num bytes mapped for SRAM */
#define BLIT_SRAMPAD (0x10000 - BLIT_SRAMSIZE)
/* padding between SRAM and EPROM */
#define BLIT_EPROMSIZE 0x20000 /* num bytes mapped for EPROM */
/*
* Layout of the Blit's mapped memory. The physical address is (or
* will be, eventually) determined by the Diag register (above).
*/
struct blitdev {
u_char graphmem[BLIT_MEMSIZE];
u_char reg786[BLIT_REGSIZE];
u_char pad1[BLIT_REGPAD];
u_char sram[BLIT_SRAMSIZE];
u_char pad2[BLIT_SRAMPAD];
u_char eprom[BLIT_EPROMSIZE];
};
#define BLIT_MAPPED_SIZE sizeof(struct blitdev)
/*
* Offsets for 786 registers (i.e., indices into reg786[]).
*/
#define INTER_RELOC 0x00 /* Internal Relocation Register */
#define BIU_CONTROL 0x04 /* BIU Control Register */
#define DRAM_REFRESH 0x06 /* DRAM Refresh control register */
#define DRAM_CONTROL 0x08 /* DRAM control register */
#define DP_PRIORITY 0x0A /* DP priority register */
#define GP_PRIORITY 0x0C /* GP priority register*/
#define EXT_PRIORITY 0x0E /* External Priority Register*/
#define GP_OPCODE_REG 0x20 /* GP opcode register */
#define GP_PARM1_REG 0x22 /* GP Parameter 1 Register */
#define GP_PARM2_REG 0x24 /* GP Parameter 2 Register*/
#define GP_STAT_REG 0x26 /* GP Status Register*/
#define DP_OPCODE_REG 0x40 /* DP opcode register */
#define DP_PARM1_REG 0x42 /* DP Parameter 1 Register*/
#define DP_PARM2_REG 0x44 /* DP Parameter 2 Register*/
#define DP_PARM3_REG 0x46 /* DP Parameter 3 Register*/
#define DP_STAT_REG 0x48 /* DP Status Register*/
#define DEF_VIDEO_REG 0x4A /* DP Default Video Register*/
/*
* 786 BIU Control Register values.
*/
#define BIU_WP1 0x02 /* Write Protect One; 1 = on */
#define BIU_16BIT 0x10 /* access 786 registers as words; 0 = bytes */
/*
* 786 DRAM/VRAM Control Register values.
*/
/* RW bits */
#define MEMROWS1 0
#define MEMROWS2 0x20
#define MEMROWS3 0x40
#define MEMROWS4 0x60
/* DC bits */
#define PG_NONINTERLV 0
#define FASTPG_NONINTERLV 0x10
#define PG_INTERLV 0x08
#define FASTPG_INTERLV 0x18
/* HT bits */
#define HEIGHT_8K 0
#define HEIGHT_16K 0x1
#define HEIGHT_32K 0x2
#define HEIGHT_64K 0x3
#define HEIGHT_128K 0x4
#define HEIGHT_256K 0x5
#define HEIGHT_512K 0x6
#define HEIGHT_1M 0x7
/*
* 786 Graphics Processor opcodes.
*/
#define GECL 0x001 /* end of command list */
#define OP_LINK 0x200 /* LINK - "link next cmd" */
/*
* 786 Display Processor opcodes.
*/
#define DECL 1 /* end of list */
#define DP_LOADALL 0x500
/*
* Macros for accessing 786 registers (see BIU_16BIT) and EPROM.
*/
#define WRITEREG8(base,offset,val) \
(base)->reg786[(offset)] = (val) & 0xff, \
(base)->reg786[(offset)+1] = ((val) & 0xff00) >> 8
#define WRITEREG16(base,offset,val) \
(*((u_short *)((base)->reg786+(offset)))) = (val)
#define READREG(base,offset) \
(*((u_short *)(((base)->reg786+(offset)))))
#define WRITEROM(romp,offset,val) \
(*((u_short *)((romp)+(offset)))) = (val)
#define READROM(romp,offset) \
(*((u_short *)(((romp)+(offset)))))
/*
* Layout of Display Processor Control Block Registers. This block is
* allocated somewhere in the Blit's graphics memory, and a pointer to
* it is passed to the Display Processor.
*
* NOTE: The 786 only sees the memory mapped by the Blit. Thus all
* addresses passed to the 786 are relative to the start of the Blit's
* mapped memory.
*/
typedef int addr786_t; /* 0 = start of Blit mapped memory */
typedef struct {
u_short vidstat; /* video status */
u_short intrmask; /* interrupt mask */
u_short trip_point;
u_short frame_intr; /* frame interrupt */
u_short reserved1;
u_short crtmode; /* CRT controller mode */
u_short hsyncstop; /* monitor parameters */
u_short hfldstart;
u_short hfldstop;
u_short linelength;
u_short vsyncstop;
u_short vfldstart;
u_short vfldstop;
u_short vframelen;
u_short descl; /* descriptor pointer low part */
u_short desch; /* descriptor pointer high part */
u_short reserved2;
u_short xyzoom;
u_short fldcolor;
u_short bordercolor;
u_short bpp_pad1;
u_short bpp_pad2;
u_short bpp_pad4;
u_short csrmode; /* & CsrPad */
u_short cursorx; /* cursor x location */
u_short cursory; /* cursor y location */
u_short cursorpat[16]; /* cursor pattern */
} DPCONTROLBLK;
/*
* Values for 786 Display Processor Control Block Registers.
*/
/* video status */
#define DP_DSP_ON 1 /* display on */
#define DP_CSR_ON 2 /* cursor on */
/* CRT controller modes */
#define CRTM_NONINTER 0 /* non-interlaced */
#define CRTM_INTERLCD 0x40 /* interlaced */
#define CRTM_INTERSYN 0x60 /* interlaced - sync */
#define CRTM_WIN_STAT_ENABLE 0x10 /* window status enable */
#define CRTM_SYNC_SLAVE_MODE 0x08 /* on = operate as slave */
#define CRTM_BLANK_SLAVE_MODE 0x04 /* on = Blank is input */
#define CRTM_NORMAL_SPEED 0x00
#define CRTM_HIGH_SPEED 0x01
#define CRTM_VRYHIGH_SPEED 0x02
#define CRTM_SUPHIGH_SPEED 0x03
/* cursor style */
#define DP_CURSOR_16X16 0x8000 /* off = 8x8 */
#define DP_CURSOR_CROSSHAIR 0x4000 /* off = block cursor */
#define DP_CURSOR_TRANSPRNT 0x2000 /* off = cursor is opaque */
/*
* Types for dealing with 786 Display Processor.
*/
typedef struct {
u_short lines; /* (lines in strip) - 1 */
u_short linkl; /* link to next strip low part */
u_short linkh; /* link to next strip high part */
u_short tiles; /* C bit, (tiles in strip) - 1 */
} STRIPHEADER;
/*
* If the C bit is turned on, the display processor "automatically
* displays the background color" for areas not defined by the strips.
* See section 3.1.3.2 of the '786 User's Manual.
*/
#define DP_C_BIT 0x8000
typedef struct {
u_short bitmapw; /* width of bitmap */
u_short meml; /* btb mem address low part */
u_short memh; /* btb mem address high part */
u_short bppss; /* bpp, start and stop fields */
u_short fetchcnt; /* fetch count */
u_short flags; /* various flags */
} TILEDESC;
/*
* Macros for encoding addresses for strip headers & tile descriptors.
* addr786 is relative to the start of the Blit's mapped memory.
*/
#define DP_ADDRLOW(addr786) (((int)(addr786)) & 0xffff)
#define DP_ADDRHIGH(addr786) ((((int)(addr786)) >> 16) & 0x3f)
/*
* Byte offsets to useful data words within the EPROM.
*/
#define EP_MAGIC1 0
#define EP_MAGIC1_VAL 0x7856
#define EP_MAGIC2 2
#define EP_MAGIC2_VAL 0x6587
#define EP_DPSTART 4 /* start of DP ctl block */
/* (0 = start of EPROM) */
#define EP_DPLEN 6 /* byte length of DP control block */
#define EP_FONTSTART 8 /* start of font */
/* (0 = start of EPROM) */
#define EP_FONTLEN 10 /* byte length of font */
#define EP_CHARWIDTH 12 /* bit width of each char in font */
#define EP_CHARHEIGHT 14
#define EP_NUMCHARS 16 /* num chars in font */
/* where in the bitmap the 25x80 console screen starts */
#define EP_XSTART 18
#define EP_YSTART 20
#define EP_SCREENWIDTH 22 /* pixels per scan line */
#define EP_SCREENHEIGHT 24 /* number of scan lines */
#define EP_FIXUP_X 26 /* magic numbers for displaying */
#define EP_FIXUP_Y 28 /* hardware cursor */
#define EP_BPP 30 /* bits per pixel */
/*
* Miscellaneous.
*/
#define BLIT_BLACK_BIT 0 /* try saying that 3 times fast */
#define BLIT_WHITE_BIT 1
#define BLIT_BLACK_BYTE 0
#define BLIT_WHITE_BYTE 0xff
#endif /* blitreg_DEFINED */
|