ibm561reg.h revision 1.6 1 1.6 macallan /* $NetBSD: ibm561reg.h,v 1.6 2012/10/20 13:29:53 macallan Exp $ */
2 1.1 elric
3 1.1 elric /*-
4 1.2 elric * Copyright (c) 2001 The NetBSD Foundation, Inc.
5 1.1 elric * All rights reserved.
6 1.1 elric *
7 1.1 elric * This code is derived from software contributed to The NetBSD Foundation
8 1.1 elric * by Roland C. Dowdeswell of Ponte, Inc.
9 1.1 elric *
10 1.1 elric * Redistribution and use in source and binary forms, with or without
11 1.1 elric * modification, are permitted provided that the following conditions
12 1.1 elric * are met:
13 1.1 elric * 1. Redistributions of source code must retain the above copyright
14 1.1 elric * notice, this list of conditions and the following disclaimer.
15 1.1 elric * 2. Redistributions in binary form must reproduce the above copyright
16 1.1 elric * notice, this list of conditions and the following disclaimer in the
17 1.1 elric * documentation and/or other materials provided with the distribution.
18 1.1 elric *
19 1.1 elric * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 1.1 elric * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 1.1 elric * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 1.1 elric * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 1.1 elric * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 1.1 elric * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 1.1 elric * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 1.1 elric * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 1.1 elric * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 1.1 elric * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 1.1 elric * POSSIBILITY OF SUCH DAMAGE.
30 1.1 elric */
31 1.1 elric
32 1.1 elric #define IBM561_ADDR_LOW 0x00
33 1.1 elric #define IBM561_ADDR_HIGH 0x01
34 1.1 elric #define IBM561_CMD 0x02
35 1.1 elric #define IBM561_CMD_FB_WAT 0x03
36 1.1 elric #define IBM561_CMD_CMAP 0x03
37 1.1 elric #define IBM561_CMD_GAMMA 0x03
38 1.1 elric
39 1.1 elric #define IBM561_CONFIG_REG1 0x0001
40 1.3 macallan #define CR1_MODEMASK 0xe0
41 1.3 macallan #define CR1_MODE_5_1_BASIC 0x00
42 1.3 macallan #define CR1_MODE_4_1_BASIC 0x20
43 1.3 macallan #define CR1_MODE_4_1_EXTENDED 0x40
44 1.3 macallan #define CR1_MODE_4_1_SUPER_EXT 0x60
45 1.3 macallan #define CR1_MODE_5_1_30BPP 0x80
46 1.3 macallan #define CR1_MODE_8_1_MODE_B 0xa0
47 1.3 macallan #define CR1_MODE_4_1_30BPP 0xc0
48 1.3 macallan #define CR1_MODE_8_1_MODE_A 0xe0
49 1.3 macallan #define CR1_OVL_MASK 0x18
50 1.3 macallan #define CR1_OVL_NONE 0x00
51 1.3 macallan #define CR1_OVL_8BPP 0x08
52 1.3 macallan #define CR1_OVL_16BPP 0x10
53 1.3 macallan #define CR1_OVL_VARIABLE 0x18
54 1.3 macallan #define CR1_WID_BITS_MASK 0x07
55 1.3 macallan #define CR1_WID_0 0x00
56 1.3 macallan #define CR1_WID_2 0x01
57 1.3 macallan #define CR1_WID_4 0x02
58 1.3 macallan #define CR1_WID_6 0x03
59 1.3 macallan #define CR1_WID_8 0x04
60 1.3 macallan
61 1.1 elric #define IBM561_CONFIG_REG2 0x0002
62 1.3 macallan #define CR2_ENABLE_VRAM_MASKING 0x20
63 1.3 macallan #define CR2_ENABLE_PLL 0x10
64 1.3 macallan #define CR2_ENABLE_CLC 0x08 /* sane handling of cursor
65 1.3 macallan * coordinate updates, without
66 1.3 macallan * this updates occur
67 1.3 macallan * immediately instead of
68 1.3 macallan * waiting for the 2nd byte */
69 1.3 macallan #define CR2_PLL_REF_SELECT 0x04 /* 0 - REFCLK, 1 - EXTCLK */
70 1.3 macallan #define CR2_PIXEL_CLOCK_SELECT 0x02 /* 0 - PLL, 1 - EXTCLK */
71 1.3 macallan #define CR2_ENABLE_RGB_OUTPUT 0x01
72 1.3 macallan
73 1.1 elric #define IBM561_CONFIG_REG3 0x0003
74 1.3 macallan #define CR3_ENABLE_INTERLACE 0x80
75 1.3 macallan #define CR3_SERIAL_CLK_CTRL 0x40 /* 1 - enable output */
76 1.3 macallan #define CR3_FIELD_POLARITY 0x20 /* 0 - EVEN first */
77 1.3 macallan #define CR3_ENABLE_MISR 0x10 /* diagnostic mode */
78 1.3 macallan #define CR3_CURSOR_UPDATE_ASYNC 0x08 /* don't wait for VBLANK */
79 1.3 macallan #define CR3_ENABLE_VIDEO 0x04 /* AUX video output */
80 1.3 macallan #define CR3_RGB 0x01 /* 1 - RGB, 0 - BGR */
81 1.3 macallan
82 1.1 elric #define IBM561_CONFIG_REG4 0x0004
83 1.4 macallan #define CR4_FB_SPLIT_WID_MASK 0x78 /* number of FB WID bits */
84 1.3 macallan #define CR4_ENABLE_SPLIT_WID 0x04
85 1.3 macallan #define CR4_SELECT_OL_WID 0x02 /* 1 - use upper 4 bit for OL */
86 1.3 macallan #define CR4_SELECT_FB_WID 0x01 /* 1 - use upper 4 bit for FB */
87 1.1 elric
88 1.1 elric #define IBM561_SYNC_CNTL 0x0020
89 1.3 macallan #define SYNC_HSYNC_ENABLE 0x20
90 1.3 macallan #define SYNC_HSYNC_POLARITY 0x08 /* 1 - active high */
91 1.3 macallan #define SYNC_SYNC_ON_GREEN 0x02
92 1.3 macallan #define SYNC_ENABLE_PEDESTAL 0x01
93 1.3 macallan
94 1.1 elric #define IBM561_PLL_VCO_DIV 0x0021
95 1.1 elric #define IBM561_PLL_REF_REG 0x0022
96 1.1 elric #define IBM561_CURS_CNTL_REG 0x0030
97 1.3 macallan #define CURS_COLOR_3_TRANS 0x80 /* 0 - color 3, 1 - trans */
98 1.3 macallan #define CURS_SEPARATE 0x40 /* move crosshair separately */
99 1.3 macallan #define CURS_OVERLAP_MASK 0x30
100 1.3 macallan #define CURS_OVERLAP_XOR 0x00 /* XOR cursor and xhair */
101 1.3 macallan #define CURS_OVERLAP_OR 0x10
102 1.3 macallan #define CURS_OVERLAP_CURSOR 0x20 /* cursor has priority */
103 1.3 macallan #define CURS_OVERLAP_XHAIR 0x30 /* crosshair has priority */
104 1.3 macallan #define CURS_XHAIR_BLINK 0x08 /* enable xhair blinking */
105 1.3 macallan #define CURS_XHAIR_ENABLE 0x04
106 1.3 macallan #define CURS_BLINK 0x02 /* blink cursor */
107 1.3 macallan #define CURS_ENABLE 0x01 /* enable cursor */
108 1.3 macallan
109 1.3 macallan #define IBM561_XHAIR_CONTROL_REG 0x0031
110 1.3 macallan #define XHAIR_PRIORITY 0x80 /* FILL or OUTLINE colour */
111 1.3 macallan #define XHAIR_WIDTH_MASK 0x60
112 1.3 macallan #define XHAIR_WIDTH_1 0x00
113 1.3 macallan #define XHAIR_WIDTH_3 0x20
114 1.3 macallan #define XHAIR_WIDTH_5 0x40
115 1.3 macallan #define XHAIR_WIDTH_7 0x60
116 1.3 macallan #define XHAIR_CLIP_MASK 0x18
117 1.3 macallan #define XHAIR_CLIP_NONE 0x00
118 1.3 macallan #define XHAIR_CLIP_SCISSORS 0x08 /* use scissors registers */
119 1.3 macallan #define XHAIR_CLIP_WINDOW 0x10 /* use window registers */
120 1.3 macallan #define XHAIR_CLIP_BOTH 0x18 /* window/scissor intersect */
121 1.3 macallan #define XHAIR_COLOR_MASK 0x06 /* 0 is transparent */
122 1.3 macallan #define XHAIR_EXT_PATTERN 0x01 /* enables colours, patterns */
123 1.3 macallan
124 1.3 macallan #define IBM561_CURSOR_BLINK_RATE 0x0032
125 1.3 macallan #define IBM561_CURSOR_BLINK_DUTY 0x0033
126 1.1 elric #define IBM561_HOTSPOT_REG 0x0034
127 1.3 macallan #define IBM561_HOTSPOT_X_REG 0x0034
128 1.3 macallan #define IBM561_HOTSPOT_Y_REG 0x0035
129 1.3 macallan
130 1.3 macallan /* two registers each, low 8 bit first */
131 1.3 macallan #define IBM561_CURSOR_X_REG 0x0036
132 1.3 macallan #define IBM561_CURSOR_Y_REG 0x0038
133 1.3 macallan
134 1.3 macallan #define IBM561_XHAIR_SCISSORS 0x0040
135 1.3 macallan /*
136 1.3 macallan * four 16bit registers, low first
137 1.3 macallan * X start, Y start, X end, Y end
138 1.3 macallan */
139 1.3 macallan
140 1.3 macallan #define IBM561_XHAIR_LOCATION 0x0048
141 1.3 macallan /* 2x 16bit, X first, lsb first */
142 1.3 macallan
143 1.3 macallan #define IBM561_XHAIR_PATTERN_CONTROL 0x004c
144 1.3 macallan #define IBM561_XHAIR_PATTERN_HORZ 0x004d
145 1.3 macallan #define IBM561_XHAIR_PATTERN_VERT 0x004e
146 1.3 macallan
147 1.1 elric #define IBM561_VRAM_MASK_REG 0x0050
148 1.3 macallan
149 1.3 macallan #define IBM561_DAC_CONTROL 0x005f
150 1.3 macallan #define DAC_DISABLE_OUTPUT 0x08
151 1.3 macallan #define DAC_10BIT_ENABLE 0x04 /* 0 forces bit 0 to 0 */
152 1.3 macallan #define DAC_SHUNT_ENABLE 0x02
153 1.3 macallan #define DAC_SLEW_ENABLE 0x01 /* 0 - 2.5ns, 1 - 7.5ns */
154 1.3 macallan
155 1.3 macallan #define IBM561_CURSOR_LUT 0x0a10
156 1.3 macallan /*
157 1.3 macallan * four blocks of 4, transparent, 1, 2, 3 each
158 1.6 macallan * cursor primary, cursor blink, xhair primary, xhair blink
159 1.3 macallan */
160 1.3 macallan
161 1.3 macallan #define IBM561_CURSOR_BITMAP 0x2000
162 1.3 macallan /* 64x64, 2bit packed, msb first */
163 1.3 macallan
164 1.1 elric #define IBM561_DIV_DOTCLCK 0x0082
165 1.1 elric #define IBM561_FB_WINTYPE 0x1000
166 1.3 macallan #define FB_CLUT_SELECT_MASK 0x03c0 /* selects which 64 entry block
167 1.3 macallan * in the CLUT to start with */
168 1.3 macallan #define FB_PIXEL_FORM_MASK 0x0030
169 1.3 macallan #define FB_PIXEL_8BIT 0x0000
170 1.3 macallan #define FB_PIXEL_12BIT 0x0010
171 1.3 macallan #define FB_PIXEL_16BIT 0x0020
172 1.3 macallan #define FB_PIXEL_24BIT 0x0030
173 1.3 macallan #define FB_BUFFER_SELECT 0x0008 /* 1 - buffer B */
174 1.3 macallan #define FB_MODE_MASK 0x0006
175 1.3 macallan #define FB_MODE_INDEXED 0x0000
176 1.3 macallan #define FB_MODE_GREYSCALE 0x0002
177 1.3 macallan #define FB_MODE_DIRECT 0x0004
178 1.3 macallan #define FB_MODE_TRUECOLOR 0x0006 /* doesn't work right for me */
179 1.3 macallan #define FB_MODE_TRANSP_ENABLE 0x0001
180 1.3 macallan
181 1.1 elric #define IBM561_AUXFB_WINTYPE 0x0e00
182 1.3 macallan #define AUXFB_BYPASS_GAMMA 0x04
183 1.3 macallan #define AUXFB_XHAIR_ENABLE 0x02
184 1.3 macallan #define AUXFB_TRANSPARENT 0x01 /* 0 - 0x00, 1 - 0xff */
185 1.3 macallan
186 1.1 elric #define IBM561_OL_WINTYPE 0x1400
187 1.3 macallan #define OL_CLUT_SELECT_MASK 0x03c0 /* selects which 64 entry block
188 1.3 macallan * in the CLUT to start with */
189 1.3 macallan #define OL_PIXEL_FORM_MASK 0x0030
190 1.3 macallan #define OL_PIXEL_8BIT 0x0000
191 1.3 macallan #define OL_PIXEL_6_2BIT 0x0010 /* 6 overlay, 2 underlay */
192 1.3 macallan #define OL_PIXEL_4_4BIT 0x0020
193 1.3 macallan #define OL_PIXEL_4_DBL 0x0030
194 1.3 macallan #define OL_BUFFER_SELECT 0x0008 /* 1 - buffer B */
195 1.3 macallan #define OL_MODE_MASK 0x0006
196 1.3 macallan #define OL_MODE_INDEXED 0x0000
197 1.3 macallan #define OL_MODE_GREYSCALE 0x0002
198 1.3 macallan #define OL_MODE_INDIRECT 0x0004
199 1.3 macallan #define OL_MODE_DIRECT 0x0006
200 1.3 macallan #define OL_MODE_TRANSP_ENABLE 0x0001
201 1.3 macallan
202 1.1 elric #define IBM561_AUXOL_WINTYPE 0x0f00
203 1.3 macallan #define AUXOL_TRANSP_MASK 0x21
204 1.3 macallan #define AUXOL_TRANSP_00 0x00
205 1.3 macallan #define AUXOL_TRANSP_FF 0x01
206 1.3 macallan #define AUXOL_TRANSP_CHROMA0 0x20
207 1.3 macallan #define AUXOL_TRANSP_CHROMA1 0x21
208 1.3 macallan #define AUXOL_UNDERLAY_ENABLE 0x10
209 1.3 macallan #define AUXOL_OVERLAY_ENABLE 0x08
210 1.3 macallan #define AUXOL_BYPASS_GAMMA 0x04
211 1.3 macallan #define AUXOL_XHAIR_ENABLE 0x02
212 1.3 macallan
213 1.1 elric #define IBM561_CMAP_TABLE 0x4000
214 1.1 elric #define IBM561_RED_GAMMA_TABLE 0x3000
215 1.1 elric #define IBM561_GREEN_GAMMA_TABLE 0x3400
216 1.1 elric #define IBM561_BLUE_GAMMA_TABLE 0x3800
217 1.1 elric
218 1.1 elric #define IBM561_CHROMAKEY0 0x0010
219 1.1 elric #define IBM561_CHROMAKEY1 0x0011
220 1.1 elric #define IBM561_CHROMAKEYMASK0 0x0012
221 1.1 elric #define IBM561_CHROMAKEYMASK1 0x0013
222 1.1 elric
223 1.1 elric #define IBM561_WAT_SEG_REG 0x0006
224 1.1 elric
225 1.1 elric #define IBM561_NCMAP_ENTRIES 1024
226 1.1 elric #define IBM561_NGAMMA_ENTRIES 256
227 1.1 elric
228 1.1 elric /* we actually have 1024 of them, but I am just
229 1.1 elric * going define a few, so this is good.
230 1.1 elric */
231 1.1 elric #define IBM561_NWTYPES 16
232