1
2 #ifndef __ASM_ARCH_REGS_LCD_H
3 #define __ASM_ARCH_REGS_LCD_H
4
5 #include <mach/bitfield.h>
6
7
8
9
10 #define LCCR0 (0x000)
11 #define LCCR1 (0x004)
12 #define LCCR2 (0x008)
13 #define LCCR3 (0x00C)
14 #define LCCR4 (0x010)
15 #define LCCR5 (0x014)
16 #define LCSR (0x038)
17 #define LCSR1 (0x034)
18 #define LIIDR (0x03C)
19 #define TMEDRGBR (0x040)
20 #define TMEDCR (0x044)
21
22 #define FBR0 (0x020)
23 #define FBR1 (0x024)
24 #define FBR2 (0x028)
25 #define FBR3 (0x02C)
26 #define FBR4 (0x030)
27 #define FBR5 (0x110)
28 #define FBR6 (0x114)
29
30 #define OVL1C1 (0x050)
31 #define OVL1C2 (0x060)
32 #define OVL2C1 (0x070)
33 #define OVL2C2 (0x080)
34
35 #define CMDCR (0x100)
36 #define PRSR (0x104)
37
38 #define LCCR3_BPP(x) ((((x) & 0x7) << 24) | (((x) & 0x8) ? (1 << 29) : 0))
39
40 #define LCCR3_PDFOR_0 (0 << 30)
41 #define LCCR3_PDFOR_1 (1 << 30)
42 #define LCCR3_PDFOR_2 (2 << 30)
43 #define LCCR3_PDFOR_3 (3 << 30)
44
45 #define LCCR4_PAL_FOR_0 (0 << 15)
46 #define LCCR4_PAL_FOR_1 (1 << 15)
47 #define LCCR4_PAL_FOR_2 (2 << 15)
48 #define LCCR4_PAL_FOR_3 (3 << 15)
49 #define LCCR4_PAL_FOR_MASK (3 << 15)
50
51 #define FDADR0 (0x200)
52 #define FDADR1 (0x210)
53 #define FDADR2 (0x220)
54 #define FDADR3 (0x230)
55 #define FDADR4 (0x240)
56 #define FDADR5 (0x250)
57 #define FDADR6 (0x260)
58
59 #define LCCR0_ENB (1 << 0)
60 #define LCCR0_CMS (1 << 1)
61 #define LCCR0_Color (LCCR0_CMS*0)
62 #define LCCR0_Mono (LCCR0_CMS*1)
63 #define LCCR0_SDS (1 << 2)
64 #define LCCR0_Sngl (LCCR0_SDS*0)
65 #define LCCR0_Dual (LCCR0_SDS*1)
66
67 #define LCCR0_LDM (1 << 3)
68 #define LCCR0_SFM (1 << 4)
69 #define LCCR0_IUM (1 << 5)
70 #define LCCR0_EFM (1 << 6)
71 #define LCCR0_PAS (1 << 7)
72 #define LCCR0_Pas (LCCR0_PAS*0)
73 #define LCCR0_Act (LCCR0_PAS*1)
74 #define LCCR0_DPD (1 << 9)
75 #define LCCR0_4PixMono (LCCR0_DPD*0)
76 #define LCCR0_8PixMono (LCCR0_DPD*1)
77 #define LCCR0_DIS (1 << 10)
78 #define LCCR0_QDM (1 << 11)
79 #define LCCR0_PDD (0xff << 12)
80 #define LCCR0_PDD_S 12
81 #define LCCR0_BM (1 << 20)
82 #define LCCR0_OUM (1 << 21)
83 #define LCCR0_LCDT (1 << 22)
84 #define LCCR0_RDSTM (1 << 23)
85 #define LCCR0_CMDIM (1 << 24)
86 #define LCCR0_OUC (1 << 25)
87 #define LCCR0_LDDALT (1 << 26)
88
89 #define LCCR1_PPL Fld (10, 0)
90 #define LCCR1_DisWdth(Pixel) (((Pixel) - 1) << FShft (LCCR1_PPL))
91
92 #define LCCR1_HSW Fld (6, 10)
93 #define LCCR1_HorSnchWdth(Tpix) (((Tpix) - 1) << FShft (LCCR1_HSW))
94
95 #define LCCR1_ELW Fld (8, 16)
96 #define LCCR1_EndLnDel(Tpix) (((Tpix) - 1) << FShft (LCCR1_ELW))
97
98 #define LCCR1_BLW Fld (8, 24)
99 #define LCCR1_BegLnDel(Tpix) (((Tpix) - 1) << FShft (LCCR1_BLW))
100
101 #define LCCR2_LPP Fld (10, 0)
102 #define LCCR2_DisHght(Line) (((Line) - 1) << FShft (LCCR2_LPP))
103
104 #define LCCR2_VSW Fld (6, 10)
105 #define LCCR2_VrtSnchWdth(Tln) (((Tln) - 1) << FShft (LCCR2_VSW))
106
107 #define LCCR2_EFW Fld (8, 16)
108 #define LCCR2_EndFrmDel(Tln) ((Tln) << FShft (LCCR2_EFW))
109
110 #define LCCR2_BFW Fld (8, 24)
111 #define LCCR2_BegFrmDel(Tln) ((Tln) << FShft (LCCR2_BFW))
112
113 #define LCCR3_API (0xf << 16)
114 #define LCCR3_API_S 16
115 #define LCCR3_VSP (1 << 20)
116 #define LCCR3_HSP (1 << 21)
117 #define LCCR3_PCP (1 << 22)
118 #define LCCR3_PixRsEdg (LCCR3_PCP*0)
119 #define LCCR3_PixFlEdg (LCCR3_PCP*1)
120
121 #define LCCR3_OEP (1 << 23)
122 #define LCCR3_OutEnH (LCCR3_OEP*0)
123 #define LCCR3_OutEnL (LCCR3_OEP*1)
124
125 #define LCCR3_DPC (1 << 27)
126 #define LCCR3_PCD Fld (8, 0)
127 #define LCCR3_PixClkDiv(Div) (((Div) << FShft (LCCR3_PCD)))
128
129 #define LCCR3_ACB Fld (8, 8)
130 #define LCCR3_Acb(Acb) (((Acb) << FShft (LCCR3_ACB)))
131
132 #define LCCR3_HorSnchH (LCCR3_HSP*0)
133 #define LCCR3_HorSnchL (LCCR3_HSP*1)
134
135 #define LCCR3_VrtSnchH (LCCR3_VSP*0)
136 #define LCCR3_VrtSnchL (LCCR3_VSP*1)
137
138 #define LCCR5_IUM(x) (1 << ((x) + 23))
139 #define LCCR5_BSM(x) (1 << ((x) + 15))
140 #define LCCR5_EOFM(x) (1 << ((x) + 7))
141 #define LCCR5_SOFM(x) (1 << ((x) + 0))
142
143 #define LCSR_LDD (1 << 0)
144 #define LCSR_SOF (1 << 1)
145 #define LCSR_BER (1 << 2)
146 #define LCSR_ABC (1 << 3)
147 #define LCSR_IUL (1 << 4)
148 #define LCSR_IUU (1 << 5)
149 #define LCSR_OU (1 << 6)
150 #define LCSR_QD (1 << 7)
151 #define LCSR_EOF (1 << 8)
152 #define LCSR_BS (1 << 9)
153 #define LCSR_SINT (1 << 10)
154 #define LCSR_RD_ST (1 << 11)
155 #define LCSR_CMD_INT (1 << 12)
156
157 #define LCSR1_IU(x) (1 << ((x) + 23))
158 #define LCSR1_BS(x) (1 << ((x) + 15))
159 #define LCSR1_EOF(x) (1 << ((x) + 7))
160 #define LCSR1_SOF(x) (1 << ((x) - 1))
161
162 #define LDCMD_PAL (1 << 26)
163
164
165 #define OVLxC1_PPL(x) ((((x) - 1) & 0x3ff) << 0)
166 #define OVLxC1_LPO(x) ((((x) - 1) & 0x3ff) << 10)
167 #define OVLxC1_BPP(x) (((x) & 0xf) << 20)
168 #define OVLxC1_OEN (1 << 31)
169 #define OVLxC2_XPOS(x) (((x) & 0x3ff) << 0)
170 #define OVLxC2_YPOS(x) (((x) & 0x3ff) << 10)
171 #define OVL2C2_PFOR(x) (((x) & 0x7) << 20)
172
173
174 #define PRSR_DATA(x) ((x) & 0xff)
175 #define PRSR_A0 (1 << 8)
176 #define PRSR_ST_OK (1 << 9)
177 #define PRSR_CON_NT (1 << 10)
178
179 #define SMART_CMD_A0 (0x1 << 8)
180 #define SMART_CMD_READ_STATUS_REG (0x0 << 9)
181 #define SMART_CMD_READ_FRAME_BUFFER ((0x0 << 9) | SMART_CMD_A0)
182 #define SMART_CMD_WRITE_COMMAND (0x1 << 9)
183 #define SMART_CMD_WRITE_DATA ((0x1 << 9) | SMART_CMD_A0)
184 #define SMART_CMD_WRITE_FRAME ((0x2 << 9) | SMART_CMD_A0)
185 #define SMART_CMD_WAIT_FOR_VSYNC (0x3 << 9)
186 #define SMART_CMD_NOOP (0x4 << 9)
187 #define SMART_CMD_INTERRUPT (0x5 << 9)
188
189 #define SMART_CMD(x) (SMART_CMD_WRITE_COMMAND | ((x) & 0xff))
190 #define SMART_DAT(x) (SMART_CMD_WRITE_DATA | ((x) & 0xff))
191
192
193
194
195
196 #define SMART_CMD_DELAY (0x6 << 9)
197 #define SMART_DELAY(ms) (SMART_CMD_DELAY | ((ms) & 0xff))
198 #endif