gx2_9211.h revision 71d7fec4
1/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/gx2_9211.h,v 1.3 2003/01/14 09:34:35 alanh Exp $ */ 2/* 3 * $Workfile: gx2_9211.h $ 4 * 5 * This header file defines the pneumonics used when calling Durango routines. 6 * This file is automatically included by gfx_rtns.h 7 * 8 * NSC_LIC_ALTERNATIVE_PREAMBLE 9 * 10 * Revision 1.0 11 * 12 * National Semiconductor Alternative GPL-BSD License 13 * 14 * National Semiconductor Corporation licenses this software 15 * ("Software"): 16 * 17 * Panel Library 18 * 19 * under one of the two following licenses, depending on how the 20 * Software is received by the Licensee. 21 * 22 * If this Software is received as part of the Linux Framebuffer or 23 * other GPL licensed software, then the GPL license designated 24 * NSC_LIC_GPL applies to this Software; in all other circumstances 25 * then the BSD-style license designated NSC_LIC_BSD shall apply. 26 * 27 * END_NSC_LIC_ALTERNATIVE_PREAMBLE */ 28 29/* NSC_LIC_BSD 30 * 31 * National Semiconductor Corporation Open Source License for Durango 32 * 33 * (BSD License with Export Notice) 34 * 35 * Copyright (c) 1999-2001 36 * National Semiconductor Corporation. 37 * All rights reserved. 38 * 39 * Redistribution and use in source and binary forms, with or without 40 * modification, are permitted provided that the following conditions 41 * are met: 42 * 43 * * Redistributions of source code must retain the above copyright 44 * notice, this list of conditions and the following disclaimer. 45 * 46 * * Redistributions in binary form must reproduce the above 47 * copyright notice, this list of conditions and the following 48 * disclaimer in the documentation and/or other materials provided 49 * with the distribution. 50 * 51 * * Neither the name of the National Semiconductor Corporation nor 52 * the names of its contributors may be used to endorse or promote 53 * products derived from this software without specific prior 54 * written permission. 55 * 56 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 57 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 58 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 59 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 60 * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY 61 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 62 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 63 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 64 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 65 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE, 66 * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY 67 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 68 * OF SUCH DAMAGE. 69 * 70 * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF 71 * YOUR JURISDICTION. It is licensee's responsibility to comply with 72 * any export regulations applicable in licensee's jurisdiction. Under 73 * CURRENT (2001) U.S. export regulations this software 74 * is eligible for export from the U.S. and can be downloaded by or 75 * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed 76 * destinations which include Cuba, Iraq, Libya, North Korea, Iran, 77 * Syria, Sudan, Afghanistan and any other country to which the U.S. 78 * has embargoed goods and services. 79 * 80 * END_NSC_LIC_BSD */ 81 82/* NSC_LIC_GPL 83 * 84 * National Semiconductor Corporation Gnu General Public License for Durango 85 * 86 * (GPL License with Export Notice) 87 * 88 * Copyright (c) 1999-2001 89 * National Semiconductor Corporation. 90 * All rights reserved. 91 * 92 * Redistribution and use in source and binary forms, with or without 93 * modification, are permitted under the terms of the GNU General 94 * Public License as published by the Free Software Foundation; either 95 * version 2 of the License, or (at your option) any later version 96 * 97 * In addition to the terms of the GNU General Public License, neither 98 * the name of the National Semiconductor Corporation nor the names of 99 * its contributors may be used to endorse or promote products derived 100 * from this software without specific prior written permission. 101 * 102 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 103 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 104 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 105 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 106 * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY 107 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 108 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 109 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 110 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 111 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE, 112 * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY 113 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 114 * OF SUCH DAMAGE. See the GNU General Public License for more details. 115 * 116 * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF 117 * YOUR JURISDICTION. It is licensee's responsibility to comply with 118 * any export regulations applicable in licensee's jurisdiction. Under 119 * CURRENT (2001) U.S. export regulations this software 120 * is eligible for export from the U.S. and can be downloaded by or 121 * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed 122 * destinations which include Cuba, Iraq, Libya, North Korea, Iran, 123 * Syria, Sudan, Afghanistan and any other country to which the U.S. 124 * has embargoed goods and services. 125 * 126 * You should have received a copy of the GNU General Public License 127 * along with this file; if not, write to the Free Software Foundation, 128 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 129 * 130 * END_NSC_LIC_GPL */ 131 132/* ----------------------------------------------------------- 133 * GX2 FLAT PANEL CONTROLLER REGISTER DEFINITIONS 134 *----------------------------------------------------------- 135 */ 136 137#define GX2_VP_MSR_PAD_SELECT 0x2011 138#define GX2_VP_PAD_SELECT_MASK 0x3FFFFFFF 139#define GX2_VP_PAD_SELECT_TFT 0x1FFFFFFF 140#define GX2_VP_PAD_SELECT_DSTN 0x00000000 141 142/* This is useful for generating addresses incrementally 143 * (ie, vidtest register display code). 144 */ 145 146#define GX2_FP_LCD_OFFSET 0x00000400 147#define CS9211_REDCLOUD 0x0400 /* Moved 9211 Rev C3 up to next major no. */ 148 149#define GX2_FP_PAN_TIMING1 0x0400 /* FP timings 1 */ 150#define GX2_FP_PAN_TIMING2 0x0408 /* FP timings 2 */ 151#define GX2_FP_PWR_MAN 0x0410 /* FP power management */ 152#define GX2_FP_DITH_FR_CNTRL 0x0418 /* FP dither and frame rate */ 153#define GX2_FP_BLFSR 0x0420 /* Blue LFSR seed */ 154#define GX2_FP_RLFSR 0x0428 /* Red and Green LFSR seed */ 155#define GX2_FP_FMI 0x0430 /* FRM Memory Index */ 156#define GX2_FP_FMD 0x0438 /* FRM Memory Data */ 157#define GX2_FP_DCA 0x0448 /* Dither ram control and address */ 158#define GX2_FP_DMD 0x0450 /* Dither memory data */ 159#define GX2_FP_PAN_CRC_SIG 0x0458 /* FP CRC signature */ 160#define GX2_FP_FBB 0x0460 /* Frame Buffer Base Address */ 161 162/* GX2_FP_PAN_TIMING2 bits */ 163 164#define GX2_FP_TFT_PASS_THRU 0x40000000 /* TFT pass through enable */ 165#define GX2_FP_PT2_PIX_OUT_MASK 0xFFF8FFFF /* panel output bit formats */ 166#define GX2_FP_PT2_PIX_OUT_TFT 0x00000000 /* 8 BIT DSTN or TFT panel */ 167#define GX2_FP_PT2_COLOR_MONO 0x00080000 /* color or monochrome */ 168#define GX2_FP_PT2_DSTN_TFT_MASK 0xFFCFFFFF /* panel type bits */ 169#define GX2_FP_PT2_DSTN_TFT_TFT 0x00100000 /* TFT panel */ 170#define GX2_FP_PT2_PSH_CLK_CTL 0x08000000 /* shift clock retrace activity control */ 171 172/* GX2_FP_PWR_MAN bits */ 173 174#define GX2_FP_PM_SHFCLK_INVERT 0x00002000 /* Invert shfclk to panel */ 175#define GX2_FP_PM_VSYNC_DELAY 0x0000C000 /* Vert Sync delay */ 176#define GX2_FP_PM_HSYNC_DELAY 0x00030000 /* Horiz Sync delay */ 177#define GX2_FP_PM_PWRDN_PHASE_BIT0 0x00040000 /* panel power down phase bit 0 */ 178#define GX2_FP_PM_PWRDN_PHASE_BIT1 0x00080000 /* panel power down phase bit 1 */ 179#define GX2_FP_PM_PWRDN_PHASE_BIT2 0x00100000 /* panel power down phase bit 2 */ 180#define GX2_FP_PM_PWRUP_PHASE_BIT0 0x00200000 /* panel power up phase bit 0 */ 181#define GX2_FP_PM_PWRUP_PHASE_BIT1 0x00400000 /* panel power up phase bit 1 */ 182#define GX2_FP_PM_PWRUP_PHASE_BIT2 0x00800000 /* panel power up phase bit 2 */ 183#define GX2_FP_PM_PWR_ON 0x01000000 /* panel power ON */ 184#define GX2_FP_PM_DIS_OFF_CTL 0x02000000 /* disable the panel back light */ 185#define GX2_FP_PM_EXT_PWR_SEQ 0x08000000 /* external power sequence */ 186 187/* GX2_FP_PAN_CRC_SIG bits */ 188 189#define GX2_FP_PAN_CRC_SIGE 0x00000001 /* CRC Sig Enable */ 190#define GX2_FP_PAN_CRC_SFR 0x00000002 /* CRC Sig Free Run */ 191 192/* This define is used by the hardware CRC mechanism */ 193#define GX2_FP_CRC_PASS_THRU_MASK 0x00000070 194 195#define GX2_READ 0 196#define GX2_WRITE 1 197 198void SetFPBaseAddr(unsigned long); 199void Redcloud_9211init(Pnl_PanelStat *); 200void protected_mode_access(unsigned long mode, 201 unsigned long width, 202 unsigned long addr, char *pdata); 203void write_video_reg64_low(unsigned long offset, unsigned long value); 204unsigned long read_video_reg64_low(unsigned long offset); 205void Redcloud_fp_reg(int mode, unsigned long address, unsigned long *data); 206void set_Redcloud_92xx_mode_params(int mode); 207unsigned char set_Redcloud_92xx_mode(Pnl_PanelStat * pstat); 208