cen9211.h revision 04007eba
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 "92xx.h"
34#include "panel.h"
35
36#ifndef _CEN9211_h
37#define _CEN9211_h
38
39/* Centaurus/97317 GPIO PORT defines  */
40
41#define CENT_97317_CLOCK_PORT		0xE0
42#define CENT_97317_DATA_OUTPORT		0xE0
43#define CENT_97317_CHIP_SELECT		0xE4
44#define CENT_97317_DATA_INPORT		0xE4
45#define CENT_PORT1_DIRECTION		0xE1
46#define CENT_PORT2_DIRECTION		0xE5
47#define CENT_PORT1_OUTPUT_TYPE		0xE2
48#define CENT_PORT2_OUTPUT_TYPE		0xE6
49
50/*
51 * Centaurus/97317 GPIO bit masks.
52 * In and out are with respect to the 97317.
53 */
54
55#define CENT_97317_CLOCK_MASK		0x10
56#define CENT_97317_CHIP_SEL_MASK	0x01
57#define CENT_97317_DATA_IN_MASK		0x02
58#define CENT_97317_DATA_OUT_MASK	0x80
59
60#define CENT_PASS    1
61#define CENT_FAIL    0
62#define CENT_READ    0x0000
63#define CENT_WRITE   0x0001
64#define CENT_NO_DATA 0
65
66#define CENT_CONFIG_INDEX  0x2E
67#define CENT_SIOC2         0x22
68#define CENT_CONFIG_DATA   0x2F
69#define CENT_GPIO_BANK_SELECT	0x80
70
71#define CENT_NUM_READ_CLOCK_TOGGLES	1
72#define CENT_NUM_WRITE_CLOCK_TOGGLES	4
73
74/* local functions */
75void set_Centaurus_92xx_mode_params(int mode);
76void enable_Centaurus_9211_chip_select(void);
77void disable_Centaurus_9211_chip_select(void);
78void toggle_Centaurus_9211_clock(void);
79void write_Centaurus_CX9211_GPIO(unsigned char databit);
80void write_Centaurus_CX9211_DWdata(unsigned long data);
81void Centaurus_write_gpio(int width, unsigned long address, unsigned long data);
82void Centaurus_Power_Up(void);
83void Centaurus_Power_Down(void);
84unsigned long Centaurus_read_gpio(int width, unsigned long address);
85unsigned char read_Centaurus_CX9211_GPIO(void);
86unsigned long read_Centaurus_CX9211_DWdata(void);
87unsigned char restore_Centaurus_97317_SIOC2(void);
88unsigned char init_Centaurus_GPIO(void);
89unsigned char init_Centaurus_9211(void);
90unsigned char set_Centaurus_92xx_mode(Pnl_PanelStat * pstat);
91void CentaurusProgramFRMload(void);
92void Centaurus_Get_9211_Details(unsigned long flags, Pnl_PanelParams * pParam);
93void Centaurus_Save_Panel_State(void);
94void Centaurus_Restore_Panel_State(void);
95void Centaurus_9211init(Pnl_PanelStat * pstat);
96
97#endif                          /* !_CEN9211_h */
98
99/* END OF FILE */
100