blob: d8f1adfd17f0e7cb4599eecaf29462157e294866 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/* linux/include/asm/arch-s3c2410/regs-lcd.h
2 *
3 * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
Linus Torvalds1da177e2005-04-16 15:20:36 -07009*/
10
11
12#ifndef ___ASM_ARCH_REGS_LCD_H
13#define ___ASM_ARCH_REGS_LCD_H "$Id: lcd.h,v 1.3 2003/06/26 13:25:06 ben Exp $"
14
15#define S3C2410_LCDREG(x) ((x) + S3C24XX_VA_LCD)
16
17/* LCD control registers */
18#define S3C2410_LCDCON1 S3C2410_LCDREG(0x00)
19#define S3C2410_LCDCON2 S3C2410_LCDREG(0x04)
20#define S3C2410_LCDCON3 S3C2410_LCDREG(0x08)
21#define S3C2410_LCDCON4 S3C2410_LCDREG(0x0C)
22#define S3C2410_LCDCON5 S3C2410_LCDREG(0x10)
23
24#define S3C2410_LCDCON1_CLKVAL(x) ((x) << 8)
25#define S3C2410_LCDCON1_MMODE (1<<7)
26#define S3C2410_LCDCON1_DSCAN4 (0<<5)
27#define S3C2410_LCDCON1_STN4 (1<<5)
28#define S3C2410_LCDCON1_STN8 (2<<5)
29#define S3C2410_LCDCON1_TFT (3<<5)
30
31#define S3C2410_LCDCON1_STN1BPP (0<<1)
32#define S3C2410_LCDCON1_STN2GREY (1<<1)
33#define S3C2410_LCDCON1_STN4GREY (2<<1)
34#define S3C2410_LCDCON1_STN8BPP (3<<1)
35#define S3C2410_LCDCON1_STN12BPP (4<<1)
36
37#define S3C2410_LCDCON1_TFT1BPP (8<<1)
38#define S3C2410_LCDCON1_TFT2BPP (9<<1)
39#define S3C2410_LCDCON1_TFT4BPP (10<<1)
40#define S3C2410_LCDCON1_TFT8BPP (11<<1)
41#define S3C2410_LCDCON1_TFT16BPP (12<<1)
42#define S3C2410_LCDCON1_TFT24BPP (13<<1)
43
44#define S3C2410_LCDCON1_ENVID (1)
45
Arnaud Patard20fd5762005-09-09 13:10:07 -070046#define S3C2410_LCDCON1_MODEMASK 0x1E
47
Linus Torvalds1da177e2005-04-16 15:20:36 -070048#define S3C2410_LCDCON2_VBPD(x) ((x) << 24)
49#define S3C2410_LCDCON2_LINEVAL(x) ((x) << 14)
50#define S3C2410_LCDCON2_VFPD(x) ((x) << 6)
51#define S3C2410_LCDCON2_VSPW(x) ((x) << 0)
52
Arnaud Patard20fd5762005-09-09 13:10:07 -070053#define S3C2410_LCDCON2_GET_VBPD(x) ( ((x) >> 24) & 0xFF)
54#define S3C2410_LCDCON2_GET_VFPD(x) ( ((x) >> 6) & 0xFF)
55#define S3C2410_LCDCON2_GET_VSPW(x) ( ((x) >> 0) & 0x3F)
56
Linus Torvalds1da177e2005-04-16 15:20:36 -070057#define S3C2410_LCDCON3_HBPD(x) ((x) << 19)
58#define S3C2410_LCDCON3_WDLY(x) ((x) << 19)
59#define S3C2410_LCDCON3_HOZVAL(x) ((x) << 8)
60#define S3C2410_LCDCON3_HFPD(x) ((x) << 0)
61#define S3C2410_LCDCON3_LINEBLANK(x)((x) << 0)
62
Arnaud Patard20fd5762005-09-09 13:10:07 -070063#define S3C2410_LCDCON3_GET_HBPD(x) ( ((x) >> 19) & 0x7F)
64#define S3C2410_LCDCON3_GET_HFPD(x) ( ((x) >> 0) & 0xFF)
65
Linus Torvalds1da177e2005-04-16 15:20:36 -070066#define S3C2410_LCDCON4_MVAL(x) ((x) << 8)
67#define S3C2410_LCDCON4_HSPW(x) ((x) << 0)
68#define S3C2410_LCDCON4_WLH(x) ((x) << 0)
69
Arnaud Patard20fd5762005-09-09 13:10:07 -070070#define S3C2410_LCDCON4_GET_HSPW(x) ( ((x) >> 0) & 0xFF)
71
Linus Torvalds1da177e2005-04-16 15:20:36 -070072#define S3C2410_LCDCON5_BPP24BL (1<<12)
73#define S3C2410_LCDCON5_FRM565 (1<<11)
74#define S3C2410_LCDCON5_INVVCLK (1<<10)
75#define S3C2410_LCDCON5_INVVLINE (1<<9)
76#define S3C2410_LCDCON5_INVVFRAME (1<<8)
77#define S3C2410_LCDCON5_INVVD (1<<7)
78#define S3C2410_LCDCON5_INVVDEN (1<<6)
79#define S3C2410_LCDCON5_INVPWREN (1<<5)
80#define S3C2410_LCDCON5_INVLEND (1<<4)
81#define S3C2410_LCDCON5_PWREN (1<<3)
82#define S3C2410_LCDCON5_ENLEND (1<<2)
83#define S3C2410_LCDCON5_BSWP (1<<1)
84#define S3C2410_LCDCON5_HWSWP (1<<0)
85
86/* framebuffer start addressed */
87#define S3C2410_LCDSADDR1 S3C2410_LCDREG(0x14)
88#define S3C2410_LCDSADDR2 S3C2410_LCDREG(0x18)
89#define S3C2410_LCDSADDR3 S3C2410_LCDREG(0x1C)
90
91#define S3C2410_LCDBANK(x) ((x) << 21)
92#define S3C2410_LCDBASEU(x) (x)
93
94#define S3C2410_OFFSIZE(x) ((x) << 11)
95#define S3C2410_PAGEWIDTH(x) (x)
96
97/* colour lookup and miscellaneous controls */
98
99#define S3C2410_REDLUT S3C2410_LCDREG(0x20)
100#define S3C2410_GREENLUT S3C2410_LCDREG(0x24)
101#define S3C2410_BLUELUT S3C2410_LCDREG(0x28)
102
103#define S3C2410_DITHMODE S3C2410_LCDREG(0x4C)
104#define S3C2410_TPAL S3C2410_LCDREG(0x50)
105
Arnaud Patard20fd5762005-09-09 13:10:07 -0700106#define S3C2410_TPAL_EN (1<<24)
107
Linus Torvalds1da177e2005-04-16 15:20:36 -0700108/* interrupt info */
109#define S3C2410_LCDINTPND S3C2410_LCDREG(0x54)
110#define S3C2410_LCDSRCPND S3C2410_LCDREG(0x58)
111#define S3C2410_LCDINTMSK S3C2410_LCDREG(0x5C)
Arnaud Patard20fd5762005-09-09 13:10:07 -0700112#define S3C2410_LCDINT_FIWSEL (1<<2)
113#define S3C2410_LCDINT_FRSYNC (1<<1)
114#define S3C2410_LCDINT_FICNT (1<<0)
115
Ben Dooks3e9fc8e2006-09-16 00:11:32 +0100116/* s3c2442 extra stn registers */
117
118#define S3C2442_REDLUT S3C2410_LCDREG(0x20)
119#define S3C2442_GREENLUT S3C2410_LCDREG(0x24)
120#define S3C2442_BLUELUT S3C2410_LCDREG(0x28)
121#define S3C2442_DITHMODE S3C2410_LCDREG(0x20)
122
Linus Torvalds1da177e2005-04-16 15:20:36 -0700123#define S3C2410_LPCSEL S3C2410_LCDREG(0x60)
124
125#define S3C2410_TFTPAL(x) S3C2410_LCDREG((0x400 + (x)*4))
126
127#endif /* ___ASM_ARCH_REGS_LCD_H */
128
129
130