1f29dbc25Smrg/* Copyright (c) 2005 Advanced Micro Devices, Inc.
2f29dbc25Smrg *
3f29dbc25Smrg * Permission is hereby granted, free of charge, to any person obtaining a copy
4f29dbc25Smrg * of this software and associated documentation files (the "Software"), to
5f29dbc25Smrg * deal in the Software without restriction, including without limitation the
6f29dbc25Smrg * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7f29dbc25Smrg * sell copies of the Software, and to permit persons to whom the Software is
8f29dbc25Smrg * furnished to do so, subject to the following conditions:
9f29dbc25Smrg *
10f29dbc25Smrg * The above copyright notice and this permission notice shall be included in
11f29dbc25Smrg * all copies or substantial portions of the Software.
12f29dbc25Smrg *
13f29dbc25Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14f29dbc25Smrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15f29dbc25Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16f29dbc25Smrg * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17f29dbc25Smrg * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18f29dbc25Smrg * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19f29dbc25Smrg * IN THE SOFTWARE.
20f29dbc25Smrg *
21f29dbc25Smrg * Neither the name of the Advanced Micro Devices, Inc. nor the names of its
22f29dbc25Smrg * contributors may be used to endorse or promote products derived from this
23f29dbc25Smrg * software without specific prior written permission.
24f29dbc25Smrg * */
25f29dbc25Smrg
26f29dbc25Smrg/*
27f29dbc25Smrg * File Contents:   This header file defines the Durango routines and
28f29dbc25Smrg *                  variables used to access the memory mapped regions.
29f29dbc25Smrg *
30f29dbc25Smrg * SubModule:       Geode FlatPanel library
31f29dbc25Smrg * */
32f29dbc25Smrg
33f29dbc25Smrg#include "92xx.h"
34f29dbc25Smrg#include "panel.h"
35f29dbc25Smrg
36f29dbc25Smrg#ifndef _CEN9211_h
37f29dbc25Smrg#define _CEN9211_h
38f29dbc25Smrg
39f29dbc25Smrg/* Centaurus/97317 GPIO PORT defines  */
40f29dbc25Smrg
41f29dbc25Smrg#define CENT_97317_CLOCK_PORT		0xE0
42f29dbc25Smrg#define CENT_97317_DATA_OUTPORT		0xE0
43f29dbc25Smrg#define CENT_97317_CHIP_SELECT		0xE4
44f29dbc25Smrg#define CENT_97317_DATA_INPORT		0xE4
45f29dbc25Smrg#define CENT_PORT1_DIRECTION		0xE1
46f29dbc25Smrg#define CENT_PORT2_DIRECTION		0xE5
47f29dbc25Smrg#define CENT_PORT1_OUTPUT_TYPE		0xE2
48f29dbc25Smrg#define CENT_PORT2_OUTPUT_TYPE		0xE6
49f29dbc25Smrg
50f29dbc25Smrg/*
51f29dbc25Smrg * Centaurus/97317 GPIO bit masks.
52f29dbc25Smrg * In and out are with respect to the 97317.
53f29dbc25Smrg */
54f29dbc25Smrg
55f29dbc25Smrg#define CENT_97317_CLOCK_MASK		0x10
56f29dbc25Smrg#define CENT_97317_CHIP_SEL_MASK	0x01
57f29dbc25Smrg#define CENT_97317_DATA_IN_MASK		0x02
58f29dbc25Smrg#define CENT_97317_DATA_OUT_MASK	0x80
59f29dbc25Smrg
60f29dbc25Smrg#define CENT_PASS    1
61f29dbc25Smrg#define CENT_FAIL    0
62f29dbc25Smrg#define CENT_READ    0x0000
63f29dbc25Smrg#define CENT_WRITE   0x0001
64f29dbc25Smrg#define CENT_NO_DATA 0
65f29dbc25Smrg
66f29dbc25Smrg#define CENT_CONFIG_INDEX  0x2E
67f29dbc25Smrg#define CENT_SIOC2         0x22
68f29dbc25Smrg#define CENT_CONFIG_DATA   0x2F
69f29dbc25Smrg#define CENT_GPIO_BANK_SELECT	0x80
70f29dbc25Smrg
71f29dbc25Smrg#define CENT_NUM_READ_CLOCK_TOGGLES	1
72f29dbc25Smrg#define CENT_NUM_WRITE_CLOCK_TOGGLES	4
73f29dbc25Smrg
74f29dbc25Smrg/* local functions */
75f29dbc25Smrgvoid set_Centaurus_92xx_mode_params(int mode);
76f29dbc25Smrgvoid enable_Centaurus_9211_chip_select(void);
77f29dbc25Smrgvoid disable_Centaurus_9211_chip_select(void);
78f29dbc25Smrgvoid toggle_Centaurus_9211_clock(void);
79f29dbc25Smrgvoid write_Centaurus_CX9211_GPIO(unsigned char databit);
80f29dbc25Smrgvoid write_Centaurus_CX9211_DWdata(unsigned long data);
8104007ebaSmrgvoid Centaurus_write_gpio(int width, unsigned long address, unsigned long data);
82f29dbc25Smrgvoid Centaurus_Power_Up(void);
83f29dbc25Smrgvoid Centaurus_Power_Down(void);
84f29dbc25Smrgunsigned long Centaurus_read_gpio(int width, unsigned long address);
85f29dbc25Smrgunsigned char read_Centaurus_CX9211_GPIO(void);
86f29dbc25Smrgunsigned long read_Centaurus_CX9211_DWdata(void);
87f29dbc25Smrgunsigned char restore_Centaurus_97317_SIOC2(void);
88f29dbc25Smrgunsigned char init_Centaurus_GPIO(void);
89f29dbc25Smrgunsigned char init_Centaurus_9211(void);
90f29dbc25Smrgunsigned char set_Centaurus_92xx_mode(Pnl_PanelStat * pstat);
91f29dbc25Smrgvoid CentaurusProgramFRMload(void);
9204007ebaSmrgvoid Centaurus_Get_9211_Details(unsigned long flags, Pnl_PanelParams * pParam);
93f29dbc25Smrgvoid Centaurus_Save_Panel_State(void);
94f29dbc25Smrgvoid Centaurus_Restore_Panel_State(void);
95f29dbc25Smrgvoid Centaurus_9211init(Pnl_PanelStat * pstat);
96f29dbc25Smrg
9704007ebaSmrg#endif                          /* !_CEN9211_h */
98f29dbc25Smrg
99f29dbc25Smrg/* END OF FILE */
100