gx2_9211.h revision f29dbc25
1f29dbc25Smrg/* Copyright (c) 2005 Advanced Micro Devices, Inc.
2f29dbc25Smrg *
3f29dbc25Smrg * Permission is hereby granted, free of charge, to any person obtaining a copy
4f29dbc25Smrg * of this software and associated documentation files (the "Software"), to
5f29dbc25Smrg * deal in the Software without restriction, including without limitation the
6f29dbc25Smrg * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7f29dbc25Smrg * sell copies of the Software, and to permit persons to whom the Software is
8f29dbc25Smrg * furnished to do so, subject to the following conditions:
9f29dbc25Smrg *
10f29dbc25Smrg * The above copyright notice and this permission notice shall be included in
11f29dbc25Smrg * all copies or substantial portions of the Software.
12f29dbc25Smrg *
13f29dbc25Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14f29dbc25Smrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15f29dbc25Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16f29dbc25Smrg * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17f29dbc25Smrg * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18f29dbc25Smrg * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19f29dbc25Smrg * IN THE SOFTWARE.
20f29dbc25Smrg *
21f29dbc25Smrg * Neither the name of the Advanced Micro Devices, Inc. nor the names of its
22f29dbc25Smrg * contributors may be used to endorse or promote products derived from this
23f29dbc25Smrg * software without specific prior written permission.
24f29dbc25Smrg * */
25f29dbc25Smrg
26f29dbc25Smrg/*
27f29dbc25Smrg * File Contents:   This file contains the panel library files to the
28f29dbc25Smrg *                  GX2 platforms with 9211 support.
29f29dbc25Smrg *
30f29dbc25Smrg * SubModule:       Geode FlatPanel library
31f29dbc25Smrg * */
32f29dbc25Smrg
33f29dbc25Smrg/* -----------------------------------------------------------
34f29dbc25Smrg *  GX2 FLAT PANEL CONTROLLER REGISTER DEFINITIONS
35f29dbc25Smrg *-----------------------------------------------------------
36f29dbc25Smrg */
37f29dbc25Smrg
38f29dbc25Smrg#define	GX2_VP_MSR_PAD_SELECT		0x2011
39f29dbc25Smrg#define	GX2_VP_PAD_SELECT_MASK		0x3FFFFFFF
40f29dbc25Smrg#define	GX2_VP_PAD_SELECT_TFT		0x1FFFFFFF
41f29dbc25Smrg#define	GX2_VP_PAD_SELECT_DSTN		0x00000000
42f29dbc25Smrg
43f29dbc25Smrg/* This is useful for generating addresses incrementally
44f29dbc25Smrg * (ie, vidtest register display code).
45f29dbc25Smrg */
46f29dbc25Smrg
47f29dbc25Smrg#define GX2_FP_LCD_OFFSET       0x00000400
48f29dbc25Smrg#define CS9211_REDCLOUD         0x0400 /* Moved 9211 Rev C3 up to next major
49f29dbc25Smrg                                        * no.                                                          */
50f29dbc25Smrg#define GX2_FP_PAN_TIMING1      0x0400 /* FP timings 1                                         */
51f29dbc25Smrg#define GX2_FP_PAN_TIMING2      0x0408 /* FP timings 2                                         */
52f29dbc25Smrg#define GX2_FP_PWR_MAN          0x0410 /* FP power management                          */
53f29dbc25Smrg#define GX2_FP_DITH_FR_CNTRL    0x0418 /* FP dither and frame rate             */
54f29dbc25Smrg#define GX2_FP_BLFSR            0x0420 /* Blue LFSR seed                                       */
55f29dbc25Smrg#define GX2_FP_RLFSR            0x0428 /* Red and Green LFSR seed                      */
56f29dbc25Smrg#define GX2_FP_FMI              0x0430 /* FRM Memory Index                             */
57f29dbc25Smrg#define GX2_FP_FMD              0x0438 /* FRM Memory Data                                      */
58f29dbc25Smrg#define GX2_FP_DCA              0x0448 /* Dither ram control and address       */
59f29dbc25Smrg#define GX2_FP_DMD              0x0450 /* Dither memory data                           */
60f29dbc25Smrg#define GX2_FP_PAN_CRC_SIG      0x0458 /* FP CRC signature                             */
61f29dbc25Smrg#define GX2_FP_FBB              0x0460 /* Frame Buffer Base Address            */
62f29dbc25Smrg
63f29dbc25Smrg/* GX2_FP_PAN_TIMING2 bits */
64f29dbc25Smrg
65f29dbc25Smrg#define GX2_FP_TFT_PASS_THRU		0x40000000      /* TFT pass through enable      */
66f29dbc25Smrg#define GX2_FP_PT2_PIX_OUT_MASK		0xFFF8FFFF      /* panel output bit formats */
67f29dbc25Smrg#define GX2_FP_PT2_PIX_OUT_TFT		0x00000000      /* 8 BIT DSTN or TFT panel  */
68f29dbc25Smrg#define GX2_FP_PT2_COLOR_MONO		0x00080000      /* color or monochrome              */
69f29dbc25Smrg#define GX2_FP_PT2_DSTN_TFT_MASK	0xFFCFFFFF      /* panel type bits                  */
70f29dbc25Smrg#define GX2_FP_PT2_DSTN_TFT_TFT		0x00100000      /* TFT panel                                */
71f29dbc25Smrg#define GX2_FP_PT2_PSH_CLK_CTL		0x08000000      /* shift clock retrace
72f29dbc25Smrg                                                         * activity control                 */
73f29dbc25Smrg
74f29dbc25Smrg/*  GX2_FP_PWR_MAN bits */
75f29dbc25Smrg
76f29dbc25Smrg#define GX2_FP_PM_SHFCLK_INVERT		0x00002000      /* Invert shfclk to panel       */
77f29dbc25Smrg#define GX2_FP_PM_VSYNC_DELAY		0x0000C000      /* Vert Sync delay                  */
78f29dbc25Smrg#define GX2_FP_PM_HSYNC_DELAY		0x00030000      /* Horiz Sync delay                 */
79f29dbc25Smrg#define GX2_FP_PM_PWRDN_PHASE_BIT0	0x00040000      /* panel power down phase bit
80f29dbc25Smrg                                                         * 0                                                */
81f29dbc25Smrg#define GX2_FP_PM_PWRDN_PHASE_BIT1	0x00080000      /* panel power down phase bit
82f29dbc25Smrg                                                         * 1                                                */
83f29dbc25Smrg#define GX2_FP_PM_PWRDN_PHASE_BIT2	0x00100000      /* panel power down phase bit
84f29dbc25Smrg                                                         * 2                                                */
85f29dbc25Smrg#define GX2_FP_PM_PWRUP_PHASE_BIT0	0x00200000      /* panel power up phase bit
86f29dbc25Smrg                                                         * 0                                                */
87f29dbc25Smrg#define GX2_FP_PM_PWRUP_PHASE_BIT1	0x00400000      /* panel power up phase bit
88f29dbc25Smrg                                                         * 1                                                */
89f29dbc25Smrg#define GX2_FP_PM_PWRUP_PHASE_BIT2	0x00800000      /* panel power up phase bit
90f29dbc25Smrg                                                         * 2                                                */
91f29dbc25Smrg#define GX2_FP_PM_PWR_ON			0x01000000      /* panel power ON */
92f29dbc25Smrg#define GX2_FP_PM_DIS_OFF_CTL		0x02000000      /* disable the panel back
93f29dbc25Smrg                                                         * light                                    */
94f29dbc25Smrg#define GX2_FP_PM_EXT_PWR_SEQ		0x08000000      /* external power sequence  */
95f29dbc25Smrg
96f29dbc25Smrg/*  GX2_FP_PAN_CRC_SIG bits */
97f29dbc25Smrg
98f29dbc25Smrg#define GX2_FP_PAN_CRC_SIGE         0x00000001  /* CRC Sig Enable                       */
99f29dbc25Smrg#define GX2_FP_PAN_CRC_SFR          0x00000002  /* CRC Sig Free Run             */
100f29dbc25Smrg
101f29dbc25Smrg/* This define is used by the hardware CRC mechanism */
102f29dbc25Smrg#define GX2_FP_CRC_PASS_THRU_MASK	0x00000070
103f29dbc25Smrg
104f29dbc25Smrg#define GX2_READ 0
105f29dbc25Smrg#define GX2_WRITE 1
106f29dbc25Smrg
107f29dbc25Smrgvoid SetFPBaseAddr(unsigned long);
108f29dbc25Smrgvoid Redcloud_9211init(Pnl_PanelStat *);
109f29dbc25Smrgvoid protected_mode_access(unsigned long mode,
110f29dbc25Smrg    unsigned long width, unsigned long addr, char *pdata);
111f29dbc25Smrgvoid write_video_reg64_low(unsigned long offset, unsigned long value);
112f29dbc25Smrgunsigned long read_video_reg64_low(unsigned long offset);
113f29dbc25Smrgvoid Redcloud_fp_reg(int mode, unsigned long address, unsigned long *data);
114f29dbc25Smrgvoid set_Redcloud_92xx_mode_params(int mode);
115f29dbc25Smrgunsigned char set_Redcloud_92xx_mode(Pnl_PanelStat * pstat);
116