Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * BRIEF MODULE DESCRIPTION
0003  *  Hardware definitions for the Au1200 LCD controller
0004  *
0005  * Copyright 2004 AMD
0006  * Author:  AMD
0007  *
0008  *  This program is free software; you can redistribute  it and/or modify it
0009  *  under  the terms of  the GNU General  Public License as published by the
0010  *  Free Software Foundation;  either version 2 of the  License, or (at your
0011  *  option) any later version.
0012  *
0013  *  THIS  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
0014  *  WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
0015  *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
0016  *  NO  EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT, INDIRECT,
0017  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
0018  *  NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
0019  *  USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
0020  *  ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
0021  *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
0022  *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0023  *
0024  *  You should have received a copy of the  GNU General Public License along
0025  *  with this program; if not, write  to the Free Software Foundation, Inc.,
0026  *  675 Mass Ave, Cambridge, MA 02139, USA.
0027  */
0028 
0029 #ifndef _AU1200LCD_H
0030 #define _AU1200LCD_H
0031 
0032 /********************************************************************/
0033 #define AU1200_LCD_ADDR     0xB5000000
0034 
0035 #define uint8 unsigned char
0036 #define uint32 unsigned int
0037 
0038 struct au1200_lcd {
0039     volatile uint32 reserved0;
0040     volatile uint32 screen;
0041     volatile uint32 backcolor;
0042     volatile uint32 horztiming;
0043     volatile uint32 verttiming;
0044     volatile uint32 clkcontrol;
0045     volatile uint32 pwmdiv;
0046     volatile uint32 pwmhi;
0047     volatile uint32 reserved1;
0048     volatile uint32 winenable;
0049     volatile uint32 colorkey;
0050     volatile uint32 colorkeymsk;
0051     struct
0052     {
0053         volatile uint32 cursorctrl;
0054         volatile uint32 cursorpos;
0055         volatile uint32 cursorcolor0;
0056         volatile uint32 cursorcolor1;
0057         volatile uint32 cursorcolor2;
0058         uint32  cursorcolor3;
0059     } hwc;
0060     volatile uint32 intstatus;
0061     volatile uint32 intenable;
0062     volatile uint32 outmask;
0063     volatile uint32 fifoctrl;
0064     uint32  reserved2[(0x0100-0x0058)/4];
0065     struct
0066     {
0067         volatile uint32 winctrl0;
0068         volatile uint32 winctrl1;
0069         volatile uint32 winctrl2;
0070         volatile uint32 winbuf0;
0071         volatile uint32 winbuf1;
0072         volatile uint32 winbufctrl;
0073         uint32  winreserved0;
0074         uint32  winreserved1;
0075     } window[4];
0076 
0077     uint32  reserved3[(0x0400-0x0180)/4];
0078 
0079     volatile uint32 palette[(0x0800-0x0400)/4];
0080 
0081     volatile uint8  cursorpattern[256];
0082 };
0083 
0084 /* lcd_screen */
0085 #define LCD_SCREEN_SEN      (1<<31)
0086 #define LCD_SCREEN_SX       (0x07FF<<19)
0087 #define LCD_SCREEN_SY       (0x07FF<< 8)
0088 #define LCD_SCREEN_SWP      (1<<7)
0089 #define LCD_SCREEN_SWD      (1<<6)
0090 #define LCD_SCREEN_PT       (7<<0)
0091 #define LCD_SCREEN_PT_TFT   (0<<0)
0092 #define LCD_SCREEN_SX_N(WIDTH)  ((WIDTH-1)<<19)
0093 #define LCD_SCREEN_SY_N(HEIGHT) ((HEIGHT-1)<<8)
0094 #define LCD_SCREEN_PT_CSTN  (1<<0)
0095 #define LCD_SCREEN_PT_CDSTN (2<<0)
0096 #define LCD_SCREEN_PT_M8STN (3<<0)
0097 #define LCD_SCREEN_PT_M4STN (4<<0)
0098 
0099 /* lcd_backcolor */
0100 #define LCD_BACKCOLOR_SBGR      (0xFF<<16)
0101 #define LCD_BACKCOLOR_SBGG      (0xFF<<8)
0102 #define LCD_BACKCOLOR_SBGB      (0xFF<<0)
0103 #define LCD_BACKCOLOR_SBGR_N(N) ((N)<<16)
0104 #define LCD_BACKCOLOR_SBGG_N(N) ((N)<<8)
0105 #define LCD_BACKCOLOR_SBGB_N(N) ((N)<<0)
0106 
0107 /* lcd_winenable */
0108 #define LCD_WINENABLE_WEN3      (1<<3)
0109 #define LCD_WINENABLE_WEN2      (1<<2)
0110 #define LCD_WINENABLE_WEN1      (1<<1)
0111 #define LCD_WINENABLE_WEN0      (1<<0)
0112 
0113 /* lcd_colorkey */
0114 #define LCD_COLORKEY_CKR        (0xFF<<16)
0115 #define LCD_COLORKEY_CKG        (0xFF<<8)
0116 #define LCD_COLORKEY_CKB        (0xFF<<0)
0117 #define LCD_COLORKEY_CKR_N(N)   ((N)<<16)
0118 #define LCD_COLORKEY_CKG_N(N)   ((N)<<8)
0119 #define LCD_COLORKEY_CKB_N(N)   ((N)<<0)
0120 
0121 /* lcd_colorkeymsk */
0122 #define LCD_COLORKEYMSK_CKMR        (0xFF<<16)
0123 #define LCD_COLORKEYMSK_CKMG        (0xFF<<8)
0124 #define LCD_COLORKEYMSK_CKMB        (0xFF<<0)
0125 #define LCD_COLORKEYMSK_CKMR_N(N)   ((N)<<16)
0126 #define LCD_COLORKEYMSK_CKMG_N(N)   ((N)<<8)
0127 #define LCD_COLORKEYMSK_CKMB_N(N)   ((N)<<0)
0128 
0129 /* lcd windows control 0 */
0130 #define LCD_WINCTRL0_OX     (0x07FF<<21)
0131 #define LCD_WINCTRL0_OY     (0x07FF<<10)
0132 #define LCD_WINCTRL0_A      (0x00FF<<2)
0133 #define LCD_WINCTRL0_AEN    (1<<1)
0134 #define LCD_WINCTRL0_OX_N(N) ((N)<<21)
0135 #define LCD_WINCTRL0_OY_N(N) ((N)<<10)
0136 #define LCD_WINCTRL0_A_N(N) ((N)<<2)
0137 
0138 /* lcd windows control 1 */
0139 #define LCD_WINCTRL1_PRI    (3<<30)
0140 #define LCD_WINCTRL1_PIPE   (1<<29)
0141 #define LCD_WINCTRL1_FRM    (0xF<<25)
0142 #define LCD_WINCTRL1_CCO    (1<<24)
0143 #define LCD_WINCTRL1_PO     (3<<22)
0144 #define LCD_WINCTRL1_SZX    (0x07FF<<11)
0145 #define LCD_WINCTRL1_SZY    (0x07FF<<0)
0146 #define LCD_WINCTRL1_FRM_1BPP   (0<<25)
0147 #define LCD_WINCTRL1_FRM_2BPP   (1<<25)
0148 #define LCD_WINCTRL1_FRM_4BPP   (2<<25)
0149 #define LCD_WINCTRL1_FRM_8BPP   (3<<25)
0150 #define LCD_WINCTRL1_FRM_12BPP  (4<<25)
0151 #define LCD_WINCTRL1_FRM_16BPP655   (5<<25)
0152 #define LCD_WINCTRL1_FRM_16BPP565   (6<<25)
0153 #define LCD_WINCTRL1_FRM_16BPP556   (7<<25)
0154 #define LCD_WINCTRL1_FRM_16BPPI1555 (8<<25)
0155 #define LCD_WINCTRL1_FRM_16BPPI5551 (9<<25)
0156 #define LCD_WINCTRL1_FRM_16BPPA1555 (10<<25)
0157 #define LCD_WINCTRL1_FRM_16BPPA5551 (11<<25)
0158 #define LCD_WINCTRL1_FRM_24BPP      (12<<25)
0159 #define LCD_WINCTRL1_FRM_32BPP      (13<<25)
0160 #define LCD_WINCTRL1_PRI_N(N)   ((N)<<30)
0161 #define LCD_WINCTRL1_PO_00      (0<<22)
0162 #define LCD_WINCTRL1_PO_01      (1<<22)
0163 #define LCD_WINCTRL1_PO_10      (2<<22)
0164 #define LCD_WINCTRL1_PO_11      (3<<22)
0165 #define LCD_WINCTRL1_SZX_N(N)   ((N-1)<<11)
0166 #define LCD_WINCTRL1_SZY_N(N)   ((N-1)<<0)
0167 
0168 /* lcd windows control 2 */
0169 #define LCD_WINCTRL2_CKMODE     (3<<24)
0170 #define LCD_WINCTRL2_DBM        (1<<23)
0171 #define LCD_WINCTRL2_RAM        (3<<21)
0172 #define LCD_WINCTRL2_BX         (0x1FFF<<8)
0173 #define LCD_WINCTRL2_SCX        (0xF<<4)
0174 #define LCD_WINCTRL2_SCY        (0xF<<0)
0175 #define LCD_WINCTRL2_CKMODE_00      (0<<24)
0176 #define LCD_WINCTRL2_CKMODE_01      (1<<24)
0177 #define LCD_WINCTRL2_CKMODE_10      (2<<24)
0178 #define LCD_WINCTRL2_CKMODE_11      (3<<24)
0179 #define LCD_WINCTRL2_RAM_NONE       (0<<21)
0180 #define LCD_WINCTRL2_RAM_PALETTE    (1<<21)
0181 #define LCD_WINCTRL2_RAM_GAMMA      (2<<21)
0182 #define LCD_WINCTRL2_RAM_BUFFER     (3<<21)
0183 #define LCD_WINCTRL2_BX_N(N)    ((N)<<8)
0184 #define LCD_WINCTRL2_SCX_1      (0<<4)
0185 #define LCD_WINCTRL2_SCX_2      (1<<4)
0186 #define LCD_WINCTRL2_SCX_4      (2<<4)
0187 #define LCD_WINCTRL2_SCY_1      (0<<0)
0188 #define LCD_WINCTRL2_SCY_2      (1<<0)
0189 #define LCD_WINCTRL2_SCY_4      (2<<0)
0190 
0191 /* lcd windows buffer control */
0192 #define LCD_WINBUFCTRL_DB       (1<<1)
0193 #define LCD_WINBUFCTRL_DBN      (1<<0)
0194 
0195 /* lcd_intstatus, lcd_intenable */
0196 #define LCD_INT_IFO             (0xF<<14)
0197 #define LCD_INT_IFU             (0xF<<10)
0198 #define LCD_INT_OFO             (1<<9)
0199 #define LCD_INT_OFU             (1<<8)
0200 #define LCD_INT_WAIT            (1<<3)
0201 #define LCD_INT_SD              (1<<2)
0202 #define LCD_INT_SA              (1<<1)
0203 #define LCD_INT_SS              (1<<0)
0204 
0205 /* lcd_horztiming */
0206 #define LCD_HORZTIMING_HND2     (0x1FF<<18)
0207 #define LCD_HORZTIMING_HND1     (0x1FF<<9)
0208 #define LCD_HORZTIMING_HPW      (0x1FF<<0)
0209 #define LCD_HORZTIMING_HND2_N(N)(((N)-1)<<18)
0210 #define LCD_HORZTIMING_HND1_N(N)(((N)-1)<<9)
0211 #define LCD_HORZTIMING_HPW_N(N) (((N)-1)<<0)
0212 
0213 /* lcd_verttiming */
0214 #define LCD_VERTTIMING_VND2     (0x1FF<<18)
0215 #define LCD_VERTTIMING_VND1     (0x1FF<<9)
0216 #define LCD_VERTTIMING_VPW      (0x1FF<<0)
0217 #define LCD_VERTTIMING_VND2_N(N)(((N)-1)<<18)
0218 #define LCD_VERTTIMING_VND1_N(N)(((N)-1)<<9)
0219 #define LCD_VERTTIMING_VPW_N(N) (((N)-1)<<0)
0220 
0221 /* lcd_clkcontrol */
0222 #define LCD_CLKCONTROL_EXT      (1<<22)
0223 #define LCD_CLKCONTROL_DELAY    (3<<20)
0224 #define LCD_CLKCONTROL_CDD      (1<<19)
0225 #define LCD_CLKCONTROL_IB       (1<<18)
0226 #define LCD_CLKCONTROL_IC       (1<<17)
0227 #define LCD_CLKCONTROL_IH       (1<<16)
0228 #define LCD_CLKCONTROL_IV       (1<<15)
0229 #define LCD_CLKCONTROL_BF       (0x1F<<10)
0230 #define LCD_CLKCONTROL_PCD      (0x3FF<<0)
0231 #define LCD_CLKCONTROL_BF_N(N)  (((N)-1)<<10)
0232 #define LCD_CLKCONTROL_PCD_N(N) ((N)<<0)
0233 
0234 /* lcd_pwmdiv */
0235 #define LCD_PWMDIV_EN           (1<<31)
0236 #define LCD_PWMDIV_PWMDIV       (0x1FFFF<<0)
0237 #define LCD_PWMDIV_PWMDIV_N(N)  ((N)<<0)
0238 
0239 /* lcd_pwmhi */
0240 #define LCD_PWMHI_PWMHI1        (0xFFFF<<16)
0241 #define LCD_PWMHI_PWMHI0        (0xFFFF<<0)
0242 #define LCD_PWMHI_PWMHI1_N(N)   ((N)<<16)
0243 #define LCD_PWMHI_PWMHI0_N(N)   ((N)<<0)
0244 
0245 /* lcd_hwccon */
0246 #define LCD_HWCCON_EN           (1<<0)
0247 
0248 /* lcd_cursorpos */
0249 #define LCD_CURSORPOS_HWCXOFF       (0x1F<<27)
0250 #define LCD_CURSORPOS_HWCXPOS       (0x07FF<<16)
0251 #define LCD_CURSORPOS_HWCYOFF       (0x1F<<11)
0252 #define LCD_CURSORPOS_HWCYPOS       (0x07FF<<0)
0253 #define LCD_CURSORPOS_HWCXOFF_N(N)  ((N)<<27)
0254 #define LCD_CURSORPOS_HWCXPOS_N(N)  ((N)<<16)
0255 #define LCD_CURSORPOS_HWCYOFF_N(N)  ((N)<<11)
0256 #define LCD_CURSORPOS_HWCYPOS_N(N)  ((N)<<0)
0257 
0258 /* lcd_cursorcolor */
0259 #define LCD_CURSORCOLOR_HWCA        (0xFF<<24)
0260 #define LCD_CURSORCOLOR_HWCR        (0xFF<<16)
0261 #define LCD_CURSORCOLOR_HWCG        (0xFF<<8)
0262 #define LCD_CURSORCOLOR_HWCB        (0xFF<<0)
0263 #define LCD_CURSORCOLOR_HWCA_N(N)   ((N)<<24)
0264 #define LCD_CURSORCOLOR_HWCR_N(N)   ((N)<<16)
0265 #define LCD_CURSORCOLOR_HWCG_N(N)   ((N)<<8)
0266 #define LCD_CURSORCOLOR_HWCB_N(N)   ((N)<<0)
0267 
0268 /* lcd_fifoctrl */
0269 #define LCD_FIFOCTRL_F3IF       (1<<29)
0270 #define LCD_FIFOCTRL_F3REQ      (0x1F<<24)
0271 #define LCD_FIFOCTRL_F2IF       (1<<29)
0272 #define LCD_FIFOCTRL_F2REQ      (0x1F<<16)
0273 #define LCD_FIFOCTRL_F1IF       (1<<29)
0274 #define LCD_FIFOCTRL_F1REQ      (0x1F<<8)
0275 #define LCD_FIFOCTRL_F0IF       (1<<29)
0276 #define LCD_FIFOCTRL_F0REQ      (0x1F<<0)
0277 #define LCD_FIFOCTRL_F3REQ_N(N) ((N-1)<<24)
0278 #define LCD_FIFOCTRL_F2REQ_N(N) ((N-1)<<16)
0279 #define LCD_FIFOCTRL_F1REQ_N(N) ((N-1)<<8)
0280 #define LCD_FIFOCTRL_F0REQ_N(N) ((N-1)<<0)
0281 
0282 /* lcd_outmask */
0283 #define LCD_OUTMASK_MASK        (0x00FFFFFF)
0284 
0285 /********************************************************************/
0286 #endif /* _AU1200LCD_H */