2 * BRIEF MODULE DESCRIPTION
3 * Hardware definitions for the Au1100 LCD controller
5 * Copyright 2002 MontaVista Software
6 * Copyright 2002 Alchemy Semiconductor
7 * Author: Alchemy Semiconductor, MontaVista Software
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
14 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
17 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
20 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 * You should have received a copy of the GNU General Public License along
26 * with this program; if not, write to the Free Software Foundation, Inc.,
27 * 675 Mass Ave, Cambridge, MA 02139, USA.
33 /********************************************************************/
34 #define uint32 unsigned long
35 typedef volatile struct
40 uint32 lcd_horztiming
;
41 uint32 lcd_verttiming
;
42 uint32 lcd_clkcontrol
;
48 uint32 reserved
[(0x0400-0x002C)/4];
49 uint32 lcd_pallettebase
[256];
53 /********************************************************************/
55 #define AU1100_LCD_ADDR 0xB5000000
58 * Register bit definitions
62 #define LCD_CONTROL_SBPPF (7<<18)
63 #define LCD_CONTROL_SBPPF_655 (0<<18)
64 #define LCD_CONTROL_SBPPF_565 (1<<18)
65 #define LCD_CONTROL_SBPPF_556 (2<<18)
66 #define LCD_CONTROL_SBPPF_1555 (3<<18)
67 #define LCD_CONTROL_SBPPF_5551 (4<<18)
68 #define LCD_CONTROL_WP (1<<17)
69 #define LCD_CONTROL_WD (1<<16)
70 #define LCD_CONTROL_C (1<<15)
71 #define LCD_CONTROL_SM (3<<13)
72 #define LCD_CONTROL_SM_0 (0<<13)
73 #define LCD_CONTROL_SM_90 (1<<13)
74 #define LCD_CONTROL_SM_180 (2<<13)
75 #define LCD_CONTROL_SM_270 (3<<13)
76 #define LCD_CONTROL_DB (1<<12)
77 #define LCD_CONTROL_CCO (1<<11)
78 #define LCD_CONTROL_DP (1<<10)
79 #define LCD_CONTROL_PO (3<<8)
80 #define LCD_CONTROL_PO_00 (0<<8)
81 #define LCD_CONTROL_PO_01 (1<<8)
82 #define LCD_CONTROL_PO_10 (2<<8)
83 #define LCD_CONTROL_PO_11 (3<<8)
84 #define LCD_CONTROL_MPI (1<<7)
85 #define LCD_CONTROL_PT (1<<6)
86 #define LCD_CONTROL_PC (1<<5)
87 #define LCD_CONTROL_BPP (7<<1)
88 #define LCD_CONTROL_BPP_1 (0<<1)
89 #define LCD_CONTROL_BPP_2 (1<<1)
90 #define LCD_CONTROL_BPP_4 (2<<1)
91 #define LCD_CONTROL_BPP_8 (3<<1)
92 #define LCD_CONTROL_BPP_12 (4<<1)
93 #define LCD_CONTROL_BPP_16 (5<<1)
94 #define LCD_CONTROL_GO (1<<0)
96 /* lcd_intstatus, lcd_intenable */
97 #define LCD_INT_SD (1<<7)
98 #define LCD_INT_OF (1<<6)
99 #define LCD_INT_UF (1<<5)
100 #define LCD_INT_SA (1<<3)
101 #define LCD_INT_SS (1<<2)
102 #define LCD_INT_S1 (1<<1)
103 #define LCD_INT_S0 (1<<0)
106 #define LCD_HORZTIMING_HN2 (255<<24)
107 #define LCD_HORZTIMING_HN2_N(N) (((N)-1)<<24)
108 #define LCD_HORZTIMING_HN1 (255<<16)
109 #define LCD_HORZTIMING_HN1_N(N) (((N)-1)<<16)
110 #define LCD_HORZTIMING_HPW (63<<10)
111 #define LCD_HORZTIMING_HPW_N(N) (((N)-1)<<10)
112 #define LCD_HORZTIMING_PPL (1023<<0)
113 #define LCD_HORZTIMING_PPL_N(N) (((N)-1)<<0)
116 #define LCD_VERTTIMING_VN2 (255<<24)
117 #define LCD_VERTTIMING_VN2_N(N) (((N)-1)<<24)
118 #define LCD_VERTTIMING_VN1 (255<<16)
119 #define LCD_VERTTIMING_VN1_N(N) (((N)-1)<<16)
120 #define LCD_VERTTIMING_VPW (63<<10)
121 #define LCD_VERTTIMING_VPW_N(N) (((N)-1)<<10)
122 #define LCD_VERTTIMING_LPP (1023<<0)
123 #define LCD_VERTTIMING_LPP_N(N) (((N)-1)<<0)
126 #define LCD_CLKCONTROL_IB (1<<18)
127 #define LCD_CLKCONTROL_IC (1<<17)
128 #define LCD_CLKCONTROL_IH (1<<16)
129 #define LCD_CLKCONTROL_IV (1<<15)
130 #define LCD_CLKCONTROL_BF (31<<10)
131 #define LCD_CLKCONTROL_BF_N(N) (((N)-1)<<10)
132 #define LCD_CLKCONTROL_PCD (1023<<0)
133 #define LCD_CLKCONTROL_PCD_N(N) ((N)<<0)
136 #define LCD_PWMDIV_EN (1<<12)
137 #define LCD_PWMDIV_PWMDIV (2047<<0)
138 #define LCD_PWMDIV_PWMDIV_N(N) (((N)-1)<<0)
141 #define LCD_PWMHI_PWMHI1 (2047<<12)
142 #define LCD_PWMHI_PWMHI1_N(N) ((N)<<12)
143 #define LCD_PWMHI_PWMHI0 (2047<<0)
144 #define LCD_PWMHI_PWMHI0_N(N) ((N)<<0)
146 /* lcd_pallettebase - MONOCHROME */
147 #define LCD_PALLETTE_MONO_MI (15<<0)
148 #define LCD_PALLETTE_MONO_MI_N(N) ((N)<<0)
150 /* lcd_pallettebase - COLOR */
151 #define LCD_PALLETTE_COLOR_BI (15<<8)
152 #define LCD_PALLETTE_COLOR_BI_N(N) ((N)<<8)
153 #define LCD_PALLETTE_COLOR_GI (15<<4)
154 #define LCD_PALLETTE_COLOR_GI_N(N) ((N)<<4)
155 #define LCD_PALLETTE_COLOR_RI (15<<0)
156 #define LCD_PALLETTE_COLOR_RI_N(N) ((N)<<0)
158 /* lcd_palletebase - COLOR TFT PALLETIZED */
159 #define LCD_PALLETTE_TFT_DC (65535<<0)
160 #define LCD_PALLETTE_TFT_DC_N(N) ((N)<<0)
162 /********************************************************************/
164 struct known_lcd_panels
169 unsigned char panel_name
[256];
171 uint32 mode_horztiming
;
172 uint32 mode_verttiming
;
173 uint32 mode_clkcontrol
;
176 uint32 mode_toyclksrc
;
177 uint32 mode_backlight
;
181 #if defined(__BIG_ENDIAN)
182 #define LCD_DEFAULT_PIX_FORMAT LCD_CONTROL_PO_11
184 #define LCD_DEFAULT_PIX_FORMAT LCD_CONTROL_PO_00
188 * The fb driver assumes that AUX PLL is at 48MHz. That can
189 * cover up to 800x600 resolution; if you need higher resolution,
190 * you should modify the driver as needed, not just this structure.
192 struct known_lcd_panels panels
[] =
194 { /* 0: Pb1100 LCDA: Sharp 320x240 TFT panel */
201 ( LCD_CONTROL_SBPPF_565
209 | LCD_DEFAULT_PIX_FORMAT
213 | LCD_CONTROL_BPP_16
),
215 /* mode_horztiming */
216 ( LCD_HORZTIMING_HN2_N(8)
217 | LCD_HORZTIMING_HN1_N(60)
218 | LCD_HORZTIMING_HPW_N(12)
219 | LCD_HORZTIMING_PPL_N(320) ),
221 /* mode_verttiming */
222 ( LCD_VERTTIMING_VN2_N(5)
223 | LCD_VERTTIMING_VN1_N(17)
224 | LCD_VERTTIMING_VPW_N(1)
225 | LCD_VERTTIMING_LPP_N(240) ),
227 /* mode_clkcontrol */
229 /*LCD_CLKCONTROL_IB*/
230 /*LCD_CLKCONTROL_IC*/
231 /*LCD_CLKCONTROL_IH*/
232 /*LCD_CLKCONTROL_IV*/
233 | LCD_CLKCONTROL_PCD_N(1) ),
242 ((1<<7) | (1<<6) | (1<<5)),
248 { /* 1: Pb1100 LCDC 640x480 TFT panel */
253 "Generic_640x480_16",
256 0x004806a | LCD_DEFAULT_PIX_FORMAT
,
258 /* mode_horztiming */
261 /* mode_verttiming */
264 /* mode_clkcontrol */
266 /*LCD_CLKCONTROL_IB*/
267 /*LCD_CLKCONTROL_IC*/
268 /*LCD_CLKCONTROL_IH*/
269 /*LCD_CLKCONTROL_IV*/
270 | LCD_CLKCONTROL_PCD_N(1) ),
279 ((1<<7) | (1<<6) | (0<<5)),
285 { /* 2: Pb1100 LCDB 640x480 PrimeView TFT panel */
290 "PrimeView_640x480_16",
293 0x0004886a | LCD_DEFAULT_PIX_FORMAT
,
295 /* mode_horztiming */
298 /* mode_verttiming */
301 /* mode_clkcontrol */
311 ((1<<7) | (1<<6) | (0<<5)),
317 { /* 3: Pb1100 800x600x16bpp NEON CRT */
325 0x0004886A | LCD_DEFAULT_PIX_FORMAT
,
327 /* mode_horztiming */
330 /* mode_verttiming */
333 /* mode_clkcontrol */
343 ((1<<7) | (1<<6) | (0<<5)),
349 { /* 4: Pb1100 640x480x16bpp NEON CRT */
357 0x0004886A | LCD_DEFAULT_PIX_FORMAT
,
359 /* mode_horztiming */
362 /* mode_verttiming */
365 /* mode_clkcontrol */
375 ((1<<7) | (1<<6) | (0<<5)),
381 #endif /* _AU1100LCD_H */