x86: make init_ISA_irqs() static
[sfrench/cifs-2.6.git] / include / asm-arm / arch-pxa / regs-lcd.h
1 #ifndef __ASM_ARCH_REGS_LCD_H
2 #define __ASM_ARCH_REGS_LCD_H
3 /*
4  * LCD Controller Registers and Bits Definitions
5  */
6 #define LCCR0           (0x000) /* LCD Controller Control Register 0 */
7 #define LCCR1           (0x004) /* LCD Controller Control Register 1 */
8 #define LCCR2           (0x008) /* LCD Controller Control Register 2 */
9 #define LCCR3           (0x00C) /* LCD Controller Control Register 3 */
10 #define LCCR4           (0x010) /* LCD Controller Control Register 4 */
11 #define LCCR5           (0x014) /* LCD Controller Control Register 5 */
12 #define DFBR0           (0x020) /* DMA Channel 0 Frame Branch Register */
13 #define DFBR1           (0x024) /* DMA Channel 1 Frame Branch Register */
14 #define LCSR            (0x038) /* LCD Controller Status Register */
15 #define LIIDR           (0x03C) /* LCD Controller Interrupt ID Register */
16 #define TMEDRGBR        (0x040) /* TMED RGB Seed Register */
17 #define TMEDCR          (0x044) /* TMED Control Register */
18
19 #define CMDCR           (0x100) /* Command Control Register */
20 #define PRSR            (0x104) /* Panel Read Status Register */
21
22 #define LCCR3_1BPP      (0 << 24)
23 #define LCCR3_2BPP      (1 << 24)
24 #define LCCR3_4BPP      (2 << 24)
25 #define LCCR3_8BPP      (3 << 24)
26 #define LCCR3_16BPP     (4 << 24)
27
28 #define LCCR3_PDFOR_0   (0 << 30)
29 #define LCCR3_PDFOR_1   (1 << 30)
30 #define LCCR3_PDFOR_2   (2 << 30)
31 #define LCCR3_PDFOR_3   (3 << 30)
32
33 #define LCCR4_PAL_FOR_0 (0 << 15)
34 #define LCCR4_PAL_FOR_1 (1 << 15)
35 #define LCCR4_PAL_FOR_2 (2 << 15)
36 #define LCCR4_PAL_FOR_MASK      (3 << 15)
37
38 #define FDADR0          (0x200) /* DMA Channel 0 Frame Descriptor Address Register */
39 #define FSADR0          (0x204) /* DMA Channel 0 Frame Source Address Register */
40 #define FIDR0           (0x208) /* DMA Channel 0 Frame ID Register */
41 #define LDCMD0          (0x20C) /* DMA Channel 0 Command Register */
42 #define FDADR1          (0x210) /* DMA Channel 1 Frame Descriptor Address Register */
43 #define FSADR1          (0x214) /* DMA Channel 1 Frame Source Address Register */
44 #define FIDR1           (0x218) /* DMA Channel 1 Frame ID Register */
45 #define LDCMD1          (0x21C) /* DMA Channel 1 Command Register */
46 #define FDADR6          (0x260) /* DMA Channel 6 Frame Descriptor Address Register */
47 #define FSADR6          (0x264) /* DMA Channel 6 Frame Source Address Register */
48 #define FIDR6           (0x268) /* DMA Channel 6 Frame ID Register */
49
50 #define LCCR0_ENB       (1 << 0)        /* LCD Controller enable */
51 #define LCCR0_CMS       (1 << 1)        /* Color/Monochrome Display Select */
52 #define LCCR0_Color     (LCCR0_CMS*0)   /*  Color display */
53 #define LCCR0_Mono      (LCCR0_CMS*1)   /*  Monochrome display */
54 #define LCCR0_SDS       (1 << 2)        /* Single/Dual Panel Display Select */
55 #define LCCR0_Sngl      (LCCR0_SDS*0)   /*  Single panel display */
56 #define LCCR0_Dual      (LCCR0_SDS*1)   /*  Dual panel display */
57
58 #define LCCR0_LDM       (1 << 3)        /* LCD Disable Done Mask */
59 #define LCCR0_SFM       (1 << 4)        /* Start of frame mask */
60 #define LCCR0_IUM       (1 << 5)        /* Input FIFO underrun mask */
61 #define LCCR0_EFM       (1 << 6)        /* End of Frame mask */
62 #define LCCR0_PAS       (1 << 7)        /* Passive/Active display Select */
63 #define LCCR0_Pas       (LCCR0_PAS*0)   /*  Passive display (STN) */
64 #define LCCR0_Act       (LCCR0_PAS*1)   /*  Active display (TFT) */
65 #define LCCR0_DPD       (1 << 9)        /* Double Pixel Data (monochrome) */
66 #define LCCR0_4PixMono  (LCCR0_DPD*0)   /*  4-Pixel/clock Monochrome display */
67 #define LCCR0_8PixMono  (LCCR0_DPD*1)   /*  8-Pixel/clock Monochrome display */
68 #define LCCR0_DIS       (1 << 10)       /* LCD Disable */
69 #define LCCR0_QDM       (1 << 11)       /* LCD Quick Disable mask */
70 #define LCCR0_PDD       (0xff << 12)    /* Palette DMA request delay */
71 #define LCCR0_PDD_S     12
72 #define LCCR0_BM        (1 << 20)       /* Branch mask */
73 #define LCCR0_OUM       (1 << 21)       /* Output FIFO underrun mask */
74 #define LCCR0_LCDT      (1 << 22)       /* LCD panel type */
75 #define LCCR0_RDSTM     (1 << 23)       /* Read status interrupt mask */
76 #define LCCR0_CMDIM     (1 << 24)       /* Command interrupt mask */
77 #define LCCR0_OUC       (1 << 25)       /* Overlay Underlay control bit */
78 #define LCCR0_LDDALT    (1 << 26)       /* LDD alternate mapping control */
79
80 #define LCCR1_PPL       Fld (10, 0)     /* Pixels Per Line - 1 */
81 #define LCCR1_DisWdth(Pixel)    (((Pixel) - 1) << FShft (LCCR1_PPL))
82
83 #define LCCR1_HSW       Fld (6, 10)     /* Horizontal Synchronization */
84 #define LCCR1_HorSnchWdth(Tpix) (((Tpix) - 1) << FShft (LCCR1_HSW))
85
86 #define LCCR1_ELW       Fld (8, 16)     /* End-of-Line pixel clock Wait - 1 */
87 #define LCCR1_EndLnDel(Tpix)    (((Tpix) - 1) << FShft (LCCR1_ELW))
88
89 #define LCCR1_BLW       Fld (8, 24)     /* Beginning-of-Line pixel clock */
90 #define LCCR1_BegLnDel(Tpix)    (((Tpix) - 1) << FShft (LCCR1_BLW))
91
92 #define LCCR2_LPP       Fld (10, 0)     /* Line Per Panel - 1 */
93 #define LCCR2_DisHght(Line)     (((Line) - 1) << FShft (LCCR2_LPP))
94
95 #define LCCR2_VSW       Fld (6, 10)     /* Vertical Synchronization pulse - 1 */
96 #define LCCR2_VrtSnchWdth(Tln)  (((Tln) - 1) << FShft (LCCR2_VSW))
97
98 #define LCCR2_EFW       Fld (8, 16)     /* End-of-Frame line clock Wait */
99 #define LCCR2_EndFrmDel(Tln)    ((Tln) << FShft (LCCR2_EFW))
100
101 #define LCCR2_BFW       Fld (8, 24)     /* Beginning-of-Frame line clock */
102 #define LCCR2_BegFrmDel(Tln)    ((Tln) << FShft (LCCR2_BFW))
103
104 #define LCCR3_API       (0xf << 16)     /* AC Bias pin trasitions per interrupt */
105 #define LCCR3_API_S     16
106 #define LCCR3_VSP       (1 << 20)       /* vertical sync polarity */
107 #define LCCR3_HSP       (1 << 21)       /* horizontal sync polarity */
108 #define LCCR3_PCP       (1 << 22)       /* Pixel Clock Polarity (L_PCLK) */
109 #define LCCR3_PixRsEdg  (LCCR3_PCP*0)   /*  Pixel clock Rising-Edge */
110 #define LCCR3_PixFlEdg  (LCCR3_PCP*1)   /*  Pixel clock Falling-Edge */
111
112 #define LCCR3_OEP       (1 << 23)       /* Output Enable Polarity */
113 #define LCCR3_OutEnH    (LCCR3_OEP*0)   /*  Output Enable active High */
114 #define LCCR3_OutEnL    (LCCR3_OEP*1)   /*  Output Enable active Low */
115
116 #define LCCR3_DPC       (1 << 27)       /* double pixel clock mode */
117 #define LCCR3_PCD       Fld (8, 0)      /* Pixel Clock Divisor */
118 #define LCCR3_PixClkDiv(Div)    (((Div) << FShft (LCCR3_PCD)))
119
120 #define LCCR3_BPP       Fld (3, 24)     /* Bit Per Pixel */
121 #define LCCR3_Bpp(Bpp)  (((Bpp) << FShft (LCCR3_BPP)))
122
123 #define LCCR3_ACB       Fld (8, 8)      /* AC Bias */
124 #define LCCR3_Acb(Acb)  (((Acb) << FShft (LCCR3_ACB)))
125
126 #define LCCR3_HorSnchH  (LCCR3_HSP*0)   /*  HSP Active High */
127 #define LCCR3_HorSnchL  (LCCR3_HSP*1)   /*  HSP Active Low */
128
129 #define LCCR3_VrtSnchH  (LCCR3_VSP*0)   /*  VSP Active High */
130 #define LCCR3_VrtSnchL  (LCCR3_VSP*1)   /*  VSP Active Low */
131
132 #define LCCR5_IUM(x)    (1 << ((x) + 23)) /* input underrun mask */
133 #define LCCR5_BSM(x)    (1 << ((x) + 15)) /* branch mask */
134 #define LCCR5_EOFM(x)   (1 << ((x) + 7))  /* end of frame mask */
135 #define LCCR5_SOFM(x)   (1 << ((x) + 0))  /* start of frame mask */
136
137 #define LCSR_LDD        (1 << 0)        /* LCD Disable Done */
138 #define LCSR_SOF        (1 << 1)        /* Start of frame */
139 #define LCSR_BER        (1 << 2)        /* Bus error */
140 #define LCSR_ABC        (1 << 3)        /* AC Bias count */
141 #define LCSR_IUL        (1 << 4)        /* input FIFO underrun Lower panel */
142 #define LCSR_IUU        (1 << 5)        /* input FIFO underrun Upper panel */
143 #define LCSR_OU         (1 << 6)        /* output FIFO underrun */
144 #define LCSR_QD         (1 << 7)        /* quick disable */
145 #define LCSR_EOF        (1 << 8)        /* end of frame */
146 #define LCSR_BS         (1 << 9)        /* branch status */
147 #define LCSR_SINT       (1 << 10)       /* subsequent interrupt */
148 #define LCSR_RD_ST      (1 << 11)       /* read status */
149 #define LCSR_CMD_INT    (1 << 12)       /* command interrupt */
150
151 #define LDCMD_PAL       (1 << 26)       /* instructs DMA to load palette buffer */
152
153 /* smartpanel related */
154 #define PRSR_DATA(x)    ((x) & 0xff)    /* Panel Data */
155 #define PRSR_A0         (1 << 8)        /* Read Data Source */
156 #define PRSR_ST_OK      (1 << 9)        /* Status OK */
157 #define PRSR_CON_NT     (1 << 10)       /* Continue to Next Command */
158
159 #define SMART_CMD_A0                     (0x1 << 8)
160 #define SMART_CMD_READ_STATUS_REG        (0x0 << 9)
161 #define SMART_CMD_READ_FRAME_BUFFER     ((0x0 << 9) | SMART_CMD_A0)
162 #define SMART_CMD_WRITE_COMMAND          (0x1 << 9)
163 #define SMART_CMD_WRITE_DATA            ((0x1 << 9) | SMART_CMD_A0)
164 #define SMART_CMD_WRITE_FRAME           ((0x2 << 9) | SMART_CMD_A0)
165 #define SMART_CMD_WAIT_FOR_VSYNC         (0x3 << 9)
166 #define SMART_CMD_NOOP                   (0x4 << 9)
167 #define SMART_CMD_INTERRUPT              (0x5 << 9)
168
169 #define SMART_CMD(x)    (SMART_CMD_WRITE_COMMAND | ((x) & 0xff))
170 #define SMART_DAT(x)    (SMART_CMD_WRITE_DATA | ((x) & 0xff))
171 #endif /* __ASM_ARCH_REGS_LCD_H */