1/* Copyright (c) 2005 Advanced Micro Devices, Inc. 2 * 3 * Permission is hereby granted, free of charge, to any person obtaining a copy 4 * of this software and associated documentation files (the "Software"), to 5 * deal in the Software without restriction, including without limitation the 6 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 * sell copies of the Software, and to permit persons to whom the Software is 8 * furnished to do so, subject to the following conditions: 9 * 10 * The above copyright notice and this permission notice shall be included in 11 * all copies or substantial portions of the Software. 12 * 13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 * IN THE SOFTWARE. 20 * 21 * Neither the name of the Advanced Micro Devices, Inc. nor the names of its 22 * contributors may be used to endorse or promote products derived from this 23 * software without specific prior written permission. 24 * */ 25 26/* 27 * File Contents: This header file defines the Durango routines and 28 * variables used to access the memory mapped regions. 29 * 30 * SubModule: Geode FlatPanel library 31 * */ 32 33#include "panel.h" 34#include "92xx.h" 35 36#ifndef _DORA9211_h 37#define _DORA9211_h 38 39/* 9211 Rev.C3 Dorado */ 40 41/* GPIO Pin Configuration Registers */ 42 43#define DRD_GEODE_GPPIN_SEL 0x20 /* GPIO Pin Configuration Select */ 44#define DRD_GEODE_GPPIN_CFG 0x24 /* GPIO Pin Configuration Access */ 45#define DRD_GEODE_GPPIN_RESET 0x28 /* GPIO Pin Reset */ 46 47#define DRD_GEODE_GPIO_BASE 0x6400 /* F0 GPIO, IO mapped */ 48#define DRD_GEODE_GPDI0 0x04 /* GPIO Data In 0 */ 49#define DRD_GEODE_GPDO0 0x00 /* GPIO Data Out 0 */ 50 51/* Data Ports in */ 52#define DRD_CLOCKP9211IN DRD_GEODE_GPIO_BASE + DRD_GEODE_GPDI0 53#define DRD_DATAINP9211IN DRD_GEODE_GPIO_BASE + DRD_GEODE_GPDI0 54#define DRD_DATAOUTP9211IN DRD_GEODE_GPIO_BASE + DRD_GEODE_GPDI0 55#define DRD_CSP9211IN DRD_GEODE_GPIO_BASE + DRD_GEODE_GPDI0 56 57/* Data Ports out */ 58#define DRD_CLOCKP9211OUT DRD_GEODE_GPIO_BASE + DRD_GEODE_GPDO0 59#define DRD_DATAINP9211OUT DRD_GEODE_GPIO_BASE + DRD_GEODE_GPDO0 60#define DRD_DATAOUTP9211OUT DRD_GEODE_GPIO_BASE + DRD_GEODE_GPDO0 61#define DRD_CSP9211OUT DRD_GEODE_GPIO_BASE + DRD_GEODE_GPDO0 62 63/* Pin MASKS */ 64#define DRD_CLOCK9211 0x00000080 /* gpio 7, clock output to 9211 */ 65#define DRD_DATAIN9211 0x00040000 /* gpio 18, data output to 9211 */ 66#define DRD_DATAOUT9211 0x00000800 /* gpio 11, data input from 9211 */ 67#define DRD_CS9211 0x00000200 /* gpio 9, chip select output to 9211 68 * */ 69 70/* Gpio CFG values to select in */ 71#define DRD_CLOCK9211CFG 0x00000007 /* gpio 7 */ 72#define DRD_DATAIN9211CFG 0x00000012 /* gpio 18 */ 73#define DRD_DATAOUT9211CFG 0x0000000B /* gpio 11 */ 74#define DRD_CS9211CFG 0x00000009 /* gpio 9 */ 75 76#define DRD_LCDRESGPIO1 0x00 77#define DRD_LCDRESGPIO2 0x01 78#define DRD_LCDRESGPIO3 0x02 79#define DRD_LCDRESGPIO4 0x04 80 81void Dorado9211SetCS(void); 82void Dorado9211ClearCS(void); 83void Dorado9211SetDataOut(void); 84void Dorado9211ClearDataOut(void); 85unsigned char Dorado9211ReadDataIn(void); 86void Dorado9211ToggleClock(void); 87void Dorado9211SetClock(void); 88void Dorado9211ClearClock(void); 89void Dorado9211GpioInit(void); 90unsigned long Dorado9211ReadReg(unsigned short index); 91void Dorado9211WriteReg(unsigned short index, unsigned long data); 92void DoradoProgramFRMload(void); 93void Dorado_Get_9211_Details(unsigned long flags, Pnl_PanelParams * pParam); 94void Dorado_Power_Up(void); 95void Dorado_Power_Down(void); 96void Dorado_Save_Panel_State(void); 97void Dorado_Restore_Panel_State(void); 98void Dorado9211Init(Pnl_PanelStat * pstat); 99 100#endif /* !_DORA9211_h */ 101