2 * Copyright (c) 1995, 1996 Carnegie-Mellon University.
5 * Author: Chris G. Demetriou
7 * Permission to use, copy, modify and distribute this software and
8 * its documentation is hereby granted, provided that both the copyright
9 * notice and this permission notice appear in all copies of the
10 * software, derivative works or modified versions, and any portions
11 * thereof, and that both notices appear in supporting documentation.
13 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
14 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
15 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
17 * Carnegie Mellon requests users of this software to return to
19 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
20 * School of Computer Science
21 * Carnegie Mellon University
22 * Pittsburgh PA 15213-3890
24 * any improvements or extensions that they make and grant Carnegie the
25 * rights to redistribute these changes.
27 * Copyright (c) 2000 Andrew Miklic
29 * $FreeBSD: src/sys/dev/fb/tga.h,v 1.1.2.1 2001/11/01 08:33:14 obrien Exp $
30 * $DragonFly: src/sys/dev/video/fb/Attic/tga.h,v 1.2 2003/06/17 04:28:25 dillon Exp $
36 /* TGA-specific FB stuff */
42 * Register definitions for the Brooktree Bt463 135MHz Monolithic
47 * Directly-accessible registers. Note the address register is
50 #define BT463_REG_ADDR_LOW 0x00 /* C1,C0 == 0,0 */
51 #define BT463_REG_ADDR_HIGH 0x01 /* C1,C0 == 0,1 */
52 #define BT463_REG_IREG_DATA 0x02 /* C1,C0 == 1,0 */
53 #define BT463_REG_CMAP_DATA 0x03 /* C1,C0 == 1,1 */
55 #define BT463_REG_MAX BT463_REG_CMAP_DATA
58 * All internal register access to the Bt463 is done indirectly via the
59 * Address Register (mapped into the host bus in a device-specific
60 * fashion). The following register definitions are in terms of
61 * their address register address values.
64 /* C1,C0 must be 1,0 */
65 #define BT463_IREG_CURSOR_COLOR_0 0x0100 /* 3 r/w cycles */
66 #define BT463_IREG_CURSOR_COLOR_1 0x0101 /* 3 r/w cycles */
67 #define BT463_IREG_ID 0x0200
68 #define BT463_IREG_COMMAND_0 0x0201
69 #define BT463_IREG_COMMAND_1 0x0202
70 #define BT463_IREG_COMMAND_2 0x0203
71 #define BT463_IREG_READ_MASK_P0_P7 0x0205
72 #define BT463_IREG_READ_MASK_P8_P15 0x0206
73 #define BT463_IREG_READ_MASK_P16_P23 0x0207
74 #define BT463_IREG_READ_MASK_P24_P27 0x0208
75 #define BT463_IREG_BLINK_MASK_P0_P7 0x0209
76 #define BT463_IREG_BLINK_MASK_P8_P15 0x020a
77 #define BT463_IREG_BLINK_MASK_P16_P23 0x020b
78 #define BT463_IREG_BLINK_MASK_P24_P27 0x020c
79 #define BT463_IREG_TEST 0x020d
80 #define BT463_IREG_INPUT_SIG 0x020e /* 2 of 3 r/w cycles */
81 #define BT463_IREG_OUTPUT_SIG 0x020f /* 3 r/w cycles */
82 #define BT463_IREG_REVISION 0x0220
83 #define BT463_IREG_WINDOW_TYPE_TABLE 0x0300 /* 3 r/w cycles */
85 #define BT463_NWTYPE_ENTRIES 0x10 /* 16 window type entries */
87 /* C1,C0 must be 1,1 */
88 #define BT463_IREG_CPALETTE_RAM 0x0000 /* 3 r/w cycles */
90 #define BT463_NCMAP_ENTRIES 0x210 /* 528 CMAP entries */
92 #define BT463_DATA_CURCMAP_CHANGED 0x01 /* cursor colormap changed */
93 #define BT463_DATA_CMAP_CHANGED 0x02 /* colormap changed */
94 #define BT463_DATA_WTYPE_CHANGED 0x04 /* window type table changed */
95 #define BT463_DATA_ALL_CHANGED 0x07
98 * Register definitions for the Brooktree Bt485A 170MHz Monolithic
99 * CMOS True-Color RAMDAC.
103 * Directly-addressed registers.
106 #define BT485_REG_PCRAM_WRADDR 0x00
107 #define BT485_REG_PALETTE 0x01
108 #define BT485_REG_PIXMASK 0x02
109 #define BT485_REG_PCRAM_RDADDR 0x03
110 #define BT485_REG_COC_WRADDR 0x04
111 #define BT485_REG_COCDATA 0x05
112 #define BT485_REG_COMMAND_0 0x06
113 #define BT485_REG_COC_RDADDR 0x07
114 #define BT485_REG_COMMAND_1 0x08
115 #define BT485_REG_COMMAND_2 0x09
116 #define BT485_REG_STATUS 0x0a
117 #define BT485_REG_EXTENDED BT485_REG_STATUS
118 #define BT485_REG_CURSOR_RAM 0x0b
119 #define BT485_REG_CURSOR_X_LOW 0x0c
120 #define BT485_REG_CURSOR_X_HIGH 0x0d
121 #define BT485_REG_CURSOR_Y_LOW 0x0e
122 #define BT485_REG_CURSOR_Y_HIGH 0x0f
124 #define BT485_REG_MAX 0x0f
126 #define BT485_IREG_STATUS 0x00
127 #define BT485_IREG_COMMAND_3 0x01
128 #define BT485_IREG_COMMAND_4 0x02
129 #define BT485_IREG_RSA 0x20
130 #define BT485_IREG_GSA 0x21
131 #define BT485_IREG_BSA 0x22
133 #define BT485_DATA_ENB_CHANGED 0x01 /* cursor enable changed */
134 #define BT485_DATA_CURCMAP_CHANGED 0x02 /* cursor colormap changed */
135 #define BT485_DATA_CURSHAPE_CHANGED 0x04 /* cursor size, image, mask changed */
136 #define BT485_DATA_CMAP_CHANGED 0x08 /* colormap changed */
137 #define BT485_DATA_ALL_CHANGED 0x0f
138 #define CURSOR_MAX_SIZE 64
140 #define TGA_DRIVER_NAME "tga"
141 #define TGA2_DRIVER_NAME "tga2"
143 #define BTWREG(sc, addr, val) \
144 sc->gfbc->ramdac_wr((sc), BT463_REG_ADDR_LOW, (addr) & 0xff); \
145 sc->gfbc->ramdac_wr((sc), BT463_REG_ADDR_HIGH, ((addr) >> 8) & 0xff);\
146 (sc)->gfbc->ramdac_wr((sc), BT463_REG_IREG_DATA, (val))
147 #define BTWNREG(sc, val) \
148 (sc)->gfbc->ramdac_wr((sc), BT463_REG_IREG_DATA, (val))
149 #define BTRREG(sc, addr) \
150 sc->gfbc->ramdac_wr((sc), BT463_REG_ADDR_LOW, (addr) & 0xff); \
151 sc->gfbc->ramdac_wr((sc), BT463_REG_ADDR_HIGH, ((addr) >> 8) & 0xff);\
152 (sc)->gfbc->ramdac_rd((sc), BT463_REG_IREG_DATA)
153 #define BTRNREG(sc) \
154 (sc)->gfbc->ramdac_rd((sc), BT463_REG_IREG_DATA)
156 #endif /* _FB_TGA_H_ */