1/* $XFree86$ */
2/*
3 * $Workfile: 92xx.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 * NSC_LIC_ALTERNATIVE_PREAMBLE
14 *
15 * Revision 1.0
16 *
17 * National Semiconductor Alternative GPL-BSD License
18 *
19 * National Semiconductor Corporation licenses this software
20 * ("Software"):
21 *
22 * Panel Library
23 *
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
37 *
38 * Panel Library
39 *
40 * (BSD License with Export Notice)
41 *
42 * Copyright (c) 1999-2001
43 * National Semiconductor Corporation.
44 * All rights reserved.
45 *
46 * Redistribution and use in source and binary forms, with or without
47 * modification, are permitted provided that the following conditions
48 * are met:
49 *
50 *   * Redistributions of source code must retain the above copyright
51 *     notice, this list of conditions and the following disclaimer.
52 *
53 *   * Redistributions in binary form must reproduce the above
54 *     copyright notice, this list of conditions and the following
55 *     disclaimer in the documentation and/or other materials provided
56 *     with the distribution.
57 *
58 *   * Neither the name of the National Semiconductor Corporation nor
59 *     the names of its contributors may be used to endorse or promote
60 *     products derived from this software without specific prior
61 *     written permission.
62 *
63 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
64 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
65 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
66 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
67 * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY
68 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
69 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
70 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
71 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
72 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE,
73 * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY
74 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
75 * OF SUCH DAMAGE.
76 *
77 * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF
78 * YOUR JURISDICTION. It is licensee's responsibility to comply with
79 * any export regulations applicable in licensee's jurisdiction. Under
80 * CURRENT (2001) U.S. export regulations this software
81 * is eligible for export from the U.S. and can be downloaded by or
82 * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed
83 * destinations which include Cuba, Iraq, Libya, North Korea, Iran,
84 * Syria, Sudan, Afghanistan and any other country to which the U.S.
85 * has embargoed goods and services.
86 *
87 * END_NSC_LIC_BSD */
88
89/* NSC_LIC_GPL
90 *
91 * National Semiconductor Corporation Gnu General Public License for
92 *
93 * Panel Library
94 *
95 * (GPL License with Export Notice)
96 *
97 * Copyright (c) 1999-2001
98 * National Semiconductor Corporation.
99 * All rights reserved.
100 *
101 * Redistribution and use in source and binary forms, with or without
102 * modification, are permitted under the terms of the GNU General
103 * Public License as published by the Free Software Foundation; either
104 * version 2 of the License, or (at your option) any later version
105 *
106 * In addition to the terms of the GNU General Public License, neither
107 * the name of the National Semiconductor Corporation nor the names of
108 * its contributors may be used to endorse or promote products derived
109 * from this software without specific prior written permission.
110 *
111 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
112 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
113 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
114 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
115 * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY
116 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
117 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
118 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
119 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
120 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE,
121 * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY
122 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
123 * OF SUCH DAMAGE. See the GNU General Public License for more details.
124 *
125 * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF
126 * YOUR JURISDICTION. It is licensee's responsibility to comply with
127 * any export regulations applicable in licensee's jurisdiction. Under
128 * CURRENT (2001) U.S. export regulations this software
129 * is eligible for export from the U.S. and can be downloaded by or
130 * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed
131 * destinations which include Cuba, Iraq, Libya, North Korea, Iran,
132 * Syria, Sudan, Afghanistan and any other country to which the U.S.
133 * has embargoed goods and services.
134 *
135 * You should have received a copy of the GNU General Public License
136 * along with this file; if not, write to the Free Software Foundation,
137 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
138 *
139 * END_NSC_LIC_GPL */
140
141#ifndef _92XX_h
142#define _92XX_h
143
144typedef unsigned long ULONG;
145typedef unsigned char UCHAR;
146
147#define FALSE	         0
148#define TRUE             1
149#define NUM_92XX_MODES   13
150#define ONE_BYTE         1
151#define TWO_BYTES        2
152#define FOUR_BYTES       4
153
154/* LCD Registers
155 * The LCD memory area is shared by both TV and LCD.
156 * This offset is for LCD access.
157 */
158
159#define CS92xx_LCD_OFFSET     0x00000400
160
161/* LCD CONTROL REGISTERS */
162
163#define CS92xx_LCD_PAN_TIMING1	    CS92xx_LCD_OFFSET +	0x00
164
165/* flat panel(FP) timings */
166#define CS92xx_LCD_PAN_TIMING2      CS92xx_LCD_OFFSET +	0x04
167
168/* FP panel timings */
169#define CS92xx_LCD_PWR_MAN          CS92xx_LCD_OFFSET +	0x08
170
171/* FP power management */
172#define CS92xx_LCD_DITH_FR_CNTRL    CS92xx_LCD_OFFSET +	0x0C
173
174/* FP dither and frame rate
175 * these defines are in revisions prior to C
176 */
177#define CS92xx_LCD_BLOCK_SEL1       CS92xx_LCD_OFFSET +	0x10
178
179/* FRM register */
180#define CS92xx_LCD_BLOCK_SEL2       CS92xx_LCD_OFFSET +	0x14
181
182/* FRM register */
183#define CS92xx_LCD_DISPER1          CS92xx_LCD_OFFSET +	0x18
184
185/* FRM register */
186#define CS92xx_LCD_DISPER2          CS92xx_LCD_OFFSET +	0x1C
187
188/* FRM register
189 * these defines are revision C
190 */
191#define CS92xx_BLUE_LSFR_SEED       CS92xx_LCD_OFFSET +	0x10
192
193/* FRM register */
194#define CS92xx_RED_GREEN_LSFR_SEED  CS92xx_LCD_OFFSET +	0x14
195
196/* FRM register */
197#define CS92xx_FRM_MEMORY_INDEX     CS92xx_LCD_OFFSET +	0x18
198
199/* FRM register */
200#define CS92xx_FRM_MEMORY_DATA      CS92xx_LCD_OFFSET +	0x1C
201
202/* FRM register */
203#define CS92xx_LCD_MEM_CNTRL        CS92xx_LCD_OFFSET +	0x20
204
205/* memory PLL register */
206#define CS92xx_LCD_RAM_CNTRL        CS92xx_LCD_OFFSET +	0x24
207
208/* ram control */
209
210#define CS92xx_LCD_RAM_DATA         CS92xx_LCD_OFFSET +	0x28	/* ram data */
211
212#define CS92xx_LCD_PAN_CRC_SIG      CS92xx_LCD_OFFSET +	0x2C
213
214/* FP CRC signature */
215#define CS92xx_DEV_REV_ID           CS92xx_LCD_OFFSET +	0x30
216
217/* Device and revision id */
218#define CS92xx_LCD_GPIO_DATA        CS92xx_LCD_OFFSET +	0x34	/* GPIO Data */
219
220#define CS92xx_LCD_GPIO_CNTRL       CS92xx_LCD_OFFSET +	0x38
221
222/* GPIO Control */
223int Pnl_Rev_ID;
224
225typedef struct
226{
227   /* DISPLAY MODE PARAMETERS */
228   int xres;
229   int yres;
230   int bpp;
231   int panel_type;
232   int color_type;
233   /* VALUES USED TO SET THE FLAT PANEL DISPLAY CONTROLLER */
234   unsigned long panel_timing1;
235   unsigned long panel_timing2;
236   unsigned long power_management;
237   /* the following 5 registers are prior to revision C */
238   unsigned long pre_C_dither_frc;
239   unsigned long block_select1;
240   unsigned long block_select2;
241   unsigned long dispersion1;
242   unsigned long dispersion2;
243   /* the following 4 registers are revision C only */
244   unsigned long rev_C_dither_frc;
245   unsigned long blue_lsfr_seed;
246   unsigned long red_green_lsfr_seed;
247   unsigned long frm_memory_index;
248   unsigned long frm_memory_data;
249   unsigned long memory_control;
250
251}
252CS92xx_MODE;
253
254/* VALUES USED TO SAVE AND RESTORE 9211 REGISTERS. */
255typedef struct
256{
257   unsigned long panel_state;
258   /* VALUES USED TO SET THE FLAT PANEL DISPLAY CONTROLLER */
259   unsigned long panel_timing1;
260   unsigned long panel_timing2;
261   unsigned long power_management;
262   unsigned long dither_frc_ctrl;
263   unsigned long blue_lsfr_seed;
264   unsigned long red_green_lsfr_seed;
265   unsigned long frm_memory_index;
266   unsigned long frm_memory_data;
267   unsigned long memory_control;
268}
269CS92xx_REGS;
270
271CS92xx_REGS cs9211_regs;
272
273/*
274 *------------------------------------------------------------------------
275 * PANEL MODE TABLES:
276 * GLOBAL ARRAY OF FLAT PANEL MODE STRUCTURES
277 *------------------------------------------------------------------------
278 */
279CS92xx_MODE FPModeParams[] = {
280
281   {640, 480, 8, PNL_SSTN, PNL_COLOR_PANEL,	/* display parameters */
282    0x01e00000, 0x00034000,		/* panel timing reg 1, panel timing reg 2 */
283    0x01000000,				/* power management */
284    /* The next 5 values are prior to revision C */
285    0x00000050,				/* dither and frame rate control  */
286    0x25cf3096, 0xad47b81e,		/* block select 1, block select 2 */
287    0x21446450, 0x21446450,		/* dispersion 1, dispersion 2 */
288    /* The next 5 values are for revision C */
289    0x00000050,				/* dither and frame rate control */
290    0x00000000, 0x00000000,		/* blue LSFR, red and green LSFR */
291    0x00000000, 0x00000000,		/* FRM memory index, FRM memory data */
292    0x00000000,				/* memory control */
293    },
294
295   {640, 480, 12, PNL_TFT, PNL_COLOR_PANEL,	/* display parameters */
296    0x01e00000, 0x0f100000,		/* panel timing reg 1, panel timing reg 2 */
297    0x01000000,				/* power management */
298    /* The next 5 values are prior to revision C */
299    0x00000050,				/* dither and frame rate control */
300    0x00000000, 0x00000000,		/* block select 1, block select 2 */
301    0x00000000, 0x00000000,		/* dispersion 1, dispersion 2 */
302    /* The next 5 values are for revision C */
303    0x00000050,				/* dither and frame rate control  */
304    0x00000000, 0x00000000,		/* blue LSFR, red and green LSFR */
305    0x00000000, 0x00000000,		/* FRM memory index, FRM memory data */
306    0x00000000,				/* memory control */
307    },
308
309   {640, 480, 18, PNL_TFT, PNL_COLOR_PANEL,	/* display parameters */
310    0x01e00000, 0x0f100000,		/* panel timing reg 1, panel timing reg 2 */
311    0x01000000,				/* power management */
312    /* The next 5 values are prior to revision C */
313    0x00000050,				/* dither and frame rate control */
314    0x00000000, 0x00000000,		/* block select 1, block select 2 */
315    0x00000000, 0x00000000,		/* dispersion 1, dispersion 2 */
316    /* The next 5 values are for revision C */
317    0x00000050,				/* dither and frame rate control */
318    0x00000000, 0x00000000,		/* blue LSFR, red and green LSFR */
319    0x00000000, 0x00000000,		/* FRM memory index, FRM memory data */
320    0x00000000,				/* memory control */
321    },
322
323   {640, 480, 16, PNL_DSTN, PNL_COLOR_PANEL,	/* display parameters */
324    0x01e00000, 0x00014000,		/* panel timing reg 1, panel timing reg 2 */
325    0x01000000,				/* power management */
326    /* The next 5 values are prior to revision C */
327    0x00000050,				/* dither and frame rate control */
328    0x048c26ae, 0x048c26ae,		/* block select 1, block select 2 */
329    0x02468ace, 0x13579bdf,		/* dispersion 1, dispersion 2 */
330    /* The next 5 values are for revision C */
331    0x0000004b,				/* dither and frame rate control */
332    0x00000000, 0x00000000,		/* blue LSFR, red and green LSFR */
333    0x00000000, 0x00000000,		/* FRM memory index, FRM memory data */
334    0x00000007,				/* memory control */
335    },
336
337   {640, 480, 8, PNL_DSTN, PNL_MONO_PANEL,	/* display parameters */
338    0x01e00000, 0x00084000,		/* panel timing reg 1, panel timing reg 2 */
339    0x01000000,				/* power management */
340    /* The next 5 values are prior to revision C */
341    0x0000004b,				/* dither and frame rate control */
342    0x25cf3096, 0xad47b81e,		/* block select 1, block select 2 */
343    0x21446450, 0x21446450,		/* dispersion 1, dispersion 2 */
344    /* The next 5 values are for revision C  */
345    0x00000050,				/* dither and frame rate control */
346    0x00000000, 0x00000000,		/* blue LSFR, red and green LSFR */
347    0x00000000, 0x00000000,		/* FRM memory index, FRM memory data */
348    0x00000007,				/* memory control */
349    },
350
351   {640, 480, 16, PNL_DSTN, PNL_MONO_PANEL,	/* display parameters */
352    0x01e00000, 0x00094000,		/* panel timing reg 1, panel timing reg 2 */
353    0x01000000,				/* power management */
354    /* The next 5 values are prior to revision C */
355    0x00000050,				/* dither and frame rate control  */
356    0x25cf3096, 0xad47b81e,		/* block select 1, block select 2 */
357    0x81a5d470, 0x29cfb63e,		/* dispersion 1, dispersion 2 */
358    /* The next 5 values are for revision C */
359    0x00000050,				/* dither and frame rate control  */
360    0x00000000, 0x00000000,		/* blue LSFR, red and green LSFR */
361    0x00000000, 0x00000000,		/* FRM memory index, FRM memory data */
362    0x00000007,				/* memory control */
363    },
364
365   {800, 600, 12, PNL_TFT, PNL_COLOR_PANEL,	/* display parameters */
366    0x02580000, 0x0f100000,		/* panel timing reg 1, panel timing reg 2 */
367    0x01000000,				/* power management */
368    /* The next 5 values are prior to revision C */
369    0x00000050,				/* dither and frame rate control  */
370    0x00000000, 0x00000000,		/* block select 1, block select 2 */
371    0x00000000, 0x00000000,		/* dispersion 1, dispersion 2 */
372    /* The next 5 values are for revision C */
373    0x00000050,				/* dither and frame rate control  */
374    0x00000000, 0x00000000,		/* blue LSFR, red and green LSFR */
375    0x00000000, 0x00000000,		/* FRM memory index, FRM memory data */
376    0x00000000,				/* memory control */
377    },
378
379   {800, 600, 18, PNL_TFT, PNL_COLOR_PANEL,	/* display parameters */
380    0x02580000, 0x0f100000,		/* panel timing reg 1, panel timing reg 2 */
381    0x01000000,				/* power management */
382    /* The next 5 values are prior to revision C */
383    0x00000050,				/* dither and frame rate control  */
384    0x00000000, 0x00000000,		/* block select 1, block select 2 */
385    0x00000000, 0x00000000,		/* dispersion 1, dispersion 2 */
386    /* The next 5 values are for revision C */
387    0x00000050,				/* dither and frame rate control */
388    0x00000000, 0x00000000,		/* blue LSFR, red and green LSFR */
389    0x00000000, 0x00000000,		/* FRM memory index, FRM memory data */
390    0x00000000,				/* memory control */
391    },
392
393   {800, 600, 16, PNL_DSTN, PNL_COLOR_PANEL,	/* display parameters */
394    0x02580000, 0x00014000,		/* panel timing reg 1, panel timing reg 2 */
395    0x01000000,				/* power management */
396    /* The next 5 values are prior to revision C */
397    0x00000050,				/* dither and frame rate control  */
398    0x048c26ae, 0x048c26ae,		/* block select 1, block select 2 */
399    0x02468ace, 0x13579bdf,		/* dispersion 1, dispersion 2 */
400    /* The next 5 values are for revision C */
401    0x0000004b,				/* dither and frame rate control */
402    0x00000000, 0x00000000,		/* blue LSFR, red and green LSFR */
403    0x00000000, 0x00000000,		/* FRM memory index, FRM memory data */
404    0x00000007,				/* memory control */
405    },
406
407   {800, 600, 8, PNL_DSTN, PNL_MONO_PANEL,	/* display parameters */
408    0x02580000, 0x00084000,		/* panel timing reg 1, panel timing reg 2 */
409    0x01000000,				/* power management */
410    /* The next 5 values are prior to revision C */
411    0x00000050,				/* dither and frame rate control */
412    0x25cf3096, 0xad47b81e,		/* block select 1, block select 2 */
413    0x21446450, 0x21446450,		/* dispersion 1, dispersion 2 */
414    /* The next 5 values are for revision C */
415    0x0000004b,				/* dither and frame rate control  */
416    0x00000000, 0x00000000,		/* blue LSFR, red and green LSFR */
417    0x00000000, 0x00000000,		/* FRM memory index, FRM memory data */
418    0x00000007,				/* memory control */
419    },
420
421   {800, 600, 16, PNL_DSTN, PNL_MONO_PANEL,	/* display parameters */
422    0x02580000, 0x00094000,		/* panel timing reg 1, panel timing reg 2 */
423    0x01000000,				/* power management */
424    /* The next 5 values are prior to revision C */
425    0x00000050,				/* dither and frame rate control */
426    0x25cf3096, 0xad47b81e,		/* block select 1, block select 2 */
427    0x81a5d470, 0x29cfb63e,		/* dispersion 1, dispersion 2 */
428    /* The next 5 values are for revision C */
429    0x00000050,				/* dither and frame rate control */
430    0x00000000, 0x00000000,		/* blue LSFR, red and green LSFR */
431    0x00000000, 0x00000000,		/* FRM memory index, FRM memory data */
432    0x00000007,				/* memory control */
433    },
434
435   {1024, 768, 18, PNL_TFT, PNL_COLOR_PANEL,	/* display parameters */
436    0x03000000, 0x0f100000,		/* panel timing reg 1, panel timing reg 2 */
437    0x01000000,				/* power management */
438    /*The next 5 values are prior to revision C */
439    0x00000050,				/* dither and frame rate control */
440    0x00000000, 0x00000000,		/* block select 1, block select 2 */
441    0x00000000, 0x00000000,		/* dispersion 1, dispersion 2 */
442    /*The next 5 values are for revision C */
443    0x00000050,				/* dither and frame rate control */
444    0x00000000, 0x00000000,		/* blue LSFR, red and green LSFR */
445    0x00000000, 0x00000000,		/* FRM memory index, FRM memory data */
446    0x00000000,				/* memory control */
447    },
448
449   {1024, 768, 24, PNL_DSTN, PNL_COLOR_PANEL,	/* display parameters */
450    0x03000000, 0x80024000,		/* panel timing reg 1, panel timing reg 2 */
451    0x01000000,				/* power management */
452    /*The next 5 values are prior to revision C */
453    0x00000050,				/* dither and frame rate control */
454    0x048c26ae, 0x048c26ae,		/* block select 1, block select 2 */
455    0x02468ace, 0x13579bdf,		/* dispersion 1, dispersion 2 */
456    /*The next 5 values are for revision C */
457    0x0000004b,				/* dither and frame rate control */
458    0x00000000, 0x00000000,		/* blue LSFR, red and green LSFR */
459    0x00000000, 0x00000000,		/* FRM memory index, FRM memory data */
460    0x00000005,				/* memory control */
461    }
462};
463
464#endif /* !_92XX_h */
465
466/* END OF FILE */
467