171d7fec4Smrg/* $XFree86$ */ 271d7fec4Smrg/* 371d7fec4Smrg * $Workfile: pnl_init.c $ 471d7fec4Smrg * $Revision: 1.1.1.1 $ 571d7fec4Smrg * 671d7fec4Smrg * File Contents: This file contains the Geode frame buffer panel 771d7fec4Smrg * intialization functions. 871d7fec4Smrg * 971d7fec4Smrg * SubModule: Geode FlatPanel library 1071d7fec4Smrg * 1171d7fec4Smrg */ 1271d7fec4Smrg 1371d7fec4Smrg/* 1471d7fec4Smrg * NSC_LIC_ALTERNATIVE_PREAMBLE 1571d7fec4Smrg * 1671d7fec4Smrg * Revision 1.0 1771d7fec4Smrg * 1871d7fec4Smrg * National Semiconductor Alternative GPL-BSD License 1971d7fec4Smrg * 2071d7fec4Smrg * National Semiconductor Corporation licenses this software 2171d7fec4Smrg * ("Software"): 2271d7fec4Smrg * 2371d7fec4Smrg * Panel Library 2471d7fec4Smrg * 2571d7fec4Smrg * under one of the two following licenses, depending on how the 2671d7fec4Smrg * Software is received by the Licensee. 2771d7fec4Smrg * 2871d7fec4Smrg * If this Software is received as part of the Linux Framebuffer or 2971d7fec4Smrg * other GPL licensed software, then the GPL license designated 3071d7fec4Smrg * NSC_LIC_GPL applies to this Software; in all other circumstances 3171d7fec4Smrg * then the BSD-style license designated NSC_LIC_BSD shall apply. 3271d7fec4Smrg * 3371d7fec4Smrg * END_NSC_LIC_ALTERNATIVE_PREAMBLE */ 3471d7fec4Smrg 3571d7fec4Smrg/* NSC_LIC_BSD 3671d7fec4Smrg * 3771d7fec4Smrg * National Semiconductor Corporation Open Source License for 3871d7fec4Smrg * 3971d7fec4Smrg * Panel Library 4071d7fec4Smrg * 4171d7fec4Smrg * (BSD License with Export Notice) 4271d7fec4Smrg * 4371d7fec4Smrg * Copyright (c) 1999-2001 4471d7fec4Smrg * National Semiconductor Corporation. 4571d7fec4Smrg * All rights reserved. 4671d7fec4Smrg * 4771d7fec4Smrg * Redistribution and use in source and binary forms, with or without 4871d7fec4Smrg * modification, are permitted provided that the following conditions 4971d7fec4Smrg * are met: 5071d7fec4Smrg * 5171d7fec4Smrg * * Redistributions of source code must retain the above copyright 5271d7fec4Smrg * notice, this list of conditions and the following disclaimer. 5371d7fec4Smrg * 5471d7fec4Smrg * * Redistributions in binary form must reproduce the above 5571d7fec4Smrg * copyright notice, this list of conditions and the following 5671d7fec4Smrg * disclaimer in the documentation and/or other materials provided 5771d7fec4Smrg * with the distribution. 5871d7fec4Smrg * 5971d7fec4Smrg * * Neither the name of the National Semiconductor Corporation nor 6071d7fec4Smrg * the names of its contributors may be used to endorse or promote 6171d7fec4Smrg * products derived from this software without specific prior 6271d7fec4Smrg * written permission. 6371d7fec4Smrg * 6471d7fec4Smrg * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 6571d7fec4Smrg * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 6671d7fec4Smrg * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 6771d7fec4Smrg * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 6871d7fec4Smrg * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY 6971d7fec4Smrg * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 7071d7fec4Smrg * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 7171d7fec4Smrg * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 7271d7fec4Smrg * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 7371d7fec4Smrg * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE, 7471d7fec4Smrg * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY 7571d7fec4Smrg * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 7671d7fec4Smrg * OF SUCH DAMAGE. 7771d7fec4Smrg * 7871d7fec4Smrg * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF 7971d7fec4Smrg * YOUR JURISDICTION. It is licensee's responsibility to comply with 8071d7fec4Smrg * any export regulations applicable in licensee's jurisdiction. Under 8171d7fec4Smrg * CURRENT (2001) U.S. export regulations this software 8271d7fec4Smrg * is eligible for export from the U.S. and can be downloaded by or 8371d7fec4Smrg * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed 8471d7fec4Smrg * destinations which include Cuba, Iraq, Libya, North Korea, Iran, 8571d7fec4Smrg * Syria, Sudan, Afghanistan and any other country to which the U.S. 8671d7fec4Smrg * has embargoed goods and services. 8771d7fec4Smrg * 8871d7fec4Smrg * END_NSC_LIC_BSD */ 8971d7fec4Smrg 9071d7fec4Smrg/* NSC_LIC_GPL 9171d7fec4Smrg * 9271d7fec4Smrg * National Semiconductor Corporation Gnu General Public License for 9371d7fec4Smrg * 9471d7fec4Smrg * Panel Library 9571d7fec4Smrg * 9671d7fec4Smrg * (GPL License with Export Notice) 9771d7fec4Smrg * 9871d7fec4Smrg * Copyright (c) 1999-2001 9971d7fec4Smrg * National Semiconductor Corporation. 10071d7fec4Smrg * All rights reserved. 10171d7fec4Smrg * 10271d7fec4Smrg * Redistribution and use in source and binary forms, with or without 10371d7fec4Smrg * modification, are permitted under the terms of the GNU General 10471d7fec4Smrg * Public License as published by the Free Software Foundation; either 10571d7fec4Smrg * version 2 of the License, or (at your option) any later version 10671d7fec4Smrg * 10771d7fec4Smrg * In addition to the terms of the GNU General Public License, neither 10871d7fec4Smrg * the name of the National Semiconductor Corporation nor the names of 10971d7fec4Smrg * its contributors may be used to endorse or promote products derived 11071d7fec4Smrg * from this software without specific prior written permission. 11171d7fec4Smrg * 11271d7fec4Smrg * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 11371d7fec4Smrg * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 11471d7fec4Smrg * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 11571d7fec4Smrg * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 11671d7fec4Smrg * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY 11771d7fec4Smrg * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 11871d7fec4Smrg * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 11971d7fec4Smrg * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 12071d7fec4Smrg * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 12171d7fec4Smrg * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE, 12271d7fec4Smrg * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY 12371d7fec4Smrg * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 12471d7fec4Smrg * OF SUCH DAMAGE. See the GNU General Public License for more details. 12571d7fec4Smrg * 12671d7fec4Smrg * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF 12771d7fec4Smrg * YOUR JURISDICTION. It is licensee's responsibility to comply with 12871d7fec4Smrg * any export regulations applicable in licensee's jurisdiction. Under 12971d7fec4Smrg * CURRENT (2001) U.S. export regulations this software 13071d7fec4Smrg * is eligible for export from the U.S. and can be downloaded by or 13171d7fec4Smrg * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed 13271d7fec4Smrg * destinations which include Cuba, Iraq, Libya, North Korea, Iran, 13371d7fec4Smrg * Syria, Sudan, Afghanistan and any other country to which the U.S. 13471d7fec4Smrg * has embargoed goods and services. 13571d7fec4Smrg * 13671d7fec4Smrg * You should have received a copy of the GNU General Public License 13771d7fec4Smrg * along with this file; if not, write to the Free Software Foundation, 13871d7fec4Smrg * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 13971d7fec4Smrg * 14071d7fec4Smrg * END_NSC_LIC_GPL */ 14171d7fec4Smrg 14271d7fec4Smrg#include "panel.h" 14371d7fec4Smrg#include "gfx_regs.h" 14471d7fec4Smrg#include "gfx_type.h" 14571d7fec4Smrg 14671d7fec4Smrg/* defaults 14771d7fec4SmrgPanel : Enabled 14871d7fec4SmrgPlatform : Centaurus 14971d7fec4Smrg92xx Chip : 9211 Rev. A 15071d7fec4SmrgPanelType : DSTN 15171d7fec4SmrgXResxYRes : 800x600 15271d7fec4SmrgDepth : 16 15371d7fec4SmrgMono_Color : Color 15471d7fec4Smrg*/ 15571d7fec4Smrgstatic Pnl_PanelParams sPanelParam = { 15671d7fec4Smrg 0, 1, CENTAURUS_PLATFORM, PNL_9211_A, 15771d7fec4Smrg {PNL_DSTN, 800, 600, 16, PNL_COLOR_PANEL} 15871d7fec4Smrg}; 15971d7fec4Smrg 16071d7fec4Smrg#if PLATFORM_DRACO 16171d7fec4Smrg#include "drac9210.c" 16271d7fec4Smrg#endif 16371d7fec4Smrg 16471d7fec4Smrg#if PLATFORM_CENTAURUS 16571d7fec4Smrg#include "cen9211.c" 16671d7fec4Smrg#endif 16771d7fec4Smrg 16871d7fec4Smrg#if PLATFORM_DORADO 16971d7fec4Smrg#include "dora9211.c" 17071d7fec4Smrg#endif 17171d7fec4Smrg 17271d7fec4Smrg#if PLATFORM_GX2BASED 17371d7fec4Smrg#include "gx2_9211.c" 17471d7fec4Smrg#endif 17571d7fec4Smrg#include "platform.c" 17671d7fec4Smrg 17771d7fec4Smrg/* 17871d7fec4Smrg * return -1 - UnKnown 17971d7fec4Smrg * 0 - Draco has 9210 18071d7fec4Smrg * 1 - Centaurus has 9211 Rev. A 18171d7fec4Smrg * 2 - Dorado has 9211 Rev. C 18271d7fec4Smrg */ 18371d7fec4Smrg 18471d7fec4Smrg/*----------------------------------------------------------------- 18571d7fec4Smrg * Pnl_SetPlatform 18671d7fec4Smrg * 18771d7fec4Smrg * Description: This function sets the panel with hardware platform. 18871d7fec4Smrg * parameters: 18971d7fec4Smrg * platform: It specify the platform. 19071d7fec4Smrg * return: none. 19171d7fec4Smrg *-----------------------------------------------------------------*/ 19271d7fec4Smrgvoid 19371d7fec4SmrgPnl_SetPlatform(int platform) 19471d7fec4Smrg{ 19571d7fec4Smrg /* To Be Implemented */ 19671d7fec4Smrg sPanelParam.Platform = platform; 19771d7fec4Smrg 19871d7fec4Smrg} 19971d7fec4Smrg 20071d7fec4Smrg/*----------------------------------------------------------------- 20171d7fec4Smrg * Pnl_GetPlatform 20271d7fec4Smrg * 20371d7fec4Smrg * Description: This function returns the panel platform. 20471d7fec4Smrg * parameters: none. 20571d7fec4Smrg * return: On success it returns the panel platform. 20671d7fec4Smrg *-----------------------------------------------------------------*/ 20771d7fec4Smrgint 20871d7fec4SmrgPnl_GetPlatform(void) 20971d7fec4Smrg{ 21071d7fec4Smrg sPanelParam.Platform = Detect_Platform(); 21171d7fec4Smrg 21271d7fec4Smrg return sPanelParam.Platform; 21371d7fec4Smrg 21471d7fec4Smrg} 21571d7fec4Smrg 21671d7fec4Smrg/*----------------------------------------------------------------- 21771d7fec4Smrg * Pnl_IsPanelPresent 21871d7fec4Smrg * 21971d7fec4Smrg * Description: This function specifies whether the panel is prsent 22071d7fec4Smrg * or not. 22171d7fec4Smrg * parameters: none. 22271d7fec4Smrg * return: On success it returns an integer panel present value. 22371d7fec4Smrg *-----------------------------------------------------------------*/ 22471d7fec4Smrgint 22571d7fec4SmrgPnl_IsPanelPresent(void) 22671d7fec4Smrg{ 22771d7fec4Smrg /* To Be Implemented */ 22871d7fec4Smrg return sPanelParam.PanelPresent; 22971d7fec4Smrg} 23071d7fec4Smrg 23171d7fec4Smrg/*----------------------------------------------------------------- 23271d7fec4Smrg * Pnl_SetPanelPresent 23371d7fec4Smrg * 23471d7fec4Smrg * Description: This function sets the panel_present parameter. 23571d7fec4Smrg * parameters: 23671d7fec4Smrg * present: It specifies the panel present value. 23771d7fec4Smrg * return: none. 23871d7fec4Smrg *-----------------------------------------------------------------*/ 23971d7fec4Smrgvoid 24071d7fec4SmrgPnl_SetPanelPresent(int present) 24171d7fec4Smrg{ 24271d7fec4Smrg /* To Be Implemented */ 24371d7fec4Smrg sPanelParam.PanelPresent = present; 24471d7fec4Smrg} 24571d7fec4Smrg 24671d7fec4Smrg/*----------------------------------------------------------------- 24771d7fec4Smrg * Pnl_SetPanelParam 24871d7fec4Smrg * 24971d7fec4Smrg * Description: This function sets the panel parameters 25071d7fec4Smrg * parameters: 25171d7fec4Smrg * pParam: It specifies the elements of the panel parameter 25271d7fec4Smrg * structure. 25371d7fec4Smrg * return: none. 25471d7fec4Smrg *-----------------------------------------------------------------*/ 25571d7fec4Smrgvoid 25671d7fec4SmrgPnl_SetPanelParam(PPnl_PanelParams pParam) 25771d7fec4Smrg{ 25871d7fec4Smrg if (pParam->Flags & PNL_PANELPRESENT) { 25971d7fec4Smrg Pnl_SetPanelPresent(pParam->PanelPresent); 26071d7fec4Smrg } 26171d7fec4Smrg if (pParam->Flags & PNL_PLATFORM) { 26271d7fec4Smrg Pnl_SetPlatform(pParam->Platform); 26371d7fec4Smrg } 26471d7fec4Smrg if (pParam->Flags & PNL_PANELCHIP) { 26571d7fec4Smrg Pnl_SetPanelChip(pParam->PanelChip); 26671d7fec4Smrg } 26771d7fec4Smrg if (pParam->Flags & PNL_PANELSTAT) { 26871d7fec4Smrg sPanelParam.PanelStat.XRes = pParam->PanelStat.XRes; 26971d7fec4Smrg sPanelParam.PanelStat.YRes = pParam->PanelStat.YRes; 27071d7fec4Smrg sPanelParam.PanelStat.Depth = pParam->PanelStat.Depth; 27171d7fec4Smrg sPanelParam.PanelStat.MonoColor = pParam->PanelStat.MonoColor; 27271d7fec4Smrg sPanelParam.PanelStat.Type = pParam->PanelStat.Type; 27371d7fec4Smrg } 27471d7fec4Smrg} 27571d7fec4Smrg 27671d7fec4Smrg/*----------------------------------------------------------------- 27771d7fec4Smrg * Pnl_PowerUp 27871d7fec4Smrg * 27971d7fec4Smrg * Description: This function sets the power based on the 28071d7fec4Smrg * hardware platforms dorado or centaraus. 28171d7fec4Smrg * parameters: none. 28271d7fec4Smrg * return: none. 28371d7fec4Smrg *-----------------------------------------------------------------*/ 28471d7fec4Smrgvoid 28571d7fec4SmrgPnl_PowerUp(void) 28671d7fec4Smrg{ 28771d7fec4Smrg int Platform; 28871d7fec4Smrg unsigned long dcfg, hw_video; 28971d7fec4Smrg 29071d7fec4Smrg Platform = Pnl_GetPlatform(); 29171d7fec4Smrg 29271d7fec4Smrg#if PLATFORM_CENTAURUS 29371d7fec4Smrg if (Platform == CENTAURUS_PLATFORM) { 29471d7fec4Smrg Centaurus_Power_Up(); 29571d7fec4Smrg return; 29671d7fec4Smrg } 29771d7fec4Smrg#endif 29871d7fec4Smrg 29971d7fec4Smrg#if PLATFORM_DORADO 30071d7fec4Smrg if (Platform == DORADO_PLATFORM) { 30171d7fec4Smrg Dorado_Power_Up(); 30271d7fec4Smrg return; 30371d7fec4Smrg } 30471d7fec4Smrg#endif 30571d7fec4Smrg 30671d7fec4Smrg#if PLATFORM_GX2BASED 30771d7fec4Smrg if (Platform == REDCLOUD_PLATFORM) { 30871d7fec4Smrg } 30971d7fec4Smrg#endif 31071d7fec4Smrg 31171d7fec4Smrg hw_video = gfx_detect_video(); 31271d7fec4Smrg 31371d7fec4Smrg if (hw_video == GFX_VID_CS5530) { 31471d7fec4Smrg /* READ DISPLAY CONFIG FROM CX5530 */ 31571d7fec4Smrg dcfg = READ_VID32(CS5530_DISPLAY_CONFIG); 31671d7fec4Smrg 31771d7fec4Smrg /* SET RELEVANT FIELDS */ 31871d7fec4Smrg dcfg |= (CS5530_DCFG_FP_PWR_EN | CS5530_DCFG_FP_DATA_EN); 31971d7fec4Smrg /* Enable the flatpanel power and data */ 32071d7fec4Smrg WRITE_VID32(CS5530_DISPLAY_CONFIG, dcfg); 32171d7fec4Smrg } else if (hw_video == GFX_VID_SC1200) { 32271d7fec4Smrg /* READ DISPLAY CONFIG FROM SC1200 */ 32371d7fec4Smrg dcfg = READ_VID32(SC1200_DISPLAY_CONFIG); 32471d7fec4Smrg 32571d7fec4Smrg /* SET RELEVANT FIELDS */ 32671d7fec4Smrg dcfg |= (SC1200_DCFG_FP_PWR_EN | SC1200_DCFG_FP_DATA_EN); 32771d7fec4Smrg /* Enable the flatpanel power and data */ 32871d7fec4Smrg WRITE_VID32(SC1200_DISPLAY_CONFIG, dcfg); 32971d7fec4Smrg } else if (hw_video == GFX_VID_REDCLOUD) { 33071d7fec4Smrg /* READ DISPLAY CONFIG FROM REDCLOUD */ 33171d7fec4Smrg dcfg = READ_VID32(RCDF_DISPLAY_CONFIG); 33271d7fec4Smrg 33371d7fec4Smrg /* SET RELEVANT FIELDS */ 33471d7fec4Smrg dcfg |= (RCDF_DCFG_FP_PWR_EN | RCDF_DCFG_FP_DATA_EN); 33571d7fec4Smrg /* Enable the flatpanel power and data */ 33671d7fec4Smrg WRITE_VID32(RCDF_DISPLAY_CONFIG, dcfg); 33771d7fec4Smrg } 33871d7fec4Smrg 33971d7fec4Smrg} 34071d7fec4Smrg 34171d7fec4Smrg/*----------------------------------------------------------------- 34271d7fec4Smrg * Pnl_PowerDown 34371d7fec4Smrg * 34471d7fec4Smrg * Description: This function make power down based on the 34571d7fec4Smrg * hardware platforms dorado or centaraus. 34671d7fec4Smrg * parameters: none. 34771d7fec4Smrg * return: none. 34871d7fec4Smrg *-----------------------------------------------------------------*/ 34971d7fec4Smrgvoid 35071d7fec4SmrgPnl_PowerDown(void) 35171d7fec4Smrg{ 35271d7fec4Smrg int Platform; 35371d7fec4Smrg unsigned long dcfg, hw_video; 35471d7fec4Smrg 35571d7fec4Smrg Platform = Pnl_GetPlatform(); 35671d7fec4Smrg 35771d7fec4Smrg#if PLATFORM_CENTAURUS 35871d7fec4Smrg if (Platform == CENTAURUS_PLATFORM) { 35971d7fec4Smrg Centaurus_Power_Down(); 36071d7fec4Smrg return; 36171d7fec4Smrg } 36271d7fec4Smrg#endif 36371d7fec4Smrg#if PLATFORM_DORADO 36471d7fec4Smrg if (Platform == DORADO_PLATFORM) { 36571d7fec4Smrg Dorado_Power_Down(); 36671d7fec4Smrg return; 36771d7fec4Smrg } 36871d7fec4Smrg#endif 36971d7fec4Smrg 37071d7fec4Smrg#if PLATFORM_GX2BASED 37171d7fec4Smrg if (Platform == REDCLOUD_PLATFORM) { 37271d7fec4Smrg } 37371d7fec4Smrg#endif 37471d7fec4Smrg 37571d7fec4Smrg hw_video = gfx_detect_video(); 37671d7fec4Smrg 37771d7fec4Smrg if (hw_video == GFX_VID_CS5530) { 37871d7fec4Smrg /* READ DISPLAY CONFIG FROM CX5530 */ 37971d7fec4Smrg dcfg = READ_VID32(CS5530_DISPLAY_CONFIG); 38071d7fec4Smrg 38171d7fec4Smrg /* CLEAR RELEVANT FIELDS */ 38271d7fec4Smrg dcfg &= ~(CS5530_DCFG_FP_PWR_EN | CS5530_DCFG_FP_DATA_EN); 38371d7fec4Smrg /* Disable the flatpanel power and data */ 38471d7fec4Smrg WRITE_VID32(CS5530_DISPLAY_CONFIG, dcfg); 38571d7fec4Smrg } else if (hw_video == GFX_VID_SC1200) { 38671d7fec4Smrg /* READ DISPLAY CONFIG FROM SC1200 */ 38771d7fec4Smrg dcfg = READ_VID32(SC1200_DISPLAY_CONFIG); 38871d7fec4Smrg 38971d7fec4Smrg /* CLEAR RELEVANT FIELDS */ 39071d7fec4Smrg dcfg &= ~(SC1200_DCFG_FP_PWR_EN | SC1200_DCFG_FP_DATA_EN); 39171d7fec4Smrg /* Disable the flatpanel power and data */ 39271d7fec4Smrg WRITE_VID32(SC1200_DISPLAY_CONFIG, dcfg); 39371d7fec4Smrg } else if (hw_video == GFX_VID_REDCLOUD) { 39471d7fec4Smrg /* READ DISPLAY CONFIG FROM REDCLOUD */ 39571d7fec4Smrg dcfg = READ_VID32(RCDF_DISPLAY_CONFIG); 39671d7fec4Smrg 39771d7fec4Smrg /* CLEAR RELEVANT FIELDS */ 39871d7fec4Smrg dcfg &= ~(RCDF_DCFG_FP_PWR_EN | RCDF_DCFG_FP_DATA_EN); 39971d7fec4Smrg /* Disable the flatpanel power and data */ 40071d7fec4Smrg WRITE_VID32(RCDF_DISPLAY_CONFIG, dcfg); 40171d7fec4Smrg } 40271d7fec4Smrg} 40371d7fec4Smrg 40471d7fec4Smrg/*----------------------------------------------------------------- 40571d7fec4Smrg * Pnl_SavePanelState 40671d7fec4Smrg * 40771d7fec4Smrg * Description: This function saves the panel state based on the 40871d7fec4Smrg * hardware platforms dorado or centaraus. 40971d7fec4Smrg * parameters: none. 41071d7fec4Smrg * return: none. 41171d7fec4Smrg *-----------------------------------------------------------------*/ 41271d7fec4Smrgvoid 41371d7fec4SmrgPnl_SavePanelState(void) 41471d7fec4Smrg{ 41571d7fec4Smrg int Platform; 41671d7fec4Smrg 41771d7fec4Smrg Platform = Pnl_GetPlatform(); 41871d7fec4Smrg 41971d7fec4Smrg#if PLATFORM_CENTAURUS 42071d7fec4Smrg if (Platform == CENTAURUS_PLATFORM) { 42171d7fec4Smrg Centaurus_Save_Panel_State(); 42271d7fec4Smrg return; 42371d7fec4Smrg } 42471d7fec4Smrg#endif 42571d7fec4Smrg 42671d7fec4Smrg#if PLATFORM_DORADO 42771d7fec4Smrg if (Platform == DORADO_PLATFORM) { 42871d7fec4Smrg Dorado_Save_Panel_State(); 42971d7fec4Smrg return; 43071d7fec4Smrg } 43171d7fec4Smrg#endif 43271d7fec4Smrg 43371d7fec4Smrg#if PLATFORM_GX2BASED 43471d7fec4Smrg if (Platform == REDCLOUD_PLATFORM) { 43571d7fec4Smrg } 43671d7fec4Smrg#endif 43771d7fec4Smrg} 43871d7fec4Smrg 43971d7fec4Smrg/*----------------------------------------------------------------- 44071d7fec4Smrg * Pnl_RestorePanelState 44171d7fec4Smrg * 44271d7fec4Smrg * Description: This function restore the panel state based on the 44371d7fec4Smrg * hardware platforms dorado or centaraus. 44471d7fec4Smrg * parameters: none. 44571d7fec4Smrg * return: none. 44671d7fec4Smrg *-----------------------------------------------------------------*/ 44771d7fec4Smrgvoid 44871d7fec4SmrgPnl_RestorePanelState(void) 44971d7fec4Smrg{ 45071d7fec4Smrg int Platform; 45171d7fec4Smrg 45271d7fec4Smrg Platform = Pnl_GetPlatform(); 45371d7fec4Smrg#if PLATFORM_CENTAURUS 45471d7fec4Smrg if (Platform == CENTAURUS_PLATFORM) { 45571d7fec4Smrg Centaurus_Restore_Panel_State(); 45671d7fec4Smrg return; 45771d7fec4Smrg } 45871d7fec4Smrg#endif 45971d7fec4Smrg 46071d7fec4Smrg#if PLATFORM_DORADO 46171d7fec4Smrg if (Platform == DORADO_PLATFORM) { 46271d7fec4Smrg Dorado_Restore_Panel_State(); 46371d7fec4Smrg return; 46471d7fec4Smrg } 46571d7fec4Smrg#endif 46671d7fec4Smrg 46771d7fec4Smrg#if PLATFORM_GX2BASED 46871d7fec4Smrg if (Platform == REDCLOUD_PLATFORM) { 46971d7fec4Smrg } 47071d7fec4Smrg#endif 47171d7fec4Smrg} 47271d7fec4Smrg 47371d7fec4Smrg/*----------------------------------------------------------------- 47471d7fec4Smrg * Pnl_GetPanelParam 47571d7fec4Smrg * 47671d7fec4Smrg * Description: This function gets the panel parameters from the 47771d7fec4Smrg * hardware platforms dorado or centaraus. 47871d7fec4Smrg * parameters: 47971d7fec4Smrg * pParam: It specifies the elements of the panel parameter 48071d7fec4Smrg * structure. 48171d7fec4Smrg * return: none. 48271d7fec4Smrg *-----------------------------------------------------------------*/ 48371d7fec4Smrgvoid 48471d7fec4SmrgPnl_GetPanelParam(PPnl_PanelParams pParam) 48571d7fec4Smrg{ 48671d7fec4Smrg if (pParam->Flags & PNL_PANELPRESENT) { 48771d7fec4Smrg pParam->PanelPresent = Pnl_IsPanelPresent(); 48871d7fec4Smrg } 48971d7fec4Smrg if (pParam->Flags & PNL_PLATFORM) { 49071d7fec4Smrg pParam->Platform = Pnl_GetPlatform(); 49171d7fec4Smrg } 49271d7fec4Smrg if ((pParam->Flags & PNL_PANELCHIP) || (pParam->Flags & PNL_PANELSTAT)) { 49371d7fec4Smrg#if PLATFORM_CENTAURUS 49471d7fec4Smrg if (pParam->Platform == CENTAURUS_PLATFORM) { 49571d7fec4Smrg Centaurus_Get_9211_Details(pParam->Flags, pParam); 49671d7fec4Smrg return; 49771d7fec4Smrg } 49871d7fec4Smrg#endif 49971d7fec4Smrg 50071d7fec4Smrg#if PLATFORM_DORADO 50171d7fec4Smrg if (pParam->Platform == DORADO_PLATFORM) { 50271d7fec4Smrg Dorado_Get_9211_Details(pParam->Flags, pParam); 50371d7fec4Smrg return; 50471d7fec4Smrg } 50571d7fec4Smrg#endif 50671d7fec4Smrg 50771d7fec4Smrg#if PLATFORM_GX2BASED 50871d7fec4Smrg if (pParam->Platform == REDCLOUD_PLATFORM) { 50971d7fec4Smrg } 51071d7fec4Smrg#endif 51171d7fec4Smrg 51271d7fec4Smrg /* if unknown platform put unknown */ 51371d7fec4Smrg if (pParam->Flags & PNL_PANELCHIP) 51471d7fec4Smrg pParam->PanelChip = PNL_UNKNOWN_CHIP; 51571d7fec4Smrg 51671d7fec4Smrg if (pParam->Flags & PNL_PANELSTAT) { 51771d7fec4Smrg pParam->PanelStat.XRes = 0; 51871d7fec4Smrg pParam->PanelStat.YRes = 0; 51971d7fec4Smrg pParam->PanelStat.Depth = 0; 52071d7fec4Smrg pParam->PanelStat.MonoColor = PNL_UNKNOWN_COLOR; 52171d7fec4Smrg pParam->PanelStat.Type = PNL_UNKNOWN_PANEL; 52271d7fec4Smrg } 52371d7fec4Smrg } 52471d7fec4Smrg} 52571d7fec4Smrg 52671d7fec4Smrg/*----------------------------------------------------------------- 52771d7fec4Smrg * Pnl_SetPanelChip 52871d7fec4Smrg * 52971d7fec4Smrg * Description: This function sets the panelchip parameter of panel 53071d7fec4Smrg * structure. 53171d7fec4Smrg * parameters: 53271d7fec4Smrg * panelChip: It specifies the panelChip value. 53371d7fec4Smrg * return: none. 53471d7fec4Smrg *-----------------------------------------------------------------*/ 53571d7fec4Smrg 53671d7fec4Smrgvoid 53771d7fec4SmrgPnl_SetPanelChip(int panelChip) 53871d7fec4Smrg{ 53971d7fec4Smrg /* To Be Implemented */ 54071d7fec4Smrg sPanelParam.PanelChip = panelChip; 54171d7fec4Smrg 54271d7fec4Smrg} 54371d7fec4Smrg 54471d7fec4Smrg/*----------------------------------------------------------------- 54571d7fec4Smrg * Pnl_GetPanelChip 54671d7fec4Smrg * 54771d7fec4Smrg * Description: This function gets the panelchip parameter of panel 54871d7fec4Smrg * structure. 54971d7fec4Smrg * parameters: 55071d7fec4Smrg * return: On success it returns the panelchip. 55171d7fec4Smrg *-----------------------------------------------------------------*/ 55271d7fec4Smrgint 55371d7fec4SmrgPnl_GetPanelChip(void) 55471d7fec4Smrg{ 55571d7fec4Smrg /* To Be Implemented */ 55671d7fec4Smrg return sPanelParam.PanelChip; 55771d7fec4Smrg} 55871d7fec4Smrg 55971d7fec4Smrg/*----------------------------------------------------------------- 56071d7fec4Smrg * Pnl_InitPanel 56171d7fec4Smrg * 56271d7fec4Smrg * Description: This function initializes the panel with 56371d7fec4Smrg * hardware platforms dorado or centaraus. 56471d7fec4Smrg * parameters: 56571d7fec4Smrg * pParam: It specifies the elements of the panel parameter 56671d7fec4Smrg * structure. 56771d7fec4Smrg * return: none. 56871d7fec4Smrg *-----------------------------------------------------------------*/ 56971d7fec4Smrgint 57071d7fec4SmrgPnl_InitPanel(PPnl_PanelParams pParam) 57171d7fec4Smrg{ 57271d7fec4Smrg PPnl_PanelParams pPtr; 57371d7fec4Smrg 57471d7fec4Smrg if (pParam == 0x0) /* NULL use the static table */ 57571d7fec4Smrg pPtr = &sPanelParam; 57671d7fec4Smrg else 57771d7fec4Smrg pPtr = pParam; 57871d7fec4Smrg 57971d7fec4Smrg if (!pPtr->PanelPresent) { 58071d7fec4Smrg return -1; /* error */ 58171d7fec4Smrg } else { 58271d7fec4Smrg if ((pPtr->PanelChip < 0) || (pPtr->Platform < 0)) 58371d7fec4Smrg return -1; /* error */ 58471d7fec4Smrg 58571d7fec4Smrg#if PLATFORM_DRACO 58671d7fec4Smrg /* check we are init. the right one */ 58771d7fec4Smrg if ((pPtr->Platform == DRACO_PLATFORM) && (pPtr->PanelChip == PNL_9210)) { 58871d7fec4Smrg Draco9210Init(&(pPtr->PanelStat)); 58971d7fec4Smrg } 59071d7fec4Smrg#endif 59171d7fec4Smrg 59271d7fec4Smrg#if PLATFORM_CENTAURUS 59371d7fec4Smrg /* check we are init. the right one */ 59471d7fec4Smrg if (pPtr->Platform == CENTAURUS_PLATFORM) { 59571d7fec4Smrg Centaurus_9211init(&(pPtr->PanelStat)); 59671d7fec4Smrg } 59771d7fec4Smrg#endif 59871d7fec4Smrg 59971d7fec4Smrg#if PLATFORM_DORADO 60071d7fec4Smrg /* check we are init. the right one */ 60171d7fec4Smrg if ((pPtr->Platform == DORADO_PLATFORM) && 60271d7fec4Smrg (pPtr->PanelChip == PNL_9211_C)) { 60371d7fec4Smrg Dorado9211Init(&(pPtr->PanelStat)); 60471d7fec4Smrg } 60571d7fec4Smrg#endif 60671d7fec4Smrg#if PLATFORM_GX2BASED 60771d7fec4Smrg if (pPtr->Platform == REDCLOUD_PLATFORM) { 60871d7fec4Smrg Redcloud_9211init(&(pPtr->PanelStat)); 60971d7fec4Smrg } 61071d7fec4Smrg#endif 61171d7fec4Smrg } /* else end */ 61271d7fec4Smrg return 1; 61371d7fec4Smrg} 614