summaryrefslogtreecommitdiff
path: root/src/panel
diff options
context:
space:
mode:
Diffstat (limited to 'src/panel')
-rw-r--r--src/panel/92xx.h370
-rw-r--r--src/panel/cen9211.c866
-rw-r--r--src/panel/cen9211.h101
-rw-r--r--src/panel/dora9211.c607
-rw-r--r--src/panel/dora9211.h100
-rw-r--r--src/panel/drac9210.c652
-rw-r--r--src/panel/drac9210.h41
-rw-r--r--src/panel/gx2_9211.c292
-rw-r--r--src/panel/gx2_9211.h115
-rw-r--r--src/panel/panel.c70
-rw-r--r--src/panel/panel.h80
-rw-r--r--src/panel/platform.c233
-rw-r--r--src/panel/pnl_bios.c282
-rw-r--r--src/panel/pnl_defs.h95
-rw-r--r--src/panel/pnl_init.c531
-rw-r--r--src/panel/readme.txt448
16 files changed, 4883 insertions, 0 deletions
diff --git a/src/panel/92xx.h b/src/panel/92xx.h
new file mode 100644
index 0000000..f10fa09
--- /dev/null
+++ b/src/panel/92xx.h
@@ -0,0 +1,370 @@
+/* Copyright (c) 2005 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Neither the name of the Advanced Micro Devices, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ * */
+
+/*
+ * File Contents: This header file defines the Durango routines and
+ * variables used to access the memory mapped regions.
+ *
+ * SubModule: Geode FlatPanel library
+ * */
+
+#ifndef _92XX_h
+#define _92XX_h
+
+typedef unsigned long ULONG;
+typedef unsigned char UCHAR;
+
+#define FALSE 0
+#define TRUE 1
+#define NUM_92XX_MODES 13
+#define ONE_BYTE 1
+#define TWO_BYTES 2
+#define FOUR_BYTES 4
+
+/* LCD Registers
+ * The LCD memory area is shared by both TV and LCD.
+ * This offset is for LCD access.
+ */
+
+#define CS92xx_LCD_OFFSET 0x00000400
+
+/* LCD CONTROL REGISTERS */
+
+#define CS92xx_LCD_PAN_TIMING1 CS92xx_LCD_OFFSET + 0x00
+
+/* flat panel(FP) timings */
+#define CS92xx_LCD_PAN_TIMING2 CS92xx_LCD_OFFSET + 0x04
+
+/* FP panel timings */
+#define CS92xx_LCD_PWR_MAN CS92xx_LCD_OFFSET + 0x08
+
+/* FP power management */
+#define CS92xx_LCD_DITH_FR_CNTRL CS92xx_LCD_OFFSET + 0x0C
+
+/* FP dither and frame rate
+ * these defines are in revisions prior to C
+ */
+#define CS92xx_LCD_BLOCK_SEL1 CS92xx_LCD_OFFSET + 0x10
+
+/* FRM register */
+#define CS92xx_LCD_BLOCK_SEL2 CS92xx_LCD_OFFSET + 0x14
+
+/* FRM register */
+#define CS92xx_LCD_DISPER1 CS92xx_LCD_OFFSET + 0x18
+
+/* FRM register */
+#define CS92xx_LCD_DISPER2 CS92xx_LCD_OFFSET + 0x1C
+
+/* FRM register
+ * these defines are revision C
+ */
+#define CS92xx_BLUE_LSFR_SEED CS92xx_LCD_OFFSET + 0x10
+
+/* FRM register */
+#define CS92xx_RED_GREEN_LSFR_SEED CS92xx_LCD_OFFSET + 0x14
+
+/* FRM register */
+#define CS92xx_FRM_MEMORY_INDEX CS92xx_LCD_OFFSET + 0x18
+
+/* FRM register */
+#define CS92xx_FRM_MEMORY_DATA CS92xx_LCD_OFFSET + 0x1C
+
+/* FRM register */
+#define CS92xx_LCD_MEM_CNTRL CS92xx_LCD_OFFSET + 0x20
+
+/* memory PLL register */
+#define CS92xx_LCD_RAM_CNTRL CS92xx_LCD_OFFSET + 0x24
+
+/* ram control */
+
+#define CS92xx_LCD_RAM_DATA CS92xx_LCD_OFFSET + 0x28 /* ram data */
+
+#define CS92xx_LCD_PAN_CRC_SIG CS92xx_LCD_OFFSET + 0x2C
+
+/* FP CRC signature */
+#define CS92xx_DEV_REV_ID CS92xx_LCD_OFFSET + 0x30
+
+/* Device and revision id */
+#define CS92xx_LCD_GPIO_DATA CS92xx_LCD_OFFSET + 0x34 /* GPIO Data */
+
+#define CS92xx_LCD_GPIO_CNTRL CS92xx_LCD_OFFSET + 0x38
+
+/* GPIO Control */
+int Pnl_Rev_ID;
+
+typedef struct
+{
+ /* DISPLAY MODE PARAMETERS */
+ int xres;
+ int yres;
+ int bpp;
+ int panel_type;
+ int color_type;
+ /* VALUES USED TO SET THE FLAT PANEL DISPLAY CONTROLLER */
+ unsigned long panel_timing1;
+ unsigned long panel_timing2;
+ unsigned long power_management;
+ /* the following 5 registers are prior to revision C */
+ unsigned long pre_C_dither_frc;
+ unsigned long block_select1;
+ unsigned long block_select2;
+ unsigned long dispersion1;
+ unsigned long dispersion2;
+ /* the following 4 registers are revision C only */
+ unsigned long rev_C_dither_frc;
+ unsigned long blue_lsfr_seed;
+ unsigned long red_green_lsfr_seed;
+ unsigned long frm_memory_index;
+ unsigned long frm_memory_data;
+ unsigned long memory_control;
+
+}
+CS92xx_MODE;
+
+/* VALUES USED TO SAVE AND RESTORE 9211 REGISTERS. */
+typedef struct
+{
+ unsigned long panel_state;
+ /* VALUES USED TO SET THE FLAT PANEL DISPLAY CONTROLLER */
+ unsigned long panel_timing1;
+ unsigned long panel_timing2;
+ unsigned long power_management;
+ unsigned long dither_frc_ctrl;
+ unsigned long blue_lsfr_seed;
+ unsigned long red_green_lsfr_seed;
+ unsigned long frm_memory_index;
+ unsigned long frm_memory_data;
+ unsigned long memory_control;
+}
+CS92xx_REGS;
+
+CS92xx_REGS cs9211_regs;
+
+/*
+ *------------------------------------------------------------------------
+ * PANEL MODE TABLES:
+ * GLOBAL ARRAY OF FLAT PANEL MODE STRUCTURES
+ *------------------------------------------------------------------------
+ */
+CS92xx_MODE FPModeParams[] = {
+
+ {640, 480, 8, PNL_SSTN, PNL_COLOR_PANEL, /* display parameters */
+ 0x01e00000, 0x00034000, /* panel timing reg 1, panel timing */
+ /* reg 2 */
+ 0x01000000, /* power management */
+ /* The next 5 values are prior to revision C */
+ 0x00000050, /* dither and frame rate control */
+ 0x25cf3096, 0xad47b81e, /* block select 1, block select 2 */
+ 0x21446450, 0x21446450, /* dispersion 1, dispersion 2 */
+ /* The next 5 values are for revision C */
+ 0x00000050, /* dither and frame rate control */
+ 0x00000000, 0x00000000, /* blue LSFR, red and green LSFR */
+ 0x00000000, 0x00000000, /* FRM memory index, FRM memory data */
+ 0x00000000, /* memory control */
+ },
+
+ {640, 480, 12, PNL_TFT, PNL_COLOR_PANEL, /* display parameters */
+ 0x01e00000, 0x0f100000, /* panel timing reg 1, panel timing */
+ /* reg 2 */
+ 0x01000000, /* power management */
+ /* The next 5 values are prior to revision C */
+ 0x00000050, /* dither and frame rate control */
+ 0x00000000, 0x00000000, /* block select 1, block select 2 */
+ 0x00000000, 0x00000000, /* dispersion 1, dispersion 2 */
+ /* The next 5 values are for revision C */
+ 0x00000050, /* dither and frame rate control */
+ 0x00000000, 0x00000000, /* blue LSFR, red and green LSFR */
+ 0x00000000, 0x00000000, /* FRM memory index, FRM memory data */
+ 0x00000000, /* memory control */
+ },
+
+ {640, 480, 18, PNL_TFT, PNL_COLOR_PANEL, /* display parameters */
+ 0x01e00000, 0x0f100000, /* panel timing reg 1, panel timing */
+ /* reg 2 */
+ 0x01000000, /* power management */
+ /* The next 5 values are prior to revision C */
+ 0x00000050, /* dither and frame rate control */
+ 0x00000000, 0x00000000, /* block select 1, block select 2 */
+ 0x00000000, 0x00000000, /* dispersion 1, dispersion 2 */
+ /* The next 5 values are for revision C */
+ 0x00000050, /* dither and frame rate control */
+ 0x00000000, 0x00000000, /* blue LSFR, red and green LSFR */
+ 0x00000000, 0x00000000, /* FRM memory index, FRM memory data */
+ 0x00000000, /* memory control */
+ },
+
+ {640, 480, 16, PNL_DSTN, PNL_COLOR_PANEL, /* display parameters */
+ 0x01e00000, 0x00014000, /* panel timing reg 1, panel timing */
+ /* reg 2 */
+ 0x01000000, /* power management */
+ /* The next 5 values are prior to revision C */
+ 0x00000050, /* dither and frame rate control */
+ 0x048c26ae, 0x048c26ae, /* block select 1, block select 2 */
+ 0x02468ace, 0x13579bdf, /* dispersion 1, dispersion 2 */
+ /* The next 5 values are for revision C */
+ 0x0000004b, /* dither and frame rate control */
+ 0x00000000, 0x00000000, /* blue LSFR, red and green LSFR */
+ 0x00000000, 0x00000000, /* FRM memory index, FRM memory data */
+ 0x00000007, /* memory control */
+ },
+
+ {640, 480, 8, PNL_DSTN, PNL_MONO_PANEL, /* display parameters */
+ 0x01e00000, 0x00084000, /* panel timing reg 1, panel timing */
+ /* reg 2 */
+ 0x01000000, /* power management */
+ /* The next 5 values are prior to revision C */
+ 0x0000004b, /* dither and frame rate control */
+ 0x25cf3096, 0xad47b81e, /* block select 1, block select 2 */
+ 0x21446450, 0x21446450, /* dispersion 1, dispersion 2 */
+ /* The next 5 values are for revision C */
+ 0x00000050, /* dither and frame rate control */
+ 0x00000000, 0x00000000, /* blue LSFR, red and green LSFR */
+ 0x00000000, 0x00000000, /* FRM memory index, FRM memory data */
+ 0x00000007, /* memory control */
+ },
+
+ {640, 480, 16, PNL_DSTN, PNL_MONO_PANEL, /* display parameters */
+ 0x01e00000, 0x00094000, /* panel timing reg 1, panel timing */
+ /* reg 2 */
+ 0x01000000, /* power management */
+ /* The next 5 values are prior to revision C */
+ 0x00000050, /* dither and frame rate control */
+ 0x25cf3096, 0xad47b81e, /* block select 1, block select 2 */
+ 0x81a5d470, 0x29cfb63e, /* dispersion 1, dispersion 2 */
+ /* The next 5 values are for revision C */
+ 0x00000050, /* dither and frame rate control */
+ 0x00000000, 0x00000000, /* blue LSFR, red and green LSFR */
+ 0x00000000, 0x00000000, /* FRM memory index, FRM memory data */
+ 0x00000007, /* memory control */
+ },
+
+ {800, 600, 12, PNL_TFT, PNL_COLOR_PANEL, /* display parameters */
+ 0x02580000, 0x0f100000, /* panel timing reg 1, panel timing */
+ /* reg 2 */
+ 0x01000000, /* power management */
+ /* The next 5 values are prior to revision C */
+ 0x00000050, /* dither and frame rate control */
+ 0x00000000, 0x00000000, /* block select 1, block select 2 */
+ 0x00000000, 0x00000000, /* dispersion 1, dispersion 2 */
+ /* The next 5 values are for revision C */
+ 0x00000050, /* dither and frame rate control */
+ 0x00000000, 0x00000000, /* blue LSFR, red and green LSFR */
+ 0x00000000, 0x00000000, /* FRM memory index, FRM memory data */
+ 0x00000000, /* memory control */
+ },
+
+ {800, 600, 18, PNL_TFT, PNL_COLOR_PANEL, /* display parameters */
+ 0x02580000, 0x0f100000, /* panel timing reg 1, panel timing */
+ /* reg 2 */
+ 0x01000000, /* power management */
+ /* The next 5 values are prior to revision C */
+ 0x00000050, /* dither and frame rate control */
+ 0x00000000, 0x00000000, /* block select 1, block select 2 */
+ 0x00000000, 0x00000000, /* dispersion 1, dispersion 2 */
+ /* The next 5 values are for revision C */
+ 0x00000050, /* dither and frame rate control */
+ 0x00000000, 0x00000000, /* blue LSFR, red and green LSFR */
+ 0x00000000, 0x00000000, /* FRM memory index, FRM memory data */
+ 0x00000000, /* memory control */
+ },
+
+ {800, 600, 16, PNL_DSTN, PNL_COLOR_PANEL, /* display parameters */
+ 0x02580000, 0x00014000, /* panel timing reg 1, panel timing */
+ /* reg 2 */
+ 0x01000000, /* power management */
+ /* The next 5 values are prior to revision C */
+ 0x00000050, /* dither and frame rate control */
+ 0x048c26ae, 0x048c26ae, /* block select 1, block select 2 */
+ 0x02468ace, 0x13579bdf, /* dispersion 1, dispersion 2 */
+ /* The next 5 values are for revision C */
+ 0x0000004b, /* dither and frame rate control */
+ 0x00000000, 0x00000000, /* blue LSFR, red and green LSFR */
+ 0x00000000, 0x00000000, /* FRM memory index, FRM memory data */
+ 0x00000007, /* memory control */
+ },
+
+ {800, 600, 8, PNL_DSTN, PNL_MONO_PANEL, /* display parameters */
+ 0x02580000, 0x00084000, /* panel timing reg 1, panel timing */
+ /* reg 2 */
+ 0x01000000, /* power management */
+ /* The next 5 values are prior to revision C */
+ 0x00000050, /* dither and frame rate control */
+ 0x25cf3096, 0xad47b81e, /* block select 1, block select 2 */
+ 0x21446450, 0x21446450, /* dispersion 1, dispersion 2 */
+ /* The next 5 values are for revision C */
+ 0x0000004b, /* dither and frame rate control */
+ 0x00000000, 0x00000000, /* blue LSFR, red and green LSFR */
+ 0x00000000, 0x00000000, /* FRM memory index, FRM memory data */
+ 0x00000007, /* memory control */
+ },
+
+ {800, 600, 16, PNL_DSTN, PNL_MONO_PANEL, /* display parameters */
+ 0x02580000, 0x00094000, /* panel timing reg 1, panel timing */
+ /* reg 2 */
+ 0x01000000, /* power management */
+ /* The next 5 values are prior to revision C */
+ 0x00000050, /* dither and frame rate control */
+ 0x25cf3096, 0xad47b81e, /* block select 1, block select 2 */
+ 0x81a5d470, 0x29cfb63e, /* dispersion 1, dispersion 2 */
+ /* The next 5 values are for revision C */
+ 0x00000050, /* dither and frame rate control */
+ 0x00000000, 0x00000000, /* blue LSFR, red and green LSFR */
+ 0x00000000, 0x00000000, /* FRM memory index, FRM memory data */
+ 0x00000007, /* memory control */
+ },
+
+ {1024, 768, 18, PNL_TFT, PNL_COLOR_PANEL, /* display parameters */
+ 0x03000000, 0x0f100000, /* panel timing reg 1, panel timing */
+ /* reg 2 */
+ 0x01000000, /* power management */
+ /*The next 5 values are prior to revision C */
+ 0x00000050, /* dither and frame rate control */
+ 0x00000000, 0x00000000, /* block select 1, block select 2 */
+ 0x00000000, 0x00000000, /* dispersion 1, dispersion 2 */
+ /*The next 5 values are for revision C */
+ 0x00000050, /* dither and frame rate control */
+ 0x00000000, 0x00000000, /* blue LSFR, red and green LSFR */
+ 0x00000000, 0x00000000, /* FRM memory index, FRM memory data */
+ 0x00000000, /* memory control */
+ },
+
+ {1024, 768, 24, PNL_DSTN, PNL_COLOR_PANEL, /* display parameters */
+ 0x03000000, 0x80024000, /* panel timing reg 1, panel timing reg 2 */
+ 0x01000000, /* power management */
+ /*The next 5 values are prior to revision C */
+ 0x00000050, /* dither and frame rate control */
+ 0x048c26ae, 0x048c26ae, /* block select 1, block select 2 */
+ 0x02468ace, 0x13579bdf, /* dispersion 1, dispersion 2 */
+ /*The next 5 values are for revision C */
+ 0x0000004b, /* dither and frame rate control */
+ 0x00000000, 0x00000000, /* blue LSFR, red and green LSFR */
+ 0x00000000, 0x00000000, /* FRM memory index, FRM memory data */
+ 0x00000005, /* memory control */
+ }
+};
+
+#endif /* !_92XX_h */
+
+/* END OF FILE */
diff --git a/src/panel/cen9211.c b/src/panel/cen9211.c
new file mode 100644
index 0000000..3abc7d5
--- /dev/null
+++ b/src/panel/cen9211.c
@@ -0,0 +1,866 @@
+/* Copyright (c) 2005 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Neither the name of the Advanced Micro Devices, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ * */
+
+/*
+ * File Contents: This file contains panel functions to interface with
+ * the centaraus platform.
+ *
+ * SubModule: Geode FlatPanel library
+ * */
+
+#include "cen9211.h"
+
+static unsigned char sioc2_orig_val;
+static unsigned char must_restore_97317 = FALSE;
+
+/********************************************************************
+ *
+ * PASS_FAIL init_GPIO(void);
+ * Initializes the GPIO pins in the Cx5530 or the National PC97317
+ * for use with a 9211 on a Marmot or Centaurus board. Uses
+ * the global variables RdPCIVal and sioc2_orig_val.
+ *
+ *********************************************************************/
+
+unsigned char
+init_Centaurus_GPIO(void)
+{
+ unsigned char reg_val;
+ static unsigned char first_time = TRUE;
+
+ /* The Centaurus board uses ports 1 and 2 of the 97317 for GPIO.
+ * These ports require bank 0 to be active. The first thing we will
+ * do is verify that bank 0 is active and set it if it is not.
+ */
+
+ /* set the index for access to the configuration register */
+ gfx_outb(CENT_CONFIG_INDEX, CENT_SIOC2);
+ reg_val = gfx_inb(CENT_CONFIG_DATA);
+
+ /* set to bank 0 */
+ if (reg_val & CENT_GPIO_BANK_SELECT) {
+ gfx_outb(CENT_CONFIG_DATA,
+ (unsigned char)(reg_val & ~CENT_GPIO_BANK_SELECT));
+ }
+
+ /* If this is the first time we have modified sioc2, we must
+ * save the current value (set by the BIOS) for restoration by
+ * the calling program, set the global flag must_restore_97317, and set
+ * first_time to FALSE.
+ */
+
+ if (first_time == TRUE) {
+ sioc2_orig_val = reg_val;
+ must_restore_97317 = TRUE;
+ first_time = FALSE;
+ }
+
+ /* set port 1 direction */
+ reg_val = gfx_inb(CENT_PORT1_DIRECTION);
+
+ /* make GPIO 14 and 17 outputs */
+ reg_val |= CENT_97317_CLOCK_MASK | CENT_97317_DATA_OUT_MASK;
+ gfx_outb(CENT_PORT1_DIRECTION, reg_val);
+
+ /* set port 2 direction */
+ reg_val = gfx_inb(CENT_PORT2_DIRECTION);
+
+ /* make GPIO 20 an output */
+
+ reg_val |= CENT_97317_CHIP_SEL_MASK;
+
+ /* make GPIO 21 an input */
+
+ reg_val &= ~CENT_97317_DATA_IN_MASK;
+ gfx_outb(CENT_PORT2_DIRECTION, reg_val);
+
+ /* make GPIO 14 and 17 push-pull */
+
+ reg_val = gfx_inb(CENT_PORT1_OUTPUT_TYPE);
+ reg_val |= CENT_97317_CLOCK_MASK | CENT_97317_DATA_OUT_MASK;
+ gfx_outb(CENT_PORT1_OUTPUT_TYPE, reg_val);
+
+ /* make GPIO 20 and 21 push-pull */
+ reg_val = gfx_inb(CENT_PORT2_OUTPUT_TYPE);
+ reg_val |= CENT_97317_CHIP_SEL_MASK | CENT_97317_DATA_IN_MASK;
+ gfx_outb(CENT_PORT2_OUTPUT_TYPE, reg_val);
+ return CENT_PASS;
+
+} /* end init_GPIO() */
+
+/*********************************************************************
+ *
+ * PASS_FAIL init_9211(void);
+ * Initializes (sets to 0) the clock, chip select, and data pins
+ * of the Cx9211 on a Marmot or Centaurus board.
+ *
+ **********************************************************************/
+
+unsigned char
+init_Centaurus_9211(void)
+{
+ unsigned char ReadData;
+
+ /* Uses the 97317 for GPIO.
+ * we will use the clock port define for port 1
+ */
+ ReadData = gfx_inb(CENT_97317_CLOCK_PORT);
+ ReadData &= ~CENT_97317_CLOCK_MASK & ~CENT_97317_DATA_OUT_MASK;
+ gfx_outb(CENT_97317_CLOCK_PORT, ReadData);
+ /* we will use the chip select port define for port 2 */
+ ReadData = gfx_inb(CENT_97317_CHIP_SELECT);
+ ReadData &= ~CENT_97317_CHIP_SEL_MASK & ~CENT_97317_DATA_IN_MASK;
+ gfx_outb(CENT_97317_CHIP_SELECT, ReadData);
+ return (CENT_PASS);
+
+} /*end init_9211() */
+
+/******************************************************************
+ *
+ * PASS_FAIL restore_97317_SIOC2(void);
+ * Restores the original value to the 97317 SIOC2 register using
+ * the global variable sioc2_orig_val. Returns PASS if the value
+ * was written, FAIL if not.
+ *
+ *******************************************************************/
+
+unsigned char
+restore_Centaurus_97317_SIOC2(void)
+{
+ /* set the global flag */
+ if (must_restore_97317 == TRUE) {
+ unsigned char cfg;
+
+ /* set the index for access to the configuration register */
+ gfx_outb(CENT_CONFIG_INDEX, CENT_SIOC2);
+
+ /* restore the value */
+ gfx_outb(CENT_CONFIG_DATA, sioc2_orig_val);
+
+ /* now read and verify */
+ cfg = gfx_inb(CENT_CONFIG_DATA);
+ if (cfg == sioc2_orig_val)
+ return (CENT_PASS);
+ else
+ return (CENT_FAIL);
+
+ } /* end if() */
+ return (CENT_FAIL);
+
+} /* end restore_97317_SIOC2bank() */
+
+/* -----------------------------------------------------------------------
+ *
+ * SET_FLAT_PANEL_MODE
+ *
+ * This routine sets the specified flat panel moden parameters in
+ * the 9211.
+ * Returns PASS if successful, FAIL if the mode parameters could
+ * not be set.
+ *
+ *------------------------------------------------------------------------*/
+
+unsigned char
+set_Centaurus_92xx_mode(Pnl_PanelStat * pstat)
+{
+ int mode;
+
+ /* LOOP THROUGH THE AVAILABLE MODES TO FIND A MATCH */
+
+ for (mode = 0; mode < NUM_92XX_MODES; mode++) {
+ if ((FPModeParams[mode].xres == pstat->XRes) &&
+ (FPModeParams[mode].yres == pstat->YRes) &&
+ (FPModeParams[mode].bpp == pstat->Depth) &&
+ (FPModeParams[mode].panel_type == pstat->Type) &&
+ (FPModeParams[mode].color_type == pstat->MonoColor)) {
+
+ /* SET THE 92xx FOR THE SELECTED MODE */
+ set_Centaurus_92xx_mode_params(mode);
+ return (CENT_PASS);
+ } /* end if() */
+ } /* end for() */
+ return (CENT_FAIL);
+
+} /* end set_Centaurus_92xx_mode() */
+
+/*-------------------------------------------------------------------
+ *
+ * SET_92XX_MODE_PARAMS
+ * This routine sets the 9211 mode parameters.
+ *
+ *-------------------------------------------------------------------*/
+
+void
+set_Centaurus_92xx_mode_params(int mode)
+{
+ CS92xx_MODE *pMode = &FPModeParams[mode];
+ unsigned long off_data = 0;
+
+ /* Turn the 92xx power off before setting any new parameters.
+ * Since we are going to reset all the power bit positions, we will
+ * force the power register to 0.
+ */
+
+ Centaurus_write_gpio(FOUR_BYTES, CS92xx_LCD_PWR_MAN, off_data);
+
+ /* set 9211 registers using the desired panel settings */
+
+ Centaurus_write_gpio(FOUR_BYTES,
+ CS92xx_LCD_PAN_TIMING1, pMode->panel_timing1);
+
+ Centaurus_write_gpio(FOUR_BYTES,
+ CS92xx_LCD_PAN_TIMING2, pMode->panel_timing2);
+
+ if (Pnl_Rev_ID == PNL_9211_C) {
+
+ /* load the LSFR seeds */
+ Centaurus_write_gpio(FOUR_BYTES,
+ CS92xx_LCD_DITH_FR_CNTRL, pMode->rev_C_dither_frc);
+
+ Centaurus_write_gpio(FOUR_BYTES,
+ CS92xx_BLUE_LSFR_SEED, pMode->blue_lsfr_seed);
+
+ Centaurus_write_gpio(FOUR_BYTES,
+ CS92xx_RED_GREEN_LSFR_SEED, pMode->red_green_lsfr_seed);
+ } else {
+
+ Centaurus_write_gpio(FOUR_BYTES,
+ CS92xx_LCD_DITH_FR_CNTRL, pMode->pre_C_dither_frc);
+
+ Centaurus_write_gpio(FOUR_BYTES,
+ CS92xx_LCD_BLOCK_SEL1, pMode->block_select1);
+
+ Centaurus_write_gpio(FOUR_BYTES,
+ CS92xx_LCD_BLOCK_SEL2, pMode->block_select2);
+
+ Centaurus_write_gpio(FOUR_BYTES,
+ CS92xx_LCD_DISPER1, pMode->dispersion1);
+
+ Centaurus_write_gpio(FOUR_BYTES,
+ CS92xx_LCD_DISPER2, pMode->dispersion2);
+
+ CentaurusProgramFRMload();
+ }
+
+ Centaurus_write_gpio(FOUR_BYTES, CS92xx_LCD_MEM_CNTRL,
+ pMode->memory_control);
+
+ /* Set the power register last. This will turn the panel on at the 9211. */
+
+ Centaurus_write_gpio(FOUR_BYTES,
+ CS92xx_LCD_PWR_MAN, pMode->power_management);
+
+} /* end set_Centaurus_92xx_mode_params() */
+
+void
+Centaurus_write_gpio(int width, ULONG address, unsigned long data)
+{
+ int num_clock_toggles;
+ int count;
+ unsigned long Addr = address;
+
+ enable_Centaurus_9211_chip_select();
+
+ /* Write 1 Clock period of no valid transfer */
+ write_Centaurus_CX9211_GPIO(CENT_NO_DATA);
+
+ /* Write 1 control bit (the data book calls this the control bar write) */
+ write_Centaurus_CX9211_GPIO(0x1);
+
+ /* Write the 12-bit address */
+ for (count = 0; count < 12; count++) {
+ write_Centaurus_CX9211_GPIO((unsigned char)(Addr & 0x01));
+ /*the 9211 expects data LSB->MSB */
+ Addr = Addr >> 1;
+ }
+
+ /* write */
+ write_Centaurus_CX9211_DWdata(data);
+
+ /* a write will require four toggles after disabling CS */
+ num_clock_toggles = CENT_NUM_WRITE_CLOCK_TOGGLES;
+ disable_Centaurus_9211_chip_select();
+
+ /* now toggle the clock */
+ for (count = 0; count < num_clock_toggles; count++) {
+ toggle_Centaurus_9211_clock();
+ }
+ return;
+
+} /* end Centaurus_write_gpio() */
+
+unsigned long
+Centaurus_read_gpio(int width, unsigned long address)
+{
+ int num_clock_toggles;
+ int count;
+ unsigned long Addr = address;
+ unsigned long data;
+
+ enable_Centaurus_9211_chip_select();
+
+ /* Write 1 Clock period of no valid transfer */
+ write_Centaurus_CX9211_GPIO(CENT_NO_DATA);
+
+ /* Write 1 control bit (the data book calls this the control bar write) */
+ write_Centaurus_CX9211_GPIO(0x1);
+
+ /* Write the 12-bit address */
+ for (count = 0; count < 12; count++) {
+ write_Centaurus_CX9211_GPIO((unsigned char)(Addr & 0x01));
+
+ /*the 9211 expects data LSB->MSB */
+ Addr = Addr >> 1;
+ }
+
+ data = read_Centaurus_CX9211_DWdata();
+
+ /* a read will require one toggle after disabling CS */
+ num_clock_toggles = CENT_NUM_READ_CLOCK_TOGGLES;
+ disable_Centaurus_9211_chip_select();
+
+ /* now toggle the clock */
+ for (count = 0; count < num_clock_toggles; count++) {
+ toggle_Centaurus_9211_clock();
+ }
+ return data;
+
+} /* end Centaurus_read_gpio() */
+
+/*******************************************************************
+ *
+ * void enable_Centaurus_9211_chip_select(void);
+ * Enables the chip select of the CX9211 using the National 97317
+ * on a Centaurus board.
+ *
+ *******************************************************************/
+
+void
+enable_Centaurus_9211_chip_select(void)
+{
+ unsigned char cs_port_val;
+
+ /* Set the chip select (GPIO20) high */
+ cs_port_val = gfx_inb(CENT_97317_CHIP_SELECT);
+ gfx_outb(CENT_97317_CHIP_SELECT,
+ (unsigned char)(cs_port_val | CENT_97317_CHIP_SEL_MASK));
+ return;
+} /* end enable_Centaurus_9211_chip_select() */
+
+/********************************************************************
+ *
+ * void disable_Centaurus_9211_chip_select(void);
+ * Disables the chip select of the CX9211 using the National 97317
+ * on a Centaurus board.
+ *
+ *******************************************************************/
+
+void
+disable_Centaurus_9211_chip_select(void)
+{
+ unsigned char cs_port_val;
+
+ /* Set the chip select (GPIO20) low */
+ cs_port_val = gfx_inb(CENT_97317_CHIP_SELECT);
+ gfx_outb(CENT_97317_CHIP_SELECT,
+ (unsigned char)(cs_port_val & ~CENT_97317_CHIP_SEL_MASK));
+ return;
+
+} /* end disable_Centaurus_9211_chip_select() */
+
+/**********************************************************************
+ *
+ * void toggle_Centaurus_9211_clock(void);
+ * Toggles the clock bit of the CX9211 using the National 97317 on a
+ * Centaurus board. Assumes the 9211 clock bit has previously been
+ * initialized to 0 (this way we do not have to waste GPIO cycles
+ * windowing the clock pulse).
+ *
+ **********************************************************************/
+
+void
+toggle_Centaurus_9211_clock(void)
+{
+ unsigned char port_val;
+
+ /* get the 97317 GPIO port contents for the 9211 clock */
+
+ port_val = gfx_inb(CENT_97317_CLOCK_PORT);
+ /* set the clock bit high */
+ gfx_outb(CENT_97317_CLOCK_PORT,
+ (unsigned char)(port_val | CENT_97317_CLOCK_MASK));
+
+ /* set the clock bit low */
+ gfx_outb(CENT_97317_CLOCK_PORT,
+ (unsigned char)(port_val & ~CENT_97317_CLOCK_MASK));
+
+} /* end toggle_Centaurus_9211_clock() */
+
+/********************************************************************
+ *
+ * void write_Centaurus_CX9211_GPIO(unsigned char databit);
+ * Writes the value in bit 0 of the value passed in databit to
+ * the 9211 through the GPIO interface of the National 97317 on a
+ * Centaurus board.
+ * NOTE: This function does not set or reset the chip select line!
+ *
+ *******************************************************************/
+
+void
+write_Centaurus_CX9211_GPIO(unsigned char databit)
+{
+ unsigned char data_port_val;
+
+ /* Set the data bit for (GPIO17) */
+ databit <<= 7;
+
+ /* read the value of the other bits in the 97317 data port */
+ data_port_val = gfx_inb(CENT_97317_DATA_OUTPORT);
+
+ /* set the bit accordingly */
+ data_port_val &= ~CENT_97317_DATA_OUT_MASK;
+ data_port_val |= databit;
+ gfx_outb(CENT_97317_DATA_OUTPORT, data_port_val);
+
+ /* clock the data */
+ toggle_Centaurus_9211_clock();
+ return;
+
+} /* end write_Centaurus_CX9211_GPIO() */
+
+/*****************************************************************
+ *
+ * void write_Centaurus_CX9211_DWdata(unsigned long data);
+ * Writes the doubleword value passed in data to the CX9211
+ * using GPIO Pins of the National 97317 on a Centaurus board.
+ * This function assumes the Direction register of the 97317
+ * and the address register of the CX9211 have been previously set.
+ * Uses the global variable count.
+ * NOTE: This function does not set or reset the chip select line!
+ *
+ ******************************************************************/
+
+void
+write_Centaurus_CX9211_DWdata(unsigned long data)
+{
+ int count;
+
+ /* Send the read/write command to the 9211 first. */
+
+ write_Centaurus_CX9211_GPIO(CENT_WRITE);
+
+ /* Now write the 32-bit Data */
+ for (count = 0; count < 32; count++) {
+ write_Centaurus_CX9211_GPIO((unsigned char)(data & 0x01));
+
+ /* the 9211 expects the data LSB->MSB */
+ data >>= 1;
+ }
+ return;
+
+} /* end write_Centaurus_CX9211_DWdata() */
+
+/*********************************************************************
+ *
+ * unsigned char read_Centaurus_CX9211_GPIO(void);
+ * Returns the current value of the databit of the 9211 in bit 0
+ * using the GPIO interface of the National 97317 on a Centaurus board.
+ * NOTE: This function does not set or reset the chip select line!
+ *
+ *********************************************************************/
+
+unsigned char
+read_Centaurus_CX9211_GPIO(void)
+{
+ unsigned char data_port_val;
+
+ toggle_Centaurus_9211_clock();
+
+ /* read the data */
+ data_port_val = gfx_inb(CENT_97317_DATA_INPORT);
+
+ /* Save the data from (GPIO21) as bit 0 */
+ data_port_val >>= 1;
+ return (data_port_val & 0x1);
+
+} /* end read_Centaurus_CX9211_GPIO() */
+
+/**********************************************************************
+ *
+ * void read_Centaurus_CX9211_DWdata(unsigned long *data);
+ * Reads a doubleword value from the CX9211 using GPIO Pins of
+ * the National 97317 on a Centaurus board.
+ * This function assumes the Direction register of the 97317 and
+ * the address register of the CX9211 have been previously set.
+ * NOTE: This function does not set or reset the chip select line!
+ *
+ ***********************************************************************/
+
+unsigned long
+read_Centaurus_CX9211_DWdata(void)
+{
+ unsigned char ReadData;
+ int count;
+ unsigned long Data;
+
+ /* Send read/write command word to the 9211 first. */
+ write_Centaurus_CX9211_GPIO(CENT_READ);
+
+ /* The data book (revision 0.1) states 8 clock periods of no valid data.
+ * However, the data becomes valid on the eighth clock, making the eighth
+ * clock valid. Since read_Centaurus_GPIO() toggles the clock before
+ * reading, we will only toggle the clock 7 times here.
+ */
+ for (count = 0; count < 7; count++) /* works */
+ toggle_Centaurus_9211_clock();
+
+ /* Now read the 32-bit Data, bit by bit in a single loop. */
+ Data = 0;
+ for (count = 0; count < 32; count++) {
+ ReadData = read_Centaurus_CX9211_GPIO();
+ /* 9211 sends data LSB->MSB */
+ Data = Data | (((unsigned long)ReadData) << count);
+ } /* end for() */
+
+ return Data;
+
+} /* end read_Centaurus_CX9211_DWdata() */
+
+void
+Centaurus_Get_9211_Details(unsigned long flags, Pnl_PanelParams * pParam)
+{
+ unsigned long PanelType;
+ int i;
+
+ for (i = 0; i < 0x7fff; i++) {
+ }
+
+ init_Centaurus_GPIO();
+
+ for (i = 0; i < 5; i++)
+ toggle_Centaurus_9211_clock();
+
+ if (flags & PNL_PANELCHIP) {
+
+ PanelType = Centaurus_read_gpio(FOUR_BYTES, 0x430);
+ PanelType = Centaurus_read_gpio(FOUR_BYTES, 0x430);
+ if ((PanelType & 0xFFFF0000) == 0x92110000) {
+
+ /* found 9211 */
+ /* check the values for revision ID */
+ if (PanelType >= 0x92110301)
+ pParam->PanelChip = PNL_9211_C;
+ else if ((PanelType >= 0x92110101) && (PanelType < 0x92110301))
+ pParam->PanelChip = PNL_9211_A;
+ else
+ pParam->PanelChip = PNL_UNKNOWN_CHIP;
+ } else { /* no 9211 present */
+ pParam->PanelChip = PNL_UNKNOWN_CHIP;
+ }
+ Pnl_Rev_ID = pParam->PanelChip;
+ }
+ /* if end */
+ if ((pParam->PanelChip != PNL_UNKNOWN_CHIP) && (flags & PNL_PANELSTAT)) {
+ PanelType = Centaurus_read_gpio(FOUR_BYTES, 0x438);
+ PanelType &= 0x00f8f8f8;
+ PanelType |= 0x00070000;
+ Centaurus_write_gpio(FOUR_BYTES, 0x438, PanelType);
+ PanelType = 0;
+ PanelType = Centaurus_read_gpio(FOUR_BYTES, 0x434);
+ PanelType = (PanelType >> 8);
+ PanelType &= 0x7;
+
+ switch (PanelType) {
+ case 0:
+ pParam->PanelStat.XRes = 800;
+ pParam->PanelStat.YRes = 600;
+ pParam->PanelStat.Depth = 18;
+ pParam->PanelStat.MonoColor = PNL_COLOR_PANEL;
+ pParam->PanelStat.Type = PNL_TFT;
+ break;
+ case 1:
+ pParam->PanelStat.XRes = 640;
+ pParam->PanelStat.YRes = 480;
+ pParam->PanelStat.Depth = 8;
+ pParam->PanelStat.MonoColor = PNL_COLOR_PANEL;
+ pParam->PanelStat.Type = PNL_SSTN;
+ break;
+ case 2:
+ pParam->PanelStat.XRes = 1024;
+ pParam->PanelStat.YRes = 768;
+ pParam->PanelStat.Depth = 18;
+ pParam->PanelStat.MonoColor = PNL_COLOR_PANEL;
+ pParam->PanelStat.Type = PNL_TFT;
+ break;
+ case 3:
+ pParam->PanelStat.XRes = 640;
+ pParam->PanelStat.YRes = 480;
+ pParam->PanelStat.Depth = 16;
+ pParam->PanelStat.MonoColor = PNL_COLOR_PANEL;
+ pParam->PanelStat.Type = PNL_DSTN;
+ break;
+ case 4:
+ pParam->PanelStat.XRes = 640;
+ pParam->PanelStat.YRes = 480;
+ pParam->PanelStat.Depth = 18;
+ pParam->PanelStat.MonoColor = PNL_COLOR_PANEL;
+ pParam->PanelStat.Type = PNL_TFT;
+ break;
+ case 5:
+ pParam->PanelStat.XRes = 1024;
+ pParam->PanelStat.YRes = 768;
+ pParam->PanelStat.Depth = 24;
+ pParam->PanelStat.MonoColor = PNL_COLOR_PANEL;
+ pParam->PanelStat.Type = PNL_DSTN;
+ break;
+ case 6:
+ pParam->PanelStat.XRes = 640;
+ pParam->PanelStat.YRes = 480;
+ pParam->PanelStat.Depth = 8;
+ pParam->PanelStat.MonoColor = PNL_MONO_PANEL;
+ pParam->PanelStat.Type = PNL_DSTN;
+ break;
+ case 7:
+ pParam->PanelStat.XRes = 800;
+ pParam->PanelStat.YRes = 600;
+ pParam->PanelStat.Depth = 16;
+ pParam->PanelStat.MonoColor = PNL_COLOR_PANEL;
+ pParam->PanelStat.Type = PNL_DSTN;
+ break;
+ default:
+ break;
+ }
+ }
+
+}
+
+void
+CentaurusProgramFRMload(void)
+{
+ unsigned long CentaurusFRMtable[] = {
+ 0x00000000,
+ 0x00000000,
+ 0x01000100,
+ 0x01000100,
+ 0x01010101,
+ 0x01010101,
+ 0x02081041,
+ 0x02081041,
+ 0x10111111,
+ 0x11111101,
+ 0x49249241,
+ 0x12412492,
+ 0x92244891,
+ 0x92244891,
+ 0x22252525,
+ 0x22252525,
+ 0x528294a5,
+ 0x2528494a,
+ 0x294a5295,
+ 0x294a5295,
+ 0x54a54a95,
+ 0x2952a52a,
+ 0x2a552a55,
+ 0x2a552a55,
+ 0x554aa955,
+ 0x2a9552aa,
+ 0x2aaa5555,
+ 0x2aaa5555,
+ 0x55555555,
+ 0x2aaaaaaa,
+ 0x55555555,
+ 0x55555555,
+ 0xaaaaaaab,
+ 0x55555555,
+ 0x5555aaab,
+ 0x5555aaab,
+ 0xaab556ab,
+ 0x556aad55,
+ 0x55ab55ab,
+ 0x55ab55ab,
+ 0xab5ab56b,
+ 0x56ad5ad5,
+ 0x56b5ad6b,
+ 0x56b5ad6b,
+ 0xad6d6b5b,
+ 0x5ad6b6b6,
+ 0x5b5b5b5b,
+ 0x5b5b5b5b,
+ 0x5F6db6db,
+ 0x5F6db6db,
+ 0xF776F776,
+ 0xF776F776,
+ 0xFBDEFBDE,
+ 0xFBDEFBDE,
+ 0x7eFFBFF7,
+ 0x7eFFBFF7,
+ 0xFF7FF7F7,
+ 0xFF7FF7F7,
+ 0xFF7FFF7F,
+ 0xFF7FFF7F,
+ 0xFFF7FFFF,
+ 0xFFF7FFFF,
+ 0xFFFFFFFF,
+ 0xFFFFFFFF,
+ };
+
+ unsigned char i;
+ unsigned short index;
+ unsigned long data;
+
+ Centaurus_write_gpio(FOUR_BYTES, CS92xx_FRM_MEMORY_INDEX, 0);
+ index = CS92xx_FRM_MEMORY_DATA;
+ for (i = 0; i < 64; i += 2) {
+ data = CentaurusFRMtable[i];
+ Centaurus_write_gpio(FOUR_BYTES, CS92xx_FRM_MEMORY_DATA, data);
+ data = CentaurusFRMtable[i + 1];
+ Centaurus_write_gpio(FOUR_BYTES, CS92xx_FRM_MEMORY_DATA, data);
+ }
+
+ /*
+ * The first FRM location (64 bits) does not program correctly.
+ * This location always reads back with the last value programmed.
+ * ie. If 32 64-bit values are programmed, location 0 reads
+ * back as the 32nd If 30 locations are programmed, location 0
+ * reads back as the 30th, etc.
+ * Fix this by re-writing location 0 after programming all 64 in
+ * the writeFRM loop in RevCFrmload() in CS9211.
+ */
+
+ Centaurus_write_gpio(FOUR_BYTES, CS92xx_FRM_MEMORY_INDEX, 0);
+ Centaurus_write_gpio(FOUR_BYTES, CS92xx_FRM_MEMORY_DATA, 0);
+ Centaurus_write_gpio(FOUR_BYTES, CS92xx_FRM_MEMORY_DATA, 0);
+}
+
+/********************************************************************
+ *
+ * void Centaurus_Enable_Power((void);
+ * Enables the power of the CX9211 using the National 97317 on
+ * a Centaurus board.
+ *
+ ********************************************************************/
+
+void
+Centaurus_Power_Up(void)
+{
+ unsigned long off_data = 0x01000000;
+
+ Centaurus_write_gpio(FOUR_BYTES, CS92xx_LCD_PWR_MAN, off_data);
+ return;
+
+} /* Centaurus_Disable_Power */
+
+/***********************************************************************
+ *
+ * void Centaurus_Disable_Power((void);
+ * Disables the power of the CX9211 using the National 97317
+ * on a Centaurus board.
+ *
+ **********************************************************************/
+
+void
+Centaurus_Power_Down(void)
+{
+ unsigned long off_data = 0;
+
+ Centaurus_write_gpio(FOUR_BYTES, CS92xx_LCD_PWR_MAN, off_data);
+ return;
+
+} /* Centaurus_Disable_Power */
+
+void
+Centaurus_9211init(Pnl_PanelStat * pstat)
+{
+ init_Centaurus_GPIO();
+ init_Centaurus_9211();
+ set_Centaurus_92xx_mode(pstat);
+ restore_Centaurus_97317_SIOC2();
+}
+
+void
+Centaurus_Save_Panel_State(void)
+{
+ /* set 9211 registers using the desired panel settings */
+
+ cs9211_regs.panel_timing1 =
+ Centaurus_read_gpio(FOUR_BYTES, CS92xx_LCD_PAN_TIMING1);
+ cs9211_regs.panel_timing2 =
+ Centaurus_read_gpio(FOUR_BYTES, CS92xx_LCD_PAN_TIMING2);
+ cs9211_regs.dither_frc_ctrl =
+ Centaurus_read_gpio(FOUR_BYTES, CS92xx_LCD_DITH_FR_CNTRL);
+ cs9211_regs.blue_lsfr_seed =
+ Centaurus_read_gpio(FOUR_BYTES, CS92xx_BLUE_LSFR_SEED);
+
+ cs9211_regs.red_green_lsfr_seed =
+ Centaurus_read_gpio(FOUR_BYTES, CS92xx_RED_GREEN_LSFR_SEED);
+ /* CentaurusProgramFRMload(); */
+
+ cs9211_regs.memory_control =
+ Centaurus_read_gpio(FOUR_BYTES, CS92xx_LCD_MEM_CNTRL);
+
+ /* Set the power register last.
+ * This will turn the panel on at the 9211.
+ */
+ cs9211_regs.power_management =
+ Centaurus_read_gpio(FOUR_BYTES, CS92xx_LCD_PWR_MAN);
+}
+
+void
+Centaurus_Restore_Panel_State(void)
+{
+
+ unsigned long off_data = 0;
+
+ /* Before restoring the 9211 registers, power off the 9211. */
+ Centaurus_write_gpio(FOUR_BYTES, CS92xx_LCD_PWR_MAN, off_data);
+
+ /* set 9211 registers using the desired panel settings */
+
+ Centaurus_write_gpio(FOUR_BYTES, CS92xx_LCD_PAN_TIMING1,
+ cs9211_regs.panel_timing1);
+
+ Centaurus_write_gpio(FOUR_BYTES, CS92xx_LCD_PAN_TIMING2,
+ cs9211_regs.panel_timing2);
+
+ /* load the LSFR seeds */
+
+ Centaurus_write_gpio(FOUR_BYTES, CS92xx_LCD_DITH_FR_CNTRL,
+ cs9211_regs.dither_frc_ctrl);
+
+ Centaurus_write_gpio(FOUR_BYTES, CS92xx_BLUE_LSFR_SEED,
+ cs9211_regs.blue_lsfr_seed);
+
+ Centaurus_write_gpio(FOUR_BYTES, CS92xx_RED_GREEN_LSFR_SEED,
+ cs9211_regs.red_green_lsfr_seed);
+
+ Centaurus_write_gpio(FOUR_BYTES, CS92xx_LCD_MEM_CNTRL,
+ cs9211_regs.memory_control);
+
+ /* Set the power register last. This will turn the panel on at the 9211 */
+
+ Centaurus_write_gpio(FOUR_BYTES, CS92xx_LCD_PWR_MAN,
+ cs9211_regs.power_management);
+
+}
diff --git a/src/panel/cen9211.h b/src/panel/cen9211.h
new file mode 100644
index 0000000..1ab21e8
--- /dev/null
+++ b/src/panel/cen9211.h
@@ -0,0 +1,101 @@
+/* Copyright (c) 2005 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Neither the name of the Advanced Micro Devices, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ * */
+
+/*
+ * File Contents: This header file defines the Durango routines and
+ * variables used to access the memory mapped regions.
+ *
+ * SubModule: Geode FlatPanel library
+ * */
+
+#include "92xx.h"
+#include "panel.h"
+
+#ifndef _CEN9211_h
+#define _CEN9211_h
+
+/* Centaurus/97317 GPIO PORT defines */
+
+#define CENT_97317_CLOCK_PORT 0xE0
+#define CENT_97317_DATA_OUTPORT 0xE0
+#define CENT_97317_CHIP_SELECT 0xE4
+#define CENT_97317_DATA_INPORT 0xE4
+#define CENT_PORT1_DIRECTION 0xE1
+#define CENT_PORT2_DIRECTION 0xE5
+#define CENT_PORT1_OUTPUT_TYPE 0xE2
+#define CENT_PORT2_OUTPUT_TYPE 0xE6
+
+/*
+ * Centaurus/97317 GPIO bit masks.
+ * In and out are with respect to the 97317.
+ */
+
+#define CENT_97317_CLOCK_MASK 0x10
+#define CENT_97317_CHIP_SEL_MASK 0x01
+#define CENT_97317_DATA_IN_MASK 0x02
+#define CENT_97317_DATA_OUT_MASK 0x80
+
+#define CENT_PASS 1
+#define CENT_FAIL 0
+#define CENT_READ 0x0000
+#define CENT_WRITE 0x0001
+#define CENT_NO_DATA 0
+
+#define CENT_CONFIG_INDEX 0x2E
+#define CENT_SIOC2 0x22
+#define CENT_CONFIG_DATA 0x2F
+#define CENT_GPIO_BANK_SELECT 0x80
+
+#define CENT_NUM_READ_CLOCK_TOGGLES 1
+#define CENT_NUM_WRITE_CLOCK_TOGGLES 4
+
+/* local functions */
+void set_Centaurus_92xx_mode_params(int mode);
+void enable_Centaurus_9211_chip_select(void);
+void disable_Centaurus_9211_chip_select(void);
+void toggle_Centaurus_9211_clock(void);
+void write_Centaurus_CX9211_GPIO(unsigned char databit);
+void write_Centaurus_CX9211_DWdata(unsigned long data);
+void Centaurus_write_gpio(int width, unsigned long address,
+ unsigned long data);
+void Centaurus_Power_Up(void);
+void Centaurus_Power_Down(void);
+unsigned long Centaurus_read_gpio(int width, unsigned long address);
+unsigned char read_Centaurus_CX9211_GPIO(void);
+unsigned long read_Centaurus_CX9211_DWdata(void);
+unsigned char restore_Centaurus_97317_SIOC2(void);
+unsigned char init_Centaurus_GPIO(void);
+unsigned char init_Centaurus_9211(void);
+unsigned char set_Centaurus_92xx_mode(Pnl_PanelStat * pstat);
+void CentaurusProgramFRMload(void);
+void Centaurus_Get_9211_Details(unsigned long flags,
+ Pnl_PanelParams * pParam);
+void Centaurus_Save_Panel_State(void);
+void Centaurus_Restore_Panel_State(void);
+void Centaurus_9211init(Pnl_PanelStat * pstat);
+
+#endif /* !_CEN9211_h */
+
+/* END OF FILE */
diff --git a/src/panel/dora9211.c b/src/panel/dora9211.c
new file mode 100644
index 0000000..ea52e95
--- /dev/null
+++ b/src/panel/dora9211.c
@@ -0,0 +1,607 @@
+/* Copyright (c) 2005 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Neither the name of the Advanced Micro Devices, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ * */
+
+/*
+ * File Contents: This file contains the panel functions to interface
+ * the dorado platform.
+ *
+ * SubModule: Geode FlatPanel library
+ * */
+
+#include "dora9211.h"
+
+void
+Dorado_Get_9211_Details(unsigned long flags, Pnl_PanelParams * pParam)
+{
+ unsigned long DPanelType;
+ int i;
+
+ for (i = 0; i < 0x7fff; i++) {
+ }
+
+ Dorado9211GpioInit();
+
+ for (i = 0; i < 5; i++)
+ toggle_Centaurus_9211_clock();
+
+ if (flags & PNL_PANELCHIP) {
+ DPanelType = Dorado9211ReadReg(0x430);
+
+ if ((DPanelType & 0xFFFF0000) == 0x92110000) { /* found 9211 */
+ /* check the values for revision ID */
+ if (DPanelType >= 0x92110301)
+ pParam->PanelChip = PNL_9211_C;
+ else if ((DPanelType >= 0x92110101) && (DPanelType < 0x92110301))
+ pParam->PanelChip = PNL_9211_A;
+ else
+ pParam->PanelChip = PNL_UNKNOWN_CHIP;
+ } else { /* no 9211 present */
+ pParam->PanelChip = PNL_UNKNOWN_CHIP;
+ }
+ }
+
+ if ((pParam->PanelChip != PNL_UNKNOWN_CHIP) && (flags & PNL_PANELSTAT)) {
+ unsigned long PanelTypeOrg;
+ unsigned char Panel_2Byte;
+
+ DPanelType = Dorado9211ReadReg(0x438);
+ DPanelType &= 0x00e8e8e8;
+ DPanelType |= 0x00170000;
+ Dorado9211WriteReg(0x438, DPanelType);
+ DPanelType = 0;
+
+ DPanelType = Dorado9211ReadReg(0x434);
+ DPanelType = (DPanelType >> (DRD_LCDRESGPIO1 + 1));
+ PanelTypeOrg = DPanelType >> 8;
+ Panel_2Byte = (unsigned char)PanelTypeOrg;
+ Panel_2Byte =
+ (Panel_2Byte >> (DRD_LCDRESGPIO2 - DRD_LCDRESGPIO1 - 1));
+ DPanelType = (DPanelType | ((unsigned int)Panel_2Byte << 8));
+ DPanelType = DPanelType >> 1;
+ PanelTypeOrg = DPanelType >> 8;
+ Panel_2Byte = (unsigned char)PanelTypeOrg;
+ Panel_2Byte =
+ (Panel_2Byte >> (DRD_LCDRESGPIO3 - DRD_LCDRESGPIO2 - 1));
+ DPanelType = (DPanelType | ((unsigned int)Panel_2Byte << 8));
+ DPanelType = DPanelType >> 1;
+ PanelTypeOrg = DPanelType >> 8;
+ Panel_2Byte = (unsigned char)PanelTypeOrg;
+ Panel_2Byte =
+ (Panel_2Byte >> (DRD_LCDRESGPIO4 - DRD_LCDRESGPIO3 - 1));
+ DPanelType = (DPanelType | ((unsigned int)Panel_2Byte << 8));
+ DPanelType = DPanelType >> 5;
+ DPanelType &= 0xf;
+
+ switch (DPanelType) {
+ case 8:
+ pParam->PanelStat.XRes = 800;
+ pParam->PanelStat.YRes = 600;
+ pParam->PanelStat.Depth = 18;
+ pParam->PanelStat.MonoColor = PNL_COLOR_PANEL;
+ pParam->PanelStat.Type = PNL_TFT;
+ break;
+
+ case 9:
+ pParam->PanelStat.XRes = 640;
+ pParam->PanelStat.YRes = 480;
+ pParam->PanelStat.Depth = 8;
+ pParam->PanelStat.MonoColor = PNL_COLOR_PANEL;
+ pParam->PanelStat.Type = PNL_SSTN;
+ break;
+
+ case 10:
+ pParam->PanelStat.XRes = 1024;
+ pParam->PanelStat.YRes = 768;
+ pParam->PanelStat.Depth = 18;
+ pParam->PanelStat.MonoColor = PNL_COLOR_PANEL;
+ pParam->PanelStat.Type = PNL_TFT;
+ break;
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ case 11:
+ pParam->PanelStat.XRes = 640;
+ pParam->PanelStat.YRes = 480;
+ pParam->PanelStat.Depth = 16;
+ pParam->PanelStat.MonoColor = PNL_COLOR_PANEL;
+ pParam->PanelStat.Type = PNL_DSTN;
+ break;
+ case 12:
+ pParam->PanelStat.XRes = 640;
+ pParam->PanelStat.YRes = 480;
+ pParam->PanelStat.Depth = 18;
+ pParam->PanelStat.MonoColor = PNL_COLOR_PANEL;
+ pParam->PanelStat.Type = PNL_TFT;
+ break;
+ case 13:
+ pParam->PanelStat.XRes = 1024;
+ pParam->PanelStat.YRes = 768;
+ pParam->PanelStat.Depth = 24;
+ pParam->PanelStat.MonoColor = PNL_COLOR_PANEL;
+ pParam->PanelStat.Type = PNL_DSTN;
+ break;
+ case 14:
+ pParam->PanelStat.XRes = 640;
+ pParam->PanelStat.YRes = 480;
+ pParam->PanelStat.Depth = 8;
+ pParam->PanelStat.MonoColor = PNL_MONO_PANEL;
+ pParam->PanelStat.Type = PNL_DSTN;
+ break;
+ case 15:
+ pParam->PanelStat.XRes = 800;
+ pParam->PanelStat.YRes = 600;
+ pParam->PanelStat.Depth = 16;
+ pParam->PanelStat.MonoColor = PNL_COLOR_PANEL;
+ pParam->PanelStat.Type = PNL_DSTN;
+ break;
+ default:
+ break;
+ }
+ }
+ /* if block end */
+}
+
+void
+Dorado9211Init(Pnl_PanelStat * pstat)
+{
+ int mode;
+ unsigned long orig_value, pm_value;
+
+ gfx_delay_milliseconds(100);
+ Dorado9211GpioInit();
+
+ Dorado9211ToggleClock();
+ Dorado9211ToggleClock();
+ Dorado9211ToggleClock();
+ Dorado9211ToggleClock();
+ Dorado9211ToggleClock();
+
+ gfx_delay_milliseconds(100);
+
+ Dorado9211ToggleClock();
+ Dorado9211ToggleClock();
+ Dorado9211ToggleClock();
+ Dorado9211ToggleClock();
+ Dorado9211ToggleClock();
+
+ Dorado9211WriteReg(CS92xx_LCD_PWR_MAN, 0x0);
+
+ gfx_delay_milliseconds(100);
+ gfx_delay_milliseconds(100);
+
+ /* LOOP THROUGH THE AVAILABLE MODES TO FIND A MATCH */
+ for (mode = 0; mode < NUM_92XX_MODES; mode++) {
+ if ((FPModeParams[mode].xres == pstat->XRes) &&
+ (FPModeParams[mode].yres == pstat->YRes) &&
+ (FPModeParams[mode].bpp == pstat->Depth) &&
+ (FPModeParams[mode].panel_type == pstat->Type) &&
+ (FPModeParams[mode].color_type == pstat->MonoColor)) {
+
+ /* SET THE 92xx FOR THE SELECTED MODE */
+ CS92xx_MODE *pMode = &FPModeParams[mode];
+
+ Dorado9211WriteReg(CS92xx_LCD_PAN_TIMING1, pMode->panel_timing1);
+ Dorado9211WriteReg(CS92xx_LCD_PAN_TIMING2, pMode->panel_timing2);
+ Dorado9211WriteReg(CS92xx_LCD_DITH_FR_CNTRL,
+ pMode->rev_C_dither_frc);
+ Dorado9211WriteReg(CS92xx_BLUE_LSFR_SEED, pMode->blue_lsfr_seed);
+ Dorado9211WriteReg(CS92xx_RED_GREEN_LSFR_SEED,
+ pMode->red_green_lsfr_seed);
+ DoradoProgramFRMload();
+ Dorado9211WriteReg(CS92xx_LCD_MEM_CNTRL, pMode->memory_control);
+ Dorado9211WriteReg(CS92xx_LCD_PWR_MAN, pMode->power_management);
+ gfx_delay_milliseconds(100);
+ gfx_delay_milliseconds(100);
+ Dorado9211ClearCS();
+
+ /* This code is added to take care of Panel initialization.
+ * Irrespective of Xpressrom is enabling the panel or not.
+ */
+ orig_value = READ_VID32(0X04);
+ WRITE_VID32(0x04, 0x00200141);
+ gfx_delay_milliseconds(21);
+ pm_value = gfx_ind(0x9030);
+
+ pm_value |= 0x400;
+ gfx_outd(0x9030, pm_value);
+ gfx_delay_milliseconds(4);
+ orig_value &= 0xfff1ffff;
+ WRITE_VID32(0X4, orig_value);
+ return;
+ } /*end if() */
+ } /*end for() */
+
+}
+
+void
+Dorado9211SetCS(void)
+{
+ unsigned long value;
+
+ value = gfx_ind(DRD_CSP9211IN);
+ gfx_outd(DRD_CSP9211OUT, value | DRD_CS9211);
+}
+
+void
+Dorado9211ClearCS(void)
+{
+ unsigned long value;
+
+ value = gfx_ind(DRD_CSP9211IN);
+ gfx_outd(DRD_CSP9211OUT, value & (~DRD_CS9211));
+}
+
+void
+Dorado9211SetDataOut(void)
+{
+ unsigned long value;
+
+ value = gfx_ind(DRD_DATAOUTP9211IN);
+ gfx_outd(DRD_DATAOUTP9211OUT, value | DRD_DATAIN9211);
+}
+
+void
+Dorado9211ClearDataOut(void)
+{
+ unsigned long value;
+
+ value = gfx_ind(DRD_DATAOUTP9211IN);
+ gfx_outd(DRD_DATAOUTP9211OUT, value & (~DRD_DATAIN9211));
+}
+
+unsigned char
+Dorado9211ReadDataIn(void)
+{
+ unsigned char readdata = 0;
+ unsigned long value;
+
+ /* why to read 4 times ??? */
+ value = gfx_ind(DRD_DATAINP9211IN);
+ value = gfx_ind(DRD_DATAINP9211IN);
+ value = gfx_ind(DRD_DATAINP9211IN);
+ value = gfx_ind(DRD_DATAINP9211IN);
+ if (value & DRD_DATAOUT9211)
+ readdata = 1;
+ return (readdata);
+}
+
+void
+Dorado9211ToggleClock(void)
+{
+ Dorado9211SetClock();
+ Dorado9211ClearClock();
+}
+
+void
+Dorado9211SetClock(void)
+{
+ unsigned long value;
+
+ value = gfx_ind(DRD_CLOCKP9211IN);
+ gfx_outd(DRD_CLOCKP9211OUT, value | DRD_CLOCK9211);
+}
+
+void
+Dorado9211ClearClock(void)
+{
+ unsigned long value;
+
+ value = gfx_ind(DRD_CLOCKP9211IN);
+ gfx_outd(DRD_CLOCKP9211OUT, value & (~DRD_CLOCK9211));
+}
+
+void
+Dorado9211GpioInit(void)
+{
+ unsigned long value;
+
+ /* set output enable on gpio 7, 9, 11 */
+ gfx_outd((DRD_GEODE_GPIO_BASE + DRD_GEODE_GPPIN_SEL), DRD_CLOCK9211CFG);
+ gfx_outd((DRD_GEODE_GPIO_BASE + DRD_GEODE_GPPIN_CFG), 3);
+ /* set output enable on gpio 7, 9, 11 */
+ gfx_outd((DRD_GEODE_GPIO_BASE + DRD_GEODE_GPPIN_SEL), DRD_CS9211CFG);
+ gfx_outd((DRD_GEODE_GPIO_BASE + DRD_GEODE_GPPIN_CFG), 3);
+ /* set output enable on gpio 7, 9, 18 */
+ gfx_outd((DRD_GEODE_GPIO_BASE + DRD_GEODE_GPPIN_SEL), DRD_DATAIN9211CFG);
+ gfx_outd((DRD_GEODE_GPIO_BASE + DRD_GEODE_GPPIN_CFG), 3);
+ /* disable on gpio 11 - This is the output from the 9211 */
+ gfx_outd((DRD_GEODE_GPIO_BASE + DRD_GEODE_GPPIN_SEL), DRD_DATAOUT9211CFG);
+ gfx_outd((DRD_GEODE_GPIO_BASE + DRD_GEODE_GPPIN_CFG), 0);
+ /* Set all PINS low */
+ value = gfx_ind(DRD_GEODE_GPIO_BASE + DRD_GEODE_GPDI0);
+ value &= ~(DRD_CS9211 | DRD_CLOCK9211 | DRD_DATAIN9211);
+ gfx_outd((DRD_GEODE_GPIO_BASE + DRD_GEODE_GPDO0), value);
+}
+
+unsigned long
+Dorado9211ReadReg(unsigned short index)
+{
+
+ unsigned char i, readbit;
+ unsigned long data;
+
+ Dorado9211ClearDataOut();
+
+ Dorado9211SetCS();
+ Dorado9211ToggleClock();
+
+ Dorado9211SetDataOut();
+ Dorado9211ToggleClock();
+
+ for (i = 0; i < 12; i++) {
+ if (index & 0x1) {
+ Dorado9211SetDataOut();
+ } else {
+ Dorado9211ClearDataOut();
+ }
+ Dorado9211ToggleClock();
+ index >>= 1;
+ }
+
+ Dorado9211ClearDataOut();
+ Dorado9211ToggleClock();
+
+ /* Idle clock, 7 clocks, no data set */
+
+ Dorado9211ToggleClock();
+ Dorado9211ToggleClock();
+ Dorado9211ToggleClock();
+ Dorado9211ToggleClock();
+ Dorado9211ToggleClock();
+ Dorado9211ToggleClock();
+ Dorado9211ToggleClock();
+
+ data = 0;
+ for (i = 0; i < 32; i++) {
+ Dorado9211ToggleClock();
+ readbit = Dorado9211ReadDataIn();
+ data |= (((unsigned long)readbit) << i);
+ }
+
+ Dorado9211ClearCS();
+ Dorado9211ToggleClock();
+ return (data);
+
+}
+
+void
+Dorado9211WriteReg(unsigned short index, unsigned long data)
+{
+
+ unsigned char i;
+
+ Dorado9211ClearDataOut();
+ Dorado9211SetDataOut();
+ Dorado9211SetCS();
+ Dorado9211ToggleClock();
+ Dorado9211SetDataOut();
+ Dorado9211ToggleClock();
+
+ for (i = 0; i < 12; i++) {
+ if (index & 0x1) {
+ Dorado9211SetDataOut();
+ } else {
+ Dorado9211ClearDataOut();
+ }
+ Dorado9211ToggleClock();
+ index >>= 1;
+ }
+
+ Dorado9211SetDataOut();
+ Dorado9211ToggleClock();
+
+ for (i = 0; i < 32; i++) {
+ if (data & 0x1) {
+ Dorado9211SetDataOut();
+ } else {
+ Dorado9211ClearDataOut();
+ }
+ Dorado9211ToggleClock();
+ data >>= 1;
+ }
+
+ Dorado9211ClearCS();
+
+ Dorado9211ToggleClock();
+ Dorado9211ToggleClock();
+ Dorado9211ToggleClock();
+ Dorado9211ToggleClock();
+}
+
+void
+DoradoProgramFRMload(void)
+{
+ unsigned long DoradoFRMtable[] = {
+
+ 0x00000000,
+ 0x00000000,
+ 0x01000100,
+ 0x01000100,
+ 0x01010101,
+ 0x01010101,
+ 0x02081041,
+ 0x02081041,
+ 0x10111111,
+ 0x11111101,
+ 0x49249241,
+ 0x12412492,
+ 0x92244891,
+ 0x92244891,
+ 0x22252525,
+ 0x22252525,
+ 0x528294a5,
+ 0x2528494a,
+ 0x294a5295,
+ 0x294a5295,
+ 0x54a54a95,
+ 0x2952a52a,
+ 0x2a552a55,
+ 0x2a552a55,
+ 0x554aa955,
+ 0x2a9552aa,
+ 0x2aaa5555,
+ 0x2aaa5555,
+ 0x55555555,
+ 0x2aaaaaaa,
+ 0x55555555,
+ 0x55555555,
+ 0xaaaaaaab,
+ 0x55555555,
+ 0x5555aaab,
+ 0x5555aaab,
+ 0xaab556ab,
+ 0x556aad55,
+ 0x55ab55ab,
+ 0x55ab55ab,
+ 0xab5ab56b,
+ 0x56ad5ad5,
+ 0x56b5ad6b,
+ 0x56b5ad6b,
+ 0xad6d6b5b,
+ 0x5ad6b6b6,
+ 0x5b5b5b5b,
+ 0x5b5b5b5b,
+ 0x5F6db6db,
+ 0x5F6db6db,
+ 0xF776F776,
+ 0xF776F776,
+ 0xFBDEFBDE,
+ 0xFBDEFBDE,
+ 0x7eFFBFF7,
+ 0x7eFFBFF7,
+ 0xFF7FF7F7,
+ 0xFF7FF7F7,
+ 0xFF7FFF7F,
+ 0xFF7FFF7F,
+ 0xFFF7FFFF,
+ 0xFFF7FFFF,
+ 0xFFFFFFFF,
+ 0xFFFFFFFF,
+ };
+
+ unsigned char i;
+ unsigned short index;
+ unsigned long data;
+
+ Dorado9211WriteReg(CS92xx_FRM_MEMORY_INDEX, 0);
+ index = CS92xx_FRM_MEMORY_DATA;
+ for (i = 0; i < 64; i += 2) {
+ data = DoradoFRMtable[i];
+ Dorado9211WriteReg(index, data);
+ data = DoradoFRMtable[i + 1];
+ Dorado9211WriteReg(index, data);
+ }
+
+/*
+ * The first FRM location (64 bits) does not program correctly.
+ * This location always reads back with the last value programmed.
+ * ie. If 32 64-bit values are programmed, location 0 reads back as the 32nd
+ * If 30 locations are programmed, location 0 reads back as the 30th, etc.
+ * Fix this by re-writing location 0 after programming all 64 in the writeFRM
+ * loop in RevCFrmload() in CS9211.
+ */
+
+ Dorado9211WriteReg(CS92xx_FRM_MEMORY_INDEX, 0);
+ Dorado9211WriteReg(CS92xx_FRM_MEMORY_DATA, 0);
+ Dorado9211WriteReg(CS92xx_FRM_MEMORY_DATA, 0);
+
+}
+
+/*****************************************************************************
+ * void Dorado_Enable_Power((void);
+ * Enables the power of the CX9211 on Dorado board.
+ *****************************************************************************
+ */
+
+void
+Dorado_Power_Up(void)
+{
+ Dorado9211WriteReg(CS92xx_LCD_PWR_MAN, 0x01000000);
+ return;
+
+} /* disable_Centaurus_Power */
+
+/*****************************************************************************
+ * void Dorado_Disable_Power((void);
+ * Disables the power of the CX9211 on Dorado board.
+ *****************************************************************************
+ */
+
+void
+Dorado_Power_Down(void)
+{
+ Dorado9211WriteReg(CS92xx_LCD_PWR_MAN, 0x0);
+ return;
+
+} /* disable_Centaurus_Power */
+
+void
+Dorado_Save_Panel_State(void)
+{
+
+ /* set 9211 registers using the desired panel settings */
+ cs9211_regs.panel_timing1 = Dorado9211ReadReg(CS92xx_LCD_PAN_TIMING1);
+ cs9211_regs.panel_timing2 = Dorado9211ReadReg(CS92xx_LCD_PAN_TIMING2);
+
+ cs9211_regs.dither_frc_ctrl = Dorado9211ReadReg(CS92xx_LCD_DITH_FR_CNTRL);
+ cs9211_regs.blue_lsfr_seed = Dorado9211ReadReg(CS92xx_BLUE_LSFR_SEED);
+ cs9211_regs.red_green_lsfr_seed =
+ Dorado9211ReadReg(CS92xx_RED_GREEN_LSFR_SEED);
+
+ /* CentaurusProgramFRMload(); */
+ cs9211_regs.memory_control = Dorado9211ReadReg(CS92xx_LCD_MEM_CNTRL);
+
+ /* Set the power register last. This will turn the panel on at the 9211 */
+ cs9211_regs.power_management = Dorado9211ReadReg(CS92xx_LCD_PWR_MAN);
+ cs9211_regs.panel_state = cs9211_regs.power_management;
+}
+
+void
+Dorado_Restore_Panel_State(void)
+{
+ unsigned long off_data = 0;
+
+ /* Before restoring the 9211 registers, power off the 9211. */
+
+ Dorado9211WriteReg(CS92xx_LCD_PWR_MAN, off_data);
+
+ /* set 9211 registers using the desired panel settings */
+ Dorado9211WriteReg(CS92xx_LCD_PAN_TIMING1, cs9211_regs.panel_timing1);
+ Dorado9211WriteReg(CS92xx_LCD_PAN_TIMING2, cs9211_regs.panel_timing2);
+ /* load the LSFR seeds */
+ Dorado9211WriteReg(CS92xx_LCD_DITH_FR_CNTRL, cs9211_regs.dither_frc_ctrl);
+ Dorado9211WriteReg(CS92xx_BLUE_LSFR_SEED, cs9211_regs.blue_lsfr_seed);
+ Dorado9211WriteReg(CS92xx_RED_GREEN_LSFR_SEED,
+ cs9211_regs.red_green_lsfr_seed);
+
+ Dorado9211WriteReg(CS92xx_LCD_MEM_CNTRL, cs9211_regs.memory_control);
+ /* Set the power register last. This will turn the panel on at the 9211 */
+ Dorado9211WriteReg(CS92xx_LCD_PWR_MAN, cs9211_regs.power_management);
+}
diff --git a/src/panel/dora9211.h b/src/panel/dora9211.h
new file mode 100644
index 0000000..d38b503
--- /dev/null
+++ b/src/panel/dora9211.h
@@ -0,0 +1,100 @@
+/* Copyright (c) 2005 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Neither the name of the Advanced Micro Devices, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ * */
+
+/*
+ * File Contents: This header file defines the Durango routines and
+ * variables used to access the memory mapped regions.
+ *
+ * SubModule: Geode FlatPanel library
+ * */
+
+#include "panel.h"
+#include "92xx.h"
+
+#ifndef _DORA9211_h
+#define _DORA9211_h
+
+/* 9211 Rev.C3 Dorado */
+
+/* GPIO Pin Configuration Registers */
+
+#define DRD_GEODE_GPPIN_SEL 0x20 /* GPIO Pin Configuration Select */
+#define DRD_GEODE_GPPIN_CFG 0x24 /* GPIO Pin Configuration Access */
+#define DRD_GEODE_GPPIN_RESET 0x28 /* GPIO Pin Reset */
+
+#define DRD_GEODE_GPIO_BASE 0x6400 /* F0 GPIO, IO mapped */
+#define DRD_GEODE_GPDI0 0x04 /* GPIO Data In 0 */
+#define DRD_GEODE_GPDO0 0x00 /* GPIO Data Out 0 */
+
+/* Data Ports in */
+#define DRD_CLOCKP9211IN DRD_GEODE_GPIO_BASE + DRD_GEODE_GPDI0
+#define DRD_DATAINP9211IN DRD_GEODE_GPIO_BASE + DRD_GEODE_GPDI0
+#define DRD_DATAOUTP9211IN DRD_GEODE_GPIO_BASE + DRD_GEODE_GPDI0
+#define DRD_CSP9211IN DRD_GEODE_GPIO_BASE + DRD_GEODE_GPDI0
+
+/* Data Ports out */
+#define DRD_CLOCKP9211OUT DRD_GEODE_GPIO_BASE + DRD_GEODE_GPDO0
+#define DRD_DATAINP9211OUT DRD_GEODE_GPIO_BASE + DRD_GEODE_GPDO0
+#define DRD_DATAOUTP9211OUT DRD_GEODE_GPIO_BASE + DRD_GEODE_GPDO0
+#define DRD_CSP9211OUT DRD_GEODE_GPIO_BASE + DRD_GEODE_GPDO0
+
+/* Pin MASKS */
+#define DRD_CLOCK9211 0x00000080 /* gpio 7, clock output to 9211 */
+#define DRD_DATAIN9211 0x00040000 /* gpio 18, data output to 9211 */
+#define DRD_DATAOUT9211 0x00000800 /* gpio 11, data input from 9211 */
+#define DRD_CS9211 0x00000200 /* gpio 9, chip select output to 9211
+ * */
+
+/* Gpio CFG values to select in */
+#define DRD_CLOCK9211CFG 0x00000007 /* gpio 7 */
+#define DRD_DATAIN9211CFG 0x00000012 /* gpio 18 */
+#define DRD_DATAOUT9211CFG 0x0000000B /* gpio 11 */
+#define DRD_CS9211CFG 0x00000009 /* gpio 9 */
+
+#define DRD_LCDRESGPIO1 0x00
+#define DRD_LCDRESGPIO2 0x01
+#define DRD_LCDRESGPIO3 0x02
+#define DRD_LCDRESGPIO4 0x04
+
+void Dorado9211SetCS(void);
+void Dorado9211ClearCS(void);
+void Dorado9211SetDataOut(void);
+void Dorado9211ClearDataOut(void);
+unsigned char Dorado9211ReadDataIn(void);
+void Dorado9211ToggleClock(void);
+void Dorado9211SetClock(void);
+void Dorado9211ClearClock(void);
+void Dorado9211GpioInit(void);
+unsigned long Dorado9211ReadReg(unsigned short index);
+void Dorado9211WriteReg(unsigned short index, unsigned long data);
+void DoradoProgramFRMload(void);
+void Dorado_Get_9211_Details(unsigned long flags, Pnl_PanelParams * pParam);
+void Dorado_Power_Up(void);
+void Dorado_Power_Down(void);
+void Dorado_Save_Panel_State(void);
+void Dorado_Restore_Panel_State(void);
+void Dorado9211Init(Pnl_PanelStat * pstat);
+
+#endif /* !_DORA9211_h */
diff --git a/src/panel/drac9210.c b/src/panel/drac9210.c
new file mode 100644
index 0000000..ce8b4a0
--- /dev/null
+++ b/src/panel/drac9210.c
@@ -0,0 +1,652 @@
+/* Copyright (c) 2005 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Neither the name of the Advanced Micro Devices, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ * */
+
+/*
+ * File Contents: This file contains the panel library files to the
+ * platforms with 9210, and 9211 support.
+ *
+ * SubModule: Geode FlatPanel library
+ * */
+
+#include "drac9210.h"
+
+#define CS9210 0x40 /* Chip select pin */
+
+/* 9210 on Draco */
+#define CLOCK9210 0x04 /* Clock pin */
+#define DATAIN9210 0x20 /* Data from 9210 */
+#define DATAOUT9210 0x80 /* Data to 9210 */
+
+static void DracoWriteData(unsigned char data);
+static void DracoReadData(unsigned char *data);
+static void Draco9210GpioInit();
+static void Draco9210SetCS(void);
+static unsigned char Draco9210ReadReg(unsigned char index);
+static void Draco9210WriteReg(unsigned char index, unsigned char data);
+static void Draco9210ClearCS(void);
+static void Draco9210SetDataOut(void);
+static void Draco9210ClearDataOut(void);
+static unsigned char Draco9210ReadDataIn(void);
+static void Draco9210ToggleClock(void);
+
+void
+Draco9210Init(Pnl_PanelStat * pstat)
+{
+ unsigned char panelvalues[] = {
+ 0x2, 0x80,
+ 0x2, 0x24,
+ 0x03, 0x00,
+ 0xc0, 0x00,
+ 0xc1, 0x00,
+ 0xc2, 0x00,
+ 0xc3, 0x00,
+ 0xc4, 0x00,
+ 0xc5, 0x01,
+ 0xc6, 0xff,
+ 0xc7, 0xff,
+ 0xc8, 0x3,
+ 0xc9, 0xfe,
+ 0xca, 0x0,
+ 0xcb, 0x3f,
+ 0xcc, 0xc,
+ 0xcd, 0x1,
+ 0xce, 0xff,
+ 0xcf, 0xc1,
+ 0xd0, 0x0,
+ 0xd1, 0x7e,
+ 0xd2, 0x3,
+ 0xd3, 0xfe,
+ 0xd4, 0x3,
+ 0xd5, 0x81,
+ 0xd6, 0xfc,
+ 0xd7, 0x3f,
+ 0xd8, 0x14,
+ 0xd9, 0x1e,
+ 0xda, 0x0f,
+ 0xdb, 0xc7,
+ 0xdc, 0x29,
+ 0xdd, 0xe1,
+ 0xde, 0xf1,
+ 0xdf, 0xf9,
+ 0xe0, 0x2,
+ 0xe1, 0xe,
+ 0xe2, 0x1e,
+ 0xe3, 0x3e,
+ 0xe4, 0x04,
+ 0xe5, 0x71,
+ 0xe6, 0xe3,
+ 0xe7, 0xcf,
+ 0xe8, 0x1,
+ 0xe9, 0x86,
+ 0xea, 0x3c,
+ 0xeb, 0xf3,
+ 0xec, 0xa,
+ 0xed, 0x39,
+ 0xee, 0xc7,
+ 0xef, 0x3d,
+
+ 0xf0, 0x14,
+ 0xf1, 0xc6,
+ 0xf2, 0x39,
+ 0xf3, 0xce,
+ 0xf4, 0x3,
+ 0xf5, 0x19,
+ 0xf6, 0xce,
+ 0xf7, 0x77,
+ 0xf8, 0x0,
+ 0xf9, 0x66,
+ 0xfa, 0x33,
+ 0xfb, 0xbb,
+ 0xfc, 0x2d,
+ 0xfd, 0x99,
+ 0xfe, 0xdd,
+ 0xff, 0xdd,
+
+ 0x3, 0x1,
+ 0xc0, 0x2,
+ 0xc1, 0x22,
+ 0xc2, 0x66,
+ 0xc3, 0x66,
+ 0xc4, 0x0,
+ 0xc5, 0xcd,
+ 0xc6, 0x99,
+ 0xc7, 0xbb,
+ 0xc8, 0x5,
+ 0xc9, 0x32,
+ 0xca, 0x66,
+ 0xcb, 0xdd,
+ 0xcc, 0x1a,
+ 0xcd, 0x4d,
+ 0xce, 0x9b,
+ 0xcf, 0x6f,
+ 0xd0, 0x0,
+ 0xd1, 0x92,
+ 0xd2, 0x6d,
+ 0xd3, 0xb6,
+ 0xd4, 0x5,
+ 0xd5, 0x25,
+ 0xd6, 0xb6,
+ 0xd7, 0xdb,
+ 0xd8, 0x2,
+ 0xd9, 0x5a,
+ 0xda, 0x4b,
+ 0xdb, 0x6d,
+ 0xdc, 0x29,
+ 0xdd, 0xa5,
+ 0xde, 0xb5,
+ 0xdf, 0xb7,
+ 0xe0, 0x4,
+ 0xe1, 0x4a,
+ 0xe2, 0x5a,
+ 0xe3, 0xda,
+ 0xe4, 0x12,
+ 0xe5, 0x95,
+ 0xe6, 0xad,
+ 0xe7, 0x6f,
+ 0xe8, 0x1,
+ 0xe9, 0x2a,
+ 0xea, 0x56,
+ 0xeb, 0xb5,
+ 0xec, 0xe,
+ 0xed, 0x55,
+ 0xee, 0xab,
+ 0xef, 0x5f,
+ 0xf0, 0x0,
+ 0xf1, 0xaa,
+ 0xf2, 0x55,
+ 0xf3, 0xea,
+ 0xf4, 0x1,
+ 0xf5, 0x55,
+ 0xf6, 0xaa,
+ 0xf7, 0xbf,
+ 0xf8, 0x6,
+ 0xf9, 0xaa,
+ 0xfa, 0x55,
+ 0xfb, 0x55,
+ 0xfc, 0x39,
+ 0xfd, 0x55,
+ 0xfe, 0xff,
+ 0xff, 0xff,
+
+ 0x3, 0x2,
+ 0xc0, 0x0,
+ 0xc1, 0x0,
+ 0xc2, 0xaa,
+ 0xc3, 0xaa,
+ 0xc4, 0x6,
+ 0xc5, 0xab,
+ 0xc6, 0x55,
+ 0xc7, 0x55,
+ 0xc8, 0x01,
+ 0xc9, 0x54,
+ 0xca, 0xaa,
+ 0xcb, 0xbf,
+ 0xcc, 0x8,
+ 0xcd, 0xab,
+ 0xce, 0x55,
+ 0xcf, 0xeb,
+ 0xd0, 0x6,
+ 0xd1, 0x54,
+ 0xd2, 0xab,
+ 0xd3, 0x5e,
+ 0xd4, 0x1,
+ 0xd5, 0x2b,
+ 0xd6, 0x56,
+ 0xd7, 0xb5,
+ 0xd8, 0x12,
+ 0xd9, 0x94,
+ 0xda, 0xad,
+ 0xdb, 0x6f,
+ 0xdc, 0x2d,
+ 0xdd, 0x4b,
+ 0xde, 0x5b,
+ 0xdf, 0xdb,
+ 0xe0, 0x0,
+ 0xe1, 0xa4,
+ 0xe2, 0xb4,
+ 0xe3, 0xb6,
+ 0xe4, 0x2,
+ 0xe5, 0x5b,
+ 0xe6, 0x4b,
+ 0xe7, 0x6d,
+ 0xe8, 0x5,
+ 0xe9, 0x24,
+ 0xea, 0xb6,
+ 0xeb, 0xdb,
+ 0xec, 0x8,
+ 0xed, 0x93,
+ 0xee, 0x6d,
+ 0xef, 0xb7,
+ 0xf0, 0x12,
+ 0xf1, 0x4c,
+ 0xf2, 0x9b,
+ 0xf3, 0x6e,
+ 0xf4, 0x5,
+ 0xf5, 0x33,
+ 0xf6, 0x66,
+ 0xf7, 0xdd,
+ 0xf8, 0x0,
+ 0xf9, 0xcc,
+ 0xfa, 0x99,
+ 0xfb, 0xbb,
+ 0xfc, 0x2b,
+ 0xfd, 0x33,
+ 0xfe, 0x77,
+ 0xff, 0x77,
+
+ 0x3, 0x3,
+ 0xc0, 0x4,
+ 0xc1, 0x88,
+ 0xc2, 0xcc,
+ 0xc3, 0xcc,
+ 0xc4, 0x0,
+ 0xc5, 0x67,
+ 0xc6, 0x33,
+ 0xc7, 0xbb,
+ 0xc8, 0x3,
+ 0xc9, 0x18,
+ 0xca, 0xce,
+ 0xcb, 0x77,
+ 0xcc, 0x1c,
+ 0xcd, 0xc7,
+ 0xce, 0x39,
+ 0xcf, 0xcf,
+
+ 0xd0, 0x2,
+ 0xd1, 0x38,
+ 0xd2, 0xc7,
+ 0xd3, 0x3c,
+ 0xd4, 0x1,
+ 0xd5, 0x87,
+ 0xd6, 0x3c,
+ 0xd7, 0xf3,
+ 0xd8, 0x4,
+ 0xd9, 0x70,
+ 0xda, 0xe3,
+ 0xdb, 0xcf,
+ 0xdc, 0x2b,
+ 0xdd, 0xf,
+ 0xde, 0x1f,
+ 0xdf, 0x3f,
+ 0xe0, 0x00,
+ 0xe1, 0xe0,
+ 0xe2, 0xf0,
+ 0xe3, 0xf8,
+ 0xe4, 0x14,
+ 0xe5, 0x1f,
+ 0xe6, 0xf,
+ 0xe7, 0xc7,
+ 0xe8, 0x3,
+ 0xe9, 0x80,
+ 0xea, 0xfc,
+ 0xeb, 0x3f,
+ 0xec, 0x8,
+ 0xed, 0x7f,
+ 0xee, 0x3,
+ 0xef, 0xff,
+ 0xf0, 0x4,
+ 0xf1, 0x0,
+ 0xf2, 0xff,
+ 0xf3, 0xc0,
+ 0xf4, 0x3,
+ 0xf5, 0xff,
+ 0xf6, 0x0,
+ 0xf7, 0x3f,
+ 0xf8, 0x0,
+ 0xf9, 0x0,
+ 0xfa, 0xff,
+ 0xfb, 0xff,
+ 0xfc, 0x3f,
+ 0xfd, 0xff,
+ 0xfe, 0xff,
+ 0xff, 0xff,
+ 0x3, 0x4,
+
+ /* Setup the Diter to Pattern33 */
+ 0x80, 0xdd,
+ 0x81, 0xdd,
+ 0x82, 0x33,
+ 0x83, 0x33,
+ 0x84, 0xdd,
+ 0x85, 0xdd,
+ 0x86, 0x33,
+ 0x87, 0x33,
+ 0x88, 0x33,
+ 0x89, 0x33,
+ 0x8a, 0x77,
+ 0x8b, 0x77,
+ 0x8c, 0x33,
+ 0x8d, 0x33,
+ 0x8e, 0x77,
+ 0x8f, 0x77,
+ 0x90, 0xdd,
+ 0x91, 0xdd,
+ 0x92, 0x33,
+ 0x93, 0x33,
+ 0x94, 0xdd,
+ 0x95, 0xdd,
+ 0x96, 0x33,
+ 0x97, 0x33,
+ 0x98, 0x33,
+ 0x99, 0x33,
+ 0x9a, 0x77,
+ 0x9b, 0x77,
+ 0x9c, 0x33,
+ 0x9d, 0x33,
+ 0x9e, 0x77,
+ 0x9f, 0x77,
+
+ 0x4, 0x20,
+ 0x5, 0x3,
+ 0x6, 0x56,
+ 0x7, 0x2,
+ 0x8, 0x1c,
+ 0x9, 0x0,
+ 0xa, 0x26,
+ 0xb, 0x0,
+ 0xc, 0x15,
+ 0xd, 0x4,
+ 0xe, 0x50,
+ 0xf, 0x4,
+ 0x10, 0xfa,
+ 0x11, 0x0,
+ 0x12, 0xc8,
+ 0x13, 0x0,
+ 0x14, 0x31,
+ 0x15, 0x23,
+ 0x16, 0x0,
+
+ /* Enable DSTN panel */
+ 0x2, 0x64
+ };
+ unsigned char index, data;
+ int i;
+
+ gfx_delay_milliseconds(100);
+ Draco9210GpioInit();
+ Draco9210SetCS();
+ Draco9210ToggleClock();
+ Draco9210ToggleClock();
+ Draco9210ToggleClock();
+ Draco9210ToggleClock();
+ Draco9210ClearCS();
+
+#if defined(_WIN32) /* For Windows */
+ for (i = 0; i < 10; i++) {
+ _asm {
+ out 0ED h, al}
+ }
+
+#elif defined(linux) /* Linux */
+
+#endif
+
+ for (i = 0; i < 630; i += 2) {
+ index = panelvalues[i];
+ data = panelvalues[i + 1];
+ Draco9210WriteReg(index, data);
+ }
+
+}
+
+static void
+DracoWriteData(unsigned char data)
+{
+ int i;
+ unsigned char mask = 0x80, databit;
+
+ for (i = 0; i < 8; i++) {
+
+ databit = data & mask;
+ if (data & mask) {
+ Draco9210SetDataOut();
+ } else {
+ Draco9210ClearDataOut();
+ }
+ mask >>= 1;
+ Draco9210ToggleClock();
+ }
+}
+
+static void
+DracoReadData(unsigned char *data)
+{
+ int i;
+ unsigned char tmp = 0, readbit;
+
+ Draco9210ClearDataOut();
+ Draco9210ToggleClock();
+ for (i = 0; i < 7; i++) {
+ readbit = Draco9210ReadDataIn();
+ tmp |= (readbit & 0x1);
+ tmp <<= 1;
+ Draco9210ToggleClock();
+ }
+ readbit = Draco9210ReadDataIn();
+ tmp |= (readbit & 0x1);
+ *data = tmp;
+}
+
+#if defined(_WIN32) /* For Windows */
+
+void
+Draco9210GpioInit()
+{
+ _asm {
+ pushf
+ cli
+ mov dx, 0 CF8h
+ mov eax, CX55x0_ID + 090 h
+ out dx, eax
+ mov dx, 0 CFCh mov al, 0 CFh mov ah, 00 h out dx, ax popf}
+}
+
+void
+Draco9210SetCS()
+{
+ _asm {
+ pushf;
+ Point to PCI address register mov dx, 0 CF8h;
+ 55 XX GPIO data register mov eax, CX55x0_ID + 090 h out dx, eax;
+ Point to PCI data register (CFCh)
+ mov dx, 0 CFCh
+ in ax, dx
+ and ah, 30 h
+ mov ah, c92DataReg
+ or ah, CS9210 mov c92DataReg, ah out dx, ax popf}
+}
+
+void
+Draco9210ClearCS()
+{
+ _asm {
+ pushf;
+ Point to PCI address register mov dx, 0 CF8h;
+ 55 XX GPIO data register mov eax, CX55x0_ID + 090 h out dx, eax;
+ Point to PCI data register (CFCh)
+ mov dx, 0 CFCh;
+ Set CS LOW
+ in ax, dx
+ mov ah, c92DataReg
+ and ah, NOT CS9210 mov c92DataReg, ah out dx, ax popf}
+}
+
+void
+Draco9210SetDataOut()
+{
+ _asm {
+ pushf;
+ Point to PCI address register mov dx, 0 CF8h;
+ 55 XX GPIO data register mov eax, CX55x0_ID + 090 h out dx, eax;
+ Point to PCI data register (CFCh)
+ mov dx, 0 CFCh;
+ Set DATA HIGH
+ in ax, dx
+ mov ah, c92DataReg
+ or ah, DATAOUT9210 mov c92DataReg, ah out dx, ax popf}
+}
+
+void
+Draco9210ClearDataOut()
+{
+ _asm {
+ pushf;
+ Point to PCI address register
+ mov dx, 0 CF8h mov eax, CX55x0_ID + 090 h;
+ ;
+ 55 XX GPIO data register out dx, eax;
+ Point to PCI data register (CFCh)
+ mov dx, 0 CFCh;
+ Set Data LOW
+ in ax, dx
+ mov ah, c92DataReg
+ and ah, NOT DATAOUT9210 mov c92DataReg, ah out dx, ax popf}
+}
+
+unsigned char
+Draco9210ReadDataIn()
+{
+ unsigned char readdata;
+
+ _asm {
+ pushf;
+ Point to PCI address register mov dx, 0 CF8h;
+ 55 XX GPIO data register mov eax, CX55x0_ID + 090 h out dx, eax;
+ Point to PCI data register (CFCh)
+ mov dx, 0F Ch in ax, dx;
+ Preserve just Data IN bit and ah, DATAIN9210 mov al, ah cmp al, 0;
+ Is it LOW ? je readDataLow;
+ must be HIGH mov al, 1 readDataLow:mov readdata, al popf}
+ return (readdata);
+}
+
+void
+Draco9210ToggleClock()
+{
+ _asm {
+ pushf;
+ Point to PCI address register mov dx, 0 CF8h;
+ 55 XX GPIO data register mov eax, CX55x0_ID + 090 h;
+ Point to PCI data register (CFCh)
+ out dx, eax mov dx, 0 CFCh;
+ SET CLOCK in ax, dx mov ah, c92DataReg or ah, CLOCK9210 mov c92DataReg, ah out dx, ax out 0ED h, al /* IOPAUSE */
+ ;
+ Point to PCI address register mov dx, 0 CF8h;
+ 55 XX GPIO data register mov eax, CX55x0_ID + 090 h out dx, eax;
+ Point to PCI data register (CFCh)
+ mov dx, 0 CFCh;
+
+ ;
+ CLEAR CLOCK
+ in ax, dx
+ mov ah, c92DataReg
+ and ah, NOT CLOCK9210 mov c92DataReg, ah out dx, ax popf}
+}
+
+#elif defined(linux) /* Linux */
+
+void
+Draco9210GpioInit()
+{
+}
+void
+Draco9210SetCS()
+{
+}
+void
+Draco9210ClearCS()
+{
+}
+void
+Draco9210SetDataOut()
+{
+}
+void
+Draco9210ClearDataOut()
+{
+}
+unsigned char
+Draco9210ReadDataIn()
+{
+}
+void
+Draco9210ToggleClock()
+{
+}
+
+#endif
+
+unsigned char
+Draco9210ReadReg(unsigned char index)
+{
+ unsigned char data;
+
+ Draco9210SetCS();
+ Draco9210ToggleClock();
+ Draco9210SetDataOut();
+ Draco9210ToggleClock();
+ Draco9210ClearDataOut();
+ Draco9210ToggleClock();
+ Draco9210ClearDataOut();
+ Draco9210ToggleClock();
+ Draco9210ClearDataOut();
+ Draco9210ToggleClock();
+
+ DracoWriteData(index);
+ DracoReadData(&data);
+
+ return (data);
+}
+
+void
+Draco9210WriteReg(unsigned char index, unsigned char data)
+{
+
+ Draco9210SetCS();
+ Draco9210ToggleClock();
+
+ Draco9210SetDataOut();
+ Draco9210ToggleClock();
+
+ Draco9210ClearDataOut();
+ Draco9210ToggleClock();
+
+ Draco9210ClearDataOut();
+ Draco9210ToggleClock();
+
+ Draco9210SetDataOut();
+ Draco9210ToggleClock();
+
+ DracoWriteData(index);
+ DracoWriteData(data);
+
+ Draco9210ClearDataOut();
+ Draco9210ToggleClock();
+
+ Draco9210ClearCS();
+ Draco9210ToggleClock();
+ Draco9210ToggleClock();
+
+}
diff --git a/src/panel/drac9210.h b/src/panel/drac9210.h
new file mode 100644
index 0000000..1939fd6
--- /dev/null
+++ b/src/panel/drac9210.h
@@ -0,0 +1,41 @@
+/* Copyright (c) 2005 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Neither the name of the Advanced Micro Devices, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ * */
+
+/*
+ * File Contents: This file contains the panel header file and definition
+ * for the platform with 9210 support.
+ *
+ * SubModule: Geode FlatPanel library
+ * */
+
+#include "panel.h"
+
+#ifndef _DRAC9210_h
+#define _DRAC9210_h
+#define CX55x0_ID 0x80009000
+static unsigned char c92DataReg = 0;
+#endif /* !_DRAC9210_h */
+
+/* END OF FILE */
diff --git a/src/panel/gx2_9211.c b/src/panel/gx2_9211.c
new file mode 100644
index 0000000..a60264d
--- /dev/null
+++ b/src/panel/gx2_9211.c
@@ -0,0 +1,292 @@
+/* Copyright (c) 2005 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Neither the name of the Advanced Micro Devices, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ * */
+
+/*
+ * File Contents: This file contains the panel library files to the
+ * GX2 platforms with 9211 support.
+ *
+ * SubModule: Geode FlatPanel library
+ * */
+
+#include "92xx.h"
+#include "gx2_9211.h"
+#include "pnl_defs.h"
+
+#if defined(_WIN32) /* windows */
+#include "gfx_defs.h"
+
+extern DEV_STATUS gfx_msr_read(unsigned int device, unsigned int msrRegister,
+ Q_WORD * msrValue);
+extern DEV_STATUS gfx_msr_write(unsigned int device, unsigned int msrRegister,
+ Q_WORD * msrValue);
+#endif
+
+static unsigned long FPBaseAddr;
+
+void
+SetFPBaseAddr(unsigned long addr)
+{
+
+ FPBaseAddr = addr;
+}
+
+/****************************************************************************
+ * protected_mode_access( unsigned long mode, unsigned long width,
+ * unsigned long addr, unsigned char* pdata )
+ * This function provides access to physical memory at the requested address.
+ *
+ * mode is:
+ * GX2_READ or GX2_WRITE (accesses a single byte, word or double word
+ * depending on the value of "width". Only 1, 2 or 4 supported).
+ * READ_BYTES, WRITE_BYTES accesses "width" number of bytes (8 bits)
+ * READ_WORDS, WRITE_WORDS accesses "width" number of words (16 bits)
+ * READ_DWORDS, WRITE_DWORDS accesses "width" number of dwords (32
+ * bits)
+ *
+ * width is:
+ * The size of the access. For READ or WRITE, only 1, 2 and 4 are
+ * supported. For other modes, width is not limited but will cause
+ * paging if the block traverses page boundaries.
+ *
+ * addr is:
+ * The physical address being accessed
+ *
+ * pdata is:
+ * A pointer to the data to be read or written into.
+ *
+ * NOTE! WORD or DWORD accesses can only be made on WORD or DWORD boundaries!
+ ****************************************************************************/
+void
+protected_mode_access(unsigned long mode,
+ unsigned long width, unsigned long addr, char *pdata)
+{
+ void *ptr = (void *)(FPBaseAddr + addr);
+
+ /* type specific buffer pointers */
+ char *byte_data = (char *)pdata;
+ unsigned long *word_data = (unsigned long *)pdata;
+ unsigned long *dword_data = (unsigned long *)pdata;
+
+ if (mode == GX2_READ) {
+ switch (width) {
+ case FOUR_BYTES:
+ *(dword_data) = (unsigned long)(*(unsigned long *)ptr);
+ break;
+ case TWO_BYTES:
+ *(word_data) = (unsigned long)(*(unsigned long *)ptr);
+ break;
+ default:
+ *(byte_data) = (char)(*(char *)ptr);
+ break;
+ }
+ } /* end GX2_READ */
+ else if (mode == GX2_WRITE) {
+ switch (width) {
+ case FOUR_BYTES:
+ *(unsigned long *)ptr = *dword_data;
+ break;
+ case TWO_BYTES:
+ *(unsigned long *)ptr = *word_data;
+ break;
+ default:
+ *(char *)ptr = *byte_data;
+ break;
+ } /* end switch(mode) */
+ }
+ /* end case GX2_WRITE */
+ return;
+
+} /* End of protected_mode_access. */
+
+/*************************************************************************
+ * void write_video_reg64_low( unsigned long offset, unsigned long value )
+ *
+ * Writes value to the low 32 bits of the 64 bit memory mapped video
+ * register indicated by offset.
+ * This function uses Sys_info.video_reg_base as the base address, so
+ * the value of offset should be with respect to this base.
+ *************************************************************************/
+void
+write_video_reg64_low(unsigned long offset, unsigned long value)
+{
+ protected_mode_access(GX2_WRITE, FOUR_BYTES,
+ FPBaseAddr + offset, (char *)&value);
+} /*end write_video_reg64_low() */
+
+/*************************************************************************
+ * unsigned long read_video_reg64_low( unsigned long offset )
+ *
+ * Returns the contents of the low 32 bits of the 64 bit memory mapped
+ * video register indicated by offset.
+ * This function uses Sys_info.video_reg_base as the base address, so
+ * the value of offset should be with respect to this base.
+ *************************************************************************/
+unsigned long
+read_video_reg64_low(unsigned long offset)
+{
+ unsigned long data;
+
+ protected_mode_access(GX2_READ, FOUR_BYTES,
+ FPBaseAddr + offset, (char *)&data);
+ return (data);
+} /*end read_video_reg64_low() */
+
+/*****************************************************************************
+ * void Redcloud_fp_reg(int mode, unsigned long address, unsigned long *data)
+ *
+ * Writes and reads dwords to the Redcloud flat panel registers in the
+ * Redcloud Display Filter. There's no clock control, chip select or timing
+ * to deal with.
+ * This routine expects the actual GX2 macro definitions for the address.
+ *
+ * Parameters:
+ * mode: An integer value for a GX2_READ or GX2_WRITE operation
+ * 0 = GX2_Read and 1 = GX2_Write
+ * address: A dword value representing the offset of the register.
+ * data: A pointer to a dword value that is to be written in to
+ * the required register. In case of a Read operation
+ * this will point to the result of the Read operation.
+ ****************************************************************************/
+void
+Redcloud_fp_reg(int mode, unsigned long address, unsigned long *data)
+{
+ if (mode == GX2_READ) {
+ *data = read_video_reg64_low(address);
+ } else {
+ write_video_reg64_low(address, *data);
+ }
+
+} /* End of Redcloud_fp_reg() */
+
+/*-------------------------------------------------------------------
+ *
+ * SET_92XX_MODE_PARAMS
+ * This routine sets the 9211 mode parameters.
+ *
+ *-------------------------------------------------------------------*/
+
+void
+set_Redcloud_92xx_mode_params(int mode)
+{
+ CS92xx_MODE *pMode = &FPModeParams[mode];
+ unsigned long temp_data = 0;
+ unsigned long base_data;
+ Q_WORD msrValue;
+
+ /* on a Redcloud, we need to set up the DF pad select MSR */
+ if (gfx_msr_read(RC_ID_DF, GX2_VP_MSR_PAD_SELECT, &msrValue) == FOUND) {
+ msrValue.low &= ~GX2_VP_PAD_SELECT_MASK;
+ if (pMode->panel_type == PNL_TFT || pMode->panel_type == PNL_TWOP) {
+ msrValue.low = GX2_VP_PAD_SELECT_TFT;
+ } else {
+ msrValue.low = GX2_VP_PAD_SELECT_DSTN;
+ }
+ gfx_msr_write(RC_ID_DF, GX2_VP_MSR_PAD_SELECT, &msrValue);
+ }
+
+ /* Turn the 92xx power off before setting any new parameters. */
+ temp_data = pMode->power_management & ~GX2_FP_PM_PWR_ON;
+ Redcloud_fp_reg(GX2_WRITE, GX2_FP_PWR_MAN, (unsigned long *)&temp_data);
+
+ /* Set 9211 registers using the desired panel settings */
+
+ Redcloud_fp_reg(GX2_WRITE, GX2_FP_PAN_TIMING1,
+ (unsigned long *)&pMode->panel_timing1);
+
+ /* On Redcloud, bit 31 is now reserved. */
+ temp_data = pMode->panel_timing2 & 0x7FFFFFFF;
+ Redcloud_fp_reg(GX2_WRITE, GX2_FP_PAN_TIMING2,
+ (unsigned long *)&temp_data);
+
+ /* On Redcloud TFT parts, set this to 0x70 so all 8 bits per color run
+ * thru fp crc but only non-TFT parts. Otherwise, set it to be 0x50.
+ * (source: Larry G.).
+ */
+ if (pMode->panel_type == PNL_TFT || pMode->panel_type == PNL_TWOP) {
+ temp_data = GX2_FP_CRC_PASS_THRU_MASK;
+ } else {
+ temp_data = pMode->rev_C_dither_frc;
+ }
+ Redcloud_fp_reg(GX2_WRITE, GX2_FP_DITH_FR_CNTRL,
+ (unsigned long *)&temp_data);
+ Redcloud_fp_reg(GX2_WRITE, GX2_FP_BLFSR,
+ (unsigned long *)&pMode->blue_lsfr_seed);
+ Redcloud_fp_reg(GX2_WRITE, GX2_FP_RLFSR,
+ (unsigned long *)&pMode->red_green_lsfr_seed);
+
+ /* Set the memory information, then the power register last.
+ * This will turn the panel on at the 9211.
+ */
+
+ Redcloud_fp_reg(GX2_READ, GX2_FP_FBB, (unsigned long *)&base_data);
+ if (base_data != 0x41780000) {
+ base_data = 0x41780000;
+ Redcloud_fp_reg(GX2_WRITE, GX2_FP_FBB, (unsigned long *)&base_data);
+ }
+
+ Redcloud_fp_reg(GX2_WRITE, GX2_FP_PWR_MAN,
+ (unsigned long *)&pMode->power_management);
+
+} /*end set_92xx_mode_params() */
+
+/* -----------------------------------------------------------------------
+ * SET_FLAT_PANEL_MODE
+ *
+ * This routine sets the specified flat panel moden parameters in
+ * the 9211.
+ * Returns PASS if successful, FAIL if the mode parameters could
+ * not be set.
+ *------------------------------------------------------------------------*/
+
+unsigned char
+set_Redcloud_92xx_mode(Pnl_PanelStat * pstat)
+{
+ int mode;
+
+ /* LOOP THROUGH THE AVAILABLE MODES TO FIND A MATCH */
+
+ for (mode = 0; mode < NUM_92XX_MODES; mode++) {
+ if ((FPModeParams[mode].xres == pstat->XRes) &&
+ (FPModeParams[mode].yres == pstat->YRes) &&
+ (FPModeParams[mode].bpp == pstat->Depth) &&
+ (FPModeParams[mode].panel_type == pstat->Type) &&
+ (FPModeParams[mode].color_type == pstat->MonoColor)) {
+
+ /* SET THE 92xx FOR THE SELECTED MODE */
+ set_Redcloud_92xx_mode_params(mode);
+ return TRUE;
+ } /* end if() */
+ } /* end for() */
+ return FALSE;
+
+} /* end set_Centaurus_92xx_mode() */
+
+void
+Redcloud_9211init(Pnl_PanelStat * pstat)
+{
+
+ set_Redcloud_92xx_mode(pstat);
+
+}
diff --git a/src/panel/gx2_9211.h b/src/panel/gx2_9211.h
new file mode 100644
index 0000000..071b3fb
--- /dev/null
+++ b/src/panel/gx2_9211.h
@@ -0,0 +1,115 @@
+/* Copyright (c) 2005 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Neither the name of the Advanced Micro Devices, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ * */
+
+/*
+ * File Contents: This file contains the panel library files to the
+ * GX2 platforms with 9211 support.
+ *
+ * SubModule: Geode FlatPanel library
+ * */
+
+/* -----------------------------------------------------------
+ * GX2 FLAT PANEL CONTROLLER REGISTER DEFINITIONS
+ *-----------------------------------------------------------
+ */
+
+#define GX2_VP_MSR_PAD_SELECT 0x2011
+#define GX2_VP_PAD_SELECT_MASK 0x3FFFFFFF
+#define GX2_VP_PAD_SELECT_TFT 0x1FFFFFFF
+#define GX2_VP_PAD_SELECT_DSTN 0x00000000
+
+/* This is useful for generating addresses incrementally
+ * (ie, vidtest register display code).
+ */
+
+#define GX2_FP_LCD_OFFSET 0x00000400
+#define CS9211_REDCLOUD 0x0400 /* Moved 9211 Rev C3 up to next major
+ * no. */
+#define GX2_FP_PAN_TIMING1 0x0400 /* FP timings 1 */
+#define GX2_FP_PAN_TIMING2 0x0408 /* FP timings 2 */
+#define GX2_FP_PWR_MAN 0x0410 /* FP power management */
+#define GX2_FP_DITH_FR_CNTRL 0x0418 /* FP dither and frame rate */
+#define GX2_FP_BLFSR 0x0420 /* Blue LFSR seed */
+#define GX2_FP_RLFSR 0x0428 /* Red and Green LFSR seed */
+#define GX2_FP_FMI 0x0430 /* FRM Memory Index */
+#define GX2_FP_FMD 0x0438 /* FRM Memory Data */
+#define GX2_FP_DCA 0x0448 /* Dither ram control and address */
+#define GX2_FP_DMD 0x0450 /* Dither memory data */
+#define GX2_FP_PAN_CRC_SIG 0x0458 /* FP CRC signature */
+#define GX2_FP_FBB 0x0460 /* Frame Buffer Base Address */
+
+/* GX2_FP_PAN_TIMING2 bits */
+
+#define GX2_FP_TFT_PASS_THRU 0x40000000 /* TFT pass through enable */
+#define GX2_FP_PT2_PIX_OUT_MASK 0xFFF8FFFF /* panel output bit formats */
+#define GX2_FP_PT2_PIX_OUT_TFT 0x00000000 /* 8 BIT DSTN or TFT panel */
+#define GX2_FP_PT2_COLOR_MONO 0x00080000 /* color or monochrome */
+#define GX2_FP_PT2_DSTN_TFT_MASK 0xFFCFFFFF /* panel type bits */
+#define GX2_FP_PT2_DSTN_TFT_TFT 0x00100000 /* TFT panel */
+#define GX2_FP_PT2_PSH_CLK_CTL 0x08000000 /* shift clock retrace
+ * activity control */
+
+/* GX2_FP_PWR_MAN bits */
+
+#define GX2_FP_PM_SHFCLK_INVERT 0x00002000 /* Invert shfclk to panel */
+#define GX2_FP_PM_VSYNC_DELAY 0x0000C000 /* Vert Sync delay */
+#define GX2_FP_PM_HSYNC_DELAY 0x00030000 /* Horiz Sync delay */
+#define GX2_FP_PM_PWRDN_PHASE_BIT0 0x00040000 /* panel power down phase bit
+ * 0 */
+#define GX2_FP_PM_PWRDN_PHASE_BIT1 0x00080000 /* panel power down phase bit
+ * 1 */
+#define GX2_FP_PM_PWRDN_PHASE_BIT2 0x00100000 /* panel power down phase bit
+ * 2 */
+#define GX2_FP_PM_PWRUP_PHASE_BIT0 0x00200000 /* panel power up phase bit
+ * 0 */
+#define GX2_FP_PM_PWRUP_PHASE_BIT1 0x00400000 /* panel power up phase bit
+ * 1 */
+#define GX2_FP_PM_PWRUP_PHASE_BIT2 0x00800000 /* panel power up phase bit
+ * 2 */
+#define GX2_FP_PM_PWR_ON 0x01000000 /* panel power ON */
+#define GX2_FP_PM_DIS_OFF_CTL 0x02000000 /* disable the panel back
+ * light */
+#define GX2_FP_PM_EXT_PWR_SEQ 0x08000000 /* external power sequence */
+
+/* GX2_FP_PAN_CRC_SIG bits */
+
+#define GX2_FP_PAN_CRC_SIGE 0x00000001 /* CRC Sig Enable */
+#define GX2_FP_PAN_CRC_SFR 0x00000002 /* CRC Sig Free Run */
+
+/* This define is used by the hardware CRC mechanism */
+#define GX2_FP_CRC_PASS_THRU_MASK 0x00000070
+
+#define GX2_READ 0
+#define GX2_WRITE 1
+
+void SetFPBaseAddr(unsigned long);
+void Redcloud_9211init(Pnl_PanelStat *);
+void protected_mode_access(unsigned long mode,
+ unsigned long width, unsigned long addr, char *pdata);
+void write_video_reg64_low(unsigned long offset, unsigned long value);
+unsigned long read_video_reg64_low(unsigned long offset);
+void Redcloud_fp_reg(int mode, unsigned long address, unsigned long *data);
+void set_Redcloud_92xx_mode_params(int mode);
+unsigned char set_Redcloud_92xx_mode(Pnl_PanelStat * pstat);
diff --git a/src/panel/panel.c b/src/panel/panel.c
new file mode 100644
index 0000000..b581fa9
--- /dev/null
+++ b/src/panel/panel.c
@@ -0,0 +1,70 @@
+/* Copyright (c) 2005 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Neither the name of the Advanced Micro Devices, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ * */
+
+/*
+ * File Contents: This file contains the file inclusions, macro definitions
+ * for the panel.
+ *
+ * SubModule: Geode FlatPanel library
+ * */
+
+#if defined(linux) /* Linux */
+
+#ifdef __KERNEL__
+
+#include <linux/string.h>
+#include <asm/io.h>
+
+#elif !defined(XFree86Server)
+
+#include <linux/fs.h>
+#include <asm/mman.h>
+
+#endif /* __KERNEL__ */
+#elif defined(_WIN32) /* windows */
+
+#include <windows.h>
+
+#endif
+
+#include "panel.h"
+#include "gfx_defs.h"
+
+extern unsigned char *gfx_virt_regptr;
+extern unsigned char *gfx_virt_fbptr;
+extern unsigned char *gfx_virt_vidptr;
+extern unsigned char *gfx_virt_vipptr;
+extern unsigned long gfx_detect_video(void);
+
+#define PLATFORM_DYNAMIC 1 /* runtime selection */
+#define PLATFORM_DRACO 1 /* Draco + 9210 */
+#define PLATFORM_CENTAURUS 1 /* Centaurus + 9211 RevA */
+#define PLATFORM_DORADO 1 /* Dorado + 9211 RevC */
+#define PLATFORM_REDCLOUD 1 /* GX2 */
+
+unsigned char *XpressROMPtr;
+
+#include "pnl_init.c"
+#include "pnl_bios.c"
diff --git a/src/panel/panel.h b/src/panel/panel.h
new file mode 100644
index 0000000..bc708df
--- /dev/null
+++ b/src/panel/panel.h
@@ -0,0 +1,80 @@
+/* Copyright (c) 2005 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Neither the name of the Advanced Micro Devices, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ * */
+
+/*
+ * File Contents: This file contains the Geode frame buffer panel functions
+ * prototypes and it includes panel definitions header file.
+ *
+ * SubModule: Geode FlatPanel library
+ * */
+
+/* COMPILER OPTION FOR C++ PROGRAMS */
+
+#ifndef _panel_h
+#define _panel_h
+
+#include "pnl_defs.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/* CLOSE BRACKET FOR C++ COMPLILATION */
+
+ void Pnl_SetPlatform(int platform);
+ int Pnl_GetPlatform(void);
+ int Pnl_IsPanelPresent(void);
+ void Pnl_SetPanelPresent(int present);
+ void Pnl_SetPanelChip(int panelChip);
+ int Pnl_GetPanelChip(void);
+ void Pnl_SetPanelParam(Pnl_PanelParams * pParam);
+ void Pnl_GetPanelParam(Pnl_PanelParams * pParam);
+ int Pnl_InitPanel(Pnl_PanelParams * pParam);
+ int Detect_Platform(void);
+ void Pnl_SavePanelState(void);
+ void Pnl_RestorePanelState(void);
+ void Pnl_PowerUp(void);
+ void Pnl_PowerDown(void);
+
+ int Pnl_IsPanelEnabledInBIOS(void);
+ void Pnl_GetPanelInfoFromBIOS(int *xres, int *yres, int *bpp, int *hz);
+/* from durango */
+
+#if defined(_WIN32) /* windows */
+ extern void gfx_delay_milliseconds(unsigned long milliseconds);
+ extern unsigned long gfx_ind(unsigned short port);
+ extern void gfx_outd(unsigned short port, unsigned long data);
+ extern unsigned char gfx_inb(unsigned short port);
+ extern void gfx_outb(unsigned short port, unsigned char data);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !_panel_h */
+
+/* END OF FILE */
diff --git a/src/panel/platform.c b/src/panel/platform.c
new file mode 100644
index 0000000..24012e3
--- /dev/null
+++ b/src/panel/platform.c
@@ -0,0 +1,233 @@
+/* Copyright (c) 2005 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Neither the name of the Advanced Micro Devices, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ * */
+
+/*
+ * File Contents: This file contains platform dependent functions
+ * which provide interface to that platform.
+ *
+ * SubModule: Geode FlatPanel library
+ * */
+
+#define LINUX_ROM_SEGMENT 0x000F
+#define SEGMENT_LENGTH 0xFFFF
+#define PAGE_LENGTH 0x1000
+#define SYS_BOARD_NAME_LEN 24
+
+#define PLT_UNKNOWN 0xFFFF
+
+typedef struct
+{
+ char sys_board_name[SYS_BOARD_NAME_LEN];
+ SYS_BOARD sys_board;
+}
+SYS_BOARD_INFO;
+
+static SYS_BOARD_INFO Sys_info;
+
+/*
+ * The names in the sys_board_name string must exactly match the names in the
+ * BIOS header. These names are used by FindStringInSeg() to find the names
+ * in the BIOS header space. The BIOS does not use OTHER; it is a dummy value
+ * for program useonly.
+ */
+
+SYS_BOARD_INFO Sys_board_info_array[] = {
+ {"Marmot", MARMOT_PLATFORM},
+ {"Unicorn", UNICORN_PLATFORM},
+ {"Centaurus", CENTAURUS_PLATFORM},
+ {"Aries", ARIES_PLATFORM},
+ {"Carmel", CARMEL_PLATFORM},
+ {"Hyrda", HYDRA_PLATFORM},
+ {"Dorado", DORADO_PLATFORM},
+ {"Redcloud", REDCLOUD_PLATFORM},
+ {"Other", OTHER_PLATFORM}
+};
+
+#define NUM_SYS_BOARD_TYPES \
+ sizeof(Sys_board_info_array)/sizeof(SYS_BOARD_INFO)
+
+static int Num_sys_board_type = NUM_SYS_BOARD_TYPES;
+SYS_BOARD_INFO *Sys_board_array_base = Sys_board_info_array;
+int FindStringInSeg(unsigned int, char *);
+static unsigned char get_sys_board_type(SYS_BOARD_INFO *, SYS_BOARD_INFO *);
+
+/* Detect the Platform */
+int
+Detect_Platform(void)
+{
+ /* See if we can find the board name using Xpressrom */
+ get_sys_board_type(&Sys_info, Sys_board_array_base);
+ return (Sys_info.sys_board);
+}
+
+static int
+Strncmp(char *str1, char *str2, int len)
+{
+ int i;
+
+ if ((str1 == 0x0) || (str2 == 0x0) || (len == 0))
+ return (1);
+ for (i = 0; i < len; i++) {
+ if (*(str1 + i) > *(str2 + i)) {
+ return 1;
+ } else if (*(str1 + i) < *(str2 + i)) {
+ return -1;
+ }
+ }
+ return 0;
+}
+
+static char *
+Strcpy(char *dst, char *src)
+{
+ int i;
+
+ if ((dst == 0x0) || (src == 0x0))
+ return (0);
+ for (i = 0; src[i] != 0x0; i++) {
+ dst[i] = src[i];
+ }
+ dst[i] = 0x0; /* NULL termination */
+ return dst;
+}
+
+static int
+Strlen(char *str)
+{
+ int i;
+
+ if (str == 0x0)
+ return 0;
+ for (i = 0; str[i] != 0x0; i++) ;
+ return i;
+}
+
+/* Platform Detection Code */
+
+/************************************************************************
+ * int FindStringInSeg( unsigned int segment_address, char *string_ptr )
+ *
+ * Returns the offset where the NULL terminated string pointed to by
+ * string_ptr is located in the segment passed in segment_address.
+ * Segment_address must be of the form 0xXXXX (i.e 0xf000 for segment f).
+ * Returns NULL if the string is not found.
+ ************************************************************************
+ */
+int
+FindStringInSeg(unsigned int segment_address, char *string_ptr)
+{
+ int string_length = Strlen(string_ptr);
+ char *psegment_buf;
+ unsigned long mem_ptr = (unsigned long)segment_address << 16;
+ unsigned int i;
+
+ /* silence compiler */
+ (void)mem_ptr;
+
+#if defined(linux) && !defined(XFree86Server)
+ XpressROMPtr = (unsigned char *)ioremap(mem_ptr, SEGMENT_LENGTH + 1);
+ psegment_buf = (char *)XpressROMPtr;
+#elif defined (XFree86Server)
+ psegment_buf = (char *)XpressROMPtr;
+#elif defined(_WIN32) /* Windows */
+ psegment_buf = XpressROMPtr;
+#endif
+
+ /* Now search for the first character of the string_ptr */
+ for (i = 0; i < SEGMENT_LENGTH + 1; i++) {
+ if (*(psegment_buf + i) == *string_ptr) {
+
+ /* If we match the first character, do a
+ * string compare.
+ */
+
+ if (!Strncmp(string_ptr, (psegment_buf + i), string_length)) {
+ /* They match! */
+ return (1);
+ }
+ }
+ }
+ /* if we got this far we didn't find anything. Return NULL. */
+ return (0);
+
+} /* end FindStringInSeg() */
+
+/**********************************************************************
+
+ * TRUE_FALSE get_sys_board_type( SYS_BOARD_INFO *sys_info,
+ * SYS_BOARD_INFO *sys_board_array_base)
+ *
+ * Checks the system BIOS area for Xpressrom information. If found, searches
+ * the BIOS area for one of names in the array pointed to by
+ * sys_board_array_ptr.
+ * If a match is found, sets the SYS_INFO system_board_name string
+ * and the system_board variable to the board name and returns TRUE.
+ * If Xpressrom or a board is not found, sets the variables to
+ * their default values and returns FALSE.
+ * Uses the global string pointer *xpress_rom_string_ptr.
+ ***********************************************************************
+ */
+static unsigned char
+get_sys_board_type(SYS_BOARD_INFO * sys_info,
+ SYS_BOARD_INFO * sys_board_array_base)
+{
+ int index;
+ char *xpress_rom_string_ptr = "XpressStart";
+ unsigned int segment = LINUX_ROM_SEGMENT;
+
+ /* See if XpressStart is present in the BIOS area.
+ * If it is, search for a board string. If not, Xpressrom is
+ * not present, set system_board information to UNKNOWN and
+ * return FALSE.
+ */
+
+ if (!FindStringInSeg(segment, xpress_rom_string_ptr)) {
+ sys_info->sys_board = PLT_UNKNOWN;
+ Strcpy(sys_info->sys_board_name, "Unknown");
+ return (FALSE);
+ } else {
+
+ /* we have Xpressrom, so look for a board */
+ for (index = 0; index < Num_sys_board_type; index++) {
+ if (!FindStringInSeg(segment, (sys_board_array_base +
+ index)->sys_board_name)) {
+ continue;
+ } else {
+
+ /* a match!! */
+ sys_info->sys_board =
+ (sys_board_array_base + index)->sys_board;
+ Strcpy(sys_info->sys_board_name,
+ (sys_board_array_base + index)->sys_board_name);
+ return (TRUE);
+ }
+ } /* end for() */
+ } /* end else */
+
+ /* if we are here we have failed */
+ sys_info->sys_board = PLT_UNKNOWN;
+ Strcpy(sys_info->sys_board_name, "Unknown");
+ return (FALSE);
+} /* end get_sys_board_type() */
diff --git a/src/panel/pnl_bios.c b/src/panel/pnl_bios.c
new file mode 100644
index 0000000..9e3c1fe
--- /dev/null
+++ b/src/panel/pnl_bios.c
@@ -0,0 +1,282 @@
+/* Copyright (c) 2005 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Neither the name of the Advanced Micro Devices, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ * */
+
+/*
+ * File Contents: This file panel functions which query for the BIOS for
+ * current FP Paramters.
+ *
+ * SubModule: Geode FlatPanel library
+ * */
+
+#include "panel.h"
+
+#if defined(_WIN32) /* windows */
+extern unsigned long gfx_cpu_version;
+extern void gfx_outw(unsigned short port, unsigned short data);
+extern unsigned short gfx_inw(unsigned short port);
+#endif
+
+#define SOFTVGA_DISPLAY_ENABLE 0x50
+#define SOFTVGA_FPRESOLUTION 0x52
+#define SOFTVGA_FPCLOCKFREQUENCY 0x54
+
+/* SOFTVG VIRTUAL REGISTER DEFINITIONS */
+
+#define VR_INDEX 0xAC1C
+#define VR_DATA 0xAC1E
+#define VR_UNLOCK 0xFC53
+#define VRC_VG 0x0002 /* SoftVG Virtual Register Class */
+#define VG_MEM_SIZE 0x0000 /* MemSize Virtual Register */
+#define FP_DETECT_MASK 0x8000
+
+#define VG_FP_TYPE 0x0002 /* Flat Panel Info Virtual Register */
+
+#define FP_DEV_MASK 0x0003 /* Flat Panel type */
+#define FP_TYPE_SSTN 0x0000 /* SSTN panel type value */
+#define FP_TYPE_DSTN 0x0001 /* DSTN panel type value */
+#define FP_TYPE_TFT 0x0002 /* TFT panel type value */
+#define FP_TYPE_LVDS 0x0003 /* LVDS panel type value */
+
+#define FP_RESOLUTION_MASK 0x0038
+#define FP_RES_6X4 0x0000 /* 640x480 resolution value */
+#define FP_RES_8X6 0x0008 /* 800x600 resolution value */
+#define FP_RES_10X7 0x0010 /* 1024x768 resolution value */
+#define FP_RES_11X8 0x0018 /* 1152x864 resolution value */
+#define FP_RES_12X10 0x0020 /* 1280x1024 resolution value */
+#define FP_RES_16X12 0x0028 /* 1600x1200 resolution value */
+
+#define FP_WIDTH_MASK 0x01C0
+#define FP_WIDTH_8 0x0000 /* 8 bit data bus width */
+#define FP_WIDTH_9 0x0040 /* 9 bit data bus width */
+#define FP_WIDTH_12 0x0080 /* 12 bit data bus width */
+#define FP_WIDTH_18 0x00C0 /* 18 bit data bus width */
+#define FP_WIDTH_24 0x0100 /* 24 bit data bus width */
+#define FP_WIDTH_16 0x0140 /* 16 bit data bus width - 16 bit
+ * Mono DSTN only */
+
+#define FP_COLOR_MASK 0x0200
+#define FP_COLOR_COLOR 0x0000 /* Color panel */
+#define FP_COLOR_MONO 0x0200 /* Mono Panel */
+
+#define FP_PPC_MASK 0x0400
+#define FP_PPC_1PPC 0x0000 /* One pixel per clock */
+#define FP_PPC_2PPC 0x0400 /* Two pixels per clock */
+
+#define FP_HPOL_MASK 0x0800
+#define FP_H_POL_LGH 0x0000 /* HSync at panel, normally low,
+ * active high */
+#define FP_H_POL_HGL 0x0800 /* HSync at panel, normally high,
+ * active low */
+
+#define FP_VPOL_MASK 0x1000
+#define FP_V_POL_LGH 0x0000 /* VSync at panel, normally low,
+ * active high */
+#define FP_V_POL_HGL 0x1000 /* VSync at panel, normally high,
+ * active low */
+
+#define FP_REF_MASK 0xE000
+#define FP_REF_60 0x0000 /* 60Hz refresh rate */
+#define FP_REF_70 0x2000 /* 70Hz refresh rate */
+#define FP_REF_72 0x4000 /* 72Hz refresh rate */
+#define FP_REF_75 0x6000 /* 75Hz refresh rate */
+#define FP_REF_85 0x8000 /* 85Hz refresh rate */
+#define FP_REF_90 0xA000 /* 90Hz refresh rate */
+#define FP_REF_100 0xC000 /* 100Hz refresh rate */
+
+/*-----------------------------------------------------------------
+ * Pnl_IsPanelEnabledInBIOS
+ *
+ * Description: This function specifies whether the panel is enabled
+ * by the BIOS or not.
+ * parameters: none.
+ * return: 1 - Enabled, 0 - Disabled
+ *-----------------------------------------------------------------*/
+int
+Pnl_IsPanelEnabledInBIOS(void)
+{
+ unsigned char ret = 0;
+
+ if ((gfx_cpu_version & 0xFF) == GFX_CPU_REDCLOUD) {
+ unsigned short data;
+
+ gfx_outw(VR_INDEX, VR_UNLOCK);
+ gfx_outw(VR_INDEX, (VRC_VG << 8) | VG_MEM_SIZE);
+ data = gfx_inw(VR_DATA);
+ if (data & FP_DETECT_MASK)
+ ret = 1;
+ } else {
+ unsigned short crtcindex, crtcdata;
+
+ crtcindex = (gfx_inb(0x3CC) & 0x01) ? 0x3D4 : 0x3B4;
+ crtcdata = crtcindex + 1;
+
+ /* CHECK DisplayEnable Reg in SoftVGA */
+
+ gfx_outb(crtcindex, (unsigned char)SOFTVGA_DISPLAY_ENABLE);
+ ret = gfx_inb(crtcdata);
+ }
+
+ return (ret & 0x1);
+}
+
+/*-----------------------------------------------------------------
+ * Pnl_GetPanelInfoFromBIOS
+ *
+ * Description: This function queries the panel information from
+ * the BIOS.
+ * parameters:
+ * xres: width of the panel configured
+ * yres: height of the panel configured
+ * bpp: depth of the panel configured
+ * hz: vertical frequency of the panel configured
+ * return: none
+ *-----------------------------------------------------------------*/
+void
+Pnl_GetPanelInfoFromBIOS(int *xres, int *yres, int *bpp, int *hz)
+{
+ unsigned short crtcindex, crtcdata;
+ unsigned short ret;
+
+ if ((gfx_cpu_version & 0xFF) == GFX_CPU_REDCLOUD) {
+ gfx_outw(VR_INDEX, VR_UNLOCK);
+ gfx_outw(VR_INDEX, (VRC_VG << 8) | VG_FP_TYPE);
+ ret = gfx_inw(VR_DATA);
+ switch (ret & FP_RESOLUTION_MASK) {
+ case FP_RES_6X4:
+ *xres = 640;
+ *yres = 480;
+ break;
+ case FP_RES_8X6:
+ *xres = 800;
+ *yres = 600;
+ break;
+ case FP_RES_10X7:
+ *xres = 1024;
+ *yres = 768;
+ break;
+ case FP_RES_11X8:
+ *xres = 1152;
+ *yres = 864;
+ break;
+ case FP_RES_12X10:
+ *xres = 1280;
+ *yres = 1024;
+ break;
+ case FP_RES_16X12:
+ *xres = 1600;
+ *yres = 1200;
+ break;
+ }
+
+ switch (ret & FP_WIDTH_MASK) {
+ case FP_WIDTH_8:
+ *bpp = 8;
+ break;
+ case FP_WIDTH_9:
+ *bpp = 9;
+ break;
+ case FP_WIDTH_12:
+ *bpp = 12;
+ break;
+ case FP_WIDTH_18:
+ *bpp = 18;
+ break;
+ case FP_WIDTH_24:
+ *bpp = 24;
+ break;
+ case FP_WIDTH_16:
+ *bpp = 16;
+ break;
+ }
+
+ switch (ret & FP_REF_MASK) {
+ case FP_REF_60:
+ *hz = 60;
+ break;
+ case FP_REF_70:
+ *hz = 70;
+ break;
+ case FP_REF_72:
+ *hz = 72;
+ break;
+ case FP_REF_75:
+ *hz = 75;
+ break;
+ case FP_REF_85:
+ *hz = 85;
+ break;
+ case FP_REF_90:
+ *hz = 90;
+ break;
+ case FP_REF_100:
+ *hz = 100;
+ break;
+ }
+
+ } else {
+ crtcindex = (gfx_inb(0x3CC) & 0x01) ? 0x3D4 : 0x3B4;
+ crtcdata = crtcindex + 1;
+
+ /* CHECK FPResolution Reg in SoftVGA */
+
+ gfx_outb(crtcindex, (unsigned char)SOFTVGA_FPRESOLUTION);
+ ret = gfx_inb(crtcdata);
+
+ switch (ret & 0x3) {
+ case 0:
+ *xres = 640;
+ *yres = 480;
+ break;
+ case 1:
+ *xres = 800;
+ *yres = 600;
+ break;
+ case 2:
+ *xres = 1024;
+ *yres = 768;
+ break;
+ }
+
+ switch ((ret >> 4) & 0x3) {
+ case 0:
+ *bpp = 12;
+ break;
+ case 1:
+ *bpp = 18;
+ break;
+ case 2:
+ *bpp = 16;
+ break;
+ case 3:
+ *bpp = 8;
+ break;
+ }
+
+ /* CHECK FPClockFrequency Reg in SoftVGA */
+
+ gfx_outb(crtcindex, (unsigned char)SOFTVGA_FPCLOCKFREQUENCY);
+ *hz = gfx_inb(crtcdata);
+ }
+}
diff --git a/src/panel/pnl_defs.h b/src/panel/pnl_defs.h
new file mode 100644
index 0000000..447a944
--- /dev/null
+++ b/src/panel/pnl_defs.h
@@ -0,0 +1,95 @@
+/* Copyright (c) 2005 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Neither the name of the Advanced Micro Devices, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ * */
+
+/*
+ * File Contents: This file contains definitions of the Geode frame buffer
+ * panel data structures.
+ *
+ * SubModule: Geode FlatPanel library
+ * */
+
+#ifndef _pnl_defs_h
+#define _pnl_defs_h
+
+typedef enum
+{
+ MARMOT_PLATFORM = 0,
+ UNICORN_PLATFORM,
+ CENTAURUS_PLATFORM,
+ ARIES_PLATFORM,
+ CARMEL_PLATFORM,
+ HYDRA_PLATFORM,
+ DORADO_PLATFORM,
+ DRACO_PLATFORM,
+ REDCLOUD_PLATFORM,
+ OTHER_PLATFORM
+}
+SYS_BOARD;
+
+#define PNL_9210 0x01
+#define PNL_9211_A 0x02
+#define PNL_9211_C 0x04
+#define PNL_UNKNOWN_CHIP 0x08
+
+#define PNL_TFT 0x01
+#define PNL_SSTN 0x02
+#define PNL_DSTN 0x04
+#define PNL_TWOP 0x08
+#define PNL_UNKNOWN_PANEL 0x10
+
+#define PNL_MONO_PANEL 0x01
+#define PNL_COLOR_PANEL 0x02
+#define PNL_UNKNOWN_COLOR 0x08
+
+#define PNL_PANELPRESENT 0x01
+#define PNL_PLATFORM 0x02
+#define PNL_PANELCHIP 0x04
+#define PNL_PANELSTAT 0x08
+#define PNL_OVERRIDE_STAT 0x10
+#define PNL_OVERRIDE_ALL 0x1F
+
+typedef struct _Pnl_PanelStat_
+{
+ int Type;
+ int XRes;
+ int YRes;
+ int Depth;
+ int MonoColor;
+}
+Pnl_PanelStat;
+
+typedef struct _Pnl_Params_
+{
+ unsigned long Flags;
+ int PanelPresent;
+ int Platform;
+ int PanelChip;
+ Pnl_PanelStat PanelStat;
+}
+Pnl_PanelParams, *PPnl_PanelParams;
+
+#endif /* _pnl_defs_h */
+
+/* END OF FILE */
diff --git a/src/panel/pnl_init.c b/src/panel/pnl_init.c
new file mode 100644
index 0000000..39b932e
--- /dev/null
+++ b/src/panel/pnl_init.c
@@ -0,0 +1,531 @@
+/* Copyright (c) 2005 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Neither the name of the Advanced Micro Devices, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ * */
+
+/*
+ * File Contents: This file contains the Geode frame buffer panel
+ * intialization functions.
+ *
+ * SubModule: Geode FlatPanel library
+ * */
+
+#include "panel.h"
+#include "gfx_regs.h"
+#include "gfx_type.h"
+
+/* defaults
+ * Panel: Enabled
+ * Platform: Centaurus
+ * 92xx Chip: 9211 Rev. A
+ * PanelType: DSTN
+ * XResxYRes: 800x600
+ * Depth: 16
+ * Mono_Color: Color
+ */
+static Pnl_PanelParams sPanelParam = {
+ 0, 1, CENTAURUS_PLATFORM, PNL_9211_A,
+ {PNL_DSTN, 800, 600, 16, PNL_COLOR_PANEL}
+};
+
+#if PLATFORM_DRACO
+#include "drac9210.c"
+#endif
+
+#if PLATFORM_CENTAURUS
+#include "cen9211.c"
+#endif
+
+#if PLATFORM_DORADO
+#include "dora9211.c"
+#endif
+
+#if PLATFORM_GX2BASED
+#include "gx2_9211.c"
+#endif
+#include "platform.c"
+
+/*
+ * return -1 - UnKnown
+ * 0 - Draco has 9210
+ * 1 - Centaurus has 9211 Rev. A
+ * 2 - Dorado has 9211 Rev. C
+ */
+
+/*-----------------------------------------------------------------
+ * Pnl_SetPlatform
+ *
+ * Description: This function sets the panel with hardware platform.
+ *
+ * parameters:
+ * platform: It specify the platform.
+ *
+ * return: none.
+ *-----------------------------------------------------------------*/
+void
+Pnl_SetPlatform(int platform)
+{
+ /* To Be Implemented */
+ sPanelParam.Platform = platform;
+
+}
+
+/*-----------------------------------------------------------------
+ * Pnl_GetPlatform
+ *
+ * Description: This function returns the panel platform.
+ *
+ * parameters: none.
+ *
+ * return: On success it returns the panel platform.
+ *-----------------------------------------------------------------*/
+int
+Pnl_GetPlatform(void)
+{
+ sPanelParam.Platform = Detect_Platform();
+
+ return sPanelParam.Platform;
+
+}
+
+/*-----------------------------------------------------------------
+ * Pnl_IsPanelPresent
+ *
+ * Description: This function specifies whether the panel is prsent
+ * or not.
+ *
+ * parameters: none.
+ *
+ * return: On success it returns an integer panel present value.
+ *-----------------------------------------------------------------*/
+int
+Pnl_IsPanelPresent(void)
+{
+ /* To Be Implemented */
+ return sPanelParam.PanelPresent;
+}
+
+/*-----------------------------------------------------------------
+ * Pnl_SetPanelPresent
+ *
+ * Description: This function sets the panel_present parameter.
+ *
+ * parameters:
+ * present: It specifies the panel present value.
+ *
+ * return: none.
+ *-----------------------------------------------------------------*/
+void
+Pnl_SetPanelPresent(int present)
+{
+ /* To Be Implemented */
+ sPanelParam.PanelPresent = present;
+}
+
+/*-----------------------------------------------------------------
+ * Pnl_SetPanelParam
+ *
+ * Description: This function sets the panel parameters
+ *
+ * parameters:
+ * pParam: It specifies the elements of the panel parameter
+ * structure.
+ *
+ * return: none.
+ *-----------------------------------------------------------------*/
+void
+Pnl_SetPanelParam(Pnl_PanelParams * pParam)
+{
+ if (pParam->Flags & PNL_PANELPRESENT) {
+ Pnl_SetPanelPresent(pParam->PanelPresent);
+ }
+ if (pParam->Flags & PNL_PLATFORM) {
+ Pnl_SetPlatform(pParam->Platform);
+ }
+ if (pParam->Flags & PNL_PANELCHIP) {
+ Pnl_SetPanelChip(pParam->PanelChip);
+ }
+ if (pParam->Flags & PNL_PANELSTAT) {
+ sPanelParam.PanelStat.XRes = pParam->PanelStat.XRes;
+ sPanelParam.PanelStat.YRes = pParam->PanelStat.YRes;
+ sPanelParam.PanelStat.Depth = pParam->PanelStat.Depth;
+ sPanelParam.PanelStat.MonoColor = pParam->PanelStat.MonoColor;
+ sPanelParam.PanelStat.Type = pParam->PanelStat.Type;
+ }
+}
+
+/*-----------------------------------------------------------------
+ * Pnl_PowerUp
+ *
+ * Description: This function sets the power based on the
+ * hardware platforms dorado or centaraus.
+ *
+ * parameters: none.
+ *
+ * return: none.
+ *-----------------------------------------------------------------*/
+void
+Pnl_PowerUp(void)
+{
+ int Platform;
+ unsigned long dcfg, hw_video;
+
+ Platform = Pnl_GetPlatform();
+
+#if PLATFORM_CENTAURUS
+ if (Platform == CENTAURUS_PLATFORM) {
+ Centaurus_Power_Up();
+ return;
+ }
+#endif
+
+#if PLATFORM_DORADO
+ if (Platform == DORADO_PLATFORM) {
+ Dorado_Power_Up();
+ return;
+ }
+#endif
+
+#if PLATFORM_GX2BASED
+ if (Platform == REDCLOUD_PLATFORM) {
+ }
+#endif
+
+ hw_video = gfx_detect_video();
+
+ if (hw_video == GFX_VID_CS5530) {
+ /* READ DISPLAY CONFIG FROM CX5530 */
+ dcfg = READ_VID32(CS5530_DISPLAY_CONFIG);
+
+ /* SET RELEVANT FIELDS */
+ dcfg |= (CS5530_DCFG_FP_PWR_EN | CS5530_DCFG_FP_DATA_EN);
+ /* Enable the flatpanel power and data */
+ WRITE_VID32(CS5530_DISPLAY_CONFIG, dcfg);
+ } else if (hw_video == GFX_VID_SC1200) {
+ /* READ DISPLAY CONFIG FROM SC1200 */
+ dcfg = READ_VID32(SC1200_DISPLAY_CONFIG);
+
+ /* SET RELEVANT FIELDS */
+ dcfg |= (SC1200_DCFG_FP_PWR_EN | SC1200_DCFG_FP_DATA_EN);
+ /* Enable the flatpanel power and data */
+ WRITE_VID32(SC1200_DISPLAY_CONFIG, dcfg);
+ } else if (hw_video == GFX_VID_REDCLOUD) {
+ /* READ DISPLAY CONFIG FROM REDCLOUD */
+ dcfg = READ_VID32(RCDF_DISPLAY_CONFIG);
+
+ /* SET RELEVANT FIELDS */
+ dcfg |= (RCDF_DCFG_FP_PWR_EN | RCDF_DCFG_FP_DATA_EN);
+ /* Enable the flatpanel power and data */
+ WRITE_VID32(RCDF_DISPLAY_CONFIG, dcfg);
+ }
+
+}
+
+/*-----------------------------------------------------------------
+ * Pnl_PowerDown
+ *
+ * Description: This function make power down based on the
+ * hardware platforms dorado or centaraus.
+ *
+ * parameters: none.
+ *
+ * return: none.
+ *-----------------------------------------------------------------*/
+void
+Pnl_PowerDown(void)
+{
+ int Platform;
+ unsigned long dcfg, hw_video;
+
+ Platform = Pnl_GetPlatform();
+
+#if PLATFORM_CENTAURUS
+ if (Platform == CENTAURUS_PLATFORM) {
+ Centaurus_Power_Down();
+ return;
+ }
+#endif
+#if PLATFORM_DORADO
+ if (Platform == DORADO_PLATFORM) {
+ Dorado_Power_Down();
+ return;
+ }
+#endif
+
+#if PLATFORM_GX2BASED
+ if (Platform == REDCLOUD_PLATFORM) {
+ }
+#endif
+
+ hw_video = gfx_detect_video();
+
+ if (hw_video == GFX_VID_CS5530) {
+ /* READ DISPLAY CONFIG FROM CX5530 */
+ dcfg = READ_VID32(CS5530_DISPLAY_CONFIG);
+
+ /* CLEAR RELEVANT FIELDS */
+ dcfg &= ~(CS5530_DCFG_FP_PWR_EN | CS5530_DCFG_FP_DATA_EN);
+ /* Disable the flatpanel power and data */
+ WRITE_VID32(CS5530_DISPLAY_CONFIG, dcfg);
+ } else if (hw_video == GFX_VID_SC1200) {
+ /* READ DISPLAY CONFIG FROM SC1200 */
+ dcfg = READ_VID32(SC1200_DISPLAY_CONFIG);
+
+ /* CLEAR RELEVANT FIELDS */
+ dcfg &= ~(SC1200_DCFG_FP_PWR_EN | SC1200_DCFG_FP_DATA_EN);
+ /* Disable the flatpanel power and data */
+ WRITE_VID32(SC1200_DISPLAY_CONFIG, dcfg);
+ } else if (hw_video == GFX_VID_REDCLOUD) {
+ /* READ DISPLAY CONFIG FROM REDCLOUD */
+ dcfg = READ_VID32(RCDF_DISPLAY_CONFIG);
+
+ /* CLEAR RELEVANT FIELDS */
+ dcfg &= ~(RCDF_DCFG_FP_PWR_EN | RCDF_DCFG_FP_DATA_EN);
+ /* Disable the flatpanel power and data */
+ WRITE_VID32(RCDF_DISPLAY_CONFIG, dcfg);
+ }
+}
+
+/*-----------------------------------------------------------------
+ * Pnl_SavePanelState
+ *
+ * Description: This function saves the panel state based on the
+ * hardware platforms dorado or centaraus.
+ *
+ * parameters: none.
+ *
+ * return: none.
+ *-----------------------------------------------------------------*/
+void
+Pnl_SavePanelState(void)
+{
+ int Platform;
+
+ Platform = Pnl_GetPlatform();
+
+#if PLATFORM_CENTAURUS
+ if (Platform == CENTAURUS_PLATFORM) {
+ Centaurus_Save_Panel_State();
+ return;
+ }
+#endif
+
+#if PLATFORM_DORADO
+ if (Platform == DORADO_PLATFORM) {
+ Dorado_Save_Panel_State();
+ return;
+ }
+#endif
+
+#if PLATFORM_GX2BASED
+ if (Platform == REDCLOUD_PLATFORM) {
+ }
+#endif
+}
+
+/*-----------------------------------------------------------------
+ * Pnl_RestorePanelState
+ *
+ * Description: This function restore the panel state based on the
+ * hardware platforms dorado or centaraus.
+ *
+ * parameters: none.
+ *
+ * return: none.
+ *-----------------------------------------------------------------*/
+void
+Pnl_RestorePanelState(void)
+{
+ int Platform;
+
+ Platform = Pnl_GetPlatform();
+#if PLATFORM_CENTAURUS
+ if (Platform == CENTAURUS_PLATFORM) {
+ Centaurus_Restore_Panel_State();
+ return;
+ }
+#endif
+
+#if PLATFORM_DORADO
+ if (Platform == DORADO_PLATFORM) {
+ Dorado_Restore_Panel_State();
+ return;
+ }
+#endif
+
+#if PLATFORM_GX2BASED
+ if (Platform == REDCLOUD_PLATFORM) {
+ }
+#endif
+}
+
+/*-----------------------------------------------------------------
+ * Pnl_GetPanelParam
+ *
+ * Description: This function gets the panel parameters from the
+ * hardware platforms dorado or centaraus.
+ *
+ * parameters:
+ * pParam: It specifies the elements of the panel parameter
+ * structure.
+ *
+ * return: none.
+ *-----------------------------------------------------------------*/
+void
+Pnl_GetPanelParam(Pnl_PanelParams * pParam)
+{
+ if (pParam->Flags & PNL_PANELPRESENT) {
+ pParam->PanelPresent = Pnl_IsPanelPresent();
+ }
+ if (pParam->Flags & PNL_PLATFORM) {
+ pParam->Platform = Pnl_GetPlatform();
+ }
+ if ((pParam->Flags & PNL_PANELCHIP) || (pParam->Flags & PNL_PANELSTAT)) {
+#if PLATFORM_CENTAURUS
+ if (pParam->Platform == CENTAURUS_PLATFORM) {
+ Centaurus_Get_9211_Details(pParam->Flags, pParam);
+ return;
+ }
+#endif
+
+#if PLATFORM_DORADO
+ if (pParam->Platform == DORADO_PLATFORM) {
+ Dorado_Get_9211_Details(pParam->Flags, pParam);
+ return;
+ }
+#endif
+
+#if PLATFORM_GX2BASED
+ if (pParam->Platform == REDCLOUD_PLATFORM) {
+ }
+#endif
+
+ /* if unknown platform put unknown */
+ if (pParam->Flags & PNL_PANELCHIP)
+ pParam->PanelChip = PNL_UNKNOWN_CHIP;
+
+ if (pParam->Flags & PNL_PANELSTAT) {
+ pParam->PanelStat.XRes = 0;
+ pParam->PanelStat.YRes = 0;
+ pParam->PanelStat.Depth = 0;
+ pParam->PanelStat.MonoColor = PNL_UNKNOWN_COLOR;
+ pParam->PanelStat.Type = PNL_UNKNOWN_PANEL;
+ }
+ }
+}
+
+/*-----------------------------------------------------------------
+ * Pnl_SetPanelChip
+ *
+ * Description: This function sets the panelchip parameter of panel
+ * structure.
+ *
+ * parameters:
+ * panelChip: It specifies the panelChip value.
+ *
+ * return: none.
+ *-----------------------------------------------------------------*/
+
+void
+Pnl_SetPanelChip(int panelChip)
+{
+ /* To Be Implemented */
+ sPanelParam.PanelChip = panelChip;
+
+}
+
+/*-----------------------------------------------------------------
+ * Pnl_GetPanelChip
+ *
+ * Description: This function gets the panelchip parameter of panel
+ * structure.
+ *
+ * parameters: none
+ *
+ * return: On success it returns the panelchip.
+ *-----------------------------------------------------------------*/
+int
+Pnl_GetPanelChip(void)
+{
+ /* To Be Implemented */
+ return sPanelParam.PanelChip;
+}
+
+/*-----------------------------------------------------------------
+ * Pnl_InitPanel
+ *
+ * Description: This function initializes the panel with
+ * hardware platforms dorado or centaraus.
+ *
+ * parameters:
+ * pParam: It specifies the elements of the panel parameter
+ * structure.
+ *
+ * return: none.
+ *-----------------------------------------------------------------*/
+int
+Pnl_InitPanel(Pnl_PanelParams * pParam)
+{
+ Pnl_PanelParams *pPtr;
+
+ if (pParam == 0x0) /* NULL use the static table */
+ pPtr = &sPanelParam;
+ else
+ pPtr = pParam;
+
+ if (!pPtr->PanelPresent) {
+ return -1; /* error */
+ } else {
+ if ((pPtr->PanelChip < 0) || (pPtr->Platform < 0))
+ return -1; /* error */
+
+#if PLATFORM_DRACO
+ /* check we are init. the right one */
+ if ((pPtr->Platform == DRACO_PLATFORM)
+ && (pPtr->PanelChip == PNL_9210)) {
+ Draco9210Init(&(pPtr->PanelStat));
+ }
+#endif
+
+#if PLATFORM_CENTAURUS
+ /* check we are init. the right one */
+ if (pPtr->Platform == CENTAURUS_PLATFORM) {
+ Centaurus_9211init(&(pPtr->PanelStat));
+ }
+#endif
+
+#if PLATFORM_DORADO
+ /* check we are init. the right one */
+ if ((pPtr->Platform == DORADO_PLATFORM) &&
+ (pPtr->PanelChip == PNL_9211_C)) {
+ Dorado9211Init(&(pPtr->PanelStat));
+ }
+#endif
+#if PLATFORM_GX2BASED
+ if (pPtr->Platform == REDCLOUD_PLATFORM) {
+ Redcloud_9211init(&(pPtr->PanelStat));
+ }
+#endif
+ } /* else end */
+ return 1;
+}
diff --git a/src/panel/readme.txt b/src/panel/readme.txt
new file mode 100644
index 0000000..c8ca986
--- /dev/null
+++ b/src/panel/readme.txt
@@ -0,0 +1,448 @@
+Panel Library
+Release 1.3.6
+OS - Can be used in all OS's.
+May 19, 2003
+Developer - Sarma Kolluru
+
+-----------------------------------------------------------------------------
+PRODUCT INFORMATION
+-----------------------------------------------------------------------------
+Panel library is set of functions enabling the driver to give panel support.
+The panel library is supported on Centaurus and Dorado.
+The panel library can detect the panel support by the jumper settings
+selected on the board. The platform can be detected too.
+
+ \readme.txt This file
+
+-----------------------------------------------------------------------------
+BUILD INSTRUCTIONS
+-----------------------------------------------------------------------------
+Panel library is a set of files which has support for flatpanel. The panel
+subdirectory needs to be copied in the driver directory.
+-----------------------------------------------------------------------------
+INSTALLATION INSTRUCTIONS
+-----------------------------------------------------------------------------
+These is no instalation and to be treaded as a driver source code extension.
+-----------------------------------------------------------------------------
+UNIT TEST
+Panel library when compiled is a part of the driver and cannot be unit tested.
+-----------------------------------------------------------------------------
+
+-----------------------------------------------------------------------------
+REVISION HISTORY
+-----------------------------------------------------------------------------
+Version changes v1.3.6 05/19/03
+-----------------------------------------------------------------------------
+Dependencies:
+ - None
+-----------------------------------------------------------------------------
+FUNCTIONAL CHANGES
+-----------------------------------------------------------------------------
+- None.
+-----------------------------------------------------------------------------
+DEFECTS CORRECTED
+-----------------------------------------------------------------------------
+Removed the code which is not being used in linux env. The allocation of
+segment buffer in stack was the cause of instability.
+-----------------------------------------------------------------------------
+FILE CHANGES
+ platform.c
+-----------------------------------------------------------------------------
+Version changes v1.3.5 02/28/03
+-----------------------------------------------------------------------------
+Dependencies:
+ - crlf v1.0.1o
+-----------------------------------------------------------------------------
+FUNCTIONAL CHANGES
+-----------------------------------------------------------------------------
+Added National Copyright header which replaced the GPL and BSD..
+-----------------------------------------------------------------------------
+DEFECTS CORRECTED
+-----------------------------------------------------------------------------
+- None.
+-----------------------------------------------------------------------------
+FILE CHANGES
+ 92xx.h
+ cen9211.c
+ cen9211.h
+ dora9211.c
+ dora9211.h
+ drac9210.c
+ drac9210.h
+ gx2_9211.c
+ gx2_9211.h
+ panel.h
+ panel.c
+ platform.c
+ pnl_bios.c
+ pnl_defs.h
+ pnl_init.c
+-----------------------------------------------------------------------------
+Version changes v1.3.4 12/30/02
+-----------------------------------------------------------------------------
+Dependencies:
+ - crlf v1.0.1o
+-----------------------------------------------------------------------------
+FUNCTIONAL CHANGES
+-----------------------------------------------------------------------------
+- Added special GX2_READ and GX2_WRITE instead of READ/WRITE supplied by
+ system.
+-----------------------------------------------------------------------------
+DEFECTS CORRECTED
+-----------------------------------------------------------------------------
+- None.
+-----------------------------------------------------------------------------
+FILE CHANGES
+ gx2_9211.c
+ gx2_9211.h
+ panel.c
+ panel.h
+ platform.c
+ pnl_bios.c
+-----------------------------------------------------------------------------
+Version changes v1.3.3 12/17/02
+-----------------------------------------------------------------------------
+Dependencies:
+ - crlf v1.0.1o
+-----------------------------------------------------------------------------
+FUNCTIONAL CHANGES
+-----------------------------------------------------------------------------
+- None
+-----------------------------------------------------------------------------
+DEFECTS CORRECTED
+-----------------------------------------------------------------------------
+- 125.10 Panel code no longer compiles under WinCE with latest change.
+-----------------------------------------------------------------------------
+FILE CHANGES
+ drac9210.c
+-----------------------------------------------------------------------------
+Version changes v1.3.2 12/10/02
+-----------------------------------------------------------------------------
+Dependencies:
+ - crlf v1.0.1o
+-----------------------------------------------------------------------------
+FUNCTIONAL CHANGES
+-----------------------------------------------------------------------------
+- Did code indentation for XFree release.
+-----------------------------------------------------------------------------
+DEFECTS CORRECTED
+-----------------------------------------------------------------------------
+- None.
+-----------------------------------------------------------------------------
+FILE CHANGES
+ 92xx.h
+ cen9211.c
+ cen9211.h
+ dora9211.c
+ dora9211.h
+ drac9210.c
+ drac9210.h
+ gx2_9211.c
+ gx2_9211.h
+ panel.h
+ panel.c
+ platform.c
+ pnl_bios.c
+ pnl_defs.h
+ pnl_init.c
+-----------------------------------------------------------------------------
+Version changes v1.3.1 12/06/02
+-----------------------------------------------------------------------------
+Dependencies:
+ - crlf v1.0.1o
+-----------------------------------------------------------------------------
+FUNCTIONAL CHANGES
+-----------------------------------------------------------------------------
+- Added function protoype.
+-----------------------------------------------------------------------------
+DEFECTS CORRECTED
+-----------------------------------------------------------------------------
+- None.
+-----------------------------------------------------------------------------
+FILE CHANGES
+ cen9211.h
+ dora9211.h
+ gx2_9211.h
+-----------------------------------------------------------------------------
+Version changes v1.3.0 11/29/02
+-----------------------------------------------------------------------------
+Dependencies:
+ - crlf v1.0.1o
+-----------------------------------------------------------------------------
+FUNCTIONAL CHANGES
+-----------------------------------------------------------------------------
+- None.
+-----------------------------------------------------------------------------
+DEFECTS CORRECTED
+-----------------------------------------------------------------------------
+- cursor variable not defined for XFree when not as a module.
+-----------------------------------------------------------------------------
+FILE CHANGES
+ platform.c
+-----------------------------------------------------------------------------
+Version changes v1.2.9 7/31/02
+-----------------------------------------------------------------------------
+Dependencies:
+ - crlf v1.0.1o
+-----------------------------------------------------------------------------
+FUNCTIONAL CHANGES
+-----------------------------------------------------------------------------
+Added FP setup from user input.
+Added Redcloud Panel initialization.
+-----------------------------------------------------------------------------
+DEFECTS CORRECTED
+-----------------------------------------------------------------------------
+- None listed
+-----------------------------------------------------------------------------
+FILE CHANGES
+ pnl_init.c
+ panel.c
+ platform.c
+ gx2_9211.c
+ gx2_9211.h
+-----------------------------------------------------------------------------
+Version changes v1.2.8 5/16/02
+-----------------------------------------------------------------------------
+Dependencies:
+ - crlf v1.0.1o
+-----------------------------------------------------------------------------
+FUNCTIONAL CHANGES
+-----------------------------------------------------------------------------
+Added FP detection with BIOS for GX2.
+-----------------------------------------------------------------------------
+DEFECTS CORRECTED
+-----------------------------------------------------------------------------
+- None listed
+-----------------------------------------------------------------------------
+FILE CHANGES
+ pnl_bios.c
+-----------------------------------------------------------------------------
+Version changes v1.2.7 1/20/02
+-----------------------------------------------------------------------------
+Dependencies:
+ - crlf v1.0.1o
+-----------------------------------------------------------------------------
+FUNCTIONAL CHANGES
+-----------------------------------------------------------------------------
+Added the protoype for gfx_detect_video.
+Durango dependency removed.
+-----------------------------------------------------------------------------
+DEFECTS CORRECTED
+-----------------------------------------------------------------------------
+- None listed
+-----------------------------------------------------------------------------
+FILE CHANGES
+ panel.c
+-----------------------------------------------------------------------------
+Version changes v1.2.6 12/1/01
+-----------------------------------------------------------------------------
+Dependencies:
+ - crlf v1.0.1o
+ - Durango 2.35.01
+
+-----------------------------------------------------------------------------
+FUNCTIONAL CHANGES
+-----------------------------------------------------------------------------
+Toggle 5530/scx200/RC FlatPanel Power and Data accordingly during
+power up/down.
+
+-----------------------------------------------------------------------------
+DEFECTS CORRECTED
+-----------------------------------------------------------------------------
+- None listed
+-----------------------------------------------------------------------------
+FILE CHANGES
+ pnl_init.c
+-----------------------------------------------------------------------------
+Version changes v1.2.5 11/1/01
+-----------------------------------------------------------------------------
+Dependencies:
+ - crlf v1.0.1o
+ - Durango 2.35.01
+
+-----------------------------------------------------------------------------
+FUNCTIONAL CHANGES
+-----------------------------------------------------------------------------
+Re-Enabled the Draco platform support.
+
+-----------------------------------------------------------------------------
+DEFECTS CORRECTED
+-----------------------------------------------------------------------------
+- None listed
+-----------------------------------------------------------------------------
+FILE CHANGES
+ panel_defs.h
+ pnl_init.c
+-----------------------------------------------------------------------------
+Version changes v1.2.4 08/12/01
+-----------------------------------------------------------------------------
+Dependencies:
+ - crlf v1.0.1
+ - Durango 2.33.01
+
+-----------------------------------------------------------------------------
+FUNCTIONAL CHANGES
+-----------------------------------------------------------------------------
+Added 2 functions to get the FP setting details from BIOS.
+
+int Pnl_IsPanelEnabledInBIOS(void);
+void Pnl_GetPanelInfoFromBIOS(int *xres, int *yres, int *bpp, int *hz);
+
+-----------------------------------------------------------------------------
+DEFECTS CORRECTED
+-----------------------------------------------------------------------------
+- None listed
+-----------------------------------------------------------------------------
+FILE CHANGES
+ panel.h
+ pnl_bios.c
+-----------------------------------------------------------------------------
+Version changes v1.2.3 06/05/01
+-----------------------------------------------------------------------------
+Dependencies:
+ - crlf v1.0.1
+ - Durango 2.31.00
+
+-----------------------------------------------------------------------------
+FUNCTIONAL CHANGES
+-----------------------------------------------------------------------------
+Code cleanup and documentation.
+
+-----------------------------------------------------------------------------
+DEFECTS CORRECTED
+-----------------------------------------------------------------------------
+- None listed
+-----------------------------------------------------------------------------
+FILE CHANGES
+ panel.h
+ cen9211.c
+ cen9211.h
+ dora9211.c
+ dora9211.h
+ panel.h
+ pnl_init.c
+-----------------------------------------------------------------------------
+Version changes v1.2.2 04/11/01
+-----------------------------------------------------------------------------
+Dependencies:
+ - Durango 2.27.00
+
+-----------------------------------------------------------------------------
+FUNCTIONAL CHANGES
+-----------------------------------------------------------------------------
+Added Pnl_PowerUp and Pnl_PowerDown Functions.
+
+-----------------------------------------------------------------------------
+DEFECTS CORRECTED
+-----------------------------------------------------------------------------
+- None listed
+-----------------------------------------------------------------------------
+FILE CHANGES
+ panel.h
+ cen9211.c
+ cen9211.h
+ dora9211.c
+ dora9211.h
+ panel.h
+ pnl_init.c
+-----------------------------------------------------------------------------
+Version changes v1.2.1 03/29/01
+-----------------------------------------------------------------------------
+Dependencies:
+ - Durango 2.25
+
+-----------------------------------------------------------------------------
+FUNCTIONAL CHANGES
+-----------------------------------------------------------------------------
+Added Pnl_SavePanelState and Pnl_RestorePanelState Functions.
+
+-----------------------------------------------------------------------------
+DEFECTS CORRECTED
+-----------------------------------------------------------------------------
+- None listed
+-----------------------------------------------------------------------------
+FILE CHANGES
+ panel.h
+ 92xx.h
+ cen9211.c
+ cen9211.h
+ dora9211.c
+ dora9211.h
+ platform.c
+ pnl_init.c
+-----------------------------------------------------------------------------
+Version changes v1.2.0 03/04/01
+-----------------------------------------------------------------------------
+Dependencies:
+ - Durango 2.23
+
+-----------------------------------------------------------------------------
+FUNCTIONAL CHANGES
+-----------------------------------------------------------------------------
+Use inb/out routines from durango directly.
+-----------------------------------------------------------------------------
+DEFECTS CORRECTED
+-----------------------------------------------------------------------------
+- None listed
+-----------------------------------------------------------------------------
+FILE CHANGES
+ panel.h -inb/outb deleted.
+=============================================================================
+Version changes v1.0.1 02/02/01
+-----------------------------------------------------------------------------
+Dependencies:
+ - Durango 2.19
+
+-----------------------------------------------------------------------------
+FUNCTIONAL CHANGES
+-----------------------------------------------------------------------------
+Added 9211 Rev. C on Centaurus platform.
+
+-----------------------------------------------------------------------------
+DEFECTS CORRECTED
+-----------------------------------------------------------------------------
+- None listed
+-----------------------------------------------------------------------------
+FILE CHANGES
+ 92xx.h -9211 Rev.C.
+ cen9211.c - centaurus 9211_C support file.
+ cen9211.h - centaurus 9211_C support file.
+ platform.c - Support for detection of platform in which driver runs.
+=============================================================================
+Version changes v1.0.0 01/21/01
+-----------------------------------------------------------------------------
+Dependencies:
+ - Durango 2.16
+
+-----------------------------------------------------------------------------
+FUNCTIONAL CHANGES
+-----------------------------------------------------------------------------
+Detection of platform
+Detection of 92x chip with version and the panel sected by jumper settings.
+initialization of the h/w.
+-----------------------------------------------------------------------------
+DEFECTS CORRECTED
+-----------------------------------------------------------------------------
+- None listed
+-----------------------------------------------------------------------------
+FILE CHANGES
+ 92xx.h -common file with all 9211/9210 definitions.
+ cen9211.c - centaurus 9211_A support file.
+ cen9211.h - centaurus 9211_A support file.
+ dora9211.c - dorado 9211_A support file.
+ dora9211.h - dorado 9211_C support file.
+ drac9210.c - draco 9210 support file.
+ drac9210.h - draco 9210 support file.
+ panel.c - This is the confiuration file to enable support for platforms.
+ panel.h - centaurus 9211_A support file.
+ platform.c - Support for detection of platform in which driver runs.
+ pnl_defs.h - common definitions for panel.
+ pnl_init.c - configurationto call appropriate platform calls.
+ readme.txt - this file.
+-----------------------------------------------------------------------------
+-----------------------------------------------------------------------------
+KNOWN ERRATA
+-----------------------------------------------------------------------------
+- None listed
+-----------------------------------------------------------------------------
+