1/* $XFree86$ */
2/*
3 * $Workfile: dora9211.h $
4 * $Revision: 1.1.1.1 $
5 *
6 * File Contents: This header file defines the Durango routines and
7 *                variables used to access the memory mapped regions.
8 *
9 * SubModule:     Geode FlatPanel library
10 *
11 */
12
13/*
14 * NSC_LIC_ALTERNATIVE_PREAMBLE
15 *
16 * Revision 1.0
17 *
18 * National Semiconductor Alternative GPL-BSD License
19 *
20 * National Semiconductor Corporation licenses this software
21 * ("Software"):
22 *
23 *     Geode graphics driver for panel support
24 * under one of the two following licenses, depending on how the
25 * Software is received by the Licensee.
26 *
27 * If this Software is received as part of the Linux Framebuffer or
28 * other GPL licensed software, then the GPL license designated
29 * NSC_LIC_GPL applies to this Software; in all other circumstances
30 * then the BSD-style license designated NSC_LIC_BSD shall apply.
31 *
32 * END_NSC_LIC_ALTERNATIVE_PREAMBLE */
33
34/* NSC_LIC_BSD
35 *
36 * National Semiconductor Corporation Open Source License for Durango
37 *
38 * (BSD License with Export Notice)
39 *
40 * Copyright (c) 1999-2001
41 * National Semiconductor Corporation.
42 * All rights reserved.
43 *
44 * Redistribution and use in source and binary forms, with or without
45 * modification, are permitted provided that the following conditions
46 * are met:
47 *
48 *   * Redistributions of source code must retain the above copyright
49 *     notice, this list of conditions and the following disclaimer.
50 *
51 *   * Redistributions in binary form must reproduce the above
52 *     copyright notice, this list of conditions and the following
53 *     disclaimer in the documentation and/or other materials provided
54 *     with the distribution.
55 *
56 *   * Neither the name of the National Semiconductor Corporation nor
57 *     the names of its contributors may be used to endorse or promote
58 *     products derived from this software without specific prior
59 *     written permission.
60 *
61 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
62 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
63 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
64 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
65 * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY
66 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
67 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
68 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
69 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
70 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE,
71 * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY
72 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
73 * OF SUCH DAMAGE.
74 *
75 * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF
76 * YOUR JURISDICTION. It is licensee's responsibility to comply with
77 * any export regulations applicable in licensee's jurisdiction. Under
78 * CURRENT (2001) U.S. export regulations this software
79 * is eligible for export from the U.S. and can be downloaded by or
80 * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed
81 * destinations which include Cuba, Iraq, Libya, North Korea, Iran,
82 * Syria, Sudan, Afghanistan and any other country to which the U.S.
83 * has embargoed goods and services.
84 *
85 * END_NSC_LIC_BSD */
86
87/* NSC_LIC_GPL
88 *
89 * National Semiconductor Corporation Gnu General Public License for Durango
90 *
91 * (GPL License with Export Notice)
92 *
93 * Copyright (c) 1999-2001
94 * National Semiconductor Corporation.
95 * All rights reserved.
96 *
97 * Redistribution and use in source and binary forms, with or without
98 * modification, are permitted under the terms of the GNU General
99 * Public License as published by the Free Software Foundation; either
100 * version 2 of the License, or (at your option) any later version
101 *
102 * In addition to the terms of the GNU General Public License, neither
103 * the name of the National Semiconductor Corporation nor the names of
104 * its contributors may be used to endorse or promote products derived
105 * from this software without specific prior written permission.
106 *
107 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
108 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
109 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
110 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
111 * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY
112 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
113 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
114 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
115 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
116 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE,
117 * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY
118 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
119 * OF SUCH DAMAGE. See the GNU General Public License for more details.
120 *
121 * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF
122 * YOUR JURISDICTION. It is licensee's responsibility to comply with
123 * any export regulations applicable in licensee's jurisdiction. Under
124 * CURRENT (2001) U.S. export regulations this software
125 * is eligible for export from the U.S. and can be downloaded by or
126 * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed
127 * destinations which include Cuba, Iraq, Libya, North Korea, Iran,
128 * Syria, Sudan, Afghanistan and any other country to which the U.S.
129 * has embargoed goods and services.
130 *
131 * You should have received a copy of the GNU General Public License
132 * along with this file; if not, write to the Free Software Foundation,
133 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
134 *
135 * END_NSC_LIC_GPL */
136
137#include "panel.h"
138#include "92xx.h"
139
140#ifndef _DORA9211_h
141#define _DORA9211_h
142
143/* 9211 Rev.C3 Dorado */
144
145/* GPIO Pin Configuration Registers */
146
147#define DRD_GEODE_GPPIN_SEL	0x20	/* GPIO Pin Configuration Select */
148#define DRD_GEODE_GPPIN_CFG	0x24	/* GPIO Pin Configuration Access */
149#define DRD_GEODE_GPPIN_RESET	0x28	/* GPIO Pin Reset */
150
151#define DRD_GEODE_GPIO_BASE	0x6400	/* F0 GPIO, IO mapped */
152#define DRD_GEODE_GPDI0		0x04	/* GPIO Data In 0 */
153#define DRD_GEODE_GPDO0		0x00	/* GPIO Data Out 0 */
154
155/* Data Ports in */
156#define	DRD_CLOCKP9211IN	DRD_GEODE_GPIO_BASE + DRD_GEODE_GPDI0
157#define	DRD_DATAINP9211IN	DRD_GEODE_GPIO_BASE + DRD_GEODE_GPDI0
158#define	DRD_DATAOUTP9211IN	DRD_GEODE_GPIO_BASE + DRD_GEODE_GPDI0
159#define	DRD_CSP9211IN		DRD_GEODE_GPIO_BASE + DRD_GEODE_GPDI0
160
161/* Data Ports out */
162#define	DRD_CLOCKP9211OUT	DRD_GEODE_GPIO_BASE + DRD_GEODE_GPDO0
163#define	DRD_DATAINP9211OUT	DRD_GEODE_GPIO_BASE + DRD_GEODE_GPDO0
164#define	DRD_DATAOUTP9211OUT	DRD_GEODE_GPIO_BASE + DRD_GEODE_GPDO0
165#define DRD_CSP9211OUT		DRD_GEODE_GPIO_BASE + DRD_GEODE_GPDO0
166
167/* Pin MASKS */
168#define	DRD_CLOCK9211	0x00000080	/*;gpio 7, clock output to 9211 */
169#define	DRD_DATAIN9211	0x00040000	/*;gpio 18, data output to 9211 */
170#define	DRD_DATAOUT9211	0x00000800	/*;gpio 11, data input from 9211 */
171#define	DRD_CS9211	0x00000200	/*;gpio 9, chip select output to 9211 */
172
173/* Gpio CFG values to select in  */
174#define	DRD_CLOCK9211CFG	0x00000007	/* ;gpio 7 */
175#define	DRD_DATAIN9211CFG	0x00000012	/* ;gpio 18 */
176#define	DRD_DATAOUT9211CFG	0x0000000B	/* ;gpio 11 */
177#define	DRD_CS9211CFG		0x00000009	/* ;gpio 9 */
178
179#define DRD_LCDRESGPIO1		0x00
180#define DRD_LCDRESGPIO2		0x01
181#define DRD_LCDRESGPIO3		0x02
182#define DRD_LCDRESGPIO4		0x04
183
184void Dorado9211SetCS(void);
185void Dorado9211ClearCS(void);
186void Dorado9211SetDataOut(void);
187void Dorado9211ClearDataOut(void);
188unsigned char Dorado9211ReadDataIn(void);
189void Dorado9211ToggleClock(void);
190void Dorado9211SetClock(void);
191void Dorado9211ClearClock(void);
192void Dorado9211GpioInit(void);
193unsigned long Dorado9211ReadReg(unsigned short index);
194void Dorado9211WriteReg(unsigned short index, unsigned long data);
195void DoradoProgramFRMload(void);
196void Dorado_Get_9211_Details(unsigned long flags, PPnl_PanelParams pParam);
197void Dorado_Power_Up(void);
198void Dorado_Power_Down(void);
199void Dorado_Save_Panel_State(void);
200void Dorado_Restore_Panel_State(void);
201void Dorado9211Init(Pnl_PanelStat * pstat);
202
203#endif /* !_DORA9211_h */
204