ite8181reg.h revision 1.6 1 1.6 andvar /* $NetBSD: ite8181reg.h,v 1.6 2024/07/05 19:33:39 andvar Exp $ */
2 1.1 sato
3 1.1 sato /*-
4 1.1 sato * Copyright (c) 2000 SATO Kazumi
5 1.1 sato * All rights reserved.
6 1.1 sato *
7 1.1 sato * Redistribution and use in source and binary forms, with or without
8 1.1 sato * modification, are permitted provided that the following conditions
9 1.1 sato * are met:
10 1.1 sato * 1. Redistributions of source code must retain the above copyright
11 1.1 sato * notice, this list of conditions and the following disclaimer.
12 1.1 sato * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 sato * notice, this list of conditions and the following disclaimer in the
14 1.1 sato * documentation and/or other materials provided with the distribution.
15 1.1 sato *
16 1.1 sato * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 1.1 sato * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 1.1 sato * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 1.1 sato * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 1.1 sato * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 1.1 sato * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 1.1 sato * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 1.1 sato * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 1.1 sato * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 1.1 sato * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 1.1 sato * SUCH DAMAGE.
27 1.1 sato *
28 1.1 sato */
29 1.1 sato
30 1.1 sato /* ITE8181 configuration registers */
31 1.1 sato #define ITE8181_CONF_OFFSET ((8192 -1) * 1024) /* offset of config reg */
32 1.6 andvar #define ITE8181_ID 0x00 /* Device ID, Vendor ID */
33 1.1 sato #define ITE8181_DATA_ID 0x81811283
34 1.1 sato #define ITE8181_PRODUCT_ID 0x8181
35 1.1 sato #define ITE8181_VENDER_ID 0x1283
36 1.1 sato #define ITE8181_SCMD 0x04 /* Status, Command Reg. */
37 1.1 sato #define ITE8181_CLASS 0x08 /* Class, Sub-class, PRG, revision */
38 1.1 sato #define ITE8181_DATA_CLASS 0x03800000
39 1.1 sato #define ITE8181_CLASS_MASK 0xffff0000
40 1.1 sato #define ITE8181_REV_MASK 0x000000ff
41 1.5 andvar #define ITE8181_MBA 0x10 /* Memory Base Address(4MB boundary) */
42 1.2 wiz #define ITE8181_GBA 0x14 /* GUI Base Address(32KB boundary) */
43 1.1 sato #define ITE8181_SBA 0x18 /* Graphic Base Address (64KB boundary) */
44 1.1 sato #define ITE8181_TEST 0x40 /* Test Reg. */
45 1.1 sato #define ITE8181_STANDBY 0x44 /* Standby Reg. */
46 1.1 sato #define ITE8181_DATA_PLL2_TEST 0xc0000 /* PLL2 is test mode */
47 1.1 sato #define ITE8181_DATA_PLL1_TEST 0x30000 /* PLL1 is test mode */
48 1.1 sato #define ITE8181_DATA_PLL2_RESET 0x8000 /* PLL2 reset */
49 1.1 sato #define ITE8181_DATA_PLL1_RESET 0x4000 /* PLL1 reset */
50 1.1 sato #define ITE8181_DATA_PLL2_PWDOWN 0x2000 /* PLL2 powerdown */
51 1.1 sato #define ITE8181_DATA_PLL1_PWDOWN 0x1000 /* PLL1 powerdown */
52 1.5 andvar #define ITE8181_DATA_PALETTESTBY 0x0200 /* Palette RAM standby */
53 1.1 sato #define ITE8181_DATA_CURSORSTBY 0x0100 /* Cursor standby */
54 1.1 sato #define ITE8181_DATA_BITBLTSTBY 0x0080 /* BitBlt engine standby */
55 1.1 sato #define ITE8181_DATA_LINESTBY 0x0040 /* Line Draw standby */
56 1.1 sato #define ITE8181_DATA_DACCLKSTOP 0x0020 /* DAC Clock stop */
57 1.1 sato #define ITE8181_DATA_DACPOWERON 0x0010 /* DAC Power ON */
58 1.1 sato #define ITE8181_DATA_GATEPLL2IN 0x0008 /* Gate PLL2 input clock */
59 1.1 sato #define ITE8181_DATA_GATEPLL1IN 0x0004 /* Gate PLL1 input clock */
60 1.1 sato #define ITE8181_DATA_CLOCKSTOP 0x0001 /* 14.318MHZ CLock Stop */
61 1.1 sato #define ITE8181_PLL1 0x48 /* PLL1 Reg. */
62 1.1 sato #define ITE8181_PLL2 0x4c /* PLL2 Reg. */
63 1.1 sato
64 1.1 sato /* ITE8181 GUI 32bit registers */
65 1.1 sato #define ITE8181_GUI_BSLE 0x00 /* BitBlt src/Line Draw End */
66 1.1 sato #define ITE8181_GUI_BDLS 0x04 /* BitBlt dst/Line Draw Start */
67 1.1 sato #define ITE8181_GUI_BPOA 0x08 /* BitBlt Pattern Offset Address */
68 1.6 andvar #define ITE8181_GUI_BWH 0x0c /* BitBlt Width, Height */
69 1.1 sato #define ITE8181_GUI_BSO 0x10 /* BitBlt Screen Offset */
70 1.6 andvar #define ITE8181_GUI_FCR 0x14 /* Foreground Color Reg. */
71 1.6 andvar #define ITE8181_GUI_BCR 0x18 /* Background Color Reg. */
72 1.1 sato #define ITE8181_GUI_BC 0x1c /* BitBlt Control */
73 1.1 sato #define ITE8181_GUI_BS 0x20 /* BitBlt Status */
74 1.1 sato #define ITE8181_GUI_ASDS 0x24 /* Line Draw Axial Step, Diagonal Step */
75 1.1 sato #define ITE8181_GUI_LET 0x28 /* Line Draw Error Term/ Pixel Count */
76 1.1 sato #define ITE8181_GUI_LST 0x2c /* Scissor Top */
77 1.1 sato #define ITE8181_GUI_LSB 0x30 /* Scissor Bottom */
78 1.1 sato #define ITE8181_GUI_LSR 0x34 /* Line Style Register */
79 1.1 sato #define ITE8181_GUI_SSVS 0x38 /* Short Stroke Vector Spec */
80 1.1 sato #define ITE8181_GUI_MR 0x4c /* Misc Reg. */
81 1.1 sato #define ITE8181_GUI_PIO 0x40000 /* Pixel I/port for System Data */
82 1.1 sato
83 1.1 sato /* ITE8181 GUI 8bit registers */
84 1.1 sato #define ITE8181_GUI_C1C 0x100 /* Cursor1 Control Reg. */
85 1.1 sato #define ITE8181_GUI_C1O 0x101 /* Cursor1 Offset Reg. */
86 1.1 sato #define ITE8181_GUI_C1F 0x102 /* Cursor1 Feature Reg. */
87 1.1 sato #define ITE8181_GUI_C1SAH 0x103 /* Icon Map Address MSB */
88 1.1 sato #define ITE8181_GUI_C1SAL 0x108 /* Icon Map Address LSB */
89 1.1 sato #define ITE8181_GUI_C1LPX 0x109 /* Cursor Clipping X Coord Reg. */
90 1.1 sato #define ITE8181_GUI_C1LPY 0x10a /* Cursor Clipping Y Coord Reg. */
91 1.1 sato #define ITE8181_GUI_CC0R0 0x110 /* Cursor Color 0 Reg. */
92 1.1 sato #define ITE8181_GUI_CC0R1 0x111
93 1.1 sato #define ITE8181_GUI_CC0R2 0x112
94 1.1 sato #define ITE8181_GUI_CC0R3 0x113
95 1.1 sato #define ITE8181_GUI_CC1R0 0x114 /* Cursor Color 1 Reg. */
96 1.1 sato #define ITE8181_GUI_CC1R1 0x115
97 1.1 sato #define ITE8181_GUI_CC1R2 0x116
98 1.1 sato #define ITE8181_GUI_CC1R3 0x117
99 1.1 sato #define ITE8181_GUI_CC2R0 0x118 /* Cursor Color 2 Reg. */
100 1.1 sato #define ITE8181_GUI_CC2R1 0x119
101 1.1 sato #define ITE8181_GUI_CC2R2 0x11a
102 1.1 sato #define ITE8181_GUI_CC2R3 0x11b
103 1.1 sato #define ITE8181_GUI_C1XC0 0x120 /* cursor 1 X coord bits[7:0] */
104 1.1 sato #define ITE8181_GUI_C1XC1 0x121 /* cursor 1 X coord bits[11:8] */
105 1.1 sato #define ITE8181_GUI_C1YC0 0x122 /* cursor 1 Y coord bits[7:0] */
106 1.1 sato #define ITE8181_GUI_C1YC1 0x123 /* cursor 1 Y coord bits[11:8] */
107 1.1 sato
108 1.1 sato /* Extension Mode A registers */
109 1.1 sato #define ITE8181_EMA_EXAX 0x03d6 /* Extension Controller Index Reg. */
110 1.1 sato #define ITE8181_EMA_EXADATA 0x03d7 /* Extension Controller Data. */
111 1.1 sato
112 1.1 sato #define ITE8181_EMA_ENABLEEMA 0x0b /* Extension Index Enable Reg. */
113 1.1 sato #define ITE8181_EMA_ENABLEPASS 0xec /* EMA enable passwd(w) */
114 1.1 sato #define ITE8181_EMA_DISABLEPASS 0xce /* EMA disable passwd(w) */
115 1.1 sato #define ITE8181_EMA_ENABLED 0x01 /* EMA enabled (r) */
116 1.1 sato
117 1.6 andvar /* ITE8181 LCD Controller Timing Reg. */
118 1.3 wiz #define ITE8181_EMA_HSIZE 0x80 /* LCD Controller H size Reg. */
119 1.1 sato #define ITE8181_EMA_HALIGN 0x81 /* LCD H Align Adjust Reg. */
120 1.1 sato #define ITE8181_EMA_HRETRACE 0x82 /* LCD H Retrace Adjust Reg. */
121 1.1 sato #define ITE8181_EMA_HADJUST 0x83 /* LCD H Adjust Reg. */
122 1.1 sato #define ITE8181_EMA_HSYNCDELAY 0x84 /* LCD HSYNC Delay Reg. */
123 1.1 sato #define ITE8181_EMA_VSIZE 0x85 /* LCD V size Reg. */
124 1.1 sato #define ITE8181_EMA_VSYNC_DELAY 0x86 /* LCD VSYNC Delay Reg. */
125 1.1 sato #define ITE8181_EMA_OVERFLOW 0x87 /* LCD Overflow Reg. */
126 1.1 sato #define ITE8181_EMA_MODULATION 0x88 /* LCD Modulation Reg. */
127 1.1 sato #define ITE8181_EMA_EXTMODE 0x89 /* LCD Ext Mode Tuning Reg. */
128 1.1 sato #define ITE8181_EMA_VALIGNA 0x8a /* LCD V Align Adjust Reg A(350) */
129 1.1 sato #define ITE8181_EMA_VALIGNB 0x8b /* LCD V Align Adjust Reg B(400) */
130 1.1 sato #define ITE8181_EMA_VALIGNC 0x8c /* LCD V Align Adjust Reg C(>=480) */
131 1.6 andvar #define ITE8181_EMA_VRETRACE 0x8d /* LCD V Retrace Adjust Reg. */
132 1.1 sato #define ITE8181_EMA_VOVERFLOW 0x8e /* LCD V Adjust Overflow Reg. */
133 1.1 sato
134 1.1 sato /* ITE8181 LCD Controller Reg. */
135 1.1 sato #define ITE8181_EMA_TYPE 0x90 /* LCD Type Select Reg. */
136 1.1 sato #define ITE8181_EMA_CONTROL 0x91 /* LCD Controller Reg. */
137 1.1 sato #define ITE8181_EMA_PINSEL 0x92 /* LCD Controller Pin Select Reg. */
138 1.1 sato #define ITE8181_EMA_MISCCTL 0x93 /* LCD Misc Control Reg. */
139 1.1 sato
140 1.1 sato /* ITE8181 LCD Controller Power Management Register */
141 1.1 sato #define ITE8181_EMA_LCDPOWER 0x98
142 1.1 sato #define ITE8181_LCDSTANDBY 0x20 /* LCD S/W Standby */
143 1.1 sato #define ITE8181_EMA_LCDPOWERSEQ 0x9a
144 1.1 sato #define ITE8181_PUP2 0x80 /* Panel Power UP phase 2 */
145 1.1 sato #define ITE8181_PUP1 0x40 /* Panel Power UP phase 1 */
146 1.1 sato #define ITE8181_PUP0 0x20 /* Panel Power UP phase 0 */
147 1.1 sato #define ITE8181_PDP2 0x10 /* Panel Power DOWN phase 2 */
148 1.1 sato #define ITE8181_PDP1 0x08 /* Panel Power DOWN phase 1 */
149 1.1 sato #define ITE8181_PDP0 0x04 /* Panel Power DOWN phase 0 */
150 1.1 sato #define ITE8181_EMA_LCDPOWERSTAT 0x9b /* data sheet seem to be not correct */
151 1.1 sato #define ITE8181_PPTOBEMASK 0x01 /* Panel Power to be...*/
152 1.1 sato #define ITE8181_PPTOBEON 0x01 /* Panel Power to be ON */
153 1.1 sato #define ITE8181_PPTOBEOFF 0x00 /* Panel Power to be OFF */
154 1.1 sato #define ITE8181_LCDPON 0x08 /* LCD ON? (XX no info) */
155 1.1 sato #define ITE8181_LCDPSTANDBY 0x20 /* LCD STANDBY? (XX no info) */
156 1.1 sato #define ITE8181_LCDPDOWN 0x40 /* LCD POWER DOWN PROGRESS(XX) */
157 1.1 sato #define ITE8181_LCDPUP 0x80 /* LCD POWER UP PROGRESS (XX) */
158 1.1 sato
159 1.1 sato /* ITE8181 LCD Controller Data Manipulation Registers */
160 1.1 sato #define ITE8181_EMA_DITHERCTRL1 0xa0 /* dither control 1 */
161 1.1 sato #define ITE8181_DITHER_CMASK 0xa0 /* dither enable mask */
162 1.1 sato #define ITE8181_DITHER_DISABLE 0x00 /* disable */
163 1.1 sato #define ITE8181_DITHER_SOMEMODE 0x40 /* dither 256/32k/64k/16M color mode */
164 1.1 sato #define ITE8181_DITHER_ENABLE 0x80 /* dither in all mode */
165 1.1 sato
166 1.1 sato #define ITE8181_DITHER_BCMASK 0x38 /* Base Color select */
167 1.1 sato #define ITE8181_DITHER_BC1BIT 0x00
168 1.1 sato #define ITE8181_DITHER_BC2BIT 0x08
169 1.1 sato #define ITE8181_DITHER_BC3BIT 0x10
170 1.1 sato #define ITE8181_DITHER_BC4BIT 0x18
171 1.1 sato #define ITE8181_DITHER_BC5BIT 0x20
172 1.1 sato #define ITE8181_DITHER_BC6BIT 0x28
173 1.1 sato #define ITE8181_DITHER_BC7BIT 0x30
174 1.1 sato #define ITE8181_DITHER_BC8BIT 0x38
175 1.1 sato
176 1.1 sato #define ITE8181_DITHER_BSMASK 0x03 /* dither bit select */
177 1.1 sato #define ITE8181_DITHER_BS6BIT 0x00
178 1.1 sato #define ITE8181_DITHER_BS5BIT 0x01
179 1.1 sato #define ITE8181_DITHER_BS4BIT 0x02
180 1.1 sato #define ITE8181_DITHER_BS3BIT 0x03
181 1.1 sato #define ITE8181_DITHER_BS2BIT 0x04
182 1.1 sato #define ITE8181_DITHER_BS1BIT 0x05
183 1.1 sato #define ITE8181_DITHER_BS0BIT 0x06
184 1.1 sato
185 1.1 sato #define ITE8181_EMA_DITHERCTRL2 0xa1 /* dither control 2 */
186 1.1 sato #define ITE8181_FMS_MASK 0x40 /* frame rate modulation select */
187 1.1 sato #define ITE8181_FMS_2 0x00
188 1.1 sato #define ITE8181_FMS_1 0x40
189 1.1 sato
190 1.1 sato #define ITE8181_GRC_MASK 0x20 /* graphics reverse control */
191 1.1 sato #define ITE8181_GRC_NOGREVERSE 0x00
192 1.1 sato #define ITE8181_GRC_GREVERSE 0x20
193 1.1 sato
194 1.1 sato #define ITE8181_TRC_MASK 0x10 /* text reverse control */
195 1.1 sato #define ITE8181_TRC_NOTREVERSE 0x00
196 1.1 sato #define ITE8181_TRC_TREVERSE 0x10
197 1.1 sato
198 1.1 sato #define ITE8181_CM_MASK 0x01 /* color to mono map */
199 1.1 sato #define ITE8181_CM_NTSC 0x00 /* NTSC weighting */
200 1.1 sato #define ITE8181_CM_GREEN 0x01 /* green only */
201 1.1 sato
202 1.1 sato #define ITE8181_EMA_FRCCOL 0xa2 /* FRC Color */
203 1.1 sato #define ITE8181_FRCCOL_MASK 0x80 /* FRC color option */
204 1.1 sato #define ITE8181_FRCCOL_8 0x80 /* option1, 8 color */
205 1.1 sato #define ITE8181_FRCCOL_16 0x00 /* option2, 16 color */
206 1.1 sato
207 1.5 andvar #define ITE8181_EMA_FRCPAT 0xa3 /* select frame rate pattern */
208 1.1 sato #define ITE8181_FRCPAT_PROGRAM 0x80
209 1.1 sato #define ITE8181_FRCPAT_CONSTANT 0x00
210 1.1 sato
211 1.1 sato #define ITE8181_EMA_FBADDR1 0xa8 /* FB addr1 [21:14] */
212 1.1 sato #define ITE8181_EMA_FBADDR2 0xa9 /* FB addr2 [21:14] */
213 1.1 sato #define ITE8181_EMA_FBADDR3 0xaa /* FB addr3 [21:14] */
214 1.1 sato
215 1.1 sato #define ITE8181_EMA_REDBCOLOR 0xaa /* Red Border color */
216 1.1 sato #define ITE8181_EMA_GREENBCOLOR 0xab /* Green Border color */
217 1.1 sato #define ITE8181_EMA_BLUEBCOLOR 0xac /* Blue Border color */
218 1.1 sato
219 1.1 sato #define ITE8181_EMA_DISPERSION1 0xb0 /* Dispersion-1 B0-B7 */
220 1.1 sato #define ITE8181_EMA_DISPERSION2 0xb8 /* Dispersion-2 B8-BF */
221 1.1 sato
222 1.1 sato #define ITE8181_EMA_FRCPAT0 0xc0 /* Frame Rate Pattern0 C0(lsb)-C1(msb) */
223 1.1 sato #define ITE8181_EMA_FRCPAT1 0xc2 /* Frame Rate Pattern1 C2(lsb)-C3(msb) */
224 1.1 sato #define ITE8181_EMA_FRCPAT2 0xc4 /* Frame Rate Pattern2 C4(lsb)-C5(msb) */
225 1.1 sato #define ITE8181_EMA_FRCPAT3 0xc6 /* Frame Rate Pattern3 C6(lsb)-C7(msb) */
226 1.1 sato #define ITE8181_EMA_FRCPAT4 0xc8 /* Frame Rate Pattern4 C8(lsb)-C9(msb) */
227 1.1 sato #define ITE8181_EMA_FRCPAT5 0xca /* Frame Rate Pattern5 CA(lsb)-CB(msb) */
228 1.1 sato #define ITE8181_EMA_FRCPAT6 0xcc /* Frame Rate Pattern6 CC(lsb)-CD(msb) */
229 1.1 sato #define ITE8181_EMA_FRCPAT7 0xce /* Frame Rate Pattern7 CE(lsb)-CF(msb) */
230 1.1 sato #define ITE8181_EMA_FRCPAT8 0xd0 /* Frame Rate Pattern8 D0(lsb)-D1(msb) */
231 1.1 sato #define ITE8181_EMA_FRCPAT9 0xd2 /* Frame Rate Pattern9 D2(lsb)-D3(msb) */
232 1.1 sato #define ITE8181_EMA_FRCPAT10 0xd4 /* Frame Rate Pattern10 D4(lsb)-D5(msb) */
233 1.1 sato #define ITE8181_EMA_FRCPAT11 0xd6 /* Frame Rate Pattern11 D6(lsb)-D7(msb) */
234 1.1 sato #define ITE8181_EMA_FRCPAT12 0xd8 /* Frame Rate Pattern12 D8(lsb)-D9(msb) */
235 1.1 sato #define ITE8181_EMA_FRCPAT13 0xda /* Frame Rate Pattern13 DA(lsb)-DB(msb) */
236 1.1 sato #define ITE8181_EMA_FRCPAT14 0xdc /* Frame Rate Pattern14 DC(lsb)-DD(msb) */
237 1.1 sato #define ITE8181_EMA_FRCPAT15 0xde /* Frame Rate Pattern15 DE(lsb)-DF(msb) */
238 1.1 sato
239 1.1 sato
240 1.1 sato /* Extension Mode B registers */
241 1.1 sato #define ITE8181_EMB_EXBX 0x03ce /* Extension Controller Index Reg. */
242 1.1 sato #define ITE8181_EMB_EXBDATA 0x03cf /* Extension Controller Data. */
243 1.1 sato
244 1.1 sato #define ITE8181_EMA_ENABLEEMA 0x0b /* Extension Index Enable Reg. */
245 1.1 sato #define ITE8181_EMB_ENABLEPASS 0xca /* EMB enable passwd(w) */
246 1.1 sato #define ITE8181_EMB_DISABLEPASS 0x35 /* EMB disable passwd(w) */
247 1.1 sato #define ITE8181_EMB_ENABLED 0x01 /* EMB enabled (read) */
248 1.1 sato
249 1.1 sato /* XXX - not yet all - */
250 1.1 sato
251 1.1 sato /* end */
252