Go to the documentation of this file.
33 #define AU1200_LCD_ADDR 0xB5000000
35 #define uint8 unsigned char
36 #define uint32 unsigned int
85 #define LCD_SCREEN_SEN (1<<31)
86 #define LCD_SCREEN_SX (0x07FF<<19)
87 #define LCD_SCREEN_SY (0x07FF<< 8)
88 #define LCD_SCREEN_SWP (1<<7)
89 #define LCD_SCREEN_SWD (1<<6)
90 #define LCD_SCREEN_PT (7<<0)
91 #define LCD_SCREEN_PT_TFT (0<<0)
92 #define LCD_SCREEN_SX_N(WIDTH) ((WIDTH-1)<<19)
93 #define LCD_SCREEN_SY_N(HEIGHT) ((HEIGHT-1)<<8)
94 #define LCD_SCREEN_PT_CSTN (1<<0)
95 #define LCD_SCREEN_PT_CDSTN (2<<0)
96 #define LCD_SCREEN_PT_M8STN (3<<0)
97 #define LCD_SCREEN_PT_M4STN (4<<0)
100 #define LCD_BACKCOLOR_SBGR (0xFF<<16)
101 #define LCD_BACKCOLOR_SBGG (0xFF<<8)
102 #define LCD_BACKCOLOR_SBGB (0xFF<<0)
103 #define LCD_BACKCOLOR_SBGR_N(N) ((N)<<16)
104 #define LCD_BACKCOLOR_SBGG_N(N) ((N)<<8)
105 #define LCD_BACKCOLOR_SBGB_N(N) ((N)<<0)
108 #define LCD_WINENABLE_WEN3 (1<<3)
109 #define LCD_WINENABLE_WEN2 (1<<2)
110 #define LCD_WINENABLE_WEN1 (1<<1)
111 #define LCD_WINENABLE_WEN0 (1<<0)
114 #define LCD_COLORKEY_CKR (0xFF<<16)
115 #define LCD_COLORKEY_CKG (0xFF<<8)
116 #define LCD_COLORKEY_CKB (0xFF<<0)
117 #define LCD_COLORKEY_CKR_N(N) ((N)<<16)
118 #define LCD_COLORKEY_CKG_N(N) ((N)<<8)
119 #define LCD_COLORKEY_CKB_N(N) ((N)<<0)
122 #define LCD_COLORKEYMSK_CKMR (0xFF<<16)
123 #define LCD_COLORKEYMSK_CKMG (0xFF<<8)
124 #define LCD_COLORKEYMSK_CKMB (0xFF<<0)
125 #define LCD_COLORKEYMSK_CKMR_N(N) ((N)<<16)
126 #define LCD_COLORKEYMSK_CKMG_N(N) ((N)<<8)
127 #define LCD_COLORKEYMSK_CKMB_N(N) ((N)<<0)
130 #define LCD_WINCTRL0_OX (0x07FF<<21)
131 #define LCD_WINCTRL0_OY (0x07FF<<10)
132 #define LCD_WINCTRL0_A (0x00FF<<2)
133 #define LCD_WINCTRL0_AEN (1<<1)
134 #define LCD_WINCTRL0_OX_N(N) ((N)<<21)
135 #define LCD_WINCTRL0_OY_N(N) ((N)<<10)
136 #define LCD_WINCTRL0_A_N(N) ((N)<<2)
139 #define LCD_WINCTRL1_PRI (3<<30)
140 #define LCD_WINCTRL1_PIPE (1<<29)
141 #define LCD_WINCTRL1_FRM (0xF<<25)
142 #define LCD_WINCTRL1_CCO (1<<24)
143 #define LCD_WINCTRL1_PO (3<<22)
144 #define LCD_WINCTRL1_SZX (0x07FF<<11)
145 #define LCD_WINCTRL1_SZY (0x07FF<<0)
146 #define LCD_WINCTRL1_FRM_1BPP (0<<25)
147 #define LCD_WINCTRL1_FRM_2BPP (1<<25)
148 #define LCD_WINCTRL1_FRM_4BPP (2<<25)
149 #define LCD_WINCTRL1_FRM_8BPP (3<<25)
150 #define LCD_WINCTRL1_FRM_12BPP (4<<25)
151 #define LCD_WINCTRL1_FRM_16BPP655 (5<<25)
152 #define LCD_WINCTRL1_FRM_16BPP565 (6<<25)
153 #define LCD_WINCTRL1_FRM_16BPP556 (7<<25)
154 #define LCD_WINCTRL1_FRM_16BPPI1555 (8<<25)
155 #define LCD_WINCTRL1_FRM_16BPPI5551 (9<<25)
156 #define LCD_WINCTRL1_FRM_16BPPA1555 (10<<25)
157 #define LCD_WINCTRL1_FRM_16BPPA5551 (11<<25)
158 #define LCD_WINCTRL1_FRM_24BPP (12<<25)
159 #define LCD_WINCTRL1_FRM_32BPP (13<<25)
160 #define LCD_WINCTRL1_PRI_N(N) ((N)<<30)
161 #define LCD_WINCTRL1_PO_00 (0<<22)
162 #define LCD_WINCTRL1_PO_01 (1<<22)
163 #define LCD_WINCTRL1_PO_10 (2<<22)
164 #define LCD_WINCTRL1_PO_11 (3<<22)
165 #define LCD_WINCTRL1_SZX_N(N) ((N-1)<<11)
166 #define LCD_WINCTRL1_SZY_N(N) ((N-1)<<0)
169 #define LCD_WINCTRL2_CKMODE (3<<24)
170 #define LCD_WINCTRL2_DBM (1<<23)
171 #define LCD_WINCTRL2_RAM (3<<21)
172 #define LCD_WINCTRL2_BX (0x1FFF<<8)
173 #define LCD_WINCTRL2_SCX (0xF<<4)
174 #define LCD_WINCTRL2_SCY (0xF<<0)
175 #define LCD_WINCTRL2_CKMODE_00 (0<<24)
176 #define LCD_WINCTRL2_CKMODE_01 (1<<24)
177 #define LCD_WINCTRL2_CKMODE_10 (2<<24)
178 #define LCD_WINCTRL2_CKMODE_11 (3<<24)
179 #define LCD_WINCTRL2_RAM_NONE (0<<21)
180 #define LCD_WINCTRL2_RAM_PALETTE (1<<21)
181 #define LCD_WINCTRL2_RAM_GAMMA (2<<21)
182 #define LCD_WINCTRL2_RAM_BUFFER (3<<21)
183 #define LCD_WINCTRL2_BX_N(N) ((N)<<8)
184 #define LCD_WINCTRL2_SCX_1 (0<<4)
185 #define LCD_WINCTRL2_SCX_2 (1<<4)
186 #define LCD_WINCTRL2_SCX_4 (2<<4)
187 #define LCD_WINCTRL2_SCY_1 (0<<0)
188 #define LCD_WINCTRL2_SCY_2 (1<<0)
189 #define LCD_WINCTRL2_SCY_4 (2<<0)
192 #define LCD_WINBUFCTRL_DB (1<<1)
193 #define LCD_WINBUFCTRL_DBN (1<<0)
196 #define LCD_INT_IFO (0xF<<14)
197 #define LCD_INT_IFU (0xF<<10)
198 #define LCD_INT_OFO (1<<9)
199 #define LCD_INT_OFU (1<<8)
200 #define LCD_INT_WAIT (1<<3)
201 #define LCD_INT_SD (1<<2)
202 #define LCD_INT_SA (1<<1)
203 #define LCD_INT_SS (1<<0)
206 #define LCD_HORZTIMING_HND2 (0x1FF<<18)
207 #define LCD_HORZTIMING_HND1 (0x1FF<<9)
208 #define LCD_HORZTIMING_HPW (0x1FF<<0)
209 #define LCD_HORZTIMING_HND2_N(N)(((N)-1)<<18)
210 #define LCD_HORZTIMING_HND1_N(N)(((N)-1)<<9)
211 #define LCD_HORZTIMING_HPW_N(N) (((N)-1)<<0)
214 #define LCD_VERTTIMING_VND2 (0x1FF<<18)
215 #define LCD_VERTTIMING_VND1 (0x1FF<<9)
216 #define LCD_VERTTIMING_VPW (0x1FF<<0)
217 #define LCD_VERTTIMING_VND2_N(N)(((N)-1)<<18)
218 #define LCD_VERTTIMING_VND1_N(N)(((N)-1)<<9)
219 #define LCD_VERTTIMING_VPW_N(N) (((N)-1)<<0)
222 #define LCD_CLKCONTROL_EXT (1<<22)
223 #define LCD_CLKCONTROL_DELAY (3<<20)
224 #define LCD_CLKCONTROL_CDD (1<<19)
225 #define LCD_CLKCONTROL_IB (1<<18)
226 #define LCD_CLKCONTROL_IC (1<<17)
227 #define LCD_CLKCONTROL_IH (1<<16)
228 #define LCD_CLKCONTROL_IV (1<<15)
229 #define LCD_CLKCONTROL_BF (0x1F<<10)
230 #define LCD_CLKCONTROL_PCD (0x3FF<<0)
231 #define LCD_CLKCONTROL_BF_N(N) (((N)-1)<<10)
232 #define LCD_CLKCONTROL_PCD_N(N) ((N)<<0)
235 #define LCD_PWMDIV_EN (1<<31)
236 #define LCD_PWMDIV_PWMDIV (0x1FFFF<<0)
237 #define LCD_PWMDIV_PWMDIV_N(N) ((N)<<0)
240 #define LCD_PWMHI_PWMHI1 (0xFFFF<<16)
241 #define LCD_PWMHI_PWMHI0 (0xFFFF<<0)
242 #define LCD_PWMHI_PWMHI1_N(N) ((N)<<16)
243 #define LCD_PWMHI_PWMHI0_N(N) ((N)<<0)
246 #define LCD_HWCCON_EN (1<<0)
249 #define LCD_CURSORPOS_HWCXOFF (0x1F<<27)
250 #define LCD_CURSORPOS_HWCXPOS (0x07FF<<16)
251 #define LCD_CURSORPOS_HWCYOFF (0x1F<<11)
252 #define LCD_CURSORPOS_HWCYPOS (0x07FF<<0)
253 #define LCD_CURSORPOS_HWCXOFF_N(N) ((N)<<27)
254 #define LCD_CURSORPOS_HWCXPOS_N(N) ((N)<<16)
255 #define LCD_CURSORPOS_HWCYOFF_N(N) ((N)<<11)
256 #define LCD_CURSORPOS_HWCYPOS_N(N) ((N)<<0)
259 #define LCD_CURSORCOLOR_HWCA (0xFF<<24)
260 #define LCD_CURSORCOLOR_HWCR (0xFF<<16)
261 #define LCD_CURSORCOLOR_HWCG (0xFF<<8)
262 #define LCD_CURSORCOLOR_HWCB (0xFF<<0)
263 #define LCD_CURSORCOLOR_HWCA_N(N) ((N)<<24)
264 #define LCD_CURSORCOLOR_HWCR_N(N) ((N)<<16)
265 #define LCD_CURSORCOLOR_HWCG_N(N) ((N)<<8)
266 #define LCD_CURSORCOLOR_HWCB_N(N) ((N)<<0)
269 #define LCD_FIFOCTRL_F3IF (1<<29)
270 #define LCD_FIFOCTRL_F3REQ (0x1F<<24)
271 #define LCD_FIFOCTRL_F2IF (1<<29)
272 #define LCD_FIFOCTRL_F2REQ (0x1F<<16)
273 #define LCD_FIFOCTRL_F1IF (1<<29)
274 #define LCD_FIFOCTRL_F1REQ (0x1F<<8)
275 #define LCD_FIFOCTRL_F0IF (1<<29)
276 #define LCD_FIFOCTRL_F0REQ (0x1F<<0)
277 #define LCD_FIFOCTRL_F3REQ_N(N) ((N-1)<<24)
278 #define LCD_FIFOCTRL_F2REQ_N(N) ((N-1)<<16)
279 #define LCD_FIFOCTRL_F1REQ_N(N) ((N-1)<<8)
280 #define LCD_FIFOCTRL_F0REQ_N(N) ((N-1)<<0)
283 #define LCD_OUTMASK_MASK (0x00FFFFFF)
319 #define AU1200_LCD_ADDR 0xB5000000
321 #define uint8 unsigned char
322 #define uint32 unsigned int
371 #define LCD_SCREEN_SEN (1<<31)
372 #define LCD_SCREEN_SX (0x07FF<<19)
373 #define LCD_SCREEN_SY (0x07FF<< 8)
374 #define LCD_SCREEN_SWP (1<<7)
375 #define LCD_SCREEN_SWD (1<<6)
376 #define LCD_SCREEN_PT (7<<0)
377 #define LCD_SCREEN_PT_TFT (0<<0)
378 #define LCD_SCREEN_SX_N(WIDTH) ((WIDTH-1)<<19)
379 #define LCD_SCREEN_SY_N(HEIGHT) ((HEIGHT-1)<<8)
380 #define LCD_SCREEN_PT_CSTN (1<<0)
381 #define LCD_SCREEN_PT_CDSTN (2<<0)
382 #define LCD_SCREEN_PT_M8STN (3<<0)
383 #define LCD_SCREEN_PT_M4STN (4<<0)
386 #define LCD_BACKCOLOR_SBGR (0xFF<<16)
387 #define LCD_BACKCOLOR_SBGG (0xFF<<8)
388 #define LCD_BACKCOLOR_SBGB (0xFF<<0)
389 #define LCD_BACKCOLOR_SBGR_N(N) ((N)<<16)
390 #define LCD_BACKCOLOR_SBGG_N(N) ((N)<<8)
391 #define LCD_BACKCOLOR_SBGB_N(N) ((N)<<0)
394 #define LCD_WINENABLE_WEN3 (1<<3)
395 #define LCD_WINENABLE_WEN2 (1<<2)
396 #define LCD_WINENABLE_WEN1 (1<<1)
397 #define LCD_WINENABLE_WEN0 (1<<0)
400 #define LCD_COLORKEY_CKR (0xFF<<16)
401 #define LCD_COLORKEY_CKG (0xFF<<8)
402 #define LCD_COLORKEY_CKB (0xFF<<0)
403 #define LCD_COLORKEY_CKR_N(N) ((N)<<16)
404 #define LCD_COLORKEY_CKG_N(N) ((N)<<8)
405 #define LCD_COLORKEY_CKB_N(N) ((N)<<0)
408 #define LCD_COLORKEYMSK_CKMR (0xFF<<16)
409 #define LCD_COLORKEYMSK_CKMG (0xFF<<8)
410 #define LCD_COLORKEYMSK_CKMB (0xFF<<0)
411 #define LCD_COLORKEYMSK_CKMR_N(N) ((N)<<16)
412 #define LCD_COLORKEYMSK_CKMG_N(N) ((N)<<8)
413 #define LCD_COLORKEYMSK_CKMB_N(N) ((N)<<0)
416 #define LCD_WINCTRL0_OX (0x07FF<<21)
417 #define LCD_WINCTRL0_OY (0x07FF<<10)
418 #define LCD_WINCTRL0_A (0x00FF<<2)
419 #define LCD_WINCTRL0_AEN (1<<1)
420 #define LCD_WINCTRL0_OX_N(N) ((N)<<21)
421 #define LCD_WINCTRL0_OY_N(N) ((N)<<10)
422 #define LCD_WINCTRL0_A_N(N) ((N)<<2)
425 #define LCD_WINCTRL1_PRI (3<<30)
426 #define LCD_WINCTRL1_PIPE (1<<29)
427 #define LCD_WINCTRL1_FRM (0xF<<25)
428 #define LCD_WINCTRL1_CCO (1<<24)
429 #define LCD_WINCTRL1_PO (3<<22)
430 #define LCD_WINCTRL1_SZX (0x07FF<<11)
431 #define LCD_WINCTRL1_SZY (0x07FF<<0)
432 #define LCD_WINCTRL1_FRM_1BPP (0<<25)
433 #define LCD_WINCTRL1_FRM_2BPP (1<<25)
434 #define LCD_WINCTRL1_FRM_4BPP (2<<25)
435 #define LCD_WINCTRL1_FRM_8BPP (3<<25)
436 #define LCD_WINCTRL1_FRM_12BPP (4<<25)
437 #define LCD_WINCTRL1_FRM_16BPP655 (5<<25)
438 #define LCD_WINCTRL1_FRM_16BPP565 (6<<25)
439 #define LCD_WINCTRL1_FRM_16BPP556 (7<<25)
440 #define LCD_WINCTRL1_FRM_16BPPI1555 (8<<25)
441 #define LCD_WINCTRL1_FRM_16BPPI5551 (9<<25)
442 #define LCD_WINCTRL1_FRM_16BPPA1555 (10<<25)
443 #define LCD_WINCTRL1_FRM_16BPPA5551 (11<<25)
444 #define LCD_WINCTRL1_FRM_24BPP (12<<25)
445 #define LCD_WINCTRL1_FRM_32BPP (13<<25)
446 #define LCD_WINCTRL1_PRI_N(N) ((N)<<30)
447 #define LCD_WINCTRL1_PO_00 (0<<22)
448 #define LCD_WINCTRL1_PO_01 (1<<22)
449 #define LCD_WINCTRL1_PO_10 (2<<22)
450 #define LCD_WINCTRL1_PO_11 (3<<22)
451 #define LCD_WINCTRL1_SZX_N(N) ((N-1)<<11)
452 #define LCD_WINCTRL1_SZY_N(N) ((N-1)<<0)
455 #define LCD_WINCTRL2_CKMODE (3<<24)
456 #define LCD_WINCTRL2_DBM (1<<23)
457 #define LCD_WINCTRL2_RAM (3<<21)
458 #define LCD_WINCTRL2_BX (0x1FFF<<8)
459 #define LCD_WINCTRL2_SCX (0xF<<4)
460 #define LCD_WINCTRL2_SCY (0xF<<0)
461 #define LCD_WINCTRL2_CKMODE_00 (0<<24)
462 #define LCD_WINCTRL2_CKMODE_01 (1<<24)
463 #define LCD_WINCTRL2_CKMODE_10 (2<<24)
464 #define LCD_WINCTRL2_CKMODE_11 (3<<24)
465 #define LCD_WINCTRL2_RAM_NONE (0<<21)
466 #define LCD_WINCTRL2_RAM_PALETTE (1<<21)
467 #define LCD_WINCTRL2_RAM_GAMMA (2<<21)
468 #define LCD_WINCTRL2_RAM_BUFFER (3<<21)
469 #define LCD_WINCTRL2_BX_N(N) ((N)<<8)
470 #define LCD_WINCTRL2_SCX_1 (0<<4)
471 #define LCD_WINCTRL2_SCX_2 (1<<4)
472 #define LCD_WINCTRL2_SCX_4 (2<<4)
473 #define LCD_WINCTRL2_SCY_1 (0<<0)
474 #define LCD_WINCTRL2_SCY_2 (1<<0)
475 #define LCD_WINCTRL2_SCY_4 (2<<0)
478 #define LCD_WINBUFCTRL_DB (1<<1)
479 #define LCD_WINBUFCTRL_DBN (1<<0)
482 #define LCD_INT_IFO (0xF<<14)
483 #define LCD_INT_IFU (0xF<<10)
484 #define LCD_INT_OFO (1<<9)
485 #define LCD_INT_OFU (1<<8)
486 #define LCD_INT_WAIT (1<<3)
487 #define LCD_INT_SD (1<<2)
488 #define LCD_INT_SA (1<<1)
489 #define LCD_INT_SS (1<<0)
492 #define LCD_HORZTIMING_HND2 (0x1FF<<18)
493 #define LCD_HORZTIMING_HND1 (0x1FF<<9)
494 #define LCD_HORZTIMING_HPW (0x1FF<<0)
495 #define LCD_HORZTIMING_HND2_N(N)(((N)-1)<<18)
496 #define LCD_HORZTIMING_HND1_N(N)(((N)-1)<<9)
497 #define LCD_HORZTIMING_HPW_N(N) (((N)-1)<<0)
500 #define LCD_VERTTIMING_VND2 (0x1FF<<18)
501 #define LCD_VERTTIMING_VND1 (0x1FF<<9)
502 #define LCD_VERTTIMING_VPW (0x1FF<<0)
503 #define LCD_VERTTIMING_VND2_N(N)(((N)-1)<<18)
504 #define LCD_VERTTIMING_VND1_N(N)(((N)-1)<<9)
505 #define LCD_VERTTIMING_VPW_N(N) (((N)-1)<<0)
508 #define LCD_CLKCONTROL_EXT (1<<22)
509 #define LCD_CLKCONTROL_DELAY (3<<20)
510 #define LCD_CLKCONTROL_CDD (1<<19)
511 #define LCD_CLKCONTROL_IB (1<<18)
512 #define LCD_CLKCONTROL_IC (1<<17)
513 #define LCD_CLKCONTROL_IH (1<<16)
514 #define LCD_CLKCONTROL_IV (1<<15)
515 #define LCD_CLKCONTROL_BF (0x1F<<10)
516 #define LCD_CLKCONTROL_PCD (0x3FF<<0)
517 #define LCD_CLKCONTROL_BF_N(N) (((N)-1)<<10)
518 #define LCD_CLKCONTROL_PCD_N(N) ((N)<<0)
521 #define LCD_PWMDIV_EN (1<<31)
522 #define LCD_PWMDIV_PWMDIV (0x1FFFF<<0)
523 #define LCD_PWMDIV_PWMDIV_N(N) ((N)<<0)
526 #define LCD_PWMHI_PWMHI1 (0xFFFF<<16)
527 #define LCD_PWMHI_PWMHI0 (0xFFFF<<0)
528 #define LCD_PWMHI_PWMHI1_N(N) ((N)<<16)
529 #define LCD_PWMHI_PWMHI0_N(N) ((N)<<0)
532 #define LCD_HWCCON_EN (1<<0)
535 #define LCD_CURSORPOS_HWCXOFF (0x1F<<27)
536 #define LCD_CURSORPOS_HWCXPOS (0x07FF<<16)
537 #define LCD_CURSORPOS_HWCYOFF (0x1F<<11)
538 #define LCD_CURSORPOS_HWCYPOS (0x07FF<<0)
539 #define LCD_CURSORPOS_HWCXOFF_N(N) ((N)<<27)
540 #define LCD_CURSORPOS_HWCXPOS_N(N) ((N)<<16)
541 #define LCD_CURSORPOS_HWCYOFF_N(N) ((N)<<11)
542 #define LCD_CURSORPOS_HWCYPOS_N(N) ((N)<<0)
545 #define LCD_CURSORCOLOR_HWCA (0xFF<<24)
546 #define LCD_CURSORCOLOR_HWCR (0xFF<<16)
547 #define LCD_CURSORCOLOR_HWCG (0xFF<<8)
548 #define LCD_CURSORCOLOR_HWCB (0xFF<<0)
549 #define LCD_CURSORCOLOR_HWCA_N(N) ((N)<<24)
550 #define LCD_CURSORCOLOR_HWCR_N(N) ((N)<<16)
551 #define LCD_CURSORCOLOR_HWCG_N(N) ((N)<<8)
552 #define LCD_CURSORCOLOR_HWCB_N(N) ((N)<<0)
555 #define LCD_FIFOCTRL_F3IF (1<<29)
556 #define LCD_FIFOCTRL_F3REQ (0x1F<<24)
557 #define LCD_FIFOCTRL_F2IF (1<<29)
558 #define LCD_FIFOCTRL_F2REQ (0x1F<<16)
559 #define LCD_FIFOCTRL_F1IF (1<<29)
560 #define LCD_FIFOCTRL_F1REQ (0x1F<<8)
561 #define LCD_FIFOCTRL_F0IF (1<<29)
562 #define LCD_FIFOCTRL_F0REQ (0x1F<<0)
563 #define LCD_FIFOCTRL_F3REQ_N(N) ((N-1)<<24)
564 #define LCD_FIFOCTRL_F2REQ_N(N) ((N-1)<<16)
565 #define LCD_FIFOCTRL_F1REQ_N(N) ((N-1)<<8)
566 #define LCD_FIFOCTRL_F0REQ_N(N) ((N-1)<<0)
569 #define LCD_OUTMASK_MASK (0x00FFFFFF)