Home | History | Annotate | Line # | Download | only in radeon
atombios.h revision 1.2
      1  1.1  riastrad /*
      2  1.1  riastrad  * Copyright 2006-2007 Advanced Micro Devices, Inc.
      3  1.1  riastrad  *
      4  1.1  riastrad  * Permission is hereby granted, free of charge, to any person obtaining a
      5  1.1  riastrad  * copy of this software and associated documentation files (the "Software"),
      6  1.1  riastrad  * to deal in the Software without restriction, including without limitation
      7  1.1  riastrad  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
      8  1.1  riastrad  * and/or sell copies of the Software, and to permit persons to whom the
      9  1.1  riastrad  * Software is furnished to do so, subject to the following conditions:
     10  1.1  riastrad  *
     11  1.1  riastrad  * The above copyright notice and this permission notice shall be included in
     12  1.1  riastrad  * all copies or substantial portions of the Software.
     13  1.1  riastrad  *
     14  1.1  riastrad  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     15  1.1  riastrad  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     16  1.1  riastrad  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
     17  1.1  riastrad  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
     18  1.1  riastrad  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
     19  1.1  riastrad  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
     20  1.1  riastrad  * OTHER DEALINGS IN THE SOFTWARE.
     21  1.1  riastrad  */
     22  1.1  riastrad 
     23  1.1  riastrad 
     24  1.1  riastrad /****************************************************************************/
     25  1.1  riastrad /*Portion I: Definitions  shared between VBIOS and Driver                   */
     26  1.1  riastrad /****************************************************************************/
     27  1.1  riastrad 
     28  1.1  riastrad 
     29  1.1  riastrad #ifndef _ATOMBIOS_H
     30  1.1  riastrad #define _ATOMBIOS_H
     31  1.1  riastrad 
     32  1.1  riastrad #define ATOM_VERSION_MAJOR                   0x00020000
     33  1.1  riastrad #define ATOM_VERSION_MINOR                   0x00000002
     34  1.1  riastrad 
     35  1.1  riastrad #define ATOM_HEADER_VERSION (ATOM_VERSION_MAJOR | ATOM_VERSION_MINOR)
     36  1.1  riastrad 
     37  1.1  riastrad /* Endianness should be specified before inclusion,
     38  1.1  riastrad  * default to little endian
     39  1.1  riastrad  */
     40  1.1  riastrad #ifndef ATOM_BIG_ENDIAN
     41  1.1  riastrad #error Endian not specified
     42  1.1  riastrad #endif
     43  1.1  riastrad 
     44  1.1  riastrad #ifdef _H2INC
     45  1.1  riastrad   #ifndef ULONG
     46  1.1  riastrad     typedef unsigned long ULONG;
     47  1.1  riastrad   #endif
     48  1.1  riastrad 
     49  1.1  riastrad   #ifndef UCHAR
     50  1.1  riastrad     typedef unsigned char UCHAR;
     51  1.1  riastrad   #endif
     52  1.1  riastrad 
     53  1.1  riastrad   #ifndef USHORT
     54  1.1  riastrad     typedef unsigned short USHORT;
     55  1.1  riastrad   #endif
     56  1.1  riastrad #endif
     57  1.1  riastrad 
     58  1.1  riastrad #define ATOM_DAC_A            0
     59  1.1  riastrad #define ATOM_DAC_B            1
     60  1.1  riastrad #define ATOM_EXT_DAC          2
     61  1.1  riastrad 
     62  1.1  riastrad #define ATOM_CRTC1            0
     63  1.1  riastrad #define ATOM_CRTC2            1
     64  1.1  riastrad #define ATOM_CRTC3            2
     65  1.1  riastrad #define ATOM_CRTC4            3
     66  1.1  riastrad #define ATOM_CRTC5            4
     67  1.1  riastrad #define ATOM_CRTC6            5
     68  1.1  riastrad #define ATOM_CRTC_INVALID     0xFF
     69  1.1  riastrad 
     70  1.1  riastrad #define ATOM_DIGA             0
     71  1.1  riastrad #define ATOM_DIGB             1
     72  1.1  riastrad 
     73  1.1  riastrad #define ATOM_PPLL1            0
     74  1.1  riastrad #define ATOM_PPLL2            1
     75  1.1  riastrad #define ATOM_DCPLL            2
     76  1.1  riastrad #define ATOM_PPLL0            2
     77  1.1  riastrad #define ATOM_PPLL3            3
     78  1.1  riastrad 
     79  1.1  riastrad #define ATOM_EXT_PLL1         8
     80  1.1  riastrad #define ATOM_EXT_PLL2         9
     81  1.1  riastrad #define ATOM_EXT_CLOCK        10
     82  1.1  riastrad #define ATOM_PPLL_INVALID     0xFF
     83  1.1  riastrad 
     84  1.1  riastrad #define ENCODER_REFCLK_SRC_P1PLL       0
     85  1.1  riastrad #define ENCODER_REFCLK_SRC_P2PLL       1
     86  1.1  riastrad #define ENCODER_REFCLK_SRC_DCPLL       2
     87  1.1  riastrad #define ENCODER_REFCLK_SRC_EXTCLK      3
     88  1.1  riastrad #define ENCODER_REFCLK_SRC_INVALID     0xFF
     89  1.1  riastrad 
     90  1.1  riastrad #define ATOM_SCALER1          0
     91  1.1  riastrad #define ATOM_SCALER2          1
     92  1.1  riastrad 
     93  1.1  riastrad #define ATOM_SCALER_DISABLE   0
     94  1.1  riastrad #define ATOM_SCALER_CENTER    1
     95  1.1  riastrad #define ATOM_SCALER_EXPANSION 2
     96  1.1  riastrad #define ATOM_SCALER_MULTI_EX  3
     97  1.1  riastrad 
     98  1.1  riastrad #define ATOM_DISABLE          0
     99  1.1  riastrad #define ATOM_ENABLE           1
    100  1.1  riastrad #define ATOM_LCD_BLOFF                          (ATOM_DISABLE+2)
    101  1.1  riastrad #define ATOM_LCD_BLON                           (ATOM_ENABLE+2)
    102  1.1  riastrad #define ATOM_LCD_BL_BRIGHTNESS_CONTROL          (ATOM_ENABLE+3)
    103  1.1  riastrad #define ATOM_LCD_SELFTEST_START									(ATOM_DISABLE+5)
    104  1.1  riastrad #define ATOM_LCD_SELFTEST_STOP									(ATOM_ENABLE+5)
    105  1.1  riastrad #define ATOM_ENCODER_INIT			                  (ATOM_DISABLE+7)
    106  1.1  riastrad #define ATOM_INIT			                          (ATOM_DISABLE+7)
    107  1.1  riastrad #define ATOM_GET_STATUS                         (ATOM_DISABLE+8)
    108  1.1  riastrad 
    109  1.1  riastrad #define ATOM_BLANKING         1
    110  1.1  riastrad #define ATOM_BLANKING_OFF     0
    111  1.1  riastrad 
    112  1.1  riastrad #define ATOM_CURSOR1          0
    113  1.1  riastrad #define ATOM_CURSOR2          1
    114  1.1  riastrad 
    115  1.1  riastrad #define ATOM_ICON1            0
    116  1.1  riastrad #define ATOM_ICON2            1
    117  1.1  riastrad 
    118  1.1  riastrad #define ATOM_CRT1             0
    119  1.1  riastrad #define ATOM_CRT2             1
    120  1.1  riastrad 
    121  1.1  riastrad #define ATOM_TV_NTSC          1
    122  1.1  riastrad #define ATOM_TV_NTSCJ         2
    123  1.1  riastrad #define ATOM_TV_PAL           3
    124  1.1  riastrad #define ATOM_TV_PALM          4
    125  1.1  riastrad #define ATOM_TV_PALCN         5
    126  1.1  riastrad #define ATOM_TV_PALN          6
    127  1.1  riastrad #define ATOM_TV_PAL60         7
    128  1.1  riastrad #define ATOM_TV_SECAM         8
    129  1.1  riastrad #define ATOM_TV_CV            16
    130  1.1  riastrad 
    131  1.1  riastrad #define ATOM_DAC1_PS2         1
    132  1.1  riastrad #define ATOM_DAC1_CV          2
    133  1.1  riastrad #define ATOM_DAC1_NTSC        3
    134  1.1  riastrad #define ATOM_DAC1_PAL         4
    135  1.1  riastrad 
    136  1.1  riastrad #define ATOM_DAC2_PS2         ATOM_DAC1_PS2
    137  1.1  riastrad #define ATOM_DAC2_CV          ATOM_DAC1_CV
    138  1.1  riastrad #define ATOM_DAC2_NTSC        ATOM_DAC1_NTSC
    139  1.1  riastrad #define ATOM_DAC2_PAL         ATOM_DAC1_PAL
    140  1.1  riastrad 
    141  1.1  riastrad #define ATOM_PM_ON            0
    142  1.1  riastrad #define ATOM_PM_STANDBY       1
    143  1.1  riastrad #define ATOM_PM_SUSPEND       2
    144  1.1  riastrad #define ATOM_PM_OFF           3
    145  1.1  riastrad 
    146  1.1  riastrad /* Bit0:{=0:single, =1:dual},
    147  1.1  riastrad    Bit1 {=0:666RGB, =1:888RGB},
    148  1.1  riastrad    Bit2:3:{Grey level}
    149  1.1  riastrad    Bit4:{=0:LDI format for RGB888, =1 FPDI format for RGB888}*/
    150  1.1  riastrad 
    151  1.1  riastrad #define ATOM_PANEL_MISC_DUAL               0x00000001
    152  1.1  riastrad #define ATOM_PANEL_MISC_888RGB             0x00000002
    153  1.1  riastrad #define ATOM_PANEL_MISC_GREY_LEVEL         0x0000000C
    154  1.1  riastrad #define ATOM_PANEL_MISC_FPDI               0x00000010
    155  1.1  riastrad #define ATOM_PANEL_MISC_GREY_LEVEL_SHIFT   2
    156  1.1  riastrad #define ATOM_PANEL_MISC_SPATIAL            0x00000020
    157  1.1  riastrad #define ATOM_PANEL_MISC_TEMPORAL           0x00000040
    158  1.1  riastrad #define ATOM_PANEL_MISC_API_ENABLED        0x00000080
    159  1.1  riastrad 
    160  1.1  riastrad 
    161  1.1  riastrad #define MEMTYPE_DDR1              "DDR1"
    162  1.1  riastrad #define MEMTYPE_DDR2              "DDR2"
    163  1.1  riastrad #define MEMTYPE_DDR3              "DDR3"
    164  1.1  riastrad #define MEMTYPE_DDR4              "DDR4"
    165  1.1  riastrad 
    166  1.1  riastrad #define ASIC_BUS_TYPE_PCI         "PCI"
    167  1.1  riastrad #define ASIC_BUS_TYPE_AGP         "AGP"
    168  1.1  riastrad #define ASIC_BUS_TYPE_PCIE        "PCI_EXPRESS"
    169  1.1  riastrad 
    170  1.1  riastrad /* Maximum size of that FireGL flag string */
    171  1.1  riastrad 
    172  1.1  riastrad #define ATOM_FIREGL_FLAG_STRING     "FGL"             //Flag used to enable FireGL Support
    173  1.1  riastrad #define ATOM_MAX_SIZE_OF_FIREGL_FLAG_STRING  3        //sizeof( ATOM_FIREGL_FLAG_STRING )
    174  1.1  riastrad 
    175  1.1  riastrad #define ATOM_FAKE_DESKTOP_STRING    "DSK"             //Flag used to enable mobile ASIC on Desktop
    176  1.1  riastrad #define ATOM_MAX_SIZE_OF_FAKE_DESKTOP_STRING  ATOM_MAX_SIZE_OF_FIREGL_FLAG_STRING
    177  1.1  riastrad 
    178  1.1  riastrad #define ATOM_M54T_FLAG_STRING       "M54T"            //Flag used to enable M54T Support
    179  1.1  riastrad #define ATOM_MAX_SIZE_OF_M54T_FLAG_STRING    4        //sizeof( ATOM_M54T_FLAG_STRING )
    180  1.1  riastrad 
    181  1.1  riastrad #define HW_ASSISTED_I2C_STATUS_FAILURE          2
    182  1.1  riastrad #define HW_ASSISTED_I2C_STATUS_SUCCESS          1
    183  1.1  riastrad 
    184  1.1  riastrad #pragma pack(1)                                       /* BIOS data must use byte aligment */
    185  1.1  riastrad 
    186  1.1  riastrad /*  Define offset to location of ROM header. */
    187  1.1  riastrad 
    188  1.1  riastrad #define OFFSET_TO_POINTER_TO_ATOM_ROM_HEADER		0x00000048L
    189  1.1  riastrad #define OFFSET_TO_ATOM_ROM_IMAGE_SIZE				    0x00000002L
    190  1.1  riastrad 
    191  1.1  riastrad #define OFFSET_TO_ATOMBIOS_ASIC_BUS_MEM_TYPE    0x94
    192  1.1  riastrad #define MAXSIZE_OF_ATOMBIOS_ASIC_BUS_MEM_TYPE   20    /* including the terminator 0x0! */
    193  1.1  riastrad #define	OFFSET_TO_GET_ATOMBIOS_STRINGS_NUMBER		0x002f
    194  1.1  riastrad #define	OFFSET_TO_GET_ATOMBIOS_STRINGS_START		0x006e
    195  1.1  riastrad 
    196  1.1  riastrad /* Common header for all ROM Data tables.
    197  1.1  riastrad   Every table pointed  _ATOM_MASTER_DATA_TABLE has this common header.
    198  1.1  riastrad   And the pointer actually points to this header. */
    199  1.1  riastrad 
    200  1.1  riastrad typedef struct _ATOM_COMMON_TABLE_HEADER
    201  1.1  riastrad {
    202  1.1  riastrad   USHORT usStructureSize;
    203  1.1  riastrad   UCHAR  ucTableFormatRevision;   /*Change it when the Parser is not backward compatible */
    204  1.1  riastrad   UCHAR  ucTableContentRevision;  /*Change it only when the table needs to change but the firmware */
    205  1.1  riastrad                                   /*Image can't be updated, while Driver needs to carry the new table! */
    206  1.1  riastrad }ATOM_COMMON_TABLE_HEADER;
    207  1.1  riastrad 
    208  1.1  riastrad /****************************************************************************/
    209  1.1  riastrad // Structure stores the ROM header.
    210  1.1  riastrad /****************************************************************************/
    211  1.1  riastrad typedef struct _ATOM_ROM_HEADER
    212  1.1  riastrad {
    213  1.1  riastrad   ATOM_COMMON_TABLE_HEADER		sHeader;
    214  1.1  riastrad   UCHAR	 uaFirmWareSignature[4];    /*Signature to distinguish between Atombios and non-atombios,
    215  1.1  riastrad                                       atombios should init it as "ATOM", don't change the position */
    216  1.1  riastrad   USHORT usBiosRuntimeSegmentAddress;
    217  1.1  riastrad   USHORT usProtectedModeInfoOffset;
    218  1.1  riastrad   USHORT usConfigFilenameOffset;
    219  1.1  riastrad   USHORT usCRC_BlockOffset;
    220  1.1  riastrad   USHORT usBIOS_BootupMessageOffset;
    221  1.1  riastrad   USHORT usInt10Offset;
    222  1.1  riastrad   USHORT usPciBusDevInitCode;
    223  1.1  riastrad   USHORT usIoBaseAddress;
    224  1.1  riastrad   USHORT usSubsystemVendorID;
    225  1.1  riastrad   USHORT usSubsystemID;
    226  1.1  riastrad   USHORT usPCI_InfoOffset;
    227  1.1  riastrad   USHORT usMasterCommandTableOffset; /*Offset for SW to get all command table offsets, Don't change the position */
    228  1.1  riastrad   USHORT usMasterDataTableOffset;   /*Offset for SW to get all data table offsets, Don't change the position */
    229  1.1  riastrad   UCHAR  ucExtendedFunctionCode;
    230  1.1  riastrad   UCHAR  ucReserved;
    231  1.1  riastrad }ATOM_ROM_HEADER;
    232  1.1  riastrad 
    233  1.1  riastrad /*==============================Command Table Portion==================================== */
    234  1.1  riastrad 
    235  1.1  riastrad #ifdef	UEFI_BUILD
    236  1.1  riastrad 	#define	UTEMP	USHORT
    237  1.1  riastrad 	#define	USHORT	void*
    238  1.1  riastrad #endif
    239  1.1  riastrad 
    240  1.1  riastrad /****************************************************************************/
    241  1.1  riastrad // Structures used in Command.mtb
    242  1.1  riastrad /****************************************************************************/
    243  1.1  riastrad typedef struct _ATOM_MASTER_LIST_OF_COMMAND_TABLES{
    244  1.1  riastrad   USHORT ASIC_Init;                              //Function Table, used by various SW components,latest version 1.1
    245  1.1  riastrad   USHORT GetDisplaySurfaceSize;                  //Atomic Table,  Used by Bios when enabling HW ICON
    246  1.1  riastrad   USHORT ASIC_RegistersInit;                     //Atomic Table,  indirectly used by various SW components,called from ASIC_Init
    247  1.1  riastrad   USHORT VRAM_BlockVenderDetection;              //Atomic Table,  used only by Bios
    248  1.1  riastrad   USHORT DIGxEncoderControl;										 //Only used by Bios
    249  1.1  riastrad   USHORT MemoryControllerInit;                   //Atomic Table,  indirectly used by various SW components,called from ASIC_Init
    250  1.1  riastrad   USHORT EnableCRTCMemReq;                       //Function Table,directly used by various SW components,latest version 2.1
    251  1.1  riastrad   USHORT MemoryParamAdjust; 										 //Atomic Table,  indirectly used by various SW components,called from SetMemoryClock if needed
    252  1.1  riastrad   USHORT DVOEncoderControl;                      //Function Table,directly used by various SW components,latest version 1.2
    253  1.1  riastrad   USHORT GPIOPinControl;												 //Atomic Table,  only used by Bios
    254  1.1  riastrad   USHORT SetEngineClock;                         //Function Table,directly used by various SW components,latest version 1.1
    255  1.1  riastrad   USHORT SetMemoryClock;                         //Function Table,directly used by various SW components,latest version 1.1
    256  1.1  riastrad   USHORT SetPixelClock;                          //Function Table,directly used by various SW components,latest version 1.2
    257  1.1  riastrad   USHORT EnableDispPowerGating;                  //Atomic Table,  indirectly used by various SW components,called from ASIC_Init
    258  1.1  riastrad   USHORT ResetMemoryDLL;                         //Atomic Table,  indirectly used by various SW components,called from SetMemoryClock
    259  1.1  riastrad   USHORT ResetMemoryDevice;                      //Atomic Table,  indirectly used by various SW components,called from SetMemoryClock
    260  1.1  riastrad   USHORT MemoryPLLInit;                          //Atomic Table,  used only by Bios
    261  1.1  riastrad   USHORT AdjustDisplayPll;											 //Atomic Table,  used by various SW componentes.
    262  1.1  riastrad   USHORT AdjustMemoryController;                 //Atomic Table,  indirectly used by various SW components,called from SetMemoryClock
    263  1.1  riastrad   USHORT EnableASIC_StaticPwrMgt;                //Atomic Table,  only used by Bios
    264  1.1  riastrad   USHORT SetUniphyInstance;                      //Atomic Table,  only used by Bios
    265  1.1  riastrad   USHORT DAC_LoadDetection;                      //Atomic Table,  directly used by various SW components,latest version 1.2
    266  1.1  riastrad   USHORT LVTMAEncoderControl;                    //Atomic Table,directly used by various SW components,latest version 1.3
    267  1.1  riastrad   USHORT HW_Misc_Operation;                      //Atomic Table,  directly used by various SW components,latest version 1.1
    268  1.1  riastrad   USHORT DAC1EncoderControl;                     //Atomic Table,  directly used by various SW components,latest version 1.1
    269  1.1  riastrad   USHORT DAC2EncoderControl;                     //Atomic Table,  directly used by various SW components,latest version 1.1
    270  1.1  riastrad   USHORT DVOOutputControl;                       //Atomic Table,  directly used by various SW components,latest version 1.1
    271  1.1  riastrad   USHORT CV1OutputControl;                       //Atomic Table,  Atomic Table,  Obsolete from Ry6xx, use DAC2 Output instead
    272  1.1  riastrad   USHORT GetConditionalGoldenSetting;            //Only used by Bios
    273  1.1  riastrad   USHORT TVEncoderControl;                       //Function Table,directly used by various SW components,latest version 1.1
    274  1.1  riastrad   USHORT PatchMCSetting;                         //only used by BIOS
    275  1.1  riastrad   USHORT MC_SEQ_Control;                         //only used by BIOS
    276  1.1  riastrad   USHORT Gfx_Harvesting;                         //Atomic Table,  Obsolete from Ry6xx, Now only used by BIOS for GFX harvesting
    277  1.1  riastrad   USHORT EnableScaler;                           //Atomic Table,  used only by Bios
    278  1.1  riastrad   USHORT BlankCRTC;                              //Atomic Table,  directly used by various SW components,latest version 1.1
    279  1.1  riastrad   USHORT EnableCRTC;                             //Atomic Table,  directly used by various SW components,latest version 1.1
    280  1.1  riastrad   USHORT GetPixelClock;                          //Atomic Table,  directly used by various SW components,latest version 1.1
    281  1.1  riastrad   USHORT EnableVGA_Render;                       //Function Table,directly used by various SW components,latest version 1.1
    282  1.1  riastrad   USHORT GetSCLKOverMCLKRatio;                   //Atomic Table,  only used by Bios
    283  1.1  riastrad   USHORT SetCRTC_Timing;                         //Atomic Table,  directly used by various SW components,latest version 1.1
    284  1.1  riastrad   USHORT SetCRTC_OverScan;                       //Atomic Table,  used by various SW components,latest version 1.1
    285  1.1  riastrad   USHORT SetCRTC_Replication;                    //Atomic Table,  used only by Bios
    286  1.1  riastrad   USHORT SelectCRTC_Source;                      //Atomic Table,  directly used by various SW components,latest version 1.1
    287  1.1  riastrad   USHORT EnableGraphSurfaces;                    //Atomic Table,  used only by Bios
    288  1.1  riastrad   USHORT UpdateCRTC_DoubleBufferRegisters;			 //Atomic Table,  used only by Bios
    289  1.1  riastrad   USHORT LUT_AutoFill;                           //Atomic Table,  only used by Bios
    290  1.1  riastrad   USHORT EnableHW_IconCursor;                    //Atomic Table,  only used by Bios
    291  1.1  riastrad   USHORT GetMemoryClock;                         //Atomic Table,  directly used by various SW components,latest version 1.1
    292  1.1  riastrad   USHORT GetEngineClock;                         //Atomic Table,  directly used by various SW components,latest version 1.1
    293  1.1  riastrad   USHORT SetCRTC_UsingDTDTiming;                 //Atomic Table,  directly used by various SW components,latest version 1.1
    294  1.1  riastrad   USHORT ExternalEncoderControl;                 //Atomic Table,  directly used by various SW components,latest version 2.1
    295  1.1  riastrad   USHORT LVTMAOutputControl;                     //Atomic Table,  directly used by various SW components,latest version 1.1
    296  1.1  riastrad   USHORT VRAM_BlockDetectionByStrap;             //Atomic Table,  used only by Bios
    297  1.1  riastrad   USHORT MemoryCleanUp;                          //Atomic Table,  only used by Bios
    298  1.1  riastrad   USHORT ProcessI2cChannelTransaction;           //Function Table,only used by Bios
    299  1.1  riastrad   USHORT WriteOneByteToHWAssistedI2C;            //Function Table,indirectly used by various SW components
    300  1.1  riastrad   USHORT ReadHWAssistedI2CStatus;                //Atomic Table,  indirectly used by various SW components
    301  1.1  riastrad   USHORT SpeedFanControl;                        //Function Table,indirectly used by various SW components,called from ASIC_Init
    302  1.1  riastrad   USHORT PowerConnectorDetection;                //Atomic Table,  directly used by various SW components,latest version 1.1
    303  1.1  riastrad   USHORT MC_Synchronization;                     //Atomic Table,  indirectly used by various SW components,called from SetMemoryClock
    304  1.1  riastrad   USHORT ComputeMemoryEnginePLL;                 //Atomic Table,  indirectly used by various SW components,called from SetMemory/EngineClock
    305  1.1  riastrad   USHORT MemoryRefreshConversion;                //Atomic Table,  indirectly used by various SW components,called from SetMemory or SetEngineClock
    306  1.1  riastrad   USHORT VRAM_GetCurrentInfoBlock;               //Atomic Table,  used only by Bios
    307  1.1  riastrad   USHORT DynamicMemorySettings;                  //Atomic Table,  indirectly used by various SW components,called from SetMemoryClock
    308  1.1  riastrad   USHORT MemoryTraining;                         //Atomic Table,  used only by Bios
    309  1.1  riastrad   USHORT EnableSpreadSpectrumOnPPLL;             //Atomic Table,  directly used by various SW components,latest version 1.2
    310  1.1  riastrad   USHORT TMDSAOutputControl;                     //Atomic Table,  directly used by various SW components,latest version 1.1
    311  1.1  riastrad   USHORT SetVoltage;                             //Function Table,directly and/or indirectly used by various SW components,latest version 1.1
    312  1.1  riastrad   USHORT DAC1OutputControl;                      //Atomic Table,  directly used by various SW components,latest version 1.1
    313  1.1  riastrad   USHORT DAC2OutputControl;                      //Atomic Table,  directly used by various SW components,latest version 1.1
    314  1.1  riastrad   USHORT ComputeMemoryClockParam;                //Function Table,only used by Bios, obsolete soon.Switch to use "ReadEDIDFromHWAssistedI2C"
    315  1.1  riastrad   USHORT ClockSource;                            //Atomic Table,  indirectly used by various SW components,called from ASIC_Init
    316  1.1  riastrad   USHORT MemoryDeviceInit;                       //Atomic Table,  indirectly used by various SW components,called from SetMemoryClock
    317  1.1  riastrad   USHORT GetDispObjectInfo;                      //Atomic Table,  indirectly used by various SW components,called from EnableVGARender
    318  1.1  riastrad   USHORT DIG1EncoderControl;                     //Atomic Table,directly used by various SW components,latest version 1.1
    319  1.1  riastrad   USHORT DIG2EncoderControl;                     //Atomic Table,directly used by various SW components,latest version 1.1
    320  1.1  riastrad   USHORT DIG1TransmitterControl;                 //Atomic Table,directly used by various SW components,latest version 1.1
    321  1.1  riastrad   USHORT DIG2TransmitterControl;	               //Atomic Table,directly used by various SW components,latest version 1.1
    322  1.1  riastrad   USHORT ProcessAuxChannelTransaction;					 //Function Table,only used by Bios
    323  1.1  riastrad   USHORT DPEncoderService;											 //Function Table,only used by Bios
    324  1.1  riastrad   USHORT GetVoltageInfo;                         //Function Table,only used by Bios since SI
    325  1.1  riastrad }ATOM_MASTER_LIST_OF_COMMAND_TABLES;
    326  1.1  riastrad 
    327  1.1  riastrad // For backward compatible
    328  1.1  riastrad #define ReadEDIDFromHWAssistedI2C                ProcessI2cChannelTransaction
    329  1.1  riastrad #define DPTranslatorControl                      DIG2EncoderControl
    330  1.1  riastrad #define UNIPHYTransmitterControl			     DIG1TransmitterControl
    331  1.1  riastrad #define LVTMATransmitterControl				     DIG2TransmitterControl
    332  1.1  riastrad #define SetCRTC_DPM_State                        GetConditionalGoldenSetting
    333  1.1  riastrad #define ASIC_StaticPwrMgtStatusChange            SetUniphyInstance
    334  1.1  riastrad #define HPDInterruptService                      ReadHWAssistedI2CStatus
    335  1.1  riastrad #define EnableVGA_Access                         GetSCLKOverMCLKRatio
    336  1.1  riastrad #define EnableYUV                                GetDispObjectInfo
    337  1.1  riastrad #define DynamicClockGating                       EnableDispPowerGating
    338  1.1  riastrad #define SetupHWAssistedI2CStatus                 ComputeMemoryClockParam
    339  1.1  riastrad 
    340  1.1  riastrad #define TMDSAEncoderControl                      PatchMCSetting
    341  1.1  riastrad #define LVDSEncoderControl                       MC_SEQ_Control
    342  1.1  riastrad #define LCD1OutputControl                        HW_Misc_Operation
    343  1.1  riastrad #define TV1OutputControl                         Gfx_Harvesting
    344  1.1  riastrad 
    345  1.1  riastrad typedef struct _ATOM_MASTER_COMMAND_TABLE
    346  1.1  riastrad {
    347  1.1  riastrad   ATOM_COMMON_TABLE_HEADER           sHeader;
    348  1.1  riastrad   ATOM_MASTER_LIST_OF_COMMAND_TABLES ListOfCommandTables;
    349  1.1  riastrad }ATOM_MASTER_COMMAND_TABLE;
    350  1.1  riastrad 
    351  1.1  riastrad /****************************************************************************/
    352  1.1  riastrad // Structures used in every command table
    353  1.1  riastrad /****************************************************************************/
    354  1.1  riastrad typedef struct _ATOM_TABLE_ATTRIBUTE
    355  1.1  riastrad {
    356  1.1  riastrad #if ATOM_BIG_ENDIAN
    357  1.1  riastrad   USHORT  UpdatedByUtility:1;         //[15]=Table updated by utility flag
    358  1.1  riastrad   USHORT  PS_SizeInBytes:7;           //[14:8]=Size of parameter space in Bytes (multiple of a dword),
    359  1.1  riastrad   USHORT  WS_SizeInBytes:8;           //[7:0]=Size of workspace in Bytes (in multiple of a dword),
    360  1.1  riastrad #else
    361  1.1  riastrad   USHORT  WS_SizeInBytes:8;           //[7:0]=Size of workspace in Bytes (in multiple of a dword),
    362  1.1  riastrad   USHORT  PS_SizeInBytes:7;           //[14:8]=Size of parameter space in Bytes (multiple of a dword),
    363  1.1  riastrad   USHORT  UpdatedByUtility:1;         //[15]=Table updated by utility flag
    364  1.1  riastrad #endif
    365  1.1  riastrad }ATOM_TABLE_ATTRIBUTE;
    366  1.1  riastrad 
    367  1.1  riastrad typedef union _ATOM_TABLE_ATTRIBUTE_ACCESS
    368  1.1  riastrad {
    369  1.1  riastrad   ATOM_TABLE_ATTRIBUTE sbfAccess;
    370  1.1  riastrad   USHORT               susAccess;
    371  1.1  riastrad }ATOM_TABLE_ATTRIBUTE_ACCESS;
    372  1.1  riastrad 
    373  1.1  riastrad /****************************************************************************/
    374  1.1  riastrad // Common header for all command tables.
    375  1.1  riastrad // Every table pointed by _ATOM_MASTER_COMMAND_TABLE has this common header.
    376  1.1  riastrad // And the pointer actually points to this header.
    377  1.1  riastrad /****************************************************************************/
    378  1.1  riastrad typedef struct _ATOM_COMMON_ROM_COMMAND_TABLE_HEADER
    379  1.1  riastrad {
    380  1.1  riastrad   ATOM_COMMON_TABLE_HEADER CommonHeader;
    381  1.1  riastrad   ATOM_TABLE_ATTRIBUTE     TableAttribute;
    382  1.1  riastrad }ATOM_COMMON_ROM_COMMAND_TABLE_HEADER;
    383  1.1  riastrad 
    384  1.1  riastrad /****************************************************************************/
    385  1.1  riastrad // Structures used by ComputeMemoryEnginePLLTable
    386  1.1  riastrad /****************************************************************************/
    387  1.1  riastrad #define COMPUTE_MEMORY_PLL_PARAM        1
    388  1.1  riastrad #define COMPUTE_ENGINE_PLL_PARAM        2
    389  1.1  riastrad #define ADJUST_MC_SETTING_PARAM         3
    390  1.1  riastrad 
    391  1.1  riastrad /****************************************************************************/
    392  1.1  riastrad // Structures used by AdjustMemoryControllerTable
    393  1.1  riastrad /****************************************************************************/
    394  1.1  riastrad typedef struct _ATOM_ADJUST_MEMORY_CLOCK_FREQ
    395  1.1  riastrad {
    396  1.1  riastrad #if ATOM_BIG_ENDIAN
    397  1.1  riastrad   ULONG ulPointerReturnFlag:1;      // BYTE_3[7]=1 - Return the pointer to the right Data Block; BYTE_3[7]=0 - Program the right Data Block
    398  1.1  riastrad   ULONG ulMemoryModuleNumber:7;     // BYTE_3[6:0]
    399  1.1  riastrad   ULONG ulClockFreq:24;
    400  1.1  riastrad #else
    401  1.1  riastrad   ULONG ulClockFreq:24;
    402  1.1  riastrad   ULONG ulMemoryModuleNumber:7;     // BYTE_3[6:0]
    403  1.1  riastrad   ULONG ulPointerReturnFlag:1;      // BYTE_3[7]=1 - Return the pointer to the right Data Block; BYTE_3[7]=0 - Program the right Data Block
    404  1.1  riastrad #endif
    405  1.1  riastrad }ATOM_ADJUST_MEMORY_CLOCK_FREQ;
    406  1.1  riastrad #define POINTER_RETURN_FLAG             0x80
    407  1.1  riastrad 
    408  1.1  riastrad typedef struct _COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS
    409  1.1  riastrad {
    410  1.1  riastrad   ULONG   ulClock;        //When returen, it's the re-calculated clock based on given Fb_div Post_Div and ref_div
    411  1.1  riastrad   UCHAR   ucAction;       //0:reserved //1:Memory //2:Engine
    412  1.1  riastrad   UCHAR   ucReserved;     //may expand to return larger Fbdiv later
    413  1.1  riastrad   UCHAR   ucFbDiv;        //return value
    414  1.1  riastrad   UCHAR   ucPostDiv;      //return value
    415  1.1  riastrad }COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS;
    416  1.1  riastrad 
    417  1.1  riastrad typedef struct _COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_V2
    418  1.1  riastrad {
    419  1.1  riastrad   ULONG   ulClock;        //When return, [23:0] return real clock
    420  1.1  riastrad   UCHAR   ucAction;       //0:reserved;COMPUTE_MEMORY_PLL_PARAM:Memory;COMPUTE_ENGINE_PLL_PARAM:Engine. it return ref_div to be written to register
    421  1.1  riastrad   USHORT  usFbDiv;		    //return Feedback value to be written to register
    422  1.1  riastrad   UCHAR   ucPostDiv;      //return post div to be written to register
    423  1.1  riastrad }COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_V2;
    424  1.1  riastrad #define COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_PS_ALLOCATION   COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS
    425  1.1  riastrad 
    426  1.1  riastrad 
    427  1.1  riastrad #define SET_CLOCK_FREQ_MASK                     0x00FFFFFF  //Clock change tables only take bit [23:0] as the requested clock value
    428  1.1  riastrad #define USE_NON_BUS_CLOCK_MASK                  0x01000000  //Applicable to both memory and engine clock change, when set, it uses another clock as the temporary clock (engine uses memory and vice versa)
    429  1.1  riastrad #define USE_MEMORY_SELF_REFRESH_MASK            0x02000000	//Only applicable to memory clock change, when set, using memory self refresh during clock transition
    430  1.1  riastrad #define SKIP_INTERNAL_MEMORY_PARAMETER_CHANGE   0x04000000  //Only applicable to memory clock change, when set, the table will skip predefined internal memory parameter change
    431  1.1  riastrad #define FIRST_TIME_CHANGE_CLOCK									0x08000000	//Applicable to both memory and engine clock change,when set, it means this is 1st time to change clock after ASIC bootup
    432  1.1  riastrad #define SKIP_SW_PROGRAM_PLL											0x10000000	//Applicable to both memory and engine clock change, when set, it means the table will not program SPLL/MPLL
    433  1.1  riastrad #define USE_SS_ENABLED_PIXEL_CLOCK  USE_NON_BUS_CLOCK_MASK
    434  1.1  riastrad 
    435  1.1  riastrad #define b3USE_NON_BUS_CLOCK_MASK                  0x01       //Applicable to both memory and engine clock change, when set, it uses another clock as the temporary clock (engine uses memory and vice versa)
    436  1.1  riastrad #define b3USE_MEMORY_SELF_REFRESH                 0x02	     //Only applicable to memory clock change, when set, using memory self refresh during clock transition
    437  1.1  riastrad #define b3SKIP_INTERNAL_MEMORY_PARAMETER_CHANGE   0x04       //Only applicable to memory clock change, when set, the table will skip predefined internal memory parameter change
    438  1.1  riastrad #define b3FIRST_TIME_CHANGE_CLOCK									0x08       //Applicable to both memory and engine clock change,when set, it means this is 1st time to change clock after ASIC bootup
    439  1.1  riastrad #define b3SKIP_SW_PROGRAM_PLL											0x10			 //Applicable to both memory and engine clock change, when set, it means the table will not program SPLL/MPLL
    440  1.1  riastrad 
    441  1.1  riastrad typedef struct _ATOM_COMPUTE_CLOCK_FREQ
    442  1.1  riastrad {
    443  1.1  riastrad #if ATOM_BIG_ENDIAN
    444  1.1  riastrad   ULONG ulComputeClockFlag:8;                 // =1: COMPUTE_MEMORY_PLL_PARAM, =2: COMPUTE_ENGINE_PLL_PARAM
    445  1.1  riastrad   ULONG ulClockFreq:24;                       // in unit of 10kHz
    446  1.1  riastrad #else
    447  1.1  riastrad   ULONG ulClockFreq:24;                       // in unit of 10kHz
    448  1.1  riastrad   ULONG ulComputeClockFlag:8;                 // =1: COMPUTE_MEMORY_PLL_PARAM, =2: COMPUTE_ENGINE_PLL_PARAM
    449  1.1  riastrad #endif
    450  1.1  riastrad }ATOM_COMPUTE_CLOCK_FREQ;
    451  1.1  riastrad 
    452  1.1  riastrad typedef struct _ATOM_S_MPLL_FB_DIVIDER
    453  1.1  riastrad {
    454  1.1  riastrad   USHORT usFbDivFrac;
    455  1.1  riastrad   USHORT usFbDiv;
    456  1.1  riastrad }ATOM_S_MPLL_FB_DIVIDER;
    457  1.1  riastrad 
    458  1.1  riastrad typedef struct _COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_V3
    459  1.1  riastrad {
    460  1.1  riastrad   union
    461  1.1  riastrad   {
    462  1.1  riastrad     ATOM_COMPUTE_CLOCK_FREQ  ulClock;         //Input Parameter
    463  1.1  riastrad     ULONG ulClockParams;                      //ULONG access for BE
    464  1.1  riastrad     ATOM_S_MPLL_FB_DIVIDER   ulFbDiv;         //Output Parameter
    465  1.1  riastrad   };
    466  1.1  riastrad   UCHAR   ucRefDiv;                           //Output Parameter
    467  1.1  riastrad   UCHAR   ucPostDiv;                          //Output Parameter
    468  1.1  riastrad   UCHAR   ucCntlFlag;                         //Output Parameter
    469  1.1  riastrad   UCHAR   ucReserved;
    470  1.1  riastrad }COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_V3;
    471  1.1  riastrad 
    472  1.1  riastrad // ucCntlFlag
    473  1.1  riastrad #define ATOM_PLL_CNTL_FLAG_PLL_POST_DIV_EN          1
    474  1.1  riastrad #define ATOM_PLL_CNTL_FLAG_MPLL_VCO_MODE            2
    475  1.1  riastrad #define ATOM_PLL_CNTL_FLAG_FRACTION_DISABLE         4
    476  1.1  riastrad #define ATOM_PLL_CNTL_FLAG_SPLL_ISPARE_9						8
    477  1.1  riastrad 
    478  1.1  riastrad 
    479  1.1  riastrad // V4 are only used for APU which PLL outside GPU
    480  1.1  riastrad typedef struct _COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_V4
    481  1.1  riastrad {
    482  1.1  riastrad #if ATOM_BIG_ENDIAN
    483  1.1  riastrad   ULONG  ucPostDiv:8;        //return parameter: post divider which is used to program to register directly
    484  1.1  riastrad   ULONG  ulClock:24;         //Input= target clock, output = actual clock
    485  1.1  riastrad #else
    486  1.1  riastrad   ULONG  ulClock:24;         //Input= target clock, output = actual clock
    487  1.1  riastrad   ULONG  ucPostDiv:8;        //return parameter: post divider which is used to program to register directly
    488  1.1  riastrad #endif
    489  1.1  riastrad }COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_V4;
    490  1.1  riastrad 
    491  1.1  riastrad typedef struct _COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_V5
    492  1.1  riastrad {
    493  1.1  riastrad   union
    494  1.1  riastrad   {
    495  1.1  riastrad     ATOM_COMPUTE_CLOCK_FREQ  ulClock;         //Input Parameter
    496  1.1  riastrad     ULONG ulClockParams;                      //ULONG access for BE
    497  1.1  riastrad     ATOM_S_MPLL_FB_DIVIDER   ulFbDiv;         //Output Parameter
    498  1.1  riastrad   };
    499  1.1  riastrad   UCHAR   ucRefDiv;                           //Output Parameter
    500  1.1  riastrad   UCHAR   ucPostDiv;                          //Output Parameter
    501  1.1  riastrad   union
    502  1.1  riastrad   {
    503  1.1  riastrad     UCHAR   ucCntlFlag;                       //Output Flags
    504  1.1  riastrad     UCHAR   ucInputFlag;                      //Input Flags. ucInputFlag[0] - Strobe(1)/Performance(0) mode
    505  1.1  riastrad   };
    506  1.1  riastrad   UCHAR   ucReserved;
    507  1.1  riastrad }COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_V5;
    508  1.1  riastrad 
    509  1.1  riastrad 
    510  1.1  riastrad typedef struct _COMPUTE_GPU_CLOCK_INPUT_PARAMETERS_V1_6
    511  1.1  riastrad {
    512  1.1  riastrad   ATOM_COMPUTE_CLOCK_FREQ  ulClock;         //Input Parameter
    513  1.1  riastrad   ULONG   ulReserved[2];
    514  1.1  riastrad }COMPUTE_GPU_CLOCK_INPUT_PARAMETERS_V1_6;
    515  1.1  riastrad 
    516  1.1  riastrad //ATOM_COMPUTE_CLOCK_FREQ.ulComputeClockFlag
    517  1.1  riastrad #define COMPUTE_GPUCLK_INPUT_FLAG_CLK_TYPE_MASK            0x0f
    518  1.1  riastrad #define COMPUTE_GPUCLK_INPUT_FLAG_DEFAULT_GPUCLK           0x00
    519  1.1  riastrad #define COMPUTE_GPUCLK_INPUT_FLAG_SCLK                     0x01
    520  1.1  riastrad 
    521  1.1  riastrad typedef struct _COMPUTE_GPU_CLOCK_OUTPUT_PARAMETERS_V1_6
    522  1.1  riastrad {
    523  1.1  riastrad   COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_V4  ulClock;         //Output Parameter: ucPostDiv=DFS divider
    524  1.1  riastrad   ATOM_S_MPLL_FB_DIVIDER   ulFbDiv;         //Output Parameter: PLL FB divider
    525  1.1  riastrad   UCHAR   ucPllRefDiv;                      //Output Parameter: PLL ref divider
    526  1.1  riastrad   UCHAR   ucPllPostDiv;                     //Output Parameter: PLL post divider
    527  1.1  riastrad   UCHAR   ucPllCntlFlag;                    //Output Flags: control flag
    528  1.1  riastrad   UCHAR   ucReserved;
    529  1.1  riastrad }COMPUTE_GPU_CLOCK_OUTPUT_PARAMETERS_V1_6;
    530  1.1  riastrad 
    531  1.1  riastrad //ucPllCntlFlag
    532  1.1  riastrad #define SPLL_CNTL_FLAG_VCO_MODE_MASK            0x03
    533  1.1  riastrad 
    534  1.1  riastrad 
    535  1.1  riastrad // ucInputFlag
    536  1.1  riastrad #define ATOM_PLL_INPUT_FLAG_PLL_STROBE_MODE_EN  1   // 1-StrobeMode, 0-PerformanceMode
    537  1.1  riastrad 
    538  1.1  riastrad // use for ComputeMemoryClockParamTable
    539  1.1  riastrad typedef struct _COMPUTE_MEMORY_CLOCK_PARAM_PARAMETERS_V2_1
    540  1.1  riastrad {
    541  1.1  riastrad   union
    542  1.1  riastrad   {
    543  1.1  riastrad     ULONG  ulClock;
    544  1.1  riastrad     ATOM_S_MPLL_FB_DIVIDER   ulFbDiv;         //Output:UPPER_WORD=FB_DIV_INTEGER,  LOWER_WORD=FB_DIV_FRAC shl (16-FB_FRACTION_BITS)
    545  1.1  riastrad   };
    546  1.1  riastrad   UCHAR   ucDllSpeed;                         //Output
    547  1.1  riastrad   UCHAR   ucPostDiv;                          //Output
    548  1.1  riastrad   union{
    549  1.1  riastrad     UCHAR   ucInputFlag;                      //Input : ATOM_PLL_INPUT_FLAG_PLL_STROBE_MODE_EN: 1-StrobeMode, 0-PerformanceMode
    550  1.1  riastrad     UCHAR   ucPllCntlFlag;                    //Output:
    551  1.1  riastrad   };
    552  1.1  riastrad   UCHAR   ucBWCntl;
    553  1.1  riastrad }COMPUTE_MEMORY_CLOCK_PARAM_PARAMETERS_V2_1;
    554  1.1  riastrad 
    555  1.1  riastrad // definition of ucInputFlag
    556  1.1  riastrad #define MPLL_INPUT_FLAG_STROBE_MODE_EN          0x01
    557  1.1  riastrad // definition of ucPllCntlFlag
    558  1.1  riastrad #define MPLL_CNTL_FLAG_VCO_MODE_MASK            0x03
    559  1.1  riastrad #define MPLL_CNTL_FLAG_BYPASS_DQ_PLL            0x04
    560  1.1  riastrad #define MPLL_CNTL_FLAG_QDR_ENABLE               0x08
    561  1.1  riastrad #define MPLL_CNTL_FLAG_AD_HALF_RATE             0x10
    562  1.1  riastrad 
    563  1.1  riastrad //MPLL_CNTL_FLAG_BYPASS_AD_PLL has a wrong name, should be BYPASS_DQ_PLL
    564  1.1  riastrad #define MPLL_CNTL_FLAG_BYPASS_AD_PLL            0x04
    565  1.1  riastrad 
    566  1.1  riastrad typedef struct _DYNAMICE_MEMORY_SETTINGS_PARAMETER
    567  1.1  riastrad {
    568  1.1  riastrad   ATOM_COMPUTE_CLOCK_FREQ ulClock;
    569  1.1  riastrad   ULONG ulReserved[2];
    570  1.1  riastrad }DYNAMICE_MEMORY_SETTINGS_PARAMETER;
    571  1.1  riastrad 
    572  1.1  riastrad typedef struct _DYNAMICE_ENGINE_SETTINGS_PARAMETER
    573  1.1  riastrad {
    574  1.1  riastrad   ATOM_COMPUTE_CLOCK_FREQ ulClock;
    575  1.1  riastrad   ULONG ulMemoryClock;
    576  1.1  riastrad   ULONG ulReserved;
    577  1.1  riastrad }DYNAMICE_ENGINE_SETTINGS_PARAMETER;
    578  1.1  riastrad 
    579  1.1  riastrad /****************************************************************************/
    580  1.1  riastrad // Structures used by SetEngineClockTable
    581  1.1  riastrad /****************************************************************************/
    582  1.1  riastrad typedef struct _SET_ENGINE_CLOCK_PARAMETERS
    583  1.1  riastrad {
    584  1.1  riastrad   ULONG ulTargetEngineClock;          //In 10Khz unit
    585  1.1  riastrad }SET_ENGINE_CLOCK_PARAMETERS;
    586  1.1  riastrad 
    587  1.1  riastrad typedef struct _SET_ENGINE_CLOCK_PS_ALLOCATION
    588  1.1  riastrad {
    589  1.1  riastrad   ULONG ulTargetEngineClock;          //In 10Khz unit
    590  1.1  riastrad   COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_PS_ALLOCATION sReserved;
    591  1.1  riastrad }SET_ENGINE_CLOCK_PS_ALLOCATION;
    592  1.1  riastrad 
    593  1.1  riastrad /****************************************************************************/
    594  1.1  riastrad // Structures used by SetMemoryClockTable
    595  1.1  riastrad /****************************************************************************/
    596  1.1  riastrad typedef struct _SET_MEMORY_CLOCK_PARAMETERS
    597  1.1  riastrad {
    598  1.1  riastrad   ULONG ulTargetMemoryClock;          //In 10Khz unit
    599  1.1  riastrad }SET_MEMORY_CLOCK_PARAMETERS;
    600  1.1  riastrad 
    601  1.1  riastrad typedef struct _SET_MEMORY_CLOCK_PS_ALLOCATION
    602  1.1  riastrad {
    603  1.1  riastrad   ULONG ulTargetMemoryClock;          //In 10Khz unit
    604  1.1  riastrad   COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_PS_ALLOCATION sReserved;
    605  1.1  riastrad }SET_MEMORY_CLOCK_PS_ALLOCATION;
    606  1.1  riastrad 
    607  1.1  riastrad /****************************************************************************/
    608  1.1  riastrad // Structures used by ASIC_Init.ctb
    609  1.1  riastrad /****************************************************************************/
    610  1.1  riastrad typedef struct _ASIC_INIT_PARAMETERS
    611  1.1  riastrad {
    612  1.1  riastrad   ULONG ulDefaultEngineClock;         //In 10Khz unit
    613  1.1  riastrad   ULONG ulDefaultMemoryClock;         //In 10Khz unit
    614  1.1  riastrad }ASIC_INIT_PARAMETERS;
    615  1.1  riastrad 
    616  1.1  riastrad typedef struct _ASIC_INIT_PS_ALLOCATION
    617  1.1  riastrad {
    618  1.1  riastrad   ASIC_INIT_PARAMETERS sASICInitClocks;
    619  1.1  riastrad   SET_ENGINE_CLOCK_PS_ALLOCATION sReserved; //Caller doesn't need to init this structure
    620  1.1  riastrad }ASIC_INIT_PS_ALLOCATION;
    621  1.1  riastrad 
    622  1.1  riastrad /****************************************************************************/
    623  1.1  riastrad // Structure used by DynamicClockGatingTable.ctb
    624  1.1  riastrad /****************************************************************************/
    625  1.1  riastrad typedef struct _DYNAMIC_CLOCK_GATING_PARAMETERS
    626  1.1  riastrad {
    627  1.1  riastrad   UCHAR ucEnable;                     // ATOM_ENABLE or ATOM_DISABLE
    628  1.1  riastrad   UCHAR ucPadding[3];
    629  1.1  riastrad }DYNAMIC_CLOCK_GATING_PARAMETERS;
    630  1.1  riastrad #define  DYNAMIC_CLOCK_GATING_PS_ALLOCATION  DYNAMIC_CLOCK_GATING_PARAMETERS
    631  1.1  riastrad 
    632  1.1  riastrad /****************************************************************************/
    633  1.1  riastrad // Structure used by EnableDispPowerGatingTable.ctb
    634  1.1  riastrad /****************************************************************************/
    635  1.1  riastrad typedef struct _ENABLE_DISP_POWER_GATING_PARAMETERS_V2_1
    636  1.1  riastrad {
    637  1.1  riastrad   UCHAR ucDispPipeId;                 // ATOM_CRTC1, ATOM_CRTC2, ...
    638  1.1  riastrad   UCHAR ucEnable;                     // ATOM_ENABLE or ATOM_DISABLE
    639  1.1  riastrad   UCHAR ucPadding[2];
    640  1.1  riastrad }ENABLE_DISP_POWER_GATING_PARAMETERS_V2_1;
    641  1.1  riastrad 
    642  1.1  riastrad /****************************************************************************/
    643  1.1  riastrad // Structure used by EnableASIC_StaticPwrMgtTable.ctb
    644  1.1  riastrad /****************************************************************************/
    645  1.1  riastrad typedef struct _ENABLE_ASIC_STATIC_PWR_MGT_PARAMETERS
    646  1.1  riastrad {
    647  1.1  riastrad   UCHAR ucEnable;                     // ATOM_ENABLE or ATOM_DISABLE
    648  1.1  riastrad   UCHAR ucPadding[3];
    649  1.1  riastrad }ENABLE_ASIC_STATIC_PWR_MGT_PARAMETERS;
    650  1.1  riastrad #define ENABLE_ASIC_STATIC_PWR_MGT_PS_ALLOCATION  ENABLE_ASIC_STATIC_PWR_MGT_PARAMETERS
    651  1.1  riastrad 
    652  1.1  riastrad /****************************************************************************/
    653  1.1  riastrad // Structures used by DAC_LoadDetectionTable.ctb
    654  1.1  riastrad /****************************************************************************/
    655  1.1  riastrad typedef struct _DAC_LOAD_DETECTION_PARAMETERS
    656  1.1  riastrad {
    657  1.1  riastrad   USHORT usDeviceID;                  //{ATOM_DEVICE_CRTx_SUPPORT,ATOM_DEVICE_TVx_SUPPORT,ATOM_DEVICE_CVx_SUPPORT}
    658  1.1  riastrad   UCHAR  ucDacType;                   //{ATOM_DAC_A,ATOM_DAC_B, ATOM_EXT_DAC}
    659  1.1  riastrad   UCHAR  ucMisc;											//Valid only when table revision =1.3 and above
    660  1.1  riastrad }DAC_LOAD_DETECTION_PARAMETERS;
    661  1.1  riastrad 
    662  1.1  riastrad // DAC_LOAD_DETECTION_PARAMETERS.ucMisc
    663  1.1  riastrad #define DAC_LOAD_MISC_YPrPb						0x01
    664  1.1  riastrad 
    665  1.1  riastrad typedef struct _DAC_LOAD_DETECTION_PS_ALLOCATION
    666  1.1  riastrad {
    667  1.1  riastrad   DAC_LOAD_DETECTION_PARAMETERS            sDacload;
    668  1.1  riastrad   ULONG                                    Reserved[2];// Don't set this one, allocation for EXT DAC
    669  1.1  riastrad }DAC_LOAD_DETECTION_PS_ALLOCATION;
    670  1.1  riastrad 
    671  1.1  riastrad /****************************************************************************/
    672  1.1  riastrad // Structures used by DAC1EncoderControlTable.ctb and DAC2EncoderControlTable.ctb
    673  1.1  riastrad /****************************************************************************/
    674  1.1  riastrad typedef struct _DAC_ENCODER_CONTROL_PARAMETERS
    675  1.1  riastrad {
    676  1.1  riastrad   USHORT usPixelClock;                // in 10KHz; for bios convenient
    677  1.1  riastrad   UCHAR  ucDacStandard;               // See definition of ATOM_DACx_xxx, For DEC3.0, bit 7 used as internal flag to indicate DAC2 (==1) or DAC1 (==0)
    678  1.1  riastrad   UCHAR  ucAction;                    // 0: turn off encoder
    679  1.1  riastrad                                       // 1: setup and turn on encoder
    680  1.1  riastrad                                       // 7: ATOM_ENCODER_INIT Initialize DAC
    681  1.1  riastrad }DAC_ENCODER_CONTROL_PARAMETERS;
    682  1.1  riastrad 
    683  1.1  riastrad #define DAC_ENCODER_CONTROL_PS_ALLOCATION  DAC_ENCODER_CONTROL_PARAMETERS
    684  1.1  riastrad 
    685  1.1  riastrad /****************************************************************************/
    686  1.1  riastrad // Structures used by DIG1EncoderControlTable
    687  1.1  riastrad //                    DIG2EncoderControlTable
    688  1.1  riastrad //                    ExternalEncoderControlTable
    689  1.1  riastrad /****************************************************************************/
    690  1.1  riastrad typedef struct _DIG_ENCODER_CONTROL_PARAMETERS
    691  1.1  riastrad {
    692  1.1  riastrad   USHORT usPixelClock;		// in 10KHz; for bios convenient
    693  1.1  riastrad   UCHAR  ucConfig;
    694  1.1  riastrad                             // [2] Link Select:
    695  1.1  riastrad                             // =0: PHY linkA if bfLane<3
    696  1.1  riastrad                             // =1: PHY linkB if bfLanes<3
    697  1.1  riastrad                             // =0: PHY linkA+B if bfLanes=3
    698  1.1  riastrad                             // [3] Transmitter Sel
    699  1.1  riastrad                             // =0: UNIPHY or PCIEPHY
    700  1.1  riastrad                             // =1: LVTMA
    701  1.1  riastrad   UCHAR ucAction;           // =0: turn off encoder
    702  1.1  riastrad                             // =1: turn on encoder
    703  1.1  riastrad   UCHAR ucEncoderMode;
    704  1.1  riastrad                             // =0: DP   encoder
    705  1.1  riastrad                             // =1: LVDS encoder
    706  1.1  riastrad                             // =2: DVI  encoder
    707  1.1  riastrad                             // =3: HDMI encoder
    708  1.1  riastrad                             // =4: SDVO encoder
    709  1.1  riastrad   UCHAR ucLaneNum;          // how many lanes to enable
    710  1.1  riastrad   UCHAR ucReserved[2];
    711  1.1  riastrad }DIG_ENCODER_CONTROL_PARAMETERS;
    712  1.1  riastrad #define DIG_ENCODER_CONTROL_PS_ALLOCATION			  DIG_ENCODER_CONTROL_PARAMETERS
    713  1.1  riastrad #define EXTERNAL_ENCODER_CONTROL_PARAMETER			DIG_ENCODER_CONTROL_PARAMETERS
    714  1.1  riastrad 
    715  1.1  riastrad //ucConfig
    716  1.1  riastrad #define ATOM_ENCODER_CONFIG_DPLINKRATE_MASK				0x01
    717  1.1  riastrad #define ATOM_ENCODER_CONFIG_DPLINKRATE_1_62GHZ		0x00
    718  1.1  riastrad #define ATOM_ENCODER_CONFIG_DPLINKRATE_2_70GHZ		0x01
    719  1.1  riastrad #define ATOM_ENCODER_CONFIG_DPLINKRATE_5_40GHZ		0x02
    720  1.1  riastrad #define ATOM_ENCODER_CONFIG_LINK_SEL_MASK				  0x04
    721  1.1  riastrad #define ATOM_ENCODER_CONFIG_LINKA								  0x00
    722  1.1  riastrad #define ATOM_ENCODER_CONFIG_LINKB								  0x04
    723  1.1  riastrad #define ATOM_ENCODER_CONFIG_LINKA_B							  ATOM_TRANSMITTER_CONFIG_LINKA
    724  1.1  riastrad #define ATOM_ENCODER_CONFIG_LINKB_A							  ATOM_ENCODER_CONFIG_LINKB
    725  1.1  riastrad #define ATOM_ENCODER_CONFIG_TRANSMITTER_SEL_MASK	0x08
    726  1.1  riastrad #define ATOM_ENCODER_CONFIG_UNIPHY							  0x00
    727  1.1  riastrad #define ATOM_ENCODER_CONFIG_LVTMA								  0x08
    728  1.1  riastrad #define ATOM_ENCODER_CONFIG_TRANSMITTER1				  0x00
    729  1.1  riastrad #define ATOM_ENCODER_CONFIG_TRANSMITTER2				  0x08
    730  1.1  riastrad #define ATOM_ENCODER_CONFIG_DIGB								  0x80			// VBIOS Internal use, outside SW should set this bit=0
    731  1.1  riastrad // ucAction
    732  1.1  riastrad // ATOM_ENABLE:  Enable Encoder
    733  1.1  riastrad // ATOM_DISABLE: Disable Encoder
    734  1.1  riastrad 
    735  1.1  riastrad //ucEncoderMode
    736  1.1  riastrad #define ATOM_ENCODER_MODE_DP											0
    737  1.1  riastrad #define ATOM_ENCODER_MODE_LVDS										1
    738  1.1  riastrad #define ATOM_ENCODER_MODE_DVI											2
    739  1.1  riastrad #define ATOM_ENCODER_MODE_HDMI										3
    740  1.1  riastrad #define ATOM_ENCODER_MODE_SDVO										4
    741  1.1  riastrad #define ATOM_ENCODER_MODE_DP_AUDIO                5
    742  1.1  riastrad #define ATOM_ENCODER_MODE_TV											13
    743  1.1  riastrad #define ATOM_ENCODER_MODE_CV											14
    744  1.1  riastrad #define ATOM_ENCODER_MODE_CRT											15
    745  1.1  riastrad #define ATOM_ENCODER_MODE_DVO											16
    746  1.1  riastrad #define ATOM_ENCODER_MODE_DP_SST                  ATOM_ENCODER_MODE_DP    // For DP1.2
    747  1.1  riastrad #define ATOM_ENCODER_MODE_DP_MST                  5                       // For DP1.2
    748  1.1  riastrad 
    749  1.1  riastrad typedef struct _ATOM_DIG_ENCODER_CONFIG_V2
    750  1.1  riastrad {
    751  1.1  riastrad #if ATOM_BIG_ENDIAN
    752  1.1  riastrad     UCHAR ucReserved1:2;
    753  1.1  riastrad     UCHAR ucTransmitterSel:2;     // =0: UniphyAB, =1: UniphyCD  =2: UniphyEF
    754  1.1  riastrad     UCHAR ucLinkSel:1;            // =0: linkA/C/E =1: linkB/D/F
    755  1.1  riastrad     UCHAR ucReserved:1;
    756  1.1  riastrad     UCHAR ucDPLinkRate:1;         // =0: 1.62Ghz, =1: 2.7Ghz
    757  1.1  riastrad #else
    758  1.1  riastrad     UCHAR ucDPLinkRate:1;         // =0: 1.62Ghz, =1: 2.7Ghz
    759  1.1  riastrad     UCHAR ucReserved:1;
    760  1.1  riastrad     UCHAR ucLinkSel:1;            // =0: linkA/C/E =1: linkB/D/F
    761  1.1  riastrad     UCHAR ucTransmitterSel:2;     // =0: UniphyAB, =1: UniphyCD  =2: UniphyEF
    762  1.1  riastrad     UCHAR ucReserved1:2;
    763  1.1  riastrad #endif
    764  1.1  riastrad }ATOM_DIG_ENCODER_CONFIG_V2;
    765  1.1  riastrad 
    766  1.1  riastrad 
    767  1.1  riastrad typedef struct _DIG_ENCODER_CONTROL_PARAMETERS_V2
    768  1.1  riastrad {
    769  1.1  riastrad   USHORT usPixelClock;      // in 10KHz; for bios convenient
    770  1.1  riastrad   ATOM_DIG_ENCODER_CONFIG_V2 acConfig;
    771  1.1  riastrad   UCHAR ucAction;
    772  1.1  riastrad   UCHAR ucEncoderMode;
    773  1.1  riastrad                             // =0: DP   encoder
    774  1.1  riastrad                             // =1: LVDS encoder
    775  1.1  riastrad                             // =2: DVI  encoder
    776  1.1  riastrad                             // =3: HDMI encoder
    777  1.1  riastrad                             // =4: SDVO encoder
    778  1.1  riastrad   UCHAR ucLaneNum;          // how many lanes to enable
    779  1.1  riastrad   UCHAR ucStatus;           // = DP_LINK_TRAINING_COMPLETE or DP_LINK_TRAINING_INCOMPLETE, only used by VBIOS with command ATOM_ENCODER_CMD_QUERY_DP_LINK_TRAINING_STATUS
    780  1.1  riastrad   UCHAR ucReserved;
    781  1.1  riastrad }DIG_ENCODER_CONTROL_PARAMETERS_V2;
    782  1.1  riastrad 
    783  1.1  riastrad //ucConfig
    784  1.1  riastrad #define ATOM_ENCODER_CONFIG_V2_DPLINKRATE_MASK				0x01
    785  1.1  riastrad #define ATOM_ENCODER_CONFIG_V2_DPLINKRATE_1_62GHZ		  0x00
    786  1.1  riastrad #define ATOM_ENCODER_CONFIG_V2_DPLINKRATE_2_70GHZ		  0x01
    787  1.1  riastrad #define ATOM_ENCODER_CONFIG_V2_LINK_SEL_MASK				  0x04
    788  1.1  riastrad #define ATOM_ENCODER_CONFIG_V2_LINKA								  0x00
    789  1.1  riastrad #define ATOM_ENCODER_CONFIG_V2_LINKB								  0x04
    790  1.1  riastrad #define ATOM_ENCODER_CONFIG_V2_TRANSMITTER_SEL_MASK	  0x18
    791  1.1  riastrad #define ATOM_ENCODER_CONFIG_V2_TRANSMITTER1				    0x00
    792  1.1  riastrad #define ATOM_ENCODER_CONFIG_V2_TRANSMITTER2				    0x08
    793  1.1  riastrad #define ATOM_ENCODER_CONFIG_V2_TRANSMITTER3				    0x10
    794  1.1  riastrad 
    795  1.1  riastrad // ucAction:
    796  1.1  riastrad // ATOM_DISABLE
    797  1.1  riastrad // ATOM_ENABLE
    798  1.1  riastrad #define ATOM_ENCODER_CMD_DP_LINK_TRAINING_START       0x08
    799  1.1  riastrad #define ATOM_ENCODER_CMD_DP_LINK_TRAINING_PATTERN1    0x09
    800  1.1  riastrad #define ATOM_ENCODER_CMD_DP_LINK_TRAINING_PATTERN2    0x0a
    801  1.1  riastrad #define ATOM_ENCODER_CMD_DP_LINK_TRAINING_PATTERN3    0x13
    802  1.1  riastrad #define ATOM_ENCODER_CMD_DP_LINK_TRAINING_COMPLETE    0x0b
    803  1.1  riastrad #define ATOM_ENCODER_CMD_DP_VIDEO_OFF                 0x0c
    804  1.1  riastrad #define ATOM_ENCODER_CMD_DP_VIDEO_ON                  0x0d
    805  1.1  riastrad #define ATOM_ENCODER_CMD_QUERY_DP_LINK_TRAINING_STATUS    0x0e
    806  1.1  riastrad #define ATOM_ENCODER_CMD_SETUP                        0x0f
    807  1.1  riastrad #define ATOM_ENCODER_CMD_SETUP_PANEL_MODE             0x10
    808  1.1  riastrad 
    809  1.1  riastrad // ucStatus
    810  1.1  riastrad #define ATOM_ENCODER_STATUS_LINK_TRAINING_COMPLETE    0x10
    811  1.1  riastrad #define ATOM_ENCODER_STATUS_LINK_TRAINING_INCOMPLETE  0x00
    812  1.1  riastrad 
    813  1.1  riastrad //ucTableFormatRevision=1
    814  1.1  riastrad //ucTableContentRevision=3
    815  1.1  riastrad // Following function ENABLE sub-function will be used by driver when TMDS/HDMI/LVDS is used, disable function will be used by driver
    816  1.1  riastrad typedef struct _ATOM_DIG_ENCODER_CONFIG_V3
    817  1.1  riastrad {
    818  1.1  riastrad #if ATOM_BIG_ENDIAN
    819  1.1  riastrad     UCHAR ucReserved1:1;
    820  1.1  riastrad     UCHAR ucDigSel:3;             // =0/1/2/3/4/5: DIG0/1/2/3/4/5 (In register spec also referred as DIGA/B/C/D/E/F)
    821  1.1  riastrad     UCHAR ucReserved:3;
    822  1.1  riastrad     UCHAR ucDPLinkRate:1;         // =0: 1.62Ghz, =1: 2.7Ghz
    823  1.1  riastrad #else
    824  1.1  riastrad     UCHAR ucDPLinkRate:1;         // =0: 1.62Ghz, =1: 2.7Ghz
    825  1.1  riastrad     UCHAR ucReserved:3;
    826  1.1  riastrad     UCHAR ucDigSel:3;             // =0/1/2/3/4/5: DIG0/1/2/3/4/5 (In register spec also referred as DIGA/B/C/D/E/F)
    827  1.1  riastrad     UCHAR ucReserved1:1;
    828  1.1  riastrad #endif
    829  1.1  riastrad }ATOM_DIG_ENCODER_CONFIG_V3;
    830  1.1  riastrad 
    831  1.1  riastrad #define ATOM_ENCODER_CONFIG_V3_DPLINKRATE_MASK				0x03
    832  1.1  riastrad #define ATOM_ENCODER_CONFIG_V3_DPLINKRATE_1_62GHZ		  0x00
    833  1.1  riastrad #define ATOM_ENCODER_CONFIG_V3_DPLINKRATE_2_70GHZ		  0x01
    834  1.1  riastrad #define ATOM_ENCODER_CONFIG_V3_ENCODER_SEL					  0x70
    835  1.1  riastrad #define ATOM_ENCODER_CONFIG_V3_DIG0_ENCODER					  0x00
    836  1.1  riastrad #define ATOM_ENCODER_CONFIG_V3_DIG1_ENCODER					  0x10
    837  1.1  riastrad #define ATOM_ENCODER_CONFIG_V3_DIG2_ENCODER					  0x20
    838  1.1  riastrad #define ATOM_ENCODER_CONFIG_V3_DIG3_ENCODER					  0x30
    839  1.1  riastrad #define ATOM_ENCODER_CONFIG_V3_DIG4_ENCODER					  0x40
    840  1.1  riastrad #define ATOM_ENCODER_CONFIG_V3_DIG5_ENCODER					  0x50
    841  1.1  riastrad 
    842  1.1  riastrad typedef struct _DIG_ENCODER_CONTROL_PARAMETERS_V3
    843  1.1  riastrad {
    844  1.1  riastrad   USHORT usPixelClock;      // in 10KHz; for bios convenient
    845  1.1  riastrad   ATOM_DIG_ENCODER_CONFIG_V3 acConfig;
    846  1.1  riastrad   UCHAR ucAction;
    847  1.1  riastrad   union {
    848  1.1  riastrad     UCHAR ucEncoderMode;
    849  1.1  riastrad                             // =0: DP   encoder
    850  1.1  riastrad                             // =1: LVDS encoder
    851  1.1  riastrad                             // =2: DVI  encoder
    852  1.1  riastrad                             // =3: HDMI encoder
    853  1.1  riastrad                             // =4: SDVO encoder
    854  1.1  riastrad                             // =5: DP audio
    855  1.1  riastrad     UCHAR ucPanelMode;      // only valid when ucAction == ATOM_ENCODER_CMD_SETUP_PANEL_MODE
    856  1.1  riastrad 	                    // =0:     external DP
    857  1.1  riastrad 	                    // =1:     internal DP2
    858  1.1  riastrad 	                    // =0x11:  internal DP1 for NutMeg/Travis DP translator
    859  1.1  riastrad   };
    860  1.1  riastrad   UCHAR ucLaneNum;          // how many lanes to enable
    861  1.1  riastrad   UCHAR ucBitPerColor;      // only valid for DP mode when ucAction = ATOM_ENCODER_CMD_SETUP
    862  1.1  riastrad   UCHAR ucReserved;
    863  1.1  riastrad }DIG_ENCODER_CONTROL_PARAMETERS_V3;
    864  1.1  riastrad 
    865  1.1  riastrad //ucTableFormatRevision=1
    866  1.1  riastrad //ucTableContentRevision=4
    867  1.1  riastrad // start from NI
    868  1.1  riastrad // Following function ENABLE sub-function will be used by driver when TMDS/HDMI/LVDS is used, disable function will be used by driver
    869  1.1  riastrad typedef struct _ATOM_DIG_ENCODER_CONFIG_V4
    870  1.1  riastrad {
    871  1.1  riastrad #if ATOM_BIG_ENDIAN
    872  1.1  riastrad     UCHAR ucReserved1:1;
    873  1.1  riastrad     UCHAR ucDigSel:3;             // =0/1/2/3/4/5: DIG0/1/2/3/4/5 (In register spec also referred as DIGA/B/C/D/E/F)
    874  1.1  riastrad     UCHAR ucReserved:2;
    875  1.1  riastrad     UCHAR ucDPLinkRate:2;         // =0: 1.62Ghz, =1: 2.7Ghz, 2=5.4Ghz    <= Changed comparing to previous version
    876  1.1  riastrad #else
    877  1.1  riastrad     UCHAR ucDPLinkRate:2;         // =0: 1.62Ghz, =1: 2.7Ghz, 2=5.4Ghz    <= Changed comparing to previous version
    878  1.1  riastrad     UCHAR ucReserved:2;
    879  1.1  riastrad     UCHAR ucDigSel:3;             // =0/1/2/3/4/5: DIG0/1/2/3/4/5 (In register spec also referred as DIGA/B/C/D/E/F)
    880  1.1  riastrad     UCHAR ucReserved1:1;
    881  1.1  riastrad #endif
    882  1.1  riastrad }ATOM_DIG_ENCODER_CONFIG_V4;
    883  1.1  riastrad 
    884  1.1  riastrad #define ATOM_ENCODER_CONFIG_V4_DPLINKRATE_MASK				0x03
    885  1.1  riastrad #define ATOM_ENCODER_CONFIG_V4_DPLINKRATE_1_62GHZ		  0x00
    886  1.1  riastrad #define ATOM_ENCODER_CONFIG_V4_DPLINKRATE_2_70GHZ		  0x01
    887  1.1  riastrad #define ATOM_ENCODER_CONFIG_V4_DPLINKRATE_5_40GHZ		  0x02
    888  1.1  riastrad #define ATOM_ENCODER_CONFIG_V4_DPLINKRATE_3_24GHZ		  0x03
    889  1.1  riastrad #define ATOM_ENCODER_CONFIG_V4_ENCODER_SEL					  0x70
    890  1.1  riastrad #define ATOM_ENCODER_CONFIG_V4_DIG0_ENCODER					  0x00
    891  1.1  riastrad #define ATOM_ENCODER_CONFIG_V4_DIG1_ENCODER					  0x10
    892  1.1  riastrad #define ATOM_ENCODER_CONFIG_V4_DIG2_ENCODER					  0x20
    893  1.1  riastrad #define ATOM_ENCODER_CONFIG_V4_DIG3_ENCODER					  0x30
    894  1.1  riastrad #define ATOM_ENCODER_CONFIG_V4_DIG4_ENCODER					  0x40
    895  1.1  riastrad #define ATOM_ENCODER_CONFIG_V4_DIG5_ENCODER					  0x50
    896  1.1  riastrad #define ATOM_ENCODER_CONFIG_V4_DIG6_ENCODER					  0x60
    897  1.1  riastrad 
    898  1.1  riastrad typedef struct _DIG_ENCODER_CONTROL_PARAMETERS_V4
    899  1.1  riastrad {
    900  1.1  riastrad   USHORT usPixelClock;      // in 10KHz; for bios convenient
    901  1.1  riastrad   union{
    902  1.1  riastrad   ATOM_DIG_ENCODER_CONFIG_V4 acConfig;
    903  1.1  riastrad   UCHAR ucConfig;
    904  1.1  riastrad   };
    905  1.1  riastrad   UCHAR ucAction;
    906  1.1  riastrad   union {
    907  1.1  riastrad     UCHAR ucEncoderMode;
    908  1.1  riastrad                             // =0: DP   encoder
    909  1.1  riastrad                             // =1: LVDS encoder
    910  1.1  riastrad                             // =2: DVI  encoder
    911  1.1  riastrad                             // =3: HDMI encoder
    912  1.1  riastrad                             // =4: SDVO encoder
    913  1.1  riastrad                             // =5: DP audio
    914  1.1  riastrad     UCHAR ucPanelMode;      // only valid when ucAction == ATOM_ENCODER_CMD_SETUP_PANEL_MODE
    915  1.1  riastrad 	                    // =0:     external DP
    916  1.1  riastrad 	                    // =1:     internal DP2
    917  1.1  riastrad 	                    // =0x11:  internal DP1 for NutMeg/Travis DP translator
    918  1.1  riastrad   };
    919  1.1  riastrad   UCHAR ucLaneNum;          // how many lanes to enable
    920  1.1  riastrad   UCHAR ucBitPerColor;      // only valid for DP mode when ucAction = ATOM_ENCODER_CMD_SETUP
    921  1.1  riastrad   UCHAR ucHPD_ID;           // HPD ID (1-6). =0 means to skip HDP programming. New comparing to previous version
    922  1.1  riastrad }DIG_ENCODER_CONTROL_PARAMETERS_V4;
    923  1.1  riastrad 
    924  1.1  riastrad // define ucBitPerColor:
    925  1.1  riastrad #define PANEL_BPC_UNDEFINE                               0x00
    926  1.1  riastrad #define PANEL_6BIT_PER_COLOR                             0x01
    927  1.1  riastrad #define PANEL_8BIT_PER_COLOR                             0x02
    928  1.1  riastrad #define PANEL_10BIT_PER_COLOR                            0x03
    929  1.1  riastrad #define PANEL_12BIT_PER_COLOR                            0x04
    930  1.1  riastrad #define PANEL_16BIT_PER_COLOR                            0x05
    931  1.1  riastrad 
    932  1.1  riastrad //define ucPanelMode
    933  1.1  riastrad #define DP_PANEL_MODE_EXTERNAL_DP_MODE                   0x00
    934  1.1  riastrad #define DP_PANEL_MODE_INTERNAL_DP2_MODE                  0x01
    935  1.1  riastrad #define DP_PANEL_MODE_INTERNAL_DP1_MODE                  0x11
    936  1.1  riastrad 
    937  1.1  riastrad /****************************************************************************/
    938  1.1  riastrad // Structures used by UNIPHYTransmitterControlTable
    939  1.1  riastrad //                    LVTMATransmitterControlTable
    940  1.1  riastrad //                    DVOOutputControlTable
    941  1.1  riastrad /****************************************************************************/
    942  1.1  riastrad typedef struct _ATOM_DP_VS_MODE
    943  1.1  riastrad {
    944  1.1  riastrad   UCHAR ucLaneSel;
    945  1.1  riastrad   UCHAR ucLaneSet;
    946  1.1  riastrad }ATOM_DP_VS_MODE;
    947  1.1  riastrad 
    948  1.1  riastrad typedef struct _DIG_TRANSMITTER_CONTROL_PARAMETERS
    949  1.1  riastrad {
    950  1.1  riastrad 	union
    951  1.1  riastrad 	{
    952  1.1  riastrad   USHORT usPixelClock;		// in 10KHz; for bios convenient
    953  1.1  riastrad 	USHORT usInitInfo;			// when init uniphy,lower 8bit is used for connector type defined in objectid.h
    954  1.1  riastrad   ATOM_DP_VS_MODE asMode; // DP Voltage swing mode
    955  1.1  riastrad 	};
    956  1.1  riastrad   UCHAR ucConfig;
    957  1.1  riastrad 													// [0]=0: 4 lane Link,
    958  1.1  riastrad 													//    =1: 8 lane Link ( Dual Links TMDS )
    959  1.1  riastrad                           // [1]=0: InCoherent mode
    960  1.1  riastrad 													//    =1: Coherent Mode
    961  1.1  riastrad 													// [2] Link Select:
    962  1.1  riastrad   												// =0: PHY linkA   if bfLane<3
    963  1.1  riastrad 													// =1: PHY linkB   if bfLanes<3
    964  1.1  riastrad 		  										// =0: PHY linkA+B if bfLanes=3
    965  1.1  riastrad                           // [5:4]PCIE lane Sel
    966  1.1  riastrad                           // =0: lane 0~3 or 0~7
    967  1.1  riastrad                           // =1: lane 4~7
    968  1.1  riastrad                           // =2: lane 8~11 or 8~15
    969  1.1  riastrad                           // =3: lane 12~15
    970  1.1  riastrad 	UCHAR ucAction;				  // =0: turn off encoder
    971  1.1  riastrad 	                        // =1: turn on encoder
    972  1.1  riastrad   UCHAR ucReserved[4];
    973  1.1  riastrad }DIG_TRANSMITTER_CONTROL_PARAMETERS;
    974  1.1  riastrad 
    975  1.1  riastrad #define DIG_TRANSMITTER_CONTROL_PS_ALLOCATION		DIG_TRANSMITTER_CONTROL_PARAMETERS
    976  1.1  riastrad 
    977  1.1  riastrad //ucInitInfo
    978  1.1  riastrad #define ATOM_TRAMITTER_INITINFO_CONNECTOR_MASK	0x00ff
    979  1.1  riastrad 
    980  1.1  riastrad //ucConfig
    981  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_8LANE_LINK			0x01
    982  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_COHERENT				0x02
    983  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_LINK_SEL_MASK		0x04
    984  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_LINKA						0x00
    985  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_LINKB						0x04
    986  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_LINKA_B					0x00
    987  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_LINKB_A					0x04
    988  1.1  riastrad 
    989  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_ENCODER_SEL_MASK	0x08			// only used when ATOM_TRANSMITTER_ACTION_ENABLE
    990  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_DIG1_ENCODER		0x00				// only used when ATOM_TRANSMITTER_ACTION_ENABLE
    991  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_DIG2_ENCODER		0x08				// only used when ATOM_TRANSMITTER_ACTION_ENABLE
    992  1.1  riastrad 
    993  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_CLKSRC_MASK			0x30
    994  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_CLKSRC_PPLL			0x00
    995  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_CLKSRC_PCIE			0x20
    996  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_CLKSRC_XTALIN		0x30
    997  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_LANE_SEL_MASK		0xc0
    998  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_LANE_0_3				0x00
    999  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_LANE_0_7				0x00
   1000  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_LANE_4_7				0x40
   1001  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_LANE_8_11				0x80
   1002  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_LANE_8_15				0x80
   1003  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_LANE_12_15			0xc0
   1004  1.1  riastrad 
   1005  1.1  riastrad //ucAction
   1006  1.1  riastrad #define ATOM_TRANSMITTER_ACTION_DISABLE					       0
   1007  1.1  riastrad #define ATOM_TRANSMITTER_ACTION_ENABLE					       1
   1008  1.1  riastrad #define ATOM_TRANSMITTER_ACTION_LCD_BLOFF				       2
   1009  1.1  riastrad #define ATOM_TRANSMITTER_ACTION_LCD_BLON				       3
   1010  1.1  riastrad #define ATOM_TRANSMITTER_ACTION_BL_BRIGHTNESS_CONTROL  4
   1011  1.1  riastrad #define ATOM_TRANSMITTER_ACTION_LCD_SELFTEST_START		 5
   1012  1.1  riastrad #define ATOM_TRANSMITTER_ACTION_LCD_SELFTEST_STOP			 6
   1013  1.1  riastrad #define ATOM_TRANSMITTER_ACTION_INIT						       7
   1014  1.1  riastrad #define ATOM_TRANSMITTER_ACTION_DISABLE_OUTPUT	       8
   1015  1.1  riastrad #define ATOM_TRANSMITTER_ACTION_ENABLE_OUTPUT		       9
   1016  1.1  riastrad #define ATOM_TRANSMITTER_ACTION_SETUP						       10
   1017  1.1  riastrad #define ATOM_TRANSMITTER_ACTION_SETUP_VSEMPH           11
   1018  1.1  riastrad #define ATOM_TRANSMITTER_ACTION_POWER_ON               12
   1019  1.1  riastrad #define ATOM_TRANSMITTER_ACTION_POWER_OFF              13
   1020  1.1  riastrad 
   1021  1.1  riastrad // Following are used for DigTransmitterControlTable ver1.2
   1022  1.1  riastrad typedef struct _ATOM_DIG_TRANSMITTER_CONFIG_V2
   1023  1.1  riastrad {
   1024  1.1  riastrad #if ATOM_BIG_ENDIAN
   1025  1.1  riastrad   UCHAR ucTransmitterSel:2;         //bit7:6: =0 Dig Transmitter 1 ( Uniphy AB )
   1026  1.1  riastrad                                     //        =1 Dig Transmitter 2 ( Uniphy CD )
   1027  1.1  riastrad                                     //        =2 Dig Transmitter 3 ( Uniphy EF )
   1028  1.1  riastrad   UCHAR ucReserved:1;
   1029  1.1  riastrad   UCHAR fDPConnector:1;             //bit4=0: DP connector  =1: None DP connector
   1030  1.1  riastrad   UCHAR ucEncoderSel:1;             //bit3=0: Data/Clk path source from DIGA( DIG inst0 ). =1: Data/clk path source from DIGB ( DIG inst1 )
   1031  1.1  riastrad   UCHAR ucLinkSel:1;                //bit2=0: Uniphy LINKA or C or E when fDualLinkConnector=0. when fDualLinkConnector=1, it means master link of dual link is A or C or E
   1032  1.1  riastrad                                     //    =1: Uniphy LINKB or D or F when fDualLinkConnector=0. when fDualLinkConnector=1, it means master link of dual link is B or D or F
   1033  1.1  riastrad 
   1034  1.1  riastrad   UCHAR fCoherentMode:1;            //bit1=1: Coherent Mode ( for DVI/HDMI mode )
   1035  1.1  riastrad   UCHAR fDualLinkConnector:1;       //bit0=1: Dual Link DVI connector
   1036  1.1  riastrad #else
   1037  1.1  riastrad   UCHAR fDualLinkConnector:1;       //bit0=1: Dual Link DVI connector
   1038  1.1  riastrad   UCHAR fCoherentMode:1;            //bit1=1: Coherent Mode ( for DVI/HDMI mode )
   1039  1.1  riastrad   UCHAR ucLinkSel:1;                //bit2=0: Uniphy LINKA or C or E when fDualLinkConnector=0. when fDualLinkConnector=1, it means master link of dual link is A or C or E
   1040  1.1  riastrad                                     //    =1: Uniphy LINKB or D or F when fDualLinkConnector=0. when fDualLinkConnector=1, it means master link of dual link is B or D or F
   1041  1.1  riastrad   UCHAR ucEncoderSel:1;             //bit3=0: Data/Clk path source from DIGA( DIG inst0 ). =1: Data/clk path source from DIGB ( DIG inst1 )
   1042  1.1  riastrad   UCHAR fDPConnector:1;             //bit4=0: DP connector  =1: None DP connector
   1043  1.1  riastrad   UCHAR ucReserved:1;
   1044  1.1  riastrad   UCHAR ucTransmitterSel:2;         //bit7:6: =0 Dig Transmitter 1 ( Uniphy AB )
   1045  1.1  riastrad                                     //        =1 Dig Transmitter 2 ( Uniphy CD )
   1046  1.1  riastrad                                     //        =2 Dig Transmitter 3 ( Uniphy EF )
   1047  1.1  riastrad #endif
   1048  1.1  riastrad }ATOM_DIG_TRANSMITTER_CONFIG_V2;
   1049  1.1  riastrad 
   1050  1.1  riastrad //ucConfig
   1051  1.1  riastrad //Bit0
   1052  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V2_DUAL_LINK_CONNECTOR			0x01
   1053  1.1  riastrad 
   1054  1.1  riastrad //Bit1
   1055  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V2_COHERENT				          0x02
   1056  1.1  riastrad 
   1057  1.1  riastrad //Bit2
   1058  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V2_LINK_SEL_MASK		        0x04
   1059  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V2_LINKA  			            0x00
   1060  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V2_LINKB				            0x04
   1061  1.1  riastrad 
   1062  1.1  riastrad // Bit3
   1063  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V2_ENCODER_SEL_MASK	        0x08
   1064  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V2_DIG1_ENCODER		          0x00				// only used when ucAction == ATOM_TRANSMITTER_ACTION_ENABLE or ATOM_TRANSMITTER_ACTION_SETUP
   1065  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V2_DIG2_ENCODER		          0x08				// only used when ucAction == ATOM_TRANSMITTER_ACTION_ENABLE or ATOM_TRANSMITTER_ACTION_SETUP
   1066  1.1  riastrad 
   1067  1.1  riastrad // Bit4
   1068  1.1  riastrad #define ATOM_TRASMITTER_CONFIG_V2_DP_CONNECTOR			        0x10
   1069  1.1  riastrad 
   1070  1.1  riastrad // Bit7:6
   1071  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V2_TRANSMITTER_SEL_MASK     0xC0
   1072  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V2_TRANSMITTER1           	0x00	//AB
   1073  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V2_TRANSMITTER2           	0x40	//CD
   1074  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V2_TRANSMITTER3           	0x80	//EF
   1075  1.1  riastrad 
   1076  1.1  riastrad typedef struct _DIG_TRANSMITTER_CONTROL_PARAMETERS_V2
   1077  1.1  riastrad {
   1078  1.1  riastrad 	union
   1079  1.1  riastrad 	{
   1080  1.1  riastrad   USHORT usPixelClock;		// in 10KHz; for bios convenient
   1081  1.1  riastrad 	USHORT usInitInfo;			// when init uniphy,lower 8bit is used for connector type defined in objectid.h
   1082  1.1  riastrad   ATOM_DP_VS_MODE asMode; // DP Voltage swing mode
   1083  1.1  riastrad 	};
   1084  1.1  riastrad   ATOM_DIG_TRANSMITTER_CONFIG_V2 acConfig;
   1085  1.1  riastrad 	UCHAR ucAction;				  // define as ATOM_TRANSMITER_ACTION_XXX
   1086  1.1  riastrad   UCHAR ucReserved[4];
   1087  1.1  riastrad }DIG_TRANSMITTER_CONTROL_PARAMETERS_V2;
   1088  1.1  riastrad 
   1089  1.1  riastrad typedef struct _ATOM_DIG_TRANSMITTER_CONFIG_V3
   1090  1.1  riastrad {
   1091  1.1  riastrad #if ATOM_BIG_ENDIAN
   1092  1.1  riastrad   UCHAR ucTransmitterSel:2;         //bit7:6: =0 Dig Transmitter 1 ( Uniphy AB )
   1093  1.1  riastrad                                     //        =1 Dig Transmitter 2 ( Uniphy CD )
   1094  1.1  riastrad                                     //        =2 Dig Transmitter 3 ( Uniphy EF )
   1095  1.1  riastrad   UCHAR ucRefClkSource:2;           //bit5:4: PPLL1 =0, PPLL2=1, EXT_CLK=2
   1096  1.1  riastrad   UCHAR ucEncoderSel:1;             //bit3=0: Data/Clk path source from DIGA/C/E. =1: Data/clk path source from DIGB/D/F
   1097  1.1  riastrad   UCHAR ucLinkSel:1;                //bit2=0: Uniphy LINKA or C or E when fDualLinkConnector=0. when fDualLinkConnector=1, it means master link of dual link is A or C or E
   1098  1.1  riastrad                                     //    =1: Uniphy LINKB or D or F when fDualLinkConnector=0. when fDualLinkConnector=1, it means master link of dual link is B or D or F
   1099  1.1  riastrad   UCHAR fCoherentMode:1;            //bit1=1: Coherent Mode ( for DVI/HDMI mode )
   1100  1.1  riastrad   UCHAR fDualLinkConnector:1;       //bit0=1: Dual Link DVI connector
   1101  1.1  riastrad #else
   1102  1.1  riastrad   UCHAR fDualLinkConnector:1;       //bit0=1: Dual Link DVI connector
   1103  1.1  riastrad   UCHAR fCoherentMode:1;            //bit1=1: Coherent Mode ( for DVI/HDMI mode )
   1104  1.1  riastrad   UCHAR ucLinkSel:1;                //bit2=0: Uniphy LINKA or C or E when fDualLinkConnector=0. when fDualLinkConnector=1, it means master link of dual link is A or C or E
   1105  1.1  riastrad                                     //    =1: Uniphy LINKB or D or F when fDualLinkConnector=0. when fDualLinkConnector=1, it means master link of dual link is B or D or F
   1106  1.1  riastrad   UCHAR ucEncoderSel:1;             //bit3=0: Data/Clk path source from DIGA/C/E. =1: Data/clk path source from DIGB/D/F
   1107  1.1  riastrad   UCHAR ucRefClkSource:2;           //bit5:4: PPLL1 =0, PPLL2=1, EXT_CLK=2
   1108  1.1  riastrad   UCHAR ucTransmitterSel:2;         //bit7:6: =0 Dig Transmitter 1 ( Uniphy AB )
   1109  1.1  riastrad                                     //        =1 Dig Transmitter 2 ( Uniphy CD )
   1110  1.1  riastrad                                     //        =2 Dig Transmitter 3 ( Uniphy EF )
   1111  1.1  riastrad #endif
   1112  1.1  riastrad }ATOM_DIG_TRANSMITTER_CONFIG_V3;
   1113  1.1  riastrad 
   1114  1.1  riastrad 
   1115  1.1  riastrad typedef struct _DIG_TRANSMITTER_CONTROL_PARAMETERS_V3
   1116  1.1  riastrad {
   1117  1.1  riastrad 	union
   1118  1.1  riastrad 	{
   1119  1.1  riastrad     USHORT usPixelClock;		// in 10KHz; for bios convenient
   1120  1.1  riastrad 	  USHORT usInitInfo;			// when init uniphy,lower 8bit is used for connector type defined in objectid.h
   1121  1.1  riastrad     ATOM_DP_VS_MODE asMode; // DP Voltage swing mode
   1122  1.1  riastrad 	};
   1123  1.1  riastrad   ATOM_DIG_TRANSMITTER_CONFIG_V3 acConfig;
   1124  1.1  riastrad 	UCHAR ucAction;				    // define as ATOM_TRANSMITER_ACTION_XXX
   1125  1.1  riastrad   UCHAR ucLaneNum;
   1126  1.1  riastrad   UCHAR ucReserved[3];
   1127  1.1  riastrad }DIG_TRANSMITTER_CONTROL_PARAMETERS_V3;
   1128  1.1  riastrad 
   1129  1.1  riastrad //ucConfig
   1130  1.1  riastrad //Bit0
   1131  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V3_DUAL_LINK_CONNECTOR			0x01
   1132  1.1  riastrad 
   1133  1.1  riastrad //Bit1
   1134  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V3_COHERENT				          0x02
   1135  1.1  riastrad 
   1136  1.1  riastrad //Bit2
   1137  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V3_LINK_SEL_MASK		        0x04
   1138  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V3_LINKA  			            0x00
   1139  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V3_LINKB				            0x04
   1140  1.1  riastrad 
   1141  1.1  riastrad // Bit3
   1142  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V3_ENCODER_SEL_MASK	        0x08
   1143  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V3_DIG1_ENCODER		          0x00
   1144  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V3_DIG2_ENCODER		          0x08
   1145  1.1  riastrad 
   1146  1.1  riastrad // Bit5:4
   1147  1.1  riastrad #define ATOM_TRASMITTER_CONFIG_V3_REFCLK_SEL_MASK 	        0x30
   1148  1.1  riastrad #define ATOM_TRASMITTER_CONFIG_V3_P1PLL          		        0x00
   1149  1.1  riastrad #define ATOM_TRASMITTER_CONFIG_V3_P2PLL		                  0x10
   1150  1.1  riastrad #define ATOM_TRASMITTER_CONFIG_V3_REFCLK_SRC_EXT            0x20
   1151  1.1  riastrad 
   1152  1.1  riastrad // Bit7:6
   1153  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V3_TRANSMITTER_SEL_MASK     0xC0
   1154  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V3_TRANSMITTER1           	0x00	//AB
   1155  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V3_TRANSMITTER2           	0x40	//CD
   1156  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V3_TRANSMITTER3           	0x80	//EF
   1157  1.1  riastrad 
   1158  1.1  riastrad 
   1159  1.1  riastrad /****************************************************************************/
   1160  1.1  riastrad // Structures used by UNIPHYTransmitterControlTable V1.4
   1161  1.1  riastrad // ASIC Families: NI
   1162  1.1  riastrad // ucTableFormatRevision=1
   1163  1.1  riastrad // ucTableContentRevision=4
   1164  1.1  riastrad /****************************************************************************/
   1165  1.1  riastrad typedef struct _ATOM_DP_VS_MODE_V4
   1166  1.1  riastrad {
   1167  1.1  riastrad   UCHAR ucLaneSel;
   1168  1.1  riastrad  	union
   1169  1.1  riastrad  	{
   1170  1.1  riastrad  	  UCHAR ucLaneSet;
   1171  1.1  riastrad  	  struct {
   1172  1.1  riastrad #if ATOM_BIG_ENDIAN
   1173  1.1  riastrad  		  UCHAR ucPOST_CURSOR2:2;         //Bit[7:6] Post Cursor2 Level      <= New in V4
   1174  1.1  riastrad  		  UCHAR ucPRE_EMPHASIS:3;         //Bit[5:3] Pre-emphasis Level
   1175  1.1  riastrad  		  UCHAR ucVOLTAGE_SWING:3;        //Bit[2:0] Voltage Swing Level
   1176  1.1  riastrad #else
   1177  1.1  riastrad  		  UCHAR ucVOLTAGE_SWING:3;        //Bit[2:0] Voltage Swing Level
   1178  1.1  riastrad  		  UCHAR ucPRE_EMPHASIS:3;         //Bit[5:3] Pre-emphasis Level
   1179  1.1  riastrad  		  UCHAR ucPOST_CURSOR2:2;         //Bit[7:6] Post Cursor2 Level      <= New in V4
   1180  1.1  riastrad #endif
   1181  1.1  riastrad  		};
   1182  1.1  riastrad  	};
   1183  1.1  riastrad }ATOM_DP_VS_MODE_V4;
   1184  1.1  riastrad 
   1185  1.1  riastrad typedef struct _ATOM_DIG_TRANSMITTER_CONFIG_V4
   1186  1.1  riastrad {
   1187  1.1  riastrad #if ATOM_BIG_ENDIAN
   1188  1.1  riastrad   UCHAR ucTransmitterSel:2;         //bit7:6: =0 Dig Transmitter 1 ( Uniphy AB )
   1189  1.1  riastrad                                     //        =1 Dig Transmitter 2 ( Uniphy CD )
   1190  1.1  riastrad                                     //        =2 Dig Transmitter 3 ( Uniphy EF )
   1191  1.1  riastrad   UCHAR ucRefClkSource:2;           //bit5:4: PPLL1 =0, PPLL2=1, DCPLL=2, EXT_CLK=3   <= New
   1192  1.1  riastrad   UCHAR ucEncoderSel:1;             //bit3=0: Data/Clk path source from DIGA/C/E. =1: Data/clk path source from DIGB/D/F
   1193  1.1  riastrad   UCHAR ucLinkSel:1;                //bit2=0: Uniphy LINKA or C or E when fDualLinkConnector=0. when fDualLinkConnector=1, it means master link of dual link is A or C or E
   1194  1.1  riastrad                                     //    =1: Uniphy LINKB or D or F when fDualLinkConnector=0. when fDualLinkConnector=1, it means master link of dual link is B or D or F
   1195  1.1  riastrad   UCHAR fCoherentMode:1;            //bit1=1: Coherent Mode ( for DVI/HDMI mode )
   1196  1.1  riastrad   UCHAR fDualLinkConnector:1;       //bit0=1: Dual Link DVI connector
   1197  1.1  riastrad #else
   1198  1.1  riastrad   UCHAR fDualLinkConnector:1;       //bit0=1: Dual Link DVI connector
   1199  1.1  riastrad   UCHAR fCoherentMode:1;            //bit1=1: Coherent Mode ( for DVI/HDMI mode )
   1200  1.1  riastrad   UCHAR ucLinkSel:1;                //bit2=0: Uniphy LINKA or C or E when fDualLinkConnector=0. when fDualLinkConnector=1, it means master link of dual link is A or C or E
   1201  1.1  riastrad                                     //    =1: Uniphy LINKB or D or F when fDualLinkConnector=0. when fDualLinkConnector=1, it means master link of dual link is B or D or F
   1202  1.1  riastrad   UCHAR ucEncoderSel:1;             //bit3=0: Data/Clk path source from DIGA/C/E. =1: Data/clk path source from DIGB/D/F
   1203  1.1  riastrad   UCHAR ucRefClkSource:2;           //bit5:4: PPLL1 =0, PPLL2=1, DCPLL=2, EXT_CLK=3   <= New
   1204  1.1  riastrad   UCHAR ucTransmitterSel:2;         //bit7:6: =0 Dig Transmitter 1 ( Uniphy AB )
   1205  1.1  riastrad                                     //        =1 Dig Transmitter 2 ( Uniphy CD )
   1206  1.1  riastrad                                     //        =2 Dig Transmitter 3 ( Uniphy EF )
   1207  1.1  riastrad #endif
   1208  1.1  riastrad }ATOM_DIG_TRANSMITTER_CONFIG_V4;
   1209  1.1  riastrad 
   1210  1.1  riastrad typedef struct _DIG_TRANSMITTER_CONTROL_PARAMETERS_V4
   1211  1.1  riastrad {
   1212  1.1  riastrad   union
   1213  1.1  riastrad   {
   1214  1.1  riastrad     USHORT usPixelClock;		// in 10KHz; for bios convenient
   1215  1.1  riastrad     USHORT usInitInfo;			// when init uniphy,lower 8bit is used for connector type defined in objectid.h
   1216  1.1  riastrad     ATOM_DP_VS_MODE_V4 asMode; // DP Voltage swing mode     Redefined comparing to previous version
   1217  1.1  riastrad   };
   1218  1.1  riastrad   union
   1219  1.1  riastrad   {
   1220  1.1  riastrad   ATOM_DIG_TRANSMITTER_CONFIG_V4 acConfig;
   1221  1.1  riastrad   UCHAR ucConfig;
   1222  1.1  riastrad   };
   1223  1.1  riastrad   UCHAR ucAction;				    // define as ATOM_TRANSMITER_ACTION_XXX
   1224  1.1  riastrad   UCHAR ucLaneNum;
   1225  1.1  riastrad   UCHAR ucReserved[3];
   1226  1.1  riastrad }DIG_TRANSMITTER_CONTROL_PARAMETERS_V4;
   1227  1.1  riastrad 
   1228  1.1  riastrad //ucConfig
   1229  1.1  riastrad //Bit0
   1230  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V4_DUAL_LINK_CONNECTOR			0x01
   1231  1.1  riastrad //Bit1
   1232  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V4_COHERENT				          0x02
   1233  1.1  riastrad //Bit2
   1234  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V4_LINK_SEL_MASK		        0x04
   1235  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V4_LINKA  			            0x00
   1236  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V4_LINKB				            0x04
   1237  1.1  riastrad // Bit3
   1238  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V4_ENCODER_SEL_MASK	        0x08
   1239  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V4_DIG1_ENCODER		          0x00
   1240  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V4_DIG2_ENCODER		          0x08
   1241  1.1  riastrad // Bit5:4
   1242  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V4_REFCLK_SEL_MASK 	        0x30
   1243  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V4_P1PLL         		        0x00
   1244  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V4_P2PLL		                0x10
   1245  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V4_DCPLL		                0x20   // New in _V4
   1246  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V4_REFCLK_SRC_EXT           0x30   // Changed comparing to V3
   1247  1.1  riastrad // Bit7:6
   1248  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V4_TRANSMITTER_SEL_MASK     0xC0
   1249  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V4_TRANSMITTER1           	0x00	//AB
   1250  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V4_TRANSMITTER2           	0x40	//CD
   1251  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V4_TRANSMITTER3           	0x80	//EF
   1252  1.1  riastrad 
   1253  1.1  riastrad 
   1254  1.1  riastrad typedef struct _ATOM_DIG_TRANSMITTER_CONFIG_V5
   1255  1.1  riastrad {
   1256  1.1  riastrad #if ATOM_BIG_ENDIAN
   1257  1.1  riastrad   UCHAR ucReservd1:1;
   1258  1.1  riastrad   UCHAR ucHPDSel:3;
   1259  1.1  riastrad   UCHAR ucPhyClkSrcId:2;
   1260  1.1  riastrad   UCHAR ucCoherentMode:1;
   1261  1.1  riastrad   UCHAR ucReserved:1;
   1262  1.1  riastrad #else
   1263  1.1  riastrad   UCHAR ucReserved:1;
   1264  1.1  riastrad   UCHAR ucCoherentMode:1;
   1265  1.1  riastrad   UCHAR ucPhyClkSrcId:2;
   1266  1.1  riastrad   UCHAR ucHPDSel:3;
   1267  1.1  riastrad   UCHAR ucReservd1:1;
   1268  1.1  riastrad #endif
   1269  1.1  riastrad }ATOM_DIG_TRANSMITTER_CONFIG_V5;
   1270  1.1  riastrad 
   1271  1.1  riastrad typedef struct _DIG_TRANSMITTER_CONTROL_PARAMETERS_V1_5
   1272  1.1  riastrad {
   1273  1.1  riastrad   USHORT usSymClock;		        // Encoder Clock in 10kHz,(DP mode)= linkclock/10, (TMDS/LVDS/HDMI)= pixel clock,  (HDMI deep color), =pixel clock * deep_color_ratio
   1274  1.1  riastrad   UCHAR  ucPhyId;                   // 0=UNIPHYA, 1=UNIPHYB, 2=UNIPHYC, 3=UNIPHYD, 4= UNIPHYE 5=UNIPHYF
   1275  1.1  riastrad   UCHAR  ucAction;				    // define as ATOM_TRANSMITER_ACTION_xxx
   1276  1.1  riastrad   UCHAR  ucLaneNum;                 // indicate lane number 1-8
   1277  1.1  riastrad   UCHAR  ucConnObjId;               // Connector Object Id defined in ObjectId.h
   1278  1.1  riastrad   UCHAR  ucDigMode;                 // indicate DIG mode
   1279  1.1  riastrad   union{
   1280  1.1  riastrad   ATOM_DIG_TRANSMITTER_CONFIG_V5 asConfig;
   1281  1.1  riastrad   UCHAR ucConfig;
   1282  1.1  riastrad   };
   1283  1.1  riastrad   UCHAR  ucDigEncoderSel;           // indicate DIG front end encoder
   1284  1.1  riastrad   UCHAR  ucDPLaneSet;
   1285  1.1  riastrad   UCHAR  ucReserved;
   1286  1.1  riastrad   UCHAR  ucReserved1;
   1287  1.1  riastrad }DIG_TRANSMITTER_CONTROL_PARAMETERS_V1_5;
   1288  1.1  riastrad 
   1289  1.1  riastrad //ucPhyId
   1290  1.1  riastrad #define ATOM_PHY_ID_UNIPHYA                                 0
   1291  1.1  riastrad #define ATOM_PHY_ID_UNIPHYB                                 1
   1292  1.1  riastrad #define ATOM_PHY_ID_UNIPHYC                                 2
   1293  1.1  riastrad #define ATOM_PHY_ID_UNIPHYD                                 3
   1294  1.1  riastrad #define ATOM_PHY_ID_UNIPHYE                                 4
   1295  1.1  riastrad #define ATOM_PHY_ID_UNIPHYF                                 5
   1296  1.1  riastrad #define ATOM_PHY_ID_UNIPHYG                                 6
   1297  1.1  riastrad 
   1298  1.1  riastrad // ucDigEncoderSel
   1299  1.1  riastrad #define ATOM_TRANMSITTER_V5__DIGA_SEL                       0x01
   1300  1.1  riastrad #define ATOM_TRANMSITTER_V5__DIGB_SEL                       0x02
   1301  1.1  riastrad #define ATOM_TRANMSITTER_V5__DIGC_SEL                       0x04
   1302  1.1  riastrad #define ATOM_TRANMSITTER_V5__DIGD_SEL                       0x08
   1303  1.1  riastrad #define ATOM_TRANMSITTER_V5__DIGE_SEL                       0x10
   1304  1.1  riastrad #define ATOM_TRANMSITTER_V5__DIGF_SEL                       0x20
   1305  1.1  riastrad #define ATOM_TRANMSITTER_V5__DIGG_SEL                       0x40
   1306  1.1  riastrad 
   1307  1.1  riastrad // ucDigMode
   1308  1.1  riastrad #define ATOM_TRANSMITTER_DIGMODE_V5_DP                      0
   1309  1.1  riastrad #define ATOM_TRANSMITTER_DIGMODE_V5_LVDS                    1
   1310  1.1  riastrad #define ATOM_TRANSMITTER_DIGMODE_V5_DVI                     2
   1311  1.1  riastrad #define ATOM_TRANSMITTER_DIGMODE_V5_HDMI                    3
   1312  1.1  riastrad #define ATOM_TRANSMITTER_DIGMODE_V5_SDVO                    4
   1313  1.1  riastrad #define ATOM_TRANSMITTER_DIGMODE_V5_DP_MST                  5
   1314  1.1  riastrad 
   1315  1.1  riastrad // ucDPLaneSet
   1316  1.1  riastrad #define DP_LANE_SET__0DB_0_4V                               0x00
   1317  1.1  riastrad #define DP_LANE_SET__0DB_0_6V                               0x01
   1318  1.1  riastrad #define DP_LANE_SET__0DB_0_8V                               0x02
   1319  1.1  riastrad #define DP_LANE_SET__0DB_1_2V                               0x03
   1320  1.1  riastrad #define DP_LANE_SET__3_5DB_0_4V                             0x08
   1321  1.1  riastrad #define DP_LANE_SET__3_5DB_0_6V                             0x09
   1322  1.1  riastrad #define DP_LANE_SET__3_5DB_0_8V                             0x0a
   1323  1.1  riastrad #define DP_LANE_SET__6DB_0_4V                               0x10
   1324  1.1  riastrad #define DP_LANE_SET__6DB_0_6V                               0x11
   1325  1.1  riastrad #define DP_LANE_SET__9_5DB_0_4V                             0x18
   1326  1.1  riastrad 
   1327  1.1  riastrad // ATOM_DIG_TRANSMITTER_CONFIG_V5 asConfig;
   1328  1.1  riastrad // Bit1
   1329  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V5_COHERENT				          0x02
   1330  1.1  riastrad 
   1331  1.1  riastrad // Bit3:2
   1332  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V5_REFCLK_SEL_MASK 	        0x0c
   1333  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V5_REFCLK_SEL_SHIFT		    0x02
   1334  1.1  riastrad 
   1335  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V5_P1PLL         		        0x00
   1336  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V5_P2PLL		                0x04
   1337  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V5_P0PLL		                0x08
   1338  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V5_REFCLK_SRC_EXT           0x0c
   1339  1.1  riastrad // Bit6:4
   1340  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V5_HPD_SEL_MASK		          0x70
   1341  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V5_HPD_SEL_SHIFT		      0x04
   1342  1.1  riastrad 
   1343  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V5_NO_HPD_SEL				        0x00
   1344  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V5_HPD1_SEL				          0x10
   1345  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V5_HPD2_SEL				          0x20
   1346  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V5_HPD3_SEL				          0x30
   1347  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V5_HPD4_SEL				          0x40
   1348  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V5_HPD5_SEL				          0x50
   1349  1.1  riastrad #define ATOM_TRANSMITTER_CONFIG_V5_HPD6_SEL				          0x60
   1350  1.1  riastrad 
   1351  1.1  riastrad #define DIG_TRANSMITTER_CONTROL_PS_ALLOCATION_V1_5            DIG_TRANSMITTER_CONTROL_PARAMETERS_V1_5
   1352  1.1  riastrad 
   1353  1.1  riastrad 
   1354  1.1  riastrad /****************************************************************************/
   1355  1.1  riastrad // Structures used by ExternalEncoderControlTable V1.3
   1356  1.1  riastrad // ASIC Families: Evergreen, Llano, NI
   1357  1.1  riastrad // ucTableFormatRevision=1
   1358  1.1  riastrad // ucTableContentRevision=3
   1359  1.1  riastrad /****************************************************************************/
   1360  1.1  riastrad 
   1361  1.1  riastrad typedef struct _EXTERNAL_ENCODER_CONTROL_PARAMETERS_V3
   1362  1.1  riastrad {
   1363  1.1  riastrad   union{
   1364  1.1  riastrad   USHORT usPixelClock;      // pixel clock in 10Khz, valid when ucAction=SETUP/ENABLE_OUTPUT
   1365  1.1  riastrad   USHORT usConnectorId;     // connector id, valid when ucAction = INIT
   1366  1.1  riastrad   };
   1367  1.1  riastrad   UCHAR  ucConfig;          // indicate which encoder, and DP link rate when ucAction = SETUP/ENABLE_OUTPUT
   1368  1.1  riastrad   UCHAR  ucAction;          //
   1369  1.1  riastrad   UCHAR  ucEncoderMode;     // encoder mode, only used when ucAction = SETUP/ENABLE_OUTPUT
   1370  1.1  riastrad   UCHAR  ucLaneNum;         // lane number, only used when ucAction = SETUP/ENABLE_OUTPUT
   1371  1.1  riastrad   UCHAR  ucBitPerColor;     // output bit per color, only valid when ucAction = SETUP/ENABLE_OUTPUT and ucEncodeMode= DP
   1372  1.1  riastrad   UCHAR  ucReserved;
   1373  1.1  riastrad }EXTERNAL_ENCODER_CONTROL_PARAMETERS_V3;
   1374  1.1  riastrad 
   1375  1.1  riastrad // ucAction
   1376  1.1  riastrad #define EXTERNAL_ENCODER_ACTION_V3_DISABLE_OUTPUT         0x00
   1377  1.1  riastrad #define EXTERNAL_ENCODER_ACTION_V3_ENABLE_OUTPUT          0x01
   1378  1.1  riastrad #define EXTERNAL_ENCODER_ACTION_V3_ENCODER_INIT           0x07
   1379  1.1  riastrad #define EXTERNAL_ENCODER_ACTION_V3_ENCODER_SETUP          0x0f
   1380  1.1  riastrad #define EXTERNAL_ENCODER_ACTION_V3_ENCODER_BLANKING_OFF   0x10
   1381  1.1  riastrad #define EXTERNAL_ENCODER_ACTION_V3_ENCODER_BLANKING       0x11
   1382  1.1  riastrad #define EXTERNAL_ENCODER_ACTION_V3_DACLOAD_DETECTION      0x12
   1383  1.1  riastrad #define EXTERNAL_ENCODER_ACTION_V3_DDC_SETUP              0x14
   1384  1.1  riastrad 
   1385  1.1  riastrad // ucConfig
   1386  1.1  riastrad #define EXTERNAL_ENCODER_CONFIG_V3_DPLINKRATE_MASK				0x03
   1387  1.1  riastrad #define EXTERNAL_ENCODER_CONFIG_V3_DPLINKRATE_1_62GHZ		  0x00
   1388  1.1  riastrad #define EXTERNAL_ENCODER_CONFIG_V3_DPLINKRATE_2_70GHZ		  0x01
   1389  1.1  riastrad #define EXTERNAL_ENCODER_CONFIG_V3_DPLINKRATE_5_40GHZ		  0x02
   1390  1.1  riastrad #define EXTERNAL_ENCODER_CONFIG_V3_ENCODER_SEL_MASK		    0x70
   1391  1.1  riastrad #define EXTERNAL_ENCODER_CONFIG_V3_ENCODER1		            0x00
   1392  1.1  riastrad #define EXTERNAL_ENCODER_CONFIG_V3_ENCODER2		            0x10
   1393  1.1  riastrad #define EXTERNAL_ENCODER_CONFIG_V3_ENCODER3		            0x20
   1394  1.1  riastrad 
   1395  1.1  riastrad typedef struct _EXTERNAL_ENCODER_CONTROL_PS_ALLOCATION_V3
   1396  1.1  riastrad {
   1397  1.1  riastrad   EXTERNAL_ENCODER_CONTROL_PARAMETERS_V3 sExtEncoder;
   1398  1.1  riastrad   ULONG ulReserved[2];
   1399  1.1  riastrad }EXTERNAL_ENCODER_CONTROL_PS_ALLOCATION_V3;
   1400  1.1  riastrad 
   1401  1.1  riastrad 
   1402  1.1  riastrad /****************************************************************************/
   1403  1.1  riastrad // Structures used by DAC1OuputControlTable
   1404  1.1  riastrad //                    DAC2OuputControlTable
   1405  1.1  riastrad //                    LVTMAOutputControlTable  (Before DEC30)
   1406  1.1  riastrad //                    TMDSAOutputControlTable  (Before DEC30)
   1407  1.1  riastrad /****************************************************************************/
   1408  1.1  riastrad typedef struct _DISPLAY_DEVICE_OUTPUT_CONTROL_PARAMETERS
   1409  1.1  riastrad {
   1410  1.1  riastrad   UCHAR  ucAction;                    // Possible input:ATOM_ENABLE||ATOMDISABLE
   1411  1.1  riastrad                                       // When the display is LCD, in addition to above:
   1412  1.1  riastrad                                       // ATOM_LCD_BLOFF|| ATOM_LCD_BLON ||ATOM_LCD_BL_BRIGHTNESS_CONTROL||ATOM_LCD_SELFTEST_START||
   1413  1.1  riastrad                                       // ATOM_LCD_SELFTEST_STOP
   1414  1.1  riastrad 
   1415  1.1  riastrad   UCHAR  aucPadding[3];               // padding to DWORD aligned
   1416  1.1  riastrad }DISPLAY_DEVICE_OUTPUT_CONTROL_PARAMETERS;
   1417  1.1  riastrad 
   1418  1.1  riastrad #define DISPLAY_DEVICE_OUTPUT_CONTROL_PS_ALLOCATION DISPLAY_DEVICE_OUTPUT_CONTROL_PARAMETERS
   1419  1.1  riastrad 
   1420  1.1  riastrad 
   1421  1.1  riastrad #define CRT1_OUTPUT_CONTROL_PARAMETERS     DISPLAY_DEVICE_OUTPUT_CONTROL_PARAMETERS
   1422  1.1  riastrad #define CRT1_OUTPUT_CONTROL_PS_ALLOCATION  DISPLAY_DEVICE_OUTPUT_CONTROL_PS_ALLOCATION
   1423  1.1  riastrad 
   1424  1.1  riastrad #define CRT2_OUTPUT_CONTROL_PARAMETERS     DISPLAY_DEVICE_OUTPUT_CONTROL_PARAMETERS
   1425  1.1  riastrad #define CRT2_OUTPUT_CONTROL_PS_ALLOCATION  DISPLAY_DEVICE_OUTPUT_CONTROL_PS_ALLOCATION
   1426  1.1  riastrad 
   1427  1.1  riastrad #define CV1_OUTPUT_CONTROL_PARAMETERS      DISPLAY_DEVICE_OUTPUT_CONTROL_PARAMETERS
   1428  1.1  riastrad #define CV1_OUTPUT_CONTROL_PS_ALLOCATION   DISPLAY_DEVICE_OUTPUT_CONTROL_PS_ALLOCATION
   1429  1.1  riastrad 
   1430  1.1  riastrad #define TV1_OUTPUT_CONTROL_PARAMETERS      DISPLAY_DEVICE_OUTPUT_CONTROL_PARAMETERS
   1431  1.1  riastrad #define TV1_OUTPUT_CONTROL_PS_ALLOCATION   DISPLAY_DEVICE_OUTPUT_CONTROL_PS_ALLOCATION
   1432  1.1  riastrad 
   1433  1.1  riastrad #define DFP1_OUTPUT_CONTROL_PARAMETERS     DISPLAY_DEVICE_OUTPUT_CONTROL_PARAMETERS
   1434  1.1  riastrad #define DFP1_OUTPUT_CONTROL_PS_ALLOCATION  DISPLAY_DEVICE_OUTPUT_CONTROL_PS_ALLOCATION
   1435  1.1  riastrad 
   1436  1.1  riastrad #define DFP2_OUTPUT_CONTROL_PARAMETERS     DISPLAY_DEVICE_OUTPUT_CONTROL_PARAMETERS
   1437  1.1  riastrad #define DFP2_OUTPUT_CONTROL_PS_ALLOCATION  DISPLAY_DEVICE_OUTPUT_CONTROL_PS_ALLOCATION
   1438  1.1  riastrad 
   1439  1.1  riastrad #define LCD1_OUTPUT_CONTROL_PARAMETERS     DISPLAY_DEVICE_OUTPUT_CONTROL_PARAMETERS
   1440  1.1  riastrad #define LCD1_OUTPUT_CONTROL_PS_ALLOCATION  DISPLAY_DEVICE_OUTPUT_CONTROL_PS_ALLOCATION
   1441  1.1  riastrad 
   1442  1.1  riastrad #define DVO_OUTPUT_CONTROL_PARAMETERS      DISPLAY_DEVICE_OUTPUT_CONTROL_PARAMETERS
   1443  1.1  riastrad #define DVO_OUTPUT_CONTROL_PS_ALLOCATION   DIG_TRANSMITTER_CONTROL_PS_ALLOCATION
   1444  1.1  riastrad #define DVO_OUTPUT_CONTROL_PARAMETERS_V3	 DIG_TRANSMITTER_CONTROL_PARAMETERS
   1445  1.1  riastrad 
   1446  1.1  riastrad /****************************************************************************/
   1447  1.1  riastrad // Structures used by BlankCRTCTable
   1448  1.1  riastrad /****************************************************************************/
   1449  1.1  riastrad typedef struct _BLANK_CRTC_PARAMETERS
   1450  1.1  riastrad {
   1451  1.1  riastrad   UCHAR  ucCRTC;                    	// ATOM_CRTC1 or ATOM_CRTC2
   1452  1.1  riastrad   UCHAR  ucBlanking;                  // ATOM_BLANKING or ATOM_BLANKINGOFF
   1453  1.1  riastrad   USHORT usBlackColorRCr;
   1454  1.1  riastrad   USHORT usBlackColorGY;
   1455  1.1  riastrad   USHORT usBlackColorBCb;
   1456  1.1  riastrad }BLANK_CRTC_PARAMETERS;
   1457  1.1  riastrad #define BLANK_CRTC_PS_ALLOCATION    BLANK_CRTC_PARAMETERS
   1458  1.1  riastrad 
   1459  1.1  riastrad /****************************************************************************/
   1460  1.1  riastrad // Structures used by EnableCRTCTable
   1461  1.1  riastrad //                    EnableCRTCMemReqTable
   1462  1.1  riastrad //                    UpdateCRTC_DoubleBufferRegistersTable
   1463  1.1  riastrad /****************************************************************************/
   1464  1.1  riastrad typedef struct _ENABLE_CRTC_PARAMETERS
   1465  1.1  riastrad {
   1466  1.1  riastrad   UCHAR ucCRTC;                    	  // ATOM_CRTC1 or ATOM_CRTC2
   1467  1.1  riastrad   UCHAR ucEnable;                     // ATOM_ENABLE or ATOM_DISABLE
   1468  1.1  riastrad   UCHAR ucPadding[2];
   1469  1.1  riastrad }ENABLE_CRTC_PARAMETERS;
   1470  1.1  riastrad #define ENABLE_CRTC_PS_ALLOCATION   ENABLE_CRTC_PARAMETERS
   1471  1.1  riastrad 
   1472  1.1  riastrad /****************************************************************************/
   1473  1.1  riastrad // Structures used by SetCRTC_OverScanTable
   1474  1.1  riastrad /****************************************************************************/
   1475  1.1  riastrad typedef struct _SET_CRTC_OVERSCAN_PARAMETERS
   1476  1.1  riastrad {
   1477  1.1  riastrad   USHORT usOverscanRight;             // right
   1478  1.1  riastrad   USHORT usOverscanLeft;              // left
   1479  1.1  riastrad   USHORT usOverscanBottom;            // bottom
   1480  1.1  riastrad   USHORT usOverscanTop;               // top
   1481  1.1  riastrad   UCHAR  ucCRTC;                      // ATOM_CRTC1 or ATOM_CRTC2
   1482  1.1  riastrad   UCHAR  ucPadding[3];
   1483  1.1  riastrad }SET_CRTC_OVERSCAN_PARAMETERS;
   1484  1.1  riastrad #define SET_CRTC_OVERSCAN_PS_ALLOCATION  SET_CRTC_OVERSCAN_PARAMETERS
   1485  1.1  riastrad 
   1486  1.1  riastrad /****************************************************************************/
   1487  1.1  riastrad // Structures used by SetCRTC_ReplicationTable
   1488  1.1  riastrad /****************************************************************************/
   1489  1.1  riastrad typedef struct _SET_CRTC_REPLICATION_PARAMETERS
   1490  1.1  riastrad {
   1491  1.1  riastrad   UCHAR ucH_Replication;              // horizontal replication
   1492  1.1  riastrad   UCHAR ucV_Replication;              // vertical replication
   1493  1.1  riastrad   UCHAR usCRTC;                       // ATOM_CRTC1 or ATOM_CRTC2
   1494  1.1  riastrad   UCHAR ucPadding;
   1495  1.1  riastrad }SET_CRTC_REPLICATION_PARAMETERS;
   1496  1.1  riastrad #define SET_CRTC_REPLICATION_PS_ALLOCATION  SET_CRTC_REPLICATION_PARAMETERS
   1497  1.1  riastrad 
   1498  1.1  riastrad /****************************************************************************/
   1499  1.1  riastrad // Structures used by SelectCRTC_SourceTable
   1500  1.1  riastrad /****************************************************************************/
   1501  1.1  riastrad typedef struct _SELECT_CRTC_SOURCE_PARAMETERS
   1502  1.1  riastrad {
   1503  1.1  riastrad   UCHAR ucCRTC;                    	  // ATOM_CRTC1 or ATOM_CRTC2
   1504  1.1  riastrad   UCHAR ucDevice;                     // ATOM_DEVICE_CRT1|ATOM_DEVICE_CRT2|....
   1505  1.1  riastrad   UCHAR ucPadding[2];
   1506  1.1  riastrad }SELECT_CRTC_SOURCE_PARAMETERS;
   1507  1.1  riastrad #define SELECT_CRTC_SOURCE_PS_ALLOCATION  SELECT_CRTC_SOURCE_PARAMETERS
   1508  1.1  riastrad 
   1509  1.1  riastrad typedef struct _SELECT_CRTC_SOURCE_PARAMETERS_V2
   1510  1.1  riastrad {
   1511  1.1  riastrad   UCHAR ucCRTC;                    	  // ATOM_CRTC1 or ATOM_CRTC2
   1512  1.1  riastrad   UCHAR ucEncoderID;                  // DAC1/DAC2/TVOUT/DIG1/DIG2/DVO
   1513  1.1  riastrad   UCHAR ucEncodeMode;									// Encoding mode, only valid when using DIG1/DIG2/DVO
   1514  1.1  riastrad   UCHAR ucPadding;
   1515  1.1  riastrad }SELECT_CRTC_SOURCE_PARAMETERS_V2;
   1516  1.1  riastrad 
   1517  1.1  riastrad //ucEncoderID
   1518  1.1  riastrad //#define ASIC_INT_DAC1_ENCODER_ID    						0x00
   1519  1.1  riastrad //#define ASIC_INT_TV_ENCODER_ID									0x02
   1520  1.1  riastrad //#define ASIC_INT_DIG1_ENCODER_ID								0x03
   1521  1.1  riastrad //#define ASIC_INT_DAC2_ENCODER_ID								0x04
   1522  1.1  riastrad //#define ASIC_EXT_TV_ENCODER_ID									0x06
   1523  1.1  riastrad //#define ASIC_INT_DVO_ENCODER_ID									0x07
   1524  1.1  riastrad //#define ASIC_INT_DIG2_ENCODER_ID								0x09
   1525  1.1  riastrad //#define ASIC_EXT_DIG_ENCODER_ID									0x05
   1526  1.1  riastrad 
   1527  1.1  riastrad //ucEncodeMode
   1528  1.1  riastrad //#define ATOM_ENCODER_MODE_DP										0
   1529  1.1  riastrad //#define ATOM_ENCODER_MODE_LVDS									1
   1530  1.1  riastrad //#define ATOM_ENCODER_MODE_DVI										2
   1531  1.1  riastrad //#define ATOM_ENCODER_MODE_HDMI									3
   1532  1.1  riastrad //#define ATOM_ENCODER_MODE_SDVO									4
   1533  1.1  riastrad //#define ATOM_ENCODER_MODE_TV										13
   1534  1.1  riastrad //#define ATOM_ENCODER_MODE_CV										14
   1535  1.1  riastrad //#define ATOM_ENCODER_MODE_CRT										15
   1536  1.1  riastrad 
   1537  1.1  riastrad /****************************************************************************/
   1538  1.1  riastrad // Structures used by SetPixelClockTable
   1539  1.1  riastrad //                    GetPixelClockTable
   1540  1.1  riastrad /****************************************************************************/
   1541  1.1  riastrad //Major revision=1., Minor revision=1
   1542  1.1  riastrad typedef struct _PIXEL_CLOCK_PARAMETERS
   1543  1.1  riastrad {
   1544  1.1  riastrad   USHORT usPixelClock;                // in 10kHz unit; for bios convenient = (RefClk*FB_Div)/(Ref_Div*Post_Div)
   1545  1.1  riastrad                                       // 0 means disable PPLL
   1546  1.1  riastrad   USHORT usRefDiv;                    // Reference divider
   1547  1.1  riastrad   USHORT usFbDiv;                     // feedback divider
   1548  1.1  riastrad   UCHAR  ucPostDiv;                   // post divider
   1549  1.1  riastrad   UCHAR  ucFracFbDiv;                 // fractional feedback divider
   1550  1.1  riastrad   UCHAR  ucPpll;                      // ATOM_PPLL1 or ATOM_PPL2
   1551  1.1  riastrad   UCHAR  ucRefDivSrc;                 // ATOM_PJITTER or ATO_NONPJITTER
   1552  1.1  riastrad   UCHAR  ucCRTC;                      // Which CRTC uses this Ppll
   1553  1.1  riastrad   UCHAR  ucPadding;
   1554  1.1  riastrad }PIXEL_CLOCK_PARAMETERS;
   1555  1.1  riastrad 
   1556  1.1  riastrad //Major revision=1., Minor revision=2, add ucMiscIfno
   1557  1.1  riastrad //ucMiscInfo:
   1558  1.1  riastrad #define MISC_FORCE_REPROG_PIXEL_CLOCK 0x1
   1559  1.1  riastrad #define MISC_DEVICE_INDEX_MASK        0xF0
   1560  1.1  riastrad #define MISC_DEVICE_INDEX_SHIFT       4
   1561  1.1  riastrad 
   1562  1.1  riastrad typedef struct _PIXEL_CLOCK_PARAMETERS_V2
   1563  1.1  riastrad {
   1564  1.1  riastrad   USHORT usPixelClock;                // in 10kHz unit; for bios convenient = (RefClk*FB_Div)/(Ref_Div*Post_Div)
   1565  1.1  riastrad                                       // 0 means disable PPLL
   1566  1.1  riastrad   USHORT usRefDiv;                    // Reference divider
   1567  1.1  riastrad   USHORT usFbDiv;                     // feedback divider
   1568  1.1  riastrad   UCHAR  ucPostDiv;                   // post divider
   1569  1.1  riastrad   UCHAR  ucFracFbDiv;                 // fractional feedback divider
   1570  1.1  riastrad   UCHAR  ucPpll;                      // ATOM_PPLL1 or ATOM_PPL2
   1571  1.1  riastrad   UCHAR  ucRefDivSrc;                 // ATOM_PJITTER or ATO_NONPJITTER
   1572  1.1  riastrad   UCHAR  ucCRTC;                      // Which CRTC uses this Ppll
   1573  1.1  riastrad   UCHAR  ucMiscInfo;                  // Different bits for different purpose, bit [7:4] as device index, bit[0]=Force prog
   1574  1.1  riastrad }PIXEL_CLOCK_PARAMETERS_V2;
   1575  1.1  riastrad 
   1576  1.1  riastrad //Major revision=1., Minor revision=3, structure/definition change
   1577  1.1  riastrad //ucEncoderMode:
   1578  1.1  riastrad //ATOM_ENCODER_MODE_DP
   1579  1.1  riastrad //ATOM_ENOCDER_MODE_LVDS
   1580  1.1  riastrad //ATOM_ENOCDER_MODE_DVI
   1581  1.1  riastrad //ATOM_ENOCDER_MODE_HDMI
   1582  1.1  riastrad //ATOM_ENOCDER_MODE_SDVO
   1583  1.1  riastrad //ATOM_ENCODER_MODE_TV										13
   1584  1.1  riastrad //ATOM_ENCODER_MODE_CV										14
   1585  1.1  riastrad //ATOM_ENCODER_MODE_CRT										15
   1586  1.1  riastrad 
   1587  1.1  riastrad //ucDVOConfig
   1588  1.1  riastrad //#define DVO_ENCODER_CONFIG_RATE_SEL							0x01
   1589  1.1  riastrad //#define DVO_ENCODER_CONFIG_DDR_SPEED						0x00
   1590  1.1  riastrad //#define DVO_ENCODER_CONFIG_SDR_SPEED						0x01
   1591  1.1  riastrad //#define DVO_ENCODER_CONFIG_OUTPUT_SEL						0x0c
   1592  1.1  riastrad //#define DVO_ENCODER_CONFIG_LOW12BIT							0x00
   1593  1.1  riastrad //#define DVO_ENCODER_CONFIG_UPPER12BIT						0x04
   1594  1.1  riastrad //#define DVO_ENCODER_CONFIG_24BIT								0x08
   1595  1.1  riastrad 
   1596  1.1  riastrad //ucMiscInfo: also changed, see below
   1597  1.1  riastrad #define PIXEL_CLOCK_MISC_FORCE_PROG_PPLL						0x01
   1598  1.1  riastrad #define PIXEL_CLOCK_MISC_VGA_MODE										0x02
   1599  1.1  riastrad #define PIXEL_CLOCK_MISC_CRTC_SEL_MASK							0x04
   1600  1.1  riastrad #define PIXEL_CLOCK_MISC_CRTC_SEL_CRTC1							0x00
   1601  1.1  riastrad #define PIXEL_CLOCK_MISC_CRTC_SEL_CRTC2							0x04
   1602  1.1  riastrad #define PIXEL_CLOCK_MISC_USE_ENGINE_FOR_DISPCLK			0x08
   1603  1.1  riastrad #define PIXEL_CLOCK_MISC_REF_DIV_SRC                    0x10
   1604  1.1  riastrad // V1.4 for RoadRunner
   1605  1.1  riastrad #define PIXEL_CLOCK_V4_MISC_SS_ENABLE               0x10
   1606  1.1  riastrad #define PIXEL_CLOCK_V4_MISC_COHERENT_MODE           0x20
   1607  1.1  riastrad 
   1608  1.1  riastrad 
   1609  1.1  riastrad typedef struct _PIXEL_CLOCK_PARAMETERS_V3
   1610  1.1  riastrad {
   1611  1.1  riastrad   USHORT usPixelClock;                // in 10kHz unit; for bios convenient = (RefClk*FB_Div)/(Ref_Div*Post_Div)
   1612  1.1  riastrad                                       // 0 means disable PPLL. For VGA PPLL,make sure this value is not 0.
   1613  1.1  riastrad   USHORT usRefDiv;                    // Reference divider
   1614  1.1  riastrad   USHORT usFbDiv;                     // feedback divider
   1615  1.1  riastrad   UCHAR  ucPostDiv;                   // post divider
   1616  1.1  riastrad   UCHAR  ucFracFbDiv;                 // fractional feedback divider
   1617  1.1  riastrad   UCHAR  ucPpll;                      // ATOM_PPLL1 or ATOM_PPL2
   1618  1.1  riastrad   UCHAR  ucTransmitterId;             // graphic encoder id defined in objectId.h
   1619  1.1  riastrad 	union
   1620  1.1  riastrad 	{
   1621  1.1  riastrad   UCHAR  ucEncoderMode;               // encoder type defined as ATOM_ENCODER_MODE_DP/DVI/HDMI/
   1622  1.1  riastrad 	UCHAR  ucDVOConfig;									// when use DVO, need to know SDR/DDR, 12bit or 24bit
   1623  1.1  riastrad 	};
   1624  1.1  riastrad   UCHAR  ucMiscInfo;                  // bit[0]=Force program, bit[1]= set pclk for VGA, b[2]= CRTC sel
   1625  1.1  riastrad                                       // bit[3]=0:use PPLL for dispclk source, =1: use engine clock for dispclock source
   1626  1.1  riastrad                                       // bit[4]=0:use XTALIN as the source of reference divider,=1 use the pre-defined clock as the source of reference divider
   1627  1.1  riastrad }PIXEL_CLOCK_PARAMETERS_V3;
   1628  1.1  riastrad 
   1629  1.1  riastrad #define PIXEL_CLOCK_PARAMETERS_LAST			PIXEL_CLOCK_PARAMETERS_V2
   1630  1.1  riastrad #define GET_PIXEL_CLOCK_PS_ALLOCATION		PIXEL_CLOCK_PARAMETERS_LAST
   1631  1.1  riastrad 
   1632  1.1  riastrad typedef struct _PIXEL_CLOCK_PARAMETERS_V5
   1633  1.1  riastrad {
   1634  1.1  riastrad   UCHAR  ucCRTC;             // ATOM_CRTC1~6, indicate the CRTC controller to
   1635  1.1  riastrad                              // drive the pixel clock. not used for DCPLL case.
   1636  1.1  riastrad   union{
   1637  1.1  riastrad   UCHAR  ucReserved;
   1638  1.1  riastrad   UCHAR  ucFracFbDiv;        // [gphan] temporary to prevent build problem.  remove it after driver code is changed.
   1639  1.1  riastrad   };
   1640  1.1  riastrad   USHORT usPixelClock;       // target the pixel clock to drive the CRTC timing
   1641  1.1  riastrad                              // 0 means disable PPLL/DCPLL.
   1642  1.1  riastrad   USHORT usFbDiv;            // feedback divider integer part.
   1643  1.1  riastrad   UCHAR  ucPostDiv;          // post divider.
   1644  1.1  riastrad   UCHAR  ucRefDiv;           // Reference divider
   1645  1.1  riastrad   UCHAR  ucPpll;             // ATOM_PPLL1/ATOM_PPLL2/ATOM_DCPLL
   1646  1.1  riastrad   UCHAR  ucTransmitterID;    // ASIC encoder id defined in objectId.h,
   1647  1.1  riastrad                              // indicate which graphic encoder will be used.
   1648  1.1  riastrad   UCHAR  ucEncoderMode;      // Encoder mode:
   1649  1.1  riastrad   UCHAR  ucMiscInfo;         // bit[0]= Force program PPLL
   1650  1.1  riastrad                              // bit[1]= when VGA timing is used.
   1651  1.1  riastrad                              // bit[3:2]= HDMI panel bit depth: =0: 24bpp =1:30bpp, =2:32bpp
   1652  1.1  riastrad                              // bit[4]= RefClock source for PPLL.
   1653  1.1  riastrad                              // =0: XTLAIN( default mode )
   1654  1.1  riastrad 	                           // =1: other external clock source, which is pre-defined
   1655  1.1  riastrad                              //     by VBIOS depend on the feature required.
   1656  1.1  riastrad                              // bit[7:5]: reserved.
   1657  1.1  riastrad   ULONG  ulFbDivDecFrac;     // 20 bit feedback divider decimal fraction part, range from 1~999999 ( 0.000001 to 0.999999 )
   1658  1.1  riastrad 
   1659  1.1  riastrad }PIXEL_CLOCK_PARAMETERS_V5;
   1660  1.1  riastrad 
   1661  1.1  riastrad #define PIXEL_CLOCK_V5_MISC_FORCE_PROG_PPLL					0x01
   1662  1.1  riastrad #define PIXEL_CLOCK_V5_MISC_VGA_MODE								0x02
   1663  1.1  riastrad #define PIXEL_CLOCK_V5_MISC_HDMI_BPP_MASK           0x0c
   1664  1.1  riastrad #define PIXEL_CLOCK_V5_MISC_HDMI_24BPP              0x00
   1665  1.1  riastrad #define PIXEL_CLOCK_V5_MISC_HDMI_30BPP              0x04
   1666  1.1  riastrad #define PIXEL_CLOCK_V5_MISC_HDMI_32BPP              0x08
   1667  1.1  riastrad #define PIXEL_CLOCK_V5_MISC_REF_DIV_SRC             0x10
   1668  1.1  riastrad 
   1669  1.1  riastrad typedef struct _CRTC_PIXEL_CLOCK_FREQ
   1670  1.1  riastrad {
   1671  1.1  riastrad #if ATOM_BIG_ENDIAN
   1672  1.1  riastrad   ULONG  ucCRTC:8;            // ATOM_CRTC1~6, indicate the CRTC controller to
   1673  1.1  riastrad                               // drive the pixel clock. not used for DCPLL case.
   1674  1.1  riastrad   ULONG  ulPixelClock:24;     // target the pixel clock to drive the CRTC timing.
   1675  1.1  riastrad                               // 0 means disable PPLL/DCPLL. Expanded to 24 bits comparing to previous version.
   1676  1.1  riastrad #else
   1677  1.1  riastrad   ULONG  ulPixelClock:24;     // target the pixel clock to drive the CRTC timing.
   1678  1.1  riastrad                               // 0 means disable PPLL/DCPLL. Expanded to 24 bits comparing to previous version.
   1679  1.1  riastrad   ULONG  ucCRTC:8;            // ATOM_CRTC1~6, indicate the CRTC controller to
   1680  1.1  riastrad                               // drive the pixel clock. not used for DCPLL case.
   1681  1.1  riastrad #endif
   1682  1.1  riastrad }CRTC_PIXEL_CLOCK_FREQ;
   1683  1.1  riastrad 
   1684  1.1  riastrad typedef struct _PIXEL_CLOCK_PARAMETERS_V6
   1685  1.1  riastrad {
   1686  1.1  riastrad   union{
   1687  1.1  riastrad     CRTC_PIXEL_CLOCK_FREQ ulCrtcPclkFreq;    // pixel clock and CRTC id frequency
   1688  1.1  riastrad     ULONG ulDispEngClkFreq;                  // dispclk frequency
   1689  1.1  riastrad   };
   1690  1.1  riastrad   USHORT usFbDiv;            // feedback divider integer part.
   1691  1.1  riastrad   UCHAR  ucPostDiv;          // post divider.
   1692  1.1  riastrad   UCHAR  ucRefDiv;           // Reference divider
   1693  1.1  riastrad   UCHAR  ucPpll;             // ATOM_PPLL1/ATOM_PPLL2/ATOM_DCPLL
   1694  1.1  riastrad   UCHAR  ucTransmitterID;    // ASIC encoder id defined in objectId.h,
   1695  1.1  riastrad                              // indicate which graphic encoder will be used.
   1696  1.1  riastrad   UCHAR  ucEncoderMode;      // Encoder mode:
   1697  1.1  riastrad   UCHAR  ucMiscInfo;         // bit[0]= Force program PPLL
   1698  1.1  riastrad                              // bit[1]= when VGA timing is used.
   1699  1.1  riastrad                              // bit[3:2]= HDMI panel bit depth: =0: 24bpp =1:30bpp, =2:32bpp
   1700  1.1  riastrad                              // bit[4]= RefClock source for PPLL.
   1701  1.1  riastrad                              // =0: XTLAIN( default mode )
   1702  1.1  riastrad 	                           // =1: other external clock source, which is pre-defined
   1703  1.1  riastrad                              //     by VBIOS depend on the feature required.
   1704  1.1  riastrad                              // bit[7:5]: reserved.
   1705  1.1  riastrad   ULONG  ulFbDivDecFrac;     // 20 bit feedback divider decimal fraction part, range from 1~999999 ( 0.000001 to 0.999999 )
   1706  1.1  riastrad 
   1707  1.1  riastrad }PIXEL_CLOCK_PARAMETERS_V6;
   1708  1.1  riastrad 
   1709  1.1  riastrad #define PIXEL_CLOCK_V6_MISC_FORCE_PROG_PPLL					0x01
   1710  1.1  riastrad #define PIXEL_CLOCK_V6_MISC_VGA_MODE								0x02
   1711  1.1  riastrad #define PIXEL_CLOCK_V6_MISC_HDMI_BPP_MASK           0x0c
   1712  1.1  riastrad #define PIXEL_CLOCK_V6_MISC_HDMI_24BPP              0x00
   1713  1.1  riastrad #define PIXEL_CLOCK_V6_MISC_HDMI_36BPP              0x04
   1714  1.2       wiz #define PIXEL_CLOCK_V6_MISC_HDMI_36BPP_V6           0x08    //for V6, the correct definition for 36bpp should be 2 for 36bpp(2:1)
   1715  1.1  riastrad #define PIXEL_CLOCK_V6_MISC_HDMI_30BPP              0x08
   1716  1.2       wiz #define PIXEL_CLOCK_V6_MISC_HDMI_30BPP_V6           0x04    //for V6, the correct definition for 30bpp should be 1 for 36bpp(5:4)
   1717  1.1  riastrad #define PIXEL_CLOCK_V6_MISC_HDMI_48BPP              0x0c
   1718  1.1  riastrad #define PIXEL_CLOCK_V6_MISC_REF_DIV_SRC             0x10
   1719  1.1  riastrad #define PIXEL_CLOCK_V6_MISC_GEN_DPREFCLK            0x40
   1720  1.1  riastrad 
   1721  1.1  riastrad typedef struct _GET_DISP_PLL_STATUS_INPUT_PARAMETERS_V2
   1722  1.1  riastrad {
   1723  1.1  riastrad   PIXEL_CLOCK_PARAMETERS_V3 sDispClkInput;
   1724  1.1  riastrad }GET_DISP_PLL_STATUS_INPUT_PARAMETERS_V2;
   1725  1.1  riastrad 
   1726  1.1  riastrad typedef struct _GET_DISP_PLL_STATUS_OUTPUT_PARAMETERS_V2
   1727  1.1  riastrad {
   1728  1.1  riastrad   UCHAR  ucStatus;
   1729  1.1  riastrad   UCHAR  ucRefDivSrc;                 // =1: reference clock source from XTALIN, =0: source from PCIE ref clock
   1730  1.1  riastrad   UCHAR  ucReserved[2];
   1731  1.1  riastrad }GET_DISP_PLL_STATUS_OUTPUT_PARAMETERS_V2;
   1732  1.1  riastrad 
   1733  1.1  riastrad typedef struct _GET_DISP_PLL_STATUS_INPUT_PARAMETERS_V3
   1734  1.1  riastrad {
   1735  1.1  riastrad   PIXEL_CLOCK_PARAMETERS_V5 sDispClkInput;
   1736  1.1  riastrad }GET_DISP_PLL_STATUS_INPUT_PARAMETERS_V3;
   1737  1.1  riastrad 
   1738  1.1  riastrad /****************************************************************************/
   1739  1.1  riastrad // Structures used by AdjustDisplayPllTable
   1740  1.1  riastrad /****************************************************************************/
   1741  1.1  riastrad typedef struct _ADJUST_DISPLAY_PLL_PARAMETERS
   1742  1.1  riastrad {
   1743  1.1  riastrad 	USHORT usPixelClock;
   1744  1.1  riastrad 	UCHAR ucTransmitterID;
   1745  1.1  riastrad 	UCHAR ucEncodeMode;
   1746  1.1  riastrad 	union
   1747  1.1  riastrad 	{
   1748  1.1  riastrad 		UCHAR ucDVOConfig;									//if DVO, need passing link rate and output 12bitlow or 24bit
   1749  1.1  riastrad 		UCHAR ucConfig;											//if none DVO, not defined yet
   1750  1.1  riastrad 	};
   1751  1.1  riastrad 	UCHAR ucReserved[3];
   1752  1.1  riastrad }ADJUST_DISPLAY_PLL_PARAMETERS;
   1753  1.1  riastrad 
   1754  1.1  riastrad #define ADJUST_DISPLAY_CONFIG_SS_ENABLE       0x10
   1755  1.1  riastrad #define ADJUST_DISPLAY_PLL_PS_ALLOCATION			ADJUST_DISPLAY_PLL_PARAMETERS
   1756  1.1  riastrad 
   1757  1.1  riastrad typedef struct _ADJUST_DISPLAY_PLL_INPUT_PARAMETERS_V3
   1758  1.1  riastrad {
   1759  1.1  riastrad 	USHORT usPixelClock;                    // target pixel clock
   1760  1.1  riastrad 	UCHAR ucTransmitterID;                  // GPU transmitter id defined in objectid.h
   1761  1.1  riastrad 	UCHAR ucEncodeMode;                     // encoder mode: CRT, LVDS, DP, TMDS or HDMI
   1762  1.1  riastrad   UCHAR ucDispPllConfig;                 // display pll configure parameter defined as following DISPPLL_CONFIG_XXXX
   1763  1.1  riastrad   UCHAR ucExtTransmitterID;               // external encoder id.
   1764  1.1  riastrad 	UCHAR ucReserved[2];
   1765  1.1  riastrad }ADJUST_DISPLAY_PLL_INPUT_PARAMETERS_V3;
   1766  1.1  riastrad 
   1767  1.1  riastrad // usDispPllConfig v1.2 for RoadRunner
   1768  1.1  riastrad #define DISPPLL_CONFIG_DVO_RATE_SEL                0x0001     // need only when ucTransmitterID = DVO
   1769  1.1  riastrad #define DISPPLL_CONFIG_DVO_DDR_SPEED               0x0000     // need only when ucTransmitterID = DVO
   1770  1.1  riastrad #define DISPPLL_CONFIG_DVO_SDR_SPEED               0x0001     // need only when ucTransmitterID = DVO
   1771  1.1  riastrad #define DISPPLL_CONFIG_DVO_OUTPUT_SEL              0x000c     // need only when ucTransmitterID = DVO
   1772  1.1  riastrad #define DISPPLL_CONFIG_DVO_LOW12BIT                0x0000     // need only when ucTransmitterID = DVO
   1773  1.1  riastrad #define DISPPLL_CONFIG_DVO_UPPER12BIT              0x0004     // need only when ucTransmitterID = DVO
   1774  1.1  riastrad #define DISPPLL_CONFIG_DVO_24BIT                   0x0008     // need only when ucTransmitterID = DVO
   1775  1.1  riastrad #define DISPPLL_CONFIG_SS_ENABLE                   0x0010     // Only used when ucEncoderMode = DP or LVDS
   1776  1.1  riastrad #define DISPPLL_CONFIG_COHERENT_MODE               0x0020     // Only used when ucEncoderMode = TMDS or HDMI
   1777  1.1  riastrad #define DISPPLL_CONFIG_DUAL_LINK                   0x0040     // Only used when ucEncoderMode = TMDS or LVDS
   1778  1.1  riastrad 
   1779  1.1  riastrad 
   1780  1.1  riastrad typedef struct _ADJUST_DISPLAY_PLL_OUTPUT_PARAMETERS_V3
   1781  1.1  riastrad {
   1782  1.1  riastrad   ULONG ulDispPllFreq;                 // return display PPLL freq which is used to generate the pixclock, and related idclk, symclk etc
   1783  1.1  riastrad   UCHAR ucRefDiv;                      // if it is none-zero, it is used to be calculated the other ppll parameter fb_divider and post_div ( if it is not given )
   1784  1.1  riastrad   UCHAR ucPostDiv;                     // if it is none-zero, it is used to be calculated the other ppll parameter fb_divider
   1785  1.1  riastrad   UCHAR ucReserved[2];
   1786  1.1  riastrad }ADJUST_DISPLAY_PLL_OUTPUT_PARAMETERS_V3;
   1787  1.1  riastrad 
   1788  1.1  riastrad typedef struct _ADJUST_DISPLAY_PLL_PS_ALLOCATION_V3
   1789  1.1  riastrad {
   1790  1.1  riastrad   union
   1791  1.1  riastrad   {
   1792  1.1  riastrad     ADJUST_DISPLAY_PLL_INPUT_PARAMETERS_V3  sInput;
   1793  1.1  riastrad     ADJUST_DISPLAY_PLL_OUTPUT_PARAMETERS_V3 sOutput;
   1794  1.1  riastrad   };
   1795  1.1  riastrad } ADJUST_DISPLAY_PLL_PS_ALLOCATION_V3;
   1796  1.1  riastrad 
   1797  1.1  riastrad /****************************************************************************/
   1798  1.1  riastrad // Structures used by EnableYUVTable
   1799  1.1  riastrad /****************************************************************************/
   1800  1.1  riastrad typedef struct _ENABLE_YUV_PARAMETERS
   1801  1.1  riastrad {
   1802  1.1  riastrad   UCHAR ucEnable;                     // ATOM_ENABLE:Enable YUV or ATOM_DISABLE:Disable YUV (RGB)
   1803  1.1  riastrad   UCHAR ucCRTC;                       // Which CRTC needs this YUV or RGB format
   1804  1.1  riastrad   UCHAR ucPadding[2];
   1805  1.1  riastrad }ENABLE_YUV_PARAMETERS;
   1806  1.1  riastrad #define ENABLE_YUV_PS_ALLOCATION ENABLE_YUV_PARAMETERS
   1807  1.1  riastrad 
   1808  1.1  riastrad /****************************************************************************/
   1809  1.1  riastrad // Structures used by GetMemoryClockTable
   1810  1.1  riastrad /****************************************************************************/
   1811  1.1  riastrad typedef struct _GET_MEMORY_CLOCK_PARAMETERS
   1812  1.1  riastrad {
   1813  1.1  riastrad   ULONG ulReturnMemoryClock;          // current memory speed in 10KHz unit
   1814  1.1  riastrad } GET_MEMORY_CLOCK_PARAMETERS;
   1815  1.1  riastrad #define GET_MEMORY_CLOCK_PS_ALLOCATION  GET_MEMORY_CLOCK_PARAMETERS
   1816  1.1  riastrad 
   1817  1.1  riastrad /****************************************************************************/
   1818  1.1  riastrad // Structures used by GetEngineClockTable
   1819  1.1  riastrad /****************************************************************************/
   1820  1.1  riastrad typedef struct _GET_ENGINE_CLOCK_PARAMETERS
   1821  1.1  riastrad {
   1822  1.1  riastrad   ULONG ulReturnEngineClock;          // current engine speed in 10KHz unit
   1823  1.1  riastrad } GET_ENGINE_CLOCK_PARAMETERS;
   1824  1.1  riastrad #define GET_ENGINE_CLOCK_PS_ALLOCATION  GET_ENGINE_CLOCK_PARAMETERS
   1825  1.1  riastrad 
   1826  1.1  riastrad /****************************************************************************/
   1827  1.1  riastrad // Following Structures and constant may be obsolete
   1828  1.1  riastrad /****************************************************************************/
   1829  1.1  riastrad //Maxium 8 bytes,the data read in will be placed in the parameter space.
   1830  1.1  riastrad //Read operaion successeful when the paramter space is non-zero, otherwise read operation failed
   1831  1.1  riastrad typedef struct _READ_EDID_FROM_HW_I2C_DATA_PARAMETERS
   1832  1.1  riastrad {
   1833  1.1  riastrad   USHORT    usPrescale;         //Ratio between Engine clock and I2C clock
   1834  1.1  riastrad   USHORT    usVRAMAddress;      //Address in Frame Buffer where to pace raw EDID
   1835  1.1  riastrad   USHORT    usStatus;           //When use output: lower byte EDID checksum, high byte hardware status
   1836  1.1  riastrad                                 //WHen use input:  lower byte as 'byte to read':currently limited to 128byte or 1byte
   1837  1.1  riastrad   UCHAR     ucSlaveAddr;        //Read from which slave
   1838  1.1  riastrad   UCHAR     ucLineNumber;       //Read from which HW assisted line
   1839  1.1  riastrad }READ_EDID_FROM_HW_I2C_DATA_PARAMETERS;
   1840  1.1  riastrad #define READ_EDID_FROM_HW_I2C_DATA_PS_ALLOCATION  READ_EDID_FROM_HW_I2C_DATA_PARAMETERS
   1841  1.1  riastrad 
   1842  1.1  riastrad 
   1843  1.1  riastrad #define  ATOM_WRITE_I2C_FORMAT_PSOFFSET_PSDATABYTE                  0
   1844  1.1  riastrad #define  ATOM_WRITE_I2C_FORMAT_PSOFFSET_PSTWODATABYTES              1
   1845  1.1  riastrad #define  ATOM_WRITE_I2C_FORMAT_PSCOUNTER_PSOFFSET_IDDATABLOCK       2
   1846  1.1  riastrad #define  ATOM_WRITE_I2C_FORMAT_PSCOUNTER_IDOFFSET_PLUS_IDDATABLOCK  3
   1847  1.1  riastrad #define  ATOM_WRITE_I2C_FORMAT_IDCOUNTER_IDOFFSET_IDDATABLOCK       4
   1848  1.1  riastrad 
   1849  1.1  riastrad typedef struct _WRITE_ONE_BYTE_HW_I2C_DATA_PARAMETERS
   1850  1.1  riastrad {
   1851  1.1  riastrad   USHORT    usPrescale;         //Ratio between Engine clock and I2C clock
   1852  1.1  riastrad   USHORT    usByteOffset;       //Write to which byte
   1853  1.1  riastrad                                 //Upper portion of usByteOffset is Format of data
   1854  1.1  riastrad                                 //1bytePS+offsetPS
   1855  1.1  riastrad                                 //2bytesPS+offsetPS
   1856  1.1  riastrad                                 //blockID+offsetPS
   1857  1.1  riastrad                                 //blockID+offsetID
   1858  1.1  riastrad                                 //blockID+counterID+offsetID
   1859  1.1  riastrad   UCHAR     ucData;             //PS data1
   1860  1.1  riastrad   UCHAR     ucStatus;           //Status byte 1=success, 2=failure, Also is used as PS data2
   1861  1.1  riastrad   UCHAR     ucSlaveAddr;        //Write to which slave
   1862  1.1  riastrad   UCHAR     ucLineNumber;       //Write from which HW assisted line
   1863  1.1  riastrad }WRITE_ONE_BYTE_HW_I2C_DATA_PARAMETERS;
   1864  1.1  riastrad 
   1865  1.1  riastrad #define WRITE_ONE_BYTE_HW_I2C_DATA_PS_ALLOCATION  WRITE_ONE_BYTE_HW_I2C_DATA_PARAMETERS
   1866  1.1  riastrad 
   1867  1.1  riastrad typedef struct _SET_UP_HW_I2C_DATA_PARAMETERS
   1868  1.1  riastrad {
   1869  1.1  riastrad   USHORT    usPrescale;         //Ratio between Engine clock and I2C clock
   1870  1.1  riastrad   UCHAR     ucSlaveAddr;        //Write to which slave
   1871  1.1  riastrad   UCHAR     ucLineNumber;       //Write from which HW assisted line
   1872  1.1  riastrad }SET_UP_HW_I2C_DATA_PARAMETERS;
   1873  1.1  riastrad 
   1874  1.1  riastrad 
   1875  1.1  riastrad /**************************************************************************/
   1876  1.1  riastrad #define SPEED_FAN_CONTROL_PS_ALLOCATION   WRITE_ONE_BYTE_HW_I2C_DATA_PARAMETERS
   1877  1.1  riastrad 
   1878  1.1  riastrad 
   1879  1.1  riastrad /****************************************************************************/
   1880  1.1  riastrad // Structures used by PowerConnectorDetectionTable
   1881  1.1  riastrad /****************************************************************************/
   1882  1.1  riastrad typedef struct	_POWER_CONNECTOR_DETECTION_PARAMETERS
   1883  1.1  riastrad {
   1884  1.1  riastrad   UCHAR   ucPowerConnectorStatus;      //Used for return value 0: detected, 1:not detected
   1885  1.1  riastrad 	UCHAR   ucPwrBehaviorId;
   1886  1.1  riastrad 	USHORT	usPwrBudget;								 //how much power currently boot to in unit of watt
   1887  1.1  riastrad }POWER_CONNECTOR_DETECTION_PARAMETERS;
   1888  1.1  riastrad 
   1889  1.1  riastrad typedef struct POWER_CONNECTOR_DETECTION_PS_ALLOCATION
   1890  1.1  riastrad {
   1891  1.1  riastrad   UCHAR   ucPowerConnectorStatus;      //Used for return value 0: detected, 1:not detected
   1892  1.1  riastrad 	UCHAR   ucReserved;
   1893  1.1  riastrad 	USHORT	usPwrBudget;								 //how much power currently boot to in unit of watt
   1894  1.1  riastrad   WRITE_ONE_BYTE_HW_I2C_DATA_PS_ALLOCATION    sReserved;
   1895  1.1  riastrad }POWER_CONNECTOR_DETECTION_PS_ALLOCATION;
   1896  1.1  riastrad 
   1897  1.1  riastrad /****************************LVDS SS Command Table Definitions**********************/
   1898  1.1  riastrad 
   1899  1.1  riastrad /****************************************************************************/
   1900  1.1  riastrad // Structures used by EnableSpreadSpectrumOnPPLLTable
   1901  1.1  riastrad /****************************************************************************/
   1902  1.1  riastrad typedef struct	_ENABLE_LVDS_SS_PARAMETERS
   1903  1.1  riastrad {
   1904  1.1  riastrad   USHORT  usSpreadSpectrumPercentage;
   1905  1.1  riastrad   UCHAR   ucSpreadSpectrumType;           //Bit1=0 Down Spread,=1 Center Spread. Bit1=1 Ext. =0 Int. Others:TBD
   1906  1.1  riastrad   UCHAR   ucSpreadSpectrumStepSize_Delay; //bits3:2 SS_STEP_SIZE; bit 6:4 SS_DELAY
   1907  1.1  riastrad   UCHAR   ucEnable;                       //ATOM_ENABLE or ATOM_DISABLE
   1908  1.1  riastrad   UCHAR   ucPadding[3];
   1909  1.1  riastrad }ENABLE_LVDS_SS_PARAMETERS;
   1910  1.1  riastrad 
   1911  1.1  riastrad //ucTableFormatRevision=1,ucTableContentRevision=2
   1912  1.1  riastrad typedef struct	_ENABLE_LVDS_SS_PARAMETERS_V2
   1913  1.1  riastrad {
   1914  1.1  riastrad   USHORT  usSpreadSpectrumPercentage;
   1915  1.1  riastrad   UCHAR   ucSpreadSpectrumType;           //Bit1=0 Down Spread,=1 Center Spread. Bit1=1 Ext. =0 Int. Others:TBD
   1916  1.1  riastrad   UCHAR   ucSpreadSpectrumStep;           //
   1917  1.1  riastrad   UCHAR   ucEnable;                       //ATOM_ENABLE or ATOM_DISABLE
   1918  1.1  riastrad   UCHAR   ucSpreadSpectrumDelay;
   1919  1.1  riastrad   UCHAR   ucSpreadSpectrumRange;
   1920  1.1  riastrad   UCHAR   ucPadding;
   1921  1.1  riastrad }ENABLE_LVDS_SS_PARAMETERS_V2;
   1922  1.1  riastrad 
   1923  1.1  riastrad //This new structure is based on ENABLE_LVDS_SS_PARAMETERS but expands to SS on PPLL, so other devices can use SS.
   1924  1.1  riastrad typedef struct	_ENABLE_SPREAD_SPECTRUM_ON_PPLL
   1925  1.1  riastrad {
   1926  1.1  riastrad   USHORT  usSpreadSpectrumPercentage;
   1927  1.1  riastrad   UCHAR   ucSpreadSpectrumType;           // Bit1=0 Down Spread,=1 Center Spread. Bit1=1 Ext. =0 Int. Others:TBD
   1928  1.1  riastrad   UCHAR   ucSpreadSpectrumStep;           //
   1929  1.1  riastrad   UCHAR   ucEnable;                       // ATOM_ENABLE or ATOM_DISABLE
   1930  1.1  riastrad   UCHAR   ucSpreadSpectrumDelay;
   1931  1.1  riastrad   UCHAR   ucSpreadSpectrumRange;
   1932  1.1  riastrad   UCHAR   ucPpll;												  // ATOM_PPLL1/ATOM_PPLL2
   1933  1.1  riastrad }ENABLE_SPREAD_SPECTRUM_ON_PPLL;
   1934  1.1  riastrad 
   1935  1.1  riastrad typedef struct _ENABLE_SPREAD_SPECTRUM_ON_PPLL_V2
   1936  1.1  riastrad {
   1937  1.1  riastrad   USHORT  usSpreadSpectrumPercentage;
   1938  1.1  riastrad   UCHAR   ucSpreadSpectrumType;	        // Bit[0]: 0-Down Spread,1-Center Spread.
   1939  1.1  riastrad                                         // Bit[1]: 1-Ext. 0-Int.
   1940  1.1  riastrad                                         // Bit[3:2]: =0 P1PLL =1 P2PLL =2 DCPLL
   1941  1.1  riastrad                                         // Bits[7:4] reserved
   1942  1.1  riastrad   UCHAR   ucEnable;	                    // ATOM_ENABLE or ATOM_DISABLE
   1943  1.1  riastrad   USHORT  usSpreadSpectrumAmount;      	// Includes SS_AMOUNT_FBDIV[7:0] and SS_AMOUNT_NFRAC_SLIP[11:8]
   1944  1.1  riastrad   USHORT  usSpreadSpectrumStep;	        // SS_STEP_SIZE_DSFRAC
   1945  1.1  riastrad }ENABLE_SPREAD_SPECTRUM_ON_PPLL_V2;
   1946  1.1  riastrad 
   1947  1.1  riastrad #define ATOM_PPLL_SS_TYPE_V2_DOWN_SPREAD      0x00
   1948  1.1  riastrad #define ATOM_PPLL_SS_TYPE_V2_CENTRE_SPREAD    0x01
   1949  1.1  riastrad #define ATOM_PPLL_SS_TYPE_V2_EXT_SPREAD       0x02
   1950  1.1  riastrad #define ATOM_PPLL_SS_TYPE_V2_PPLL_SEL_MASK    0x0c
   1951  1.1  riastrad #define ATOM_PPLL_SS_TYPE_V2_P1PLL            0x00
   1952  1.1  riastrad #define ATOM_PPLL_SS_TYPE_V2_P2PLL            0x04
   1953  1.1  riastrad #define ATOM_PPLL_SS_TYPE_V2_DCPLL            0x08
   1954  1.1  riastrad #define ATOM_PPLL_SS_AMOUNT_V2_FBDIV_MASK     0x00FF
   1955  1.1  riastrad #define ATOM_PPLL_SS_AMOUNT_V2_FBDIV_SHIFT    0
   1956  1.1  riastrad #define ATOM_PPLL_SS_AMOUNT_V2_NFRAC_MASK     0x0F00
   1957  1.1  riastrad #define ATOM_PPLL_SS_AMOUNT_V2_NFRAC_SHIFT    8
   1958  1.1  riastrad 
   1959  1.1  riastrad // Used by DCE5.0
   1960  1.1  riastrad  typedef struct _ENABLE_SPREAD_SPECTRUM_ON_PPLL_V3
   1961  1.1  riastrad {
   1962  1.1  riastrad   USHORT  usSpreadSpectrumAmountFrac;   // SS_AMOUNT_DSFRAC New in DCE5.0
   1963  1.1  riastrad   UCHAR   ucSpreadSpectrumType;	        // Bit[0]: 0-Down Spread,1-Center Spread.
   1964  1.1  riastrad                                         // Bit[1]: 1-Ext. 0-Int.
   1965  1.1  riastrad                                         // Bit[3:2]: =0 P1PLL =1 P2PLL =2 DCPLL
   1966  1.1  riastrad                                         // Bits[7:4] reserved
   1967  1.1  riastrad   UCHAR   ucEnable;	                    // ATOM_ENABLE or ATOM_DISABLE
   1968  1.1  riastrad   USHORT  usSpreadSpectrumAmount;      	// Includes SS_AMOUNT_FBDIV[7:0] and SS_AMOUNT_NFRAC_SLIP[11:8]
   1969  1.1  riastrad   USHORT  usSpreadSpectrumStep;	        // SS_STEP_SIZE_DSFRAC
   1970  1.1  riastrad }ENABLE_SPREAD_SPECTRUM_ON_PPLL_V3;
   1971  1.1  riastrad 
   1972  1.1  riastrad #define ATOM_PPLL_SS_TYPE_V3_DOWN_SPREAD      0x00
   1973  1.1  riastrad #define ATOM_PPLL_SS_TYPE_V3_CENTRE_SPREAD    0x01
   1974  1.1  riastrad #define ATOM_PPLL_SS_TYPE_V3_EXT_SPREAD       0x02
   1975  1.1  riastrad #define ATOM_PPLL_SS_TYPE_V3_PPLL_SEL_MASK    0x0c
   1976  1.1  riastrad #define ATOM_PPLL_SS_TYPE_V3_P1PLL            0x00
   1977  1.1  riastrad #define ATOM_PPLL_SS_TYPE_V3_P2PLL            0x04
   1978  1.1  riastrad #define ATOM_PPLL_SS_TYPE_V3_DCPLL            0x08
   1979  1.1  riastrad #define ATOM_PPLL_SS_TYPE_V3_P0PLL            ATOM_PPLL_SS_TYPE_V3_DCPLL
   1980  1.1  riastrad #define ATOM_PPLL_SS_AMOUNT_V3_FBDIV_MASK     0x00FF
   1981  1.1  riastrad #define ATOM_PPLL_SS_AMOUNT_V3_FBDIV_SHIFT    0
   1982  1.1  riastrad #define ATOM_PPLL_SS_AMOUNT_V3_NFRAC_MASK     0x0F00
   1983  1.1  riastrad #define ATOM_PPLL_SS_AMOUNT_V3_NFRAC_SHIFT    8
   1984  1.1  riastrad 
   1985  1.1  riastrad #define ENABLE_SPREAD_SPECTRUM_ON_PPLL_PS_ALLOCATION  ENABLE_SPREAD_SPECTRUM_ON_PPLL
   1986  1.1  riastrad 
   1987  1.1  riastrad /**************************************************************************/
   1988  1.1  riastrad 
   1989  1.1  riastrad typedef struct _SET_PIXEL_CLOCK_PS_ALLOCATION
   1990  1.1  riastrad {
   1991  1.1  riastrad   PIXEL_CLOCK_PARAMETERS sPCLKInput;
   1992  1.1  riastrad   ENABLE_SPREAD_SPECTRUM_ON_PPLL sReserved;//Caller doesn't need to init this portion
   1993  1.1  riastrad }SET_PIXEL_CLOCK_PS_ALLOCATION;
   1994  1.1  riastrad 
   1995  1.1  riastrad #define ENABLE_VGA_RENDER_PS_ALLOCATION   SET_PIXEL_CLOCK_PS_ALLOCATION
   1996  1.1  riastrad 
   1997  1.1  riastrad /****************************************************************************/
   1998  1.1  riastrad // Structures used by ###
   1999  1.1  riastrad /****************************************************************************/
   2000  1.1  riastrad typedef struct	_MEMORY_TRAINING_PARAMETERS
   2001  1.1  riastrad {
   2002  1.1  riastrad   ULONG ulTargetMemoryClock;          //In 10Khz unit
   2003  1.1  riastrad }MEMORY_TRAINING_PARAMETERS;
   2004  1.1  riastrad #define MEMORY_TRAINING_PS_ALLOCATION MEMORY_TRAINING_PARAMETERS
   2005  1.1  riastrad 
   2006  1.1  riastrad 
   2007  1.1  riastrad /****************************LVDS and other encoder command table definitions **********************/
   2008  1.1  riastrad 
   2009  1.1  riastrad 
   2010  1.1  riastrad /****************************************************************************/
   2011  1.1  riastrad // Structures used by LVDSEncoderControlTable   (Before DCE30)
   2012  1.1  riastrad //                    LVTMAEncoderControlTable  (Before DCE30)
   2013  1.1  riastrad //                    TMDSAEncoderControlTable  (Before DCE30)
   2014  1.1  riastrad /****************************************************************************/
   2015  1.1  riastrad typedef struct _LVDS_ENCODER_CONTROL_PARAMETERS
   2016  1.1  riastrad {
   2017  1.1  riastrad   USHORT usPixelClock;  // in 10KHz; for bios convenient
   2018  1.1  riastrad   UCHAR  ucMisc;        // bit0=0: Enable single link
   2019  1.1  riastrad                         //     =1: Enable dual link
   2020  1.1  riastrad                         // Bit1=0: 666RGB
   2021  1.1  riastrad                         //     =1: 888RGB
   2022  1.1  riastrad   UCHAR  ucAction;      // 0: turn off encoder
   2023  1.1  riastrad                         // 1: setup and turn on encoder
   2024  1.1  riastrad }LVDS_ENCODER_CONTROL_PARAMETERS;
   2025  1.1  riastrad 
   2026  1.1  riastrad #define LVDS_ENCODER_CONTROL_PS_ALLOCATION  LVDS_ENCODER_CONTROL_PARAMETERS
   2027  1.1  riastrad 
   2028  1.1  riastrad #define TMDS1_ENCODER_CONTROL_PARAMETERS    LVDS_ENCODER_CONTROL_PARAMETERS
   2029  1.1  riastrad #define TMDS1_ENCODER_CONTROL_PS_ALLOCATION TMDS1_ENCODER_CONTROL_PARAMETERS
   2030  1.1  riastrad 
   2031  1.1  riastrad #define TMDS2_ENCODER_CONTROL_PARAMETERS    TMDS1_ENCODER_CONTROL_PARAMETERS
   2032  1.1  riastrad #define TMDS2_ENCODER_CONTROL_PS_ALLOCATION TMDS2_ENCODER_CONTROL_PARAMETERS
   2033  1.1  riastrad 
   2034  1.1  riastrad 
   2035  1.1  riastrad //ucTableFormatRevision=1,ucTableContentRevision=2
   2036  1.1  riastrad typedef struct _LVDS_ENCODER_CONTROL_PARAMETERS_V2
   2037  1.1  riastrad {
   2038  1.1  riastrad   USHORT usPixelClock;  // in 10KHz; for bios convenient
   2039  1.2       wiz   UCHAR  ucMisc;        // see PANEL_ENCODER_MISC_xx definitions below
   2040  1.1  riastrad   UCHAR  ucAction;      // 0: turn off encoder
   2041  1.1  riastrad                         // 1: setup and turn on encoder
   2042  1.1  riastrad   UCHAR  ucTruncate;    // bit0=0: Disable truncate
   2043  1.1  riastrad                         //     =1: Enable truncate
   2044  1.1  riastrad                         // bit4=0: 666RGB
   2045  1.1  riastrad                         //     =1: 888RGB
   2046  1.1  riastrad   UCHAR  ucSpatial;     // bit0=0: Disable spatial dithering
   2047  1.1  riastrad                         //     =1: Enable spatial dithering
   2048  1.1  riastrad                         // bit4=0: 666RGB
   2049  1.1  riastrad                         //     =1: 888RGB
   2050  1.1  riastrad   UCHAR  ucTemporal;    // bit0=0: Disable temporal dithering
   2051  1.1  riastrad                         //     =1: Enable temporal dithering
   2052  1.1  riastrad                         // bit4=0: 666RGB
   2053  1.1  riastrad                         //     =1: 888RGB
   2054  1.1  riastrad                         // bit5=0: Gray level 2
   2055  1.1  riastrad                         //     =1: Gray level 4
   2056  1.1  riastrad   UCHAR  ucFRC;         // bit4=0: 25FRC_SEL pattern E
   2057  1.1  riastrad                         //     =1: 25FRC_SEL pattern F
   2058  1.1  riastrad                         // bit6:5=0: 50FRC_SEL pattern A
   2059  1.1  riastrad                         //       =1: 50FRC_SEL pattern B
   2060  1.1  riastrad                         //       =2: 50FRC_SEL pattern C
   2061  1.1  riastrad                         //       =3: 50FRC_SEL pattern D
   2062  1.1  riastrad                         // bit7=0: 75FRC_SEL pattern E
   2063  1.1  riastrad                         //     =1: 75FRC_SEL pattern F
   2064  1.1  riastrad }LVDS_ENCODER_CONTROL_PARAMETERS_V2;
   2065  1.1  riastrad 
   2066  1.1  riastrad #define LVDS_ENCODER_CONTROL_PS_ALLOCATION_V2  LVDS_ENCODER_CONTROL_PARAMETERS_V2
   2067  1.1  riastrad 
   2068  1.1  riastrad #define TMDS1_ENCODER_CONTROL_PARAMETERS_V2    LVDS_ENCODER_CONTROL_PARAMETERS_V2
   2069  1.1  riastrad #define TMDS1_ENCODER_CONTROL_PS_ALLOCATION_V2 TMDS1_ENCODER_CONTROL_PARAMETERS_V2
   2070  1.1  riastrad 
   2071  1.1  riastrad #define TMDS2_ENCODER_CONTROL_PARAMETERS_V2    TMDS1_ENCODER_CONTROL_PARAMETERS_V2
   2072  1.1  riastrad #define TMDS2_ENCODER_CONTROL_PS_ALLOCATION_V2 TMDS2_ENCODER_CONTROL_PARAMETERS_V2
   2073  1.1  riastrad 
   2074  1.1  riastrad #define LVDS_ENCODER_CONTROL_PARAMETERS_V3     LVDS_ENCODER_CONTROL_PARAMETERS_V2
   2075  1.1  riastrad #define LVDS_ENCODER_CONTROL_PS_ALLOCATION_V3  LVDS_ENCODER_CONTROL_PARAMETERS_V3
   2076  1.1  riastrad 
   2077  1.1  riastrad #define TMDS1_ENCODER_CONTROL_PARAMETERS_V3    LVDS_ENCODER_CONTROL_PARAMETERS_V3
   2078  1.1  riastrad #define TMDS1_ENCODER_CONTROL_PS_ALLOCATION_V3 TMDS1_ENCODER_CONTROL_PARAMETERS_V3
   2079  1.1  riastrad 
   2080  1.1  riastrad #define TMDS2_ENCODER_CONTROL_PARAMETERS_V3    LVDS_ENCODER_CONTROL_PARAMETERS_V3
   2081  1.1  riastrad #define TMDS2_ENCODER_CONTROL_PS_ALLOCATION_V3 TMDS2_ENCODER_CONTROL_PARAMETERS_V3
   2082  1.1  riastrad 
   2083  1.1  riastrad /****************************************************************************/
   2084  1.1  riastrad // Structures used by ###
   2085  1.1  riastrad /****************************************************************************/
   2086  1.1  riastrad typedef struct _ENABLE_EXTERNAL_TMDS_ENCODER_PARAMETERS
   2087  1.1  riastrad {
   2088  1.1  riastrad   UCHAR    ucEnable;            // Enable or Disable External TMDS encoder
   2089  1.1  riastrad   UCHAR    ucMisc;              // Bit0=0:Enable Single link;=1:Enable Dual link;Bit1 {=0:666RGB, =1:888RGB}
   2090  1.1  riastrad   UCHAR    ucPadding[2];
   2091  1.1  riastrad }ENABLE_EXTERNAL_TMDS_ENCODER_PARAMETERS;
   2092  1.1  riastrad 
   2093  1.1  riastrad typedef struct _ENABLE_EXTERNAL_TMDS_ENCODER_PS_ALLOCATION
   2094  1.1  riastrad {
   2095  1.1  riastrad   ENABLE_EXTERNAL_TMDS_ENCODER_PARAMETERS    sXTmdsEncoder;
   2096  1.1  riastrad   WRITE_ONE_BYTE_HW_I2C_DATA_PS_ALLOCATION   sReserved;     //Caller doesn't need to init this portion
   2097  1.1  riastrad }ENABLE_EXTERNAL_TMDS_ENCODER_PS_ALLOCATION;
   2098  1.1  riastrad 
   2099  1.1  riastrad #define ENABLE_EXTERNAL_TMDS_ENCODER_PARAMETERS_V2  LVDS_ENCODER_CONTROL_PARAMETERS_V2
   2100  1.1  riastrad 
   2101  1.1  riastrad typedef struct _ENABLE_EXTERNAL_TMDS_ENCODER_PS_ALLOCATION_V2
   2102  1.1  riastrad {
   2103  1.1  riastrad   ENABLE_EXTERNAL_TMDS_ENCODER_PARAMETERS_V2    sXTmdsEncoder;
   2104  1.1  riastrad   WRITE_ONE_BYTE_HW_I2C_DATA_PS_ALLOCATION      sReserved;     //Caller doesn't need to init this portion
   2105  1.1  riastrad }ENABLE_EXTERNAL_TMDS_ENCODER_PS_ALLOCATION_V2;
   2106  1.1  riastrad 
   2107  1.1  riastrad typedef struct _EXTERNAL_ENCODER_CONTROL_PS_ALLOCATION
   2108  1.1  riastrad {
   2109  1.1  riastrad   DIG_ENCODER_CONTROL_PARAMETERS            sDigEncoder;
   2110  1.1  riastrad   WRITE_ONE_BYTE_HW_I2C_DATA_PS_ALLOCATION sReserved;
   2111  1.1  riastrad }EXTERNAL_ENCODER_CONTROL_PS_ALLOCATION;
   2112  1.1  riastrad 
   2113  1.1  riastrad /****************************************************************************/
   2114  1.1  riastrad // Structures used by DVOEncoderControlTable
   2115  1.1  riastrad /****************************************************************************/
   2116  1.1  riastrad //ucTableFormatRevision=1,ucTableContentRevision=3
   2117  1.1  riastrad 
   2118  1.1  riastrad //ucDVOConfig:
   2119  1.1  riastrad #define DVO_ENCODER_CONFIG_RATE_SEL							0x01
   2120  1.1  riastrad #define DVO_ENCODER_CONFIG_DDR_SPEED						0x00
   2121  1.1  riastrad #define DVO_ENCODER_CONFIG_SDR_SPEED						0x01
   2122  1.1  riastrad #define DVO_ENCODER_CONFIG_OUTPUT_SEL						0x0c
   2123  1.1  riastrad #define DVO_ENCODER_CONFIG_LOW12BIT							0x00
   2124  1.1  riastrad #define DVO_ENCODER_CONFIG_UPPER12BIT						0x04
   2125  1.1  riastrad #define DVO_ENCODER_CONFIG_24BIT								0x08
   2126  1.1  riastrad 
   2127  1.1  riastrad typedef struct _DVO_ENCODER_CONTROL_PARAMETERS_V3
   2128  1.1  riastrad {
   2129  1.1  riastrad   USHORT usPixelClock;
   2130  1.1  riastrad   UCHAR  ucDVOConfig;
   2131  1.1  riastrad   UCHAR  ucAction;														//ATOM_ENABLE/ATOM_DISABLE/ATOM_HPD_INIT
   2132  1.1  riastrad   UCHAR  ucReseved[4];
   2133  1.1  riastrad }DVO_ENCODER_CONTROL_PARAMETERS_V3;
   2134  1.1  riastrad #define DVO_ENCODER_CONTROL_PS_ALLOCATION_V3	DVO_ENCODER_CONTROL_PARAMETERS_V3
   2135  1.1  riastrad 
   2136  1.1  riastrad typedef struct _DVO_ENCODER_CONTROL_PARAMETERS_V1_4
   2137  1.1  riastrad {
   2138  1.1  riastrad   USHORT usPixelClock;
   2139  1.1  riastrad   UCHAR  ucDVOConfig;
   2140  1.1  riastrad   UCHAR  ucAction;														//ATOM_ENABLE/ATOM_DISABLE/ATOM_HPD_INIT
   2141  1.1  riastrad   UCHAR  ucBitPerColor;                       //please refer to definition of PANEL_xBIT_PER_COLOR
   2142  1.1  riastrad   UCHAR  ucReseved[3];
   2143  1.1  riastrad }DVO_ENCODER_CONTROL_PARAMETERS_V1_4;
   2144  1.1  riastrad #define DVO_ENCODER_CONTROL_PS_ALLOCATION_V1_4	DVO_ENCODER_CONTROL_PARAMETERS_V1_4
   2145  1.1  riastrad 
   2146  1.1  riastrad 
   2147  1.1  riastrad //ucTableFormatRevision=1
   2148  1.1  riastrad //ucTableContentRevision=3 structure is not changed but usMisc add bit 1 as another input for
   2149  1.1  riastrad // bit1=0: non-coherent mode
   2150  1.1  riastrad //     =1: coherent mode
   2151  1.1  riastrad 
   2152  1.1  riastrad //==========================================================================================
   2153  1.1  riastrad //Only change is here next time when changing encoder parameter definitions again!
   2154  1.1  riastrad #define LVDS_ENCODER_CONTROL_PARAMETERS_LAST     LVDS_ENCODER_CONTROL_PARAMETERS_V3
   2155  1.1  riastrad #define LVDS_ENCODER_CONTROL_PS_ALLOCATION_LAST  LVDS_ENCODER_CONTROL_PARAMETERS_LAST
   2156  1.1  riastrad 
   2157  1.1  riastrad #define TMDS1_ENCODER_CONTROL_PARAMETERS_LAST    LVDS_ENCODER_CONTROL_PARAMETERS_V3
   2158  1.1  riastrad #define TMDS1_ENCODER_CONTROL_PS_ALLOCATION_LAST TMDS1_ENCODER_CONTROL_PARAMETERS_LAST
   2159  1.1  riastrad 
   2160  1.1  riastrad #define TMDS2_ENCODER_CONTROL_PARAMETERS_LAST    LVDS_ENCODER_CONTROL_PARAMETERS_V3
   2161  1.1  riastrad #define TMDS2_ENCODER_CONTROL_PS_ALLOCATION_LAST TMDS2_ENCODER_CONTROL_PARAMETERS_LAST
   2162  1.1  riastrad 
   2163  1.1  riastrad #define DVO_ENCODER_CONTROL_PARAMETERS_LAST      DVO_ENCODER_CONTROL_PARAMETERS
   2164  1.1  riastrad #define DVO_ENCODER_CONTROL_PS_ALLOCATION_LAST   DVO_ENCODER_CONTROL_PS_ALLOCATION
   2165  1.1  riastrad 
   2166  1.1  riastrad //==========================================================================================
   2167  1.1  riastrad #define PANEL_ENCODER_MISC_DUAL                0x01
   2168  1.1  riastrad #define PANEL_ENCODER_MISC_COHERENT            0x02
   2169  1.1  riastrad #define	PANEL_ENCODER_MISC_TMDS_LINKB					 0x04
   2170  1.1  riastrad #define	PANEL_ENCODER_MISC_HDMI_TYPE					 0x08
   2171  1.1  riastrad 
   2172  1.1  riastrad #define PANEL_ENCODER_ACTION_DISABLE           ATOM_DISABLE
   2173  1.1  riastrad #define PANEL_ENCODER_ACTION_ENABLE            ATOM_ENABLE
   2174  1.1  riastrad #define PANEL_ENCODER_ACTION_COHERENTSEQ       (ATOM_ENABLE+1)
   2175  1.1  riastrad 
   2176  1.1  riastrad #define PANEL_ENCODER_TRUNCATE_EN              0x01
   2177  1.1  riastrad #define PANEL_ENCODER_TRUNCATE_DEPTH           0x10
   2178  1.1  riastrad #define PANEL_ENCODER_SPATIAL_DITHER_EN        0x01
   2179  1.1  riastrad #define PANEL_ENCODER_SPATIAL_DITHER_DEPTH     0x10
   2180  1.1  riastrad #define PANEL_ENCODER_TEMPORAL_DITHER_EN       0x01
   2181  1.1  riastrad #define PANEL_ENCODER_TEMPORAL_DITHER_DEPTH    0x10
   2182  1.1  riastrad #define PANEL_ENCODER_TEMPORAL_LEVEL_4         0x20
   2183  1.1  riastrad #define PANEL_ENCODER_25FRC_MASK               0x10
   2184  1.1  riastrad #define PANEL_ENCODER_25FRC_E                  0x00
   2185  1.1  riastrad #define PANEL_ENCODER_25FRC_F                  0x10
   2186  1.1  riastrad #define PANEL_ENCODER_50FRC_MASK               0x60
   2187  1.1  riastrad #define PANEL_ENCODER_50FRC_A                  0x00
   2188  1.1  riastrad #define PANEL_ENCODER_50FRC_B                  0x20
   2189  1.1  riastrad #define PANEL_ENCODER_50FRC_C                  0x40
   2190  1.1  riastrad #define PANEL_ENCODER_50FRC_D                  0x60
   2191  1.1  riastrad #define PANEL_ENCODER_75FRC_MASK               0x80
   2192  1.1  riastrad #define PANEL_ENCODER_75FRC_E                  0x00
   2193  1.1  riastrad #define PANEL_ENCODER_75FRC_F                  0x80
   2194  1.1  riastrad 
   2195  1.1  riastrad /****************************************************************************/
   2196  1.1  riastrad // Structures used by SetVoltageTable
   2197  1.1  riastrad /****************************************************************************/
   2198  1.1  riastrad #define SET_VOLTAGE_TYPE_ASIC_VDDC             1
   2199  1.1  riastrad #define SET_VOLTAGE_TYPE_ASIC_MVDDC            2
   2200  1.1  riastrad #define SET_VOLTAGE_TYPE_ASIC_MVDDQ            3
   2201  1.1  riastrad #define SET_VOLTAGE_TYPE_ASIC_VDDCI            4
   2202  1.1  riastrad #define SET_VOLTAGE_INIT_MODE                  5
   2203  1.1  riastrad #define SET_VOLTAGE_GET_MAX_VOLTAGE            6					//Gets the Max. voltage for the soldered Asic
   2204  1.1  riastrad 
   2205  1.1  riastrad #define SET_ASIC_VOLTAGE_MODE_ALL_SOURCE       0x1
   2206  1.1  riastrad #define SET_ASIC_VOLTAGE_MODE_SOURCE_A         0x2
   2207  1.1  riastrad #define SET_ASIC_VOLTAGE_MODE_SOURCE_B         0x4
   2208  1.1  riastrad 
   2209  1.1  riastrad #define	SET_ASIC_VOLTAGE_MODE_SET_VOLTAGE      0x0
   2210  1.1  riastrad #define	SET_ASIC_VOLTAGE_MODE_GET_GPIOVAL      0x1
   2211  1.1  riastrad #define	SET_ASIC_VOLTAGE_MODE_GET_GPIOMASK     0x2
   2212  1.1  riastrad 
   2213  1.1  riastrad typedef struct	_SET_VOLTAGE_PARAMETERS
   2214  1.1  riastrad {
   2215  1.1  riastrad   UCHAR    ucVoltageType;               // To tell which voltage to set up, VDDC/MVDDC/MVDDQ
   2216  1.1  riastrad   UCHAR    ucVoltageMode;               // To set all, to set source A or source B or ...
   2217  1.1  riastrad   UCHAR    ucVoltageIndex;              // An index to tell which voltage level
   2218  1.1  riastrad   UCHAR    ucReserved;
   2219  1.1  riastrad }SET_VOLTAGE_PARAMETERS;
   2220  1.1  riastrad 
   2221  1.1  riastrad typedef struct	_SET_VOLTAGE_PARAMETERS_V2
   2222  1.1  riastrad {
   2223  1.1  riastrad   UCHAR    ucVoltageType;               // To tell which voltage to set up, VDDC/MVDDC/MVDDQ
   2224  1.1  riastrad   UCHAR    ucVoltageMode;               // Not used, maybe use for state machine for differen power mode
   2225  1.1  riastrad   USHORT   usVoltageLevel;              // real voltage level
   2226  1.1  riastrad }SET_VOLTAGE_PARAMETERS_V2;
   2227  1.1  riastrad 
   2228  1.1  riastrad // used by both SetVoltageTable v1.3 and v1.4
   2229  1.1  riastrad typedef struct	_SET_VOLTAGE_PARAMETERS_V1_3
   2230  1.1  riastrad {
   2231  1.1  riastrad   UCHAR    ucVoltageType;               // To tell which voltage to set up, VDDC/MVDDC/MVDDQ/VDDCI
   2232  1.1  riastrad   UCHAR    ucVoltageMode;               // Indicate action: Set voltage level
   2233  1.1  riastrad   USHORT   usVoltageLevel;              // real voltage level in unit of mv or Voltage Phase (0, 1, 2, .. )
   2234  1.1  riastrad }SET_VOLTAGE_PARAMETERS_V1_3;
   2235  1.1  riastrad 
   2236  1.1  riastrad //ucVoltageType
   2237  1.1  riastrad #define VOLTAGE_TYPE_VDDC                    1
   2238  1.1  riastrad #define VOLTAGE_TYPE_MVDDC                   2
   2239  1.1  riastrad #define VOLTAGE_TYPE_MVDDQ                   3
   2240  1.1  riastrad #define VOLTAGE_TYPE_VDDCI                   4
   2241  1.1  riastrad 
   2242  1.1  riastrad //SET_VOLTAGE_PARAMETERS_V3.ucVoltageMode
   2243  1.1  riastrad #define ATOM_SET_VOLTAGE                     0        //Set voltage Level
   2244  1.1  riastrad #define ATOM_INIT_VOLTAGE_REGULATOR          3        //Init Regulator
   2245  1.1  riastrad #define ATOM_SET_VOLTAGE_PHASE               4        //Set Vregulator Phase, only for SVID/PVID regulator
   2246  1.1  riastrad #define ATOM_GET_MAX_VOLTAGE                 6        //Get Max Voltage, not used from SetVoltageTable v1.3
   2247  1.1  riastrad #define ATOM_GET_VOLTAGE_LEVEL               6        //Get Voltage level from vitual voltage ID, not used for SetVoltage v1.4
   2248  1.1  riastrad #define ATOM_GET_LEAKAGE_ID                  8        //Get Leakage Voltage Id ( starting from SMU7x IP ), SetVoltage v1.4
   2249  1.1  riastrad 
   2250  1.1  riastrad // define vitual voltage id in usVoltageLevel
   2251  1.1  riastrad #define ATOM_VIRTUAL_VOLTAGE_ID0             0xff01
   2252  1.1  riastrad #define ATOM_VIRTUAL_VOLTAGE_ID1             0xff02
   2253  1.1  riastrad #define ATOM_VIRTUAL_VOLTAGE_ID2             0xff03
   2254  1.1  riastrad #define ATOM_VIRTUAL_VOLTAGE_ID3             0xff04
   2255  1.1  riastrad #define ATOM_VIRTUAL_VOLTAGE_ID4             0xff05
   2256  1.1  riastrad #define ATOM_VIRTUAL_VOLTAGE_ID5             0xff06
   2257  1.1  riastrad #define ATOM_VIRTUAL_VOLTAGE_ID6             0xff07
   2258  1.1  riastrad #define ATOM_VIRTUAL_VOLTAGE_ID7             0xff08
   2259  1.1  riastrad 
   2260  1.1  riastrad typedef struct _SET_VOLTAGE_PS_ALLOCATION
   2261  1.1  riastrad {
   2262  1.1  riastrad   SET_VOLTAGE_PARAMETERS sASICSetVoltage;
   2263  1.1  riastrad   WRITE_ONE_BYTE_HW_I2C_DATA_PS_ALLOCATION sReserved;
   2264  1.1  riastrad }SET_VOLTAGE_PS_ALLOCATION;
   2265  1.1  riastrad 
   2266  1.1  riastrad // New Added from SI for GetVoltageInfoTable, input parameter structure
   2267  1.1  riastrad typedef struct  _GET_VOLTAGE_INFO_INPUT_PARAMETER_V1_1
   2268  1.1  riastrad {
   2269  1.1  riastrad   UCHAR    ucVoltageType;               // Input: To tell which voltage to set up, VDDC/MVDDC/MVDDQ/VDDCI
   2270  1.1  riastrad   UCHAR    ucVoltageMode;               // Input: Indicate action: Get voltage info
   2271  1.1  riastrad   USHORT   usVoltageLevel;              // Input: real voltage level in unit of mv or Voltage Phase (0, 1, 2, .. ) or Leakage Id
   2272  1.1  riastrad   ULONG    ulReserved;
   2273  1.1  riastrad }GET_VOLTAGE_INFO_INPUT_PARAMETER_V1_1;
   2274  1.1  riastrad 
   2275  1.1  riastrad // New Added from SI for GetVoltageInfoTable, output parameter structure when ucVotlageMode == ATOM_GET_VOLTAGE_VID
   2276  1.1  riastrad typedef struct  _GET_VOLTAGE_INFO_OUTPUT_PARAMETER_V1_1
   2277  1.1  riastrad {
   2278  1.1  riastrad   ULONG    ulVotlageGpioState;
   2279  1.1  riastrad   ULONG    ulVoltageGPioMask;
   2280  1.1  riastrad }GET_VOLTAGE_INFO_OUTPUT_PARAMETER_V1_1;
   2281  1.1  riastrad 
   2282  1.1  riastrad // New Added from SI for GetVoltageInfoTable, output parameter structure when ucVotlageMode == ATOM_GET_VOLTAGE_STATEx_LEAKAGE_VID
   2283  1.1  riastrad typedef struct  _GET_LEAKAGE_VOLTAGE_INFO_OUTPUT_PARAMETER_V1_1
   2284  1.1  riastrad {
   2285  1.1  riastrad   USHORT   usVoltageLevel;
   2286  1.1  riastrad   USHORT   usVoltageId;                                  // Voltage Id programmed in Voltage Regulator
   2287  1.1  riastrad   ULONG    ulReseved;
   2288  1.1  riastrad }GET_LEAKAGE_VOLTAGE_INFO_OUTPUT_PARAMETER_V1_1;
   2289  1.1  riastrad 
   2290  1.1  riastrad 
   2291  1.1  riastrad // GetVoltageInfo v1.1 ucVoltageMode
   2292  1.1  riastrad #define	ATOM_GET_VOLTAGE_VID                0x00
   2293  1.1  riastrad #define ATOM_GET_VOTLAGE_INIT_SEQ           0x03
   2294  1.1  riastrad #define ATOM_GET_VOLTTAGE_PHASE_PHASE_VID   0x04
   2295  1.1  riastrad #define ATOM_GET_VOLTAGE_SVID2              0x07        //Get SVI2 Regulator Info
   2296  1.1  riastrad 
   2297  1.1  riastrad // for SI, this state map to 0xff02 voltage state in Power Play table, which is power boost state
   2298  1.1  riastrad #define ATOM_GET_VOLTAGE_STATE0_LEAKAGE_VID 0x10
   2299  1.1  riastrad // for SI, this state map to 0xff01 voltage state in Power Play table, which is performance state
   2300  1.1  riastrad #define	ATOM_GET_VOLTAGE_STATE1_LEAKAGE_VID 0x11
   2301  1.1  riastrad 
   2302  1.1  riastrad #define	ATOM_GET_VOLTAGE_STATE2_LEAKAGE_VID 0x12
   2303  1.1  riastrad #define	ATOM_GET_VOLTAGE_STATE3_LEAKAGE_VID 0x13
   2304  1.1  riastrad 
   2305  1.1  riastrad // New Added from CI Hawaii for GetVoltageInfoTable, input parameter structure
   2306  1.1  riastrad typedef struct  _GET_VOLTAGE_INFO_INPUT_PARAMETER_V1_2
   2307  1.1  riastrad {
   2308  1.1  riastrad   UCHAR    ucVoltageType;               // Input: To tell which voltage to set up, VDDC/MVDDC/MVDDQ/VDDCI
   2309  1.1  riastrad   UCHAR    ucVoltageMode;               // Input: Indicate action: Get voltage info
   2310  1.1  riastrad   USHORT   usVoltageLevel;              // Input: real voltage level in unit of mv or Voltage Phase (0, 1, 2, .. ) or Leakage Id
   2311  1.1  riastrad   ULONG    ulSCLKFreq;                  // Input: when ucVoltageMode= ATOM_GET_VOLTAGE_EVV_VOLTAGE, DPM state SCLK frequency, Define in PPTable SCLK/Voltage dependence table
   2312  1.1  riastrad }GET_VOLTAGE_INFO_INPUT_PARAMETER_V1_2;
   2313  1.1  riastrad 
   2314  1.1  riastrad // New in GetVoltageInfo v1.2 ucVoltageMode
   2315  1.1  riastrad #define ATOM_GET_VOLTAGE_EVV_VOLTAGE        0x09
   2316  1.1  riastrad 
   2317  1.1  riastrad // New Added from CI Hawaii for EVV feature
   2318  1.1  riastrad typedef struct  _GET_EVV_VOLTAGE_INFO_OUTPUT_PARAMETER_V1_2
   2319  1.1  riastrad {
   2320  1.1  riastrad   USHORT   usVoltageLevel;                               // real voltage level in unit of mv
   2321  1.1  riastrad   USHORT   usVoltageId;                                  // Voltage Id programmed in Voltage Regulator
   2322  1.1  riastrad   ULONG    ulReseved;
   2323  1.1  riastrad }GET_EVV_VOLTAGE_INFO_OUTPUT_PARAMETER_V1_2;
   2324  1.1  riastrad 
   2325  1.1  riastrad /****************************************************************************/
   2326  1.1  riastrad // Structures used by TVEncoderControlTable
   2327  1.1  riastrad /****************************************************************************/
   2328  1.1  riastrad typedef struct _TV_ENCODER_CONTROL_PARAMETERS
   2329  1.1  riastrad {
   2330  1.1  riastrad   USHORT usPixelClock;                // in 10KHz; for bios convenient
   2331  1.1  riastrad   UCHAR  ucTvStandard;                // See definition "ATOM_TV_NTSC ..."
   2332  1.1  riastrad   UCHAR  ucAction;                    // 0: turn off encoder
   2333  1.1  riastrad                                       // 1: setup and turn on encoder
   2334  1.1  riastrad }TV_ENCODER_CONTROL_PARAMETERS;
   2335  1.1  riastrad 
   2336  1.1  riastrad typedef struct _TV_ENCODER_CONTROL_PS_ALLOCATION
   2337  1.1  riastrad {
   2338  1.1  riastrad   TV_ENCODER_CONTROL_PARAMETERS sTVEncoder;
   2339  1.1  riastrad   WRITE_ONE_BYTE_HW_I2C_DATA_PS_ALLOCATION    sReserved; // Don't set this one
   2340  1.1  riastrad }TV_ENCODER_CONTROL_PS_ALLOCATION;
   2341  1.1  riastrad 
   2342  1.1  riastrad //==============================Data Table Portion====================================
   2343  1.1  riastrad 
   2344  1.1  riastrad /****************************************************************************/
   2345  1.1  riastrad // Structure used in Data.mtb
   2346  1.1  riastrad /****************************************************************************/
   2347  1.1  riastrad typedef struct _ATOM_MASTER_LIST_OF_DATA_TABLES
   2348  1.1  riastrad {
   2349  1.1  riastrad   USHORT        UtilityPipeLine;	        // Offest for the utility to get parser info,Don't change this position!
   2350  1.1  riastrad   USHORT        MultimediaCapabilityInfo; // Only used by MM Lib,latest version 1.1, not configuable from Bios, need to include the table to build Bios
   2351  1.1  riastrad   USHORT        MultimediaConfigInfo;     // Only used by MM Lib,latest version 2.1, not configuable from Bios, need to include the table to build Bios
   2352  1.1  riastrad   USHORT        StandardVESA_Timing;      // Only used by Bios
   2353  1.1  riastrad   USHORT        FirmwareInfo;             // Shared by various SW components,latest version 1.4
   2354  1.1  riastrad   USHORT        PaletteData;              // Only used by BIOS
   2355  1.1  riastrad   USHORT        LCD_Info;                 // Shared by various SW components,latest version 1.3, was called LVDS_Info
   2356  1.1  riastrad   USHORT        DIGTransmitterInfo;       // Internal used by VBIOS only version 3.1
   2357  1.1  riastrad   USHORT        AnalogTV_Info;            // Shared by various SW components,latest version 1.1
   2358  1.1  riastrad   USHORT        SupportedDevicesInfo;     // Will be obsolete from R600
   2359  1.1  riastrad   USHORT        GPIO_I2C_Info;            // Shared by various SW components,latest version 1.2 will be used from R600
   2360  1.1  riastrad   USHORT        VRAM_UsageByFirmware;     // Shared by various SW components,latest version 1.3 will be used from R600
   2361  1.1  riastrad   USHORT        GPIO_Pin_LUT;             // Shared by various SW components,latest version 1.1
   2362  1.1  riastrad   USHORT        VESA_ToInternalModeLUT;   // Only used by Bios
   2363  1.1  riastrad   USHORT        ComponentVideoInfo;       // Shared by various SW components,latest version 2.1 will be used from R600
   2364  1.1  riastrad   USHORT        PowerPlayInfo;            // Shared by various SW components,latest version 2.1,new design from R600
   2365  1.1  riastrad   USHORT        CompassionateData;        // Will be obsolete from R600
   2366  1.1  riastrad   USHORT        SaveRestoreInfo;          // Only used by Bios
   2367  1.1  riastrad   USHORT        PPLL_SS_Info;             // Shared by various SW components,latest version 1.2, used to call SS_Info, change to new name because of int ASIC SS info
   2368  1.1  riastrad   USHORT        OemInfo;                  // Defined and used by external SW, should be obsolete soon
   2369  1.1  riastrad   USHORT        XTMDS_Info;               // Will be obsolete from R600
   2370  1.1  riastrad   USHORT        MclkSS_Info;              // Shared by various SW components,latest version 1.1, only enabled when ext SS chip is used
   2371  1.1  riastrad   USHORT        Object_Header;            // Shared by various SW components,latest version 1.1
   2372  1.1  riastrad   USHORT        IndirectIOAccess;         // Only used by Bios,this table position can't change at all!!
   2373  1.1  riastrad   USHORT        MC_InitParameter;         // Only used by command table
   2374  1.1  riastrad   USHORT        ASIC_VDDC_Info;						// Will be obsolete from R600
   2375  1.1  riastrad   USHORT        ASIC_InternalSS_Info;			// New tabel name from R600, used to be called "ASIC_MVDDC_Info"
   2376  1.1  riastrad   USHORT        TV_VideoMode;							// Only used by command table
   2377  1.1  riastrad   USHORT        VRAM_Info;								// Only used by command table, latest version 1.3
   2378  1.1  riastrad   USHORT        MemoryTrainingInfo;				// Used for VBIOS and Diag utility for memory training purpose since R600. the new table rev start from 2.1
   2379  1.1  riastrad   USHORT        IntegratedSystemInfo;			// Shared by various SW components
   2380  1.1  riastrad   USHORT        ASIC_ProfilingInfo;				// New table name from R600, used to be called "ASIC_VDDCI_Info" for pre-R600
   2381  1.1  riastrad   USHORT        VoltageObjectInfo;				// Shared by various SW components, latest version 1.1
   2382  1.1  riastrad 	USHORT				PowerSourceInfo;					// Shared by various SW components, latest versoin 1.1
   2383  1.1  riastrad }ATOM_MASTER_LIST_OF_DATA_TABLES;
   2384  1.1  riastrad 
   2385  1.1  riastrad typedef struct _ATOM_MASTER_DATA_TABLE
   2386  1.1  riastrad {
   2387  1.1  riastrad   ATOM_COMMON_TABLE_HEADER sHeader;
   2388  1.1  riastrad   ATOM_MASTER_LIST_OF_DATA_TABLES   ListOfDataTables;
   2389  1.1  riastrad }ATOM_MASTER_DATA_TABLE;
   2390  1.1  riastrad 
   2391  1.1  riastrad // For backward compatible
   2392  1.1  riastrad #define LVDS_Info                LCD_Info
   2393  1.1  riastrad #define DAC_Info                 PaletteData
   2394  1.1  riastrad #define TMDS_Info                DIGTransmitterInfo
   2395  1.1  riastrad 
   2396  1.1  riastrad /****************************************************************************/
   2397  1.1  riastrad // Structure used in MultimediaCapabilityInfoTable
   2398  1.1  riastrad /****************************************************************************/
   2399  1.1  riastrad typedef struct _ATOM_MULTIMEDIA_CAPABILITY_INFO
   2400  1.1  riastrad {
   2401  1.1  riastrad   ATOM_COMMON_TABLE_HEADER sHeader;
   2402  1.1  riastrad   ULONG                    ulSignature;      // HW info table signature string "$ATI"
   2403  1.1  riastrad   UCHAR                    ucI2C_Type;       // I2C type (normal GP_IO, ImpactTV GP_IO, Dedicated I2C pin, etc)
   2404  1.1  riastrad   UCHAR                    ucTV_OutInfo;     // Type of TV out supported (3:0) and video out crystal frequency (6:4) and TV data port (7)
   2405  1.1  riastrad   UCHAR                    ucVideoPortInfo;  // Provides the video port capabilities
   2406  1.1  riastrad   UCHAR                    ucHostPortInfo;   // Provides host port configuration information
   2407  1.1  riastrad }ATOM_MULTIMEDIA_CAPABILITY_INFO;
   2408  1.1  riastrad 
   2409  1.1  riastrad /****************************************************************************/
   2410  1.1  riastrad // Structure used in MultimediaConfigInfoTable
   2411  1.1  riastrad /****************************************************************************/
   2412  1.1  riastrad typedef struct _ATOM_MULTIMEDIA_CONFIG_INFO
   2413  1.1  riastrad {
   2414  1.1  riastrad   ATOM_COMMON_TABLE_HEADER sHeader;
   2415  1.1  riastrad   ULONG                    ulSignature;      // MM info table signature sting "$MMT"
   2416  1.1  riastrad   UCHAR                    ucTunerInfo;      // Type of tuner installed on the adapter (4:0) and video input for tuner (7:5)
   2417  1.1  riastrad   UCHAR                    ucAudioChipInfo;  // List the audio chip type (3:0) product type (4) and OEM revision (7:5)
   2418  1.1  riastrad   UCHAR                    ucProductID;      // Defines as OEM ID or ATI board ID dependent on product type setting
   2419  1.1  riastrad   UCHAR                    ucMiscInfo1;      // Tuner voltage (1:0) HW teletext support (3:2) FM audio decoder (5:4) reserved (6) audio scrambling (7)
   2420  1.1  riastrad   UCHAR                    ucMiscInfo2;      // I2S input config (0) I2S output config (1) I2S Audio Chip (4:2) SPDIF Output Config (5) reserved (7:6)
   2421  1.1  riastrad   UCHAR                    ucMiscInfo3;      // Video Decoder Type (3:0) Video In Standard/Crystal (7:4)
   2422  1.1  riastrad   UCHAR                    ucMiscInfo4;      // Video Decoder Host Config (2:0) reserved (7:3)
   2423  1.1  riastrad   UCHAR                    ucVideoInput0Info;// Video Input 0 Type (1:0) F/B setting (2) physical connector ID (5:3) reserved (7:6)
   2424  1.1  riastrad   UCHAR                    ucVideoInput1Info;// Video Input 1 Type (1:0) F/B setting (2) physical connector ID (5:3) reserved (7:6)
   2425  1.1  riastrad   UCHAR                    ucVideoInput2Info;// Video Input 2 Type (1:0) F/B setting (2) physical connector ID (5:3) reserved (7:6)
   2426  1.1  riastrad   UCHAR                    ucVideoInput3Info;// Video Input 3 Type (1:0) F/B setting (2) physical connector ID (5:3) reserved (7:6)
   2427  1.1  riastrad   UCHAR                    ucVideoInput4Info;// Video Input 4 Type (1:0) F/B setting (2) physical connector ID (5:3) reserved (7:6)
   2428  1.1  riastrad }ATOM_MULTIMEDIA_CONFIG_INFO;
   2429  1.1  riastrad 
   2430  1.1  riastrad 
   2431  1.1  riastrad /****************************************************************************/
   2432  1.1  riastrad // Structures used in FirmwareInfoTable
   2433  1.1  riastrad /****************************************************************************/
   2434  1.1  riastrad 
   2435  1.1  riastrad // usBIOSCapability Definition:
   2436  1.1  riastrad // Bit 0 = 0: Bios image is not Posted, =1:Bios image is Posted;
   2437  1.1  riastrad // Bit 1 = 0: Dual CRTC is not supported, =1: Dual CRTC is supported;
   2438  1.1  riastrad // Bit 2 = 0: Extended Desktop is not supported, =1: Extended Desktop is supported;
   2439  1.1  riastrad // Others: Reserved
   2440  1.1  riastrad #define ATOM_BIOS_INFO_ATOM_FIRMWARE_POSTED         0x0001
   2441  1.1  riastrad #define ATOM_BIOS_INFO_DUAL_CRTC_SUPPORT            0x0002
   2442  1.1  riastrad #define ATOM_BIOS_INFO_EXTENDED_DESKTOP_SUPPORT     0x0004
   2443  1.1  riastrad #define ATOM_BIOS_INFO_MEMORY_CLOCK_SS_SUPPORT      0x0008		// (valid from v1.1 ~v1.4):=1: memclk SS enable, =0 memclk SS disable.
   2444  1.1  riastrad #define ATOM_BIOS_INFO_ENGINE_CLOCK_SS_SUPPORT      0x0010		// (valid from v1.1 ~v1.4):=1: engclk SS enable, =0 engclk SS disable.
   2445  1.1  riastrad #define ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU         0x0020
   2446  1.1  riastrad #define ATOM_BIOS_INFO_WMI_SUPPORT                  0x0040
   2447  1.1  riastrad #define ATOM_BIOS_INFO_PPMODE_ASSIGNGED_BY_SYSTEM   0x0080
   2448  1.1  riastrad #define ATOM_BIOS_INFO_HYPERMEMORY_SUPPORT          0x0100
   2449  1.1  riastrad #define ATOM_BIOS_INFO_HYPERMEMORY_SIZE_MASK        0x1E00
   2450  1.1  riastrad #define ATOM_BIOS_INFO_VPOST_WITHOUT_FIRST_MODE_SET 0x2000
   2451  1.1  riastrad #define ATOM_BIOS_INFO_BIOS_SCRATCH6_SCL2_REDEFINE  0x4000
   2452  1.1  riastrad #define ATOM_BIOS_INFO_MEMORY_CLOCK_EXT_SS_SUPPORT  0x0008		// (valid from v2.1 ): =1: memclk ss enable with external ss chip
   2453  1.1  riastrad #define ATOM_BIOS_INFO_ENGINE_CLOCK_EXT_SS_SUPPORT  0x0010		// (valid from v2.1 ): =1: engclk ss enable with external ss chip
   2454  1.1  riastrad 
   2455  1.1  riastrad #ifndef _H2INC
   2456  1.1  riastrad 
   2457  1.1  riastrad //Please don't add or expand this bitfield structure below, this one will retire soon.!
   2458  1.1  riastrad typedef struct _ATOM_FIRMWARE_CAPABILITY
   2459  1.1  riastrad {
   2460  1.1  riastrad #if ATOM_BIG_ENDIAN
   2461  1.1  riastrad   USHORT Reserved:1;
   2462  1.1  riastrad   USHORT SCL2Redefined:1;
   2463  1.1  riastrad   USHORT PostWithoutModeSet:1;
   2464  1.1  riastrad   USHORT HyperMemory_Size:4;
   2465  1.1  riastrad   USHORT HyperMemory_Support:1;
   2466  1.1  riastrad   USHORT PPMode_Assigned:1;
   2467  1.1  riastrad   USHORT WMI_SUPPORT:1;
   2468  1.1  riastrad   USHORT GPUControlsBL:1;
   2469  1.1  riastrad   USHORT EngineClockSS_Support:1;
   2470  1.1  riastrad   USHORT MemoryClockSS_Support:1;
   2471  1.1  riastrad   USHORT ExtendedDesktopSupport:1;
   2472  1.1  riastrad   USHORT DualCRTC_Support:1;
   2473  1.1  riastrad   USHORT FirmwarePosted:1;
   2474  1.1  riastrad #else
   2475  1.1  riastrad   USHORT FirmwarePosted:1;
   2476  1.1  riastrad   USHORT DualCRTC_Support:1;
   2477  1.1  riastrad   USHORT ExtendedDesktopSupport:1;
   2478  1.1  riastrad   USHORT MemoryClockSS_Support:1;
   2479  1.1  riastrad   USHORT EngineClockSS_Support:1;
   2480  1.1  riastrad   USHORT GPUControlsBL:1;
   2481  1.1  riastrad   USHORT WMI_SUPPORT:1;
   2482  1.1  riastrad   USHORT PPMode_Assigned:1;
   2483  1.1  riastrad   USHORT HyperMemory_Support:1;
   2484  1.1  riastrad   USHORT HyperMemory_Size:4;
   2485  1.1  riastrad   USHORT PostWithoutModeSet:1;
   2486  1.1  riastrad   USHORT SCL2Redefined:1;
   2487  1.1  riastrad   USHORT Reserved:1;
   2488  1.1  riastrad #endif
   2489  1.1  riastrad }ATOM_FIRMWARE_CAPABILITY;
   2490  1.1  riastrad 
   2491  1.1  riastrad typedef union _ATOM_FIRMWARE_CAPABILITY_ACCESS
   2492  1.1  riastrad {
   2493  1.1  riastrad   ATOM_FIRMWARE_CAPABILITY sbfAccess;
   2494  1.1  riastrad   USHORT                   susAccess;
   2495  1.1  riastrad }ATOM_FIRMWARE_CAPABILITY_ACCESS;
   2496  1.1  riastrad 
   2497  1.1  riastrad #else
   2498  1.1  riastrad 
   2499  1.1  riastrad typedef union _ATOM_FIRMWARE_CAPABILITY_ACCESS
   2500  1.1  riastrad {
   2501  1.1  riastrad   USHORT                   susAccess;
   2502  1.1  riastrad }ATOM_FIRMWARE_CAPABILITY_ACCESS;
   2503  1.1  riastrad 
   2504  1.1  riastrad #endif
   2505  1.1  riastrad 
   2506  1.1  riastrad typedef struct _ATOM_FIRMWARE_INFO
   2507  1.1  riastrad {
   2508  1.1  riastrad   ATOM_COMMON_TABLE_HEADER        sHeader;
   2509  1.1  riastrad   ULONG                           ulFirmwareRevision;
   2510  1.1  riastrad   ULONG                           ulDefaultEngineClock;       //In 10Khz unit
   2511  1.1  riastrad   ULONG                           ulDefaultMemoryClock;       //In 10Khz unit
   2512  1.1  riastrad   ULONG                           ulDriverTargetEngineClock;  //In 10Khz unit
   2513  1.1  riastrad   ULONG                           ulDriverTargetMemoryClock;  //In 10Khz unit
   2514  1.1  riastrad   ULONG                           ulMaxEngineClockPLL_Output; //In 10Khz unit
   2515  1.1  riastrad   ULONG                           ulMaxMemoryClockPLL_Output; //In 10Khz unit
   2516  1.1  riastrad   ULONG                           ulMaxPixelClockPLL_Output;  //In 10Khz unit
   2517  1.1  riastrad   ULONG                           ulASICMaxEngineClock;       //In 10Khz unit
   2518  1.1  riastrad   ULONG                           ulASICMaxMemoryClock;       //In 10Khz unit
   2519  1.1  riastrad   UCHAR                           ucASICMaxTemperature;
   2520  1.1  riastrad   UCHAR                           ucPadding[3];               //Don't use them
   2521  1.1  riastrad   ULONG                           aulReservedForBIOS[3];      //Don't use them
   2522  1.1  riastrad   USHORT                          usMinEngineClockPLL_Input;  //In 10Khz unit
   2523  1.1  riastrad   USHORT                          usMaxEngineClockPLL_Input;  //In 10Khz unit
   2524  1.1  riastrad   USHORT                          usMinEngineClockPLL_Output; //In 10Khz unit
   2525  1.1  riastrad   USHORT                          usMinMemoryClockPLL_Input;  //In 10Khz unit
   2526  1.1  riastrad   USHORT                          usMaxMemoryClockPLL_Input;  //In 10Khz unit
   2527  1.1  riastrad   USHORT                          usMinMemoryClockPLL_Output; //In 10Khz unit
   2528  1.1  riastrad   USHORT                          usMaxPixelClock;            //In 10Khz unit, Max.  Pclk
   2529  1.1  riastrad   USHORT                          usMinPixelClockPLL_Input;   //In 10Khz unit
   2530  1.1  riastrad   USHORT                          usMaxPixelClockPLL_Input;   //In 10Khz unit
   2531  1.1  riastrad   USHORT                          usMinPixelClockPLL_Output;  //In 10Khz unit, the definitions above can't change!!!
   2532  1.1  riastrad   ATOM_FIRMWARE_CAPABILITY_ACCESS usFirmwareCapability;
   2533  1.1  riastrad   USHORT                          usReferenceClock;           //In 10Khz unit
   2534  1.1  riastrad   USHORT                          usPM_RTS_Location;          //RTS PM4 starting location in ROM in 1Kb unit
   2535  1.1  riastrad   UCHAR                           ucPM_RTS_StreamSize;        //RTS PM4 packets in Kb unit
   2536  1.1  riastrad   UCHAR                           ucDesign_ID;                //Indicate what is the board design
   2537  1.1  riastrad   UCHAR                           ucMemoryModule_ID;          //Indicate what is the board design
   2538  1.1  riastrad }ATOM_FIRMWARE_INFO;
   2539  1.1  riastrad 
   2540  1.1  riastrad typedef struct _ATOM_FIRMWARE_INFO_V1_2
   2541  1.1  riastrad {
   2542  1.1  riastrad   ATOM_COMMON_TABLE_HEADER        sHeader;
   2543  1.1  riastrad   ULONG                           ulFirmwareRevision;
   2544  1.1  riastrad   ULONG                           ulDefaultEngineClock;       //In 10Khz unit
   2545  1.1  riastrad   ULONG                           ulDefaultMemoryClock;       //In 10Khz unit
   2546  1.1  riastrad   ULONG                           ulDriverTargetEngineClock;  //In 10Khz unit
   2547  1.1  riastrad   ULONG                           ulDriverTargetMemoryClock;  //In 10Khz unit
   2548  1.1  riastrad   ULONG                           ulMaxEngineClockPLL_Output; //In 10Khz unit
   2549  1.1  riastrad   ULONG                           ulMaxMemoryClockPLL_Output; //In 10Khz unit
   2550  1.1  riastrad   ULONG                           ulMaxPixelClockPLL_Output;  //In 10Khz unit
   2551  1.1  riastrad   ULONG                           ulASICMaxEngineClock;       //In 10Khz unit
   2552  1.1  riastrad   ULONG                           ulASICMaxMemoryClock;       //In 10Khz unit
   2553  1.1  riastrad   UCHAR                           ucASICMaxTemperature;
   2554  1.1  riastrad   UCHAR                           ucMinAllowedBL_Level;
   2555  1.1  riastrad   UCHAR                           ucPadding[2];               //Don't use them
   2556  1.1  riastrad   ULONG                           aulReservedForBIOS[2];      //Don't use them
   2557  1.1  riastrad   ULONG                           ulMinPixelClockPLL_Output;  //In 10Khz unit
   2558  1.1  riastrad   USHORT                          usMinEngineClockPLL_Input;  //In 10Khz unit
   2559  1.1  riastrad   USHORT                          usMaxEngineClockPLL_Input;  //In 10Khz unit
   2560  1.1  riastrad   USHORT                          usMinEngineClockPLL_Output; //In 10Khz unit
   2561  1.1  riastrad   USHORT                          usMinMemoryClockPLL_Input;  //In 10Khz unit
   2562  1.1  riastrad   USHORT                          usMaxMemoryClockPLL_Input;  //In 10Khz unit
   2563  1.1  riastrad   USHORT                          usMinMemoryClockPLL_Output; //In 10Khz unit
   2564  1.1  riastrad   USHORT                          usMaxPixelClock;            //In 10Khz unit, Max.  Pclk
   2565  1.1  riastrad   USHORT                          usMinPixelClockPLL_Input;   //In 10Khz unit
   2566  1.1  riastrad   USHORT                          usMaxPixelClockPLL_Input;   //In 10Khz unit
   2567  1.1  riastrad   USHORT                          usMinPixelClockPLL_Output;  //In 10Khz unit - lower 16bit of ulMinPixelClockPLL_Output
   2568  1.1  riastrad   ATOM_FIRMWARE_CAPABILITY_ACCESS usFirmwareCapability;
   2569  1.1  riastrad   USHORT                          usReferenceClock;           //In 10Khz unit
   2570  1.1  riastrad   USHORT                          usPM_RTS_Location;          //RTS PM4 starting location in ROM in 1Kb unit
   2571  1.1  riastrad   UCHAR                           ucPM_RTS_StreamSize;        //RTS PM4 packets in Kb unit
   2572  1.1  riastrad   UCHAR                           ucDesign_ID;                //Indicate what is the board design
   2573  1.1  riastrad   UCHAR                           ucMemoryModule_ID;          //Indicate what is the board design
   2574  1.1  riastrad }ATOM_FIRMWARE_INFO_V1_2;
   2575  1.1  riastrad 
   2576  1.1  riastrad typedef struct _ATOM_FIRMWARE_INFO_V1_3
   2577  1.1  riastrad {
   2578  1.1  riastrad   ATOM_COMMON_TABLE_HEADER        sHeader;
   2579  1.1  riastrad   ULONG                           ulFirmwareRevision;
   2580  1.1  riastrad   ULONG                           ulDefaultEngineClock;       //In 10Khz unit
   2581  1.1  riastrad   ULONG                           ulDefaultMemoryClock;       //In 10Khz unit
   2582  1.1  riastrad   ULONG                           ulDriverTargetEngineClock;  //In 10Khz unit
   2583  1.1  riastrad   ULONG                           ulDriverTargetMemoryClock;  //In 10Khz unit
   2584  1.1  riastrad   ULONG                           ulMaxEngineClockPLL_Output; //In 10Khz unit
   2585  1.1  riastrad   ULONG                           ulMaxMemoryClockPLL_Output; //In 10Khz unit
   2586  1.1  riastrad   ULONG                           ulMaxPixelClockPLL_Output;  //In 10Khz unit
   2587  1.1  riastrad   ULONG                           ulASICMaxEngineClock;       //In 10Khz unit
   2588  1.1  riastrad   ULONG                           ulASICMaxMemoryClock;       //In 10Khz unit
   2589  1.1  riastrad   UCHAR                           ucASICMaxTemperature;
   2590  1.1  riastrad   UCHAR                           ucMinAllowedBL_Level;
   2591  1.1  riastrad   UCHAR                           ucPadding[2];               //Don't use them
   2592  1.1  riastrad   ULONG                           aulReservedForBIOS;         //Don't use them
   2593  1.1  riastrad   ULONG                           ul3DAccelerationEngineClock;//In 10Khz unit
   2594  1.1  riastrad   ULONG                           ulMinPixelClockPLL_Output;  //In 10Khz unit
   2595  1.1  riastrad   USHORT                          usMinEngineClockPLL_Input;  //In 10Khz unit
   2596  1.1  riastrad   USHORT                          usMaxEngineClockPLL_Input;  //In 10Khz unit
   2597  1.1  riastrad   USHORT                          usMinEngineClockPLL_Output; //In 10Khz unit
   2598  1.1  riastrad   USHORT                          usMinMemoryClockPLL_Input;  //In 10Khz unit
   2599  1.1  riastrad   USHORT                          usMaxMemoryClockPLL_Input;  //In 10Khz unit
   2600  1.1  riastrad   USHORT                          usMinMemoryClockPLL_Output; //In 10Khz unit
   2601  1.1  riastrad   USHORT                          usMaxPixelClock;            //In 10Khz unit, Max.  Pclk
   2602  1.1  riastrad   USHORT                          usMinPixelClockPLL_Input;   //In 10Khz unit
   2603  1.1  riastrad   USHORT                          usMaxPixelClockPLL_Input;   //In 10Khz unit
   2604  1.1  riastrad   USHORT                          usMinPixelClockPLL_Output;  //In 10Khz unit - lower 16bit of ulMinPixelClockPLL_Output
   2605  1.1  riastrad   ATOM_FIRMWARE_CAPABILITY_ACCESS usFirmwareCapability;
   2606  1.1  riastrad   USHORT                          usReferenceClock;           //In 10Khz unit
   2607  1.1  riastrad   USHORT                          usPM_RTS_Location;          //RTS PM4 starting location in ROM in 1Kb unit
   2608  1.1  riastrad   UCHAR                           ucPM_RTS_StreamSize;        //RTS PM4 packets in Kb unit
   2609  1.1  riastrad   UCHAR                           ucDesign_ID;                //Indicate what is the board design
   2610  1.1  riastrad   UCHAR                           ucMemoryModule_ID;          //Indicate what is the board design
   2611  1.1  riastrad }ATOM_FIRMWARE_INFO_V1_3;
   2612  1.1  riastrad 
   2613  1.1  riastrad typedef struct _ATOM_FIRMWARE_INFO_V1_4
   2614  1.1  riastrad {
   2615  1.1  riastrad   ATOM_COMMON_TABLE_HEADER        sHeader;
   2616  1.1  riastrad   ULONG                           ulFirmwareRevision;
   2617  1.1  riastrad   ULONG                           ulDefaultEngineClock;       //In 10Khz unit
   2618  1.1  riastrad   ULONG                           ulDefaultMemoryClock;       //In 10Khz unit
   2619  1.1  riastrad   ULONG                           ulDriverTargetEngineClock;  //In 10Khz unit
   2620  1.1  riastrad   ULONG                           ulDriverTargetMemoryClock;  //In 10Khz unit
   2621  1.1  riastrad   ULONG                           ulMaxEngineClockPLL_Output; //In 10Khz unit
   2622  1.1  riastrad   ULONG                           ulMaxMemoryClockPLL_Output; //In 10Khz unit
   2623  1.1  riastrad   ULONG                           ulMaxPixelClockPLL_Output;  //In 10Khz unit
   2624  1.1  riastrad   ULONG                           ulASICMaxEngineClock;       //In 10Khz unit
   2625  1.1  riastrad   ULONG                           ulASICMaxMemoryClock;       //In 10Khz unit
   2626  1.1  riastrad   UCHAR                           ucASICMaxTemperature;
   2627  1.1  riastrad   UCHAR                           ucMinAllowedBL_Level;
   2628  1.1  riastrad   USHORT                          usBootUpVDDCVoltage;        //In MV unit
   2629  1.1  riastrad   USHORT                          usLcdMinPixelClockPLL_Output; // In MHz unit
   2630  1.1  riastrad   USHORT                          usLcdMaxPixelClockPLL_Output; // In MHz unit
   2631  1.1  riastrad   ULONG                           ul3DAccelerationEngineClock;//In 10Khz unit
   2632  1.1  riastrad   ULONG                           ulMinPixelClockPLL_Output;  //In 10Khz unit
   2633  1.1  riastrad   USHORT                          usMinEngineClockPLL_Input;  //In 10Khz unit
   2634  1.1  riastrad   USHORT                          usMaxEngineClockPLL_Input;  //In 10Khz unit
   2635  1.1  riastrad   USHORT                          usMinEngineClockPLL_Output; //In 10Khz unit
   2636  1.1  riastrad   USHORT                          usMinMemoryClockPLL_Input;  //In 10Khz unit
   2637  1.1  riastrad   USHORT                          usMaxMemoryClockPLL_Input;  //In 10Khz unit
   2638  1.1  riastrad   USHORT                          usMinMemoryClockPLL_Output; //In 10Khz unit
   2639  1.1  riastrad   USHORT                          usMaxPixelClock;            //In 10Khz unit, Max.  Pclk
   2640  1.1  riastrad   USHORT                          usMinPixelClockPLL_Input;   //In 10Khz unit
   2641  1.1  riastrad   USHORT                          usMaxPixelClockPLL_Input;   //In 10Khz unit
   2642  1.1  riastrad   USHORT                          usMinPixelClockPLL_Output;  //In 10Khz unit - lower 16bit of ulMinPixelClockPLL_Output
   2643  1.1  riastrad   ATOM_FIRMWARE_CAPABILITY_ACCESS usFirmwareCapability;
   2644  1.1  riastrad   USHORT                          usReferenceClock;           //In 10Khz unit
   2645  1.1  riastrad   USHORT                          usPM_RTS_Location;          //RTS PM4 starting location in ROM in 1Kb unit
   2646  1.1  riastrad   UCHAR                           ucPM_RTS_StreamSize;        //RTS PM4 packets in Kb unit
   2647  1.1  riastrad   UCHAR                           ucDesign_ID;                //Indicate what is the board design
   2648  1.1  riastrad   UCHAR                           ucMemoryModule_ID;          //Indicate what is the board design
   2649  1.1  riastrad }ATOM_FIRMWARE_INFO_V1_4;
   2650  1.1  riastrad 
   2651  1.1  riastrad //the structure below to be used from Cypress
   2652  1.1  riastrad typedef struct _ATOM_FIRMWARE_INFO_V2_1
   2653  1.1  riastrad {
   2654  1.1  riastrad   ATOM_COMMON_TABLE_HEADER        sHeader;
   2655  1.1  riastrad   ULONG                           ulFirmwareRevision;
   2656  1.1  riastrad   ULONG                           ulDefaultEngineClock;       //In 10Khz unit
   2657  1.1  riastrad   ULONG                           ulDefaultMemoryClock;       //In 10Khz unit
   2658  1.1  riastrad   ULONG                           ulReserved1;
   2659  1.1  riastrad   ULONG                           ulReserved2;
   2660  1.1  riastrad   ULONG                           ulMaxEngineClockPLL_Output; //In 10Khz unit
   2661  1.1  riastrad   ULONG                           ulMaxMemoryClockPLL_Output; //In 10Khz unit
   2662  1.1  riastrad   ULONG                           ulMaxPixelClockPLL_Output;  //In 10Khz unit
   2663  1.1  riastrad   ULONG                           ulBinaryAlteredInfo;        //Was ulASICMaxEngineClock
   2664  1.1  riastrad   ULONG                           ulDefaultDispEngineClkFreq; //In 10Khz unit
   2665  1.1  riastrad   UCHAR                           ucReserved1;                //Was ucASICMaxTemperature;
   2666  1.1  riastrad   UCHAR                           ucMinAllowedBL_Level;
   2667  1.1  riastrad   USHORT                          usBootUpVDDCVoltage;        //In MV unit
   2668  1.1  riastrad   USHORT                          usLcdMinPixelClockPLL_Output; // In MHz unit
   2669  1.1  riastrad   USHORT                          usLcdMaxPixelClockPLL_Output; // In MHz unit
   2670  1.1  riastrad   ULONG                           ulReserved4;                //Was ulAsicMaximumVoltage
   2671  1.1  riastrad   ULONG                           ulMinPixelClockPLL_Output;  //In 10Khz unit
   2672  1.1  riastrad   USHORT                          usMinEngineClockPLL_Input;  //In 10Khz unit
   2673  1.1  riastrad   USHORT                          usMaxEngineClockPLL_Input;  //In 10Khz unit
   2674  1.1  riastrad   USHORT                          usMinEngineClockPLL_Output; //In 10Khz unit
   2675  1.1  riastrad   USHORT                          usMinMemoryClockPLL_Input;  //In 10Khz unit
   2676  1.1  riastrad   USHORT                          usMaxMemoryClockPLL_Input;  //In 10Khz unit
   2677  1.1  riastrad   USHORT                          usMinMemoryClockPLL_Output; //In 10Khz unit
   2678  1.1  riastrad   USHORT                          usMaxPixelClock;            //In 10Khz unit, Max.  Pclk
   2679  1.1  riastrad   USHORT                          usMinPixelClockPLL_Input;   //In 10Khz unit
   2680  1.1  riastrad   USHORT                          usMaxPixelClockPLL_Input;   //In 10Khz unit
   2681  1.1  riastrad   USHORT                          usMinPixelClockPLL_Output;  //In 10Khz unit - lower 16bit of ulMinPixelClockPLL_Output
   2682  1.1  riastrad   ATOM_FIRMWARE_CAPABILITY_ACCESS usFirmwareCapability;
   2683  1.1  riastrad   USHORT                          usCoreReferenceClock;       //In 10Khz unit
   2684  1.1  riastrad   USHORT                          usMemoryReferenceClock;     //In 10Khz unit
   2685  1.1  riastrad   USHORT                          usUniphyDPModeExtClkFreq;   //In 10Khz unit, if it is 0, In DP Mode Uniphy Input clock from internal PPLL, otherwise Input clock from external Spread clock
   2686  1.1  riastrad   UCHAR                           ucMemoryModule_ID;          //Indicate what is the board design
   2687  1.1  riastrad   UCHAR                           ucReserved4[3];
   2688  1.1  riastrad }ATOM_FIRMWARE_INFO_V2_1;
   2689  1.1  riastrad 
   2690  1.1  riastrad //the structure below to be used from NI
   2691  1.1  riastrad //ucTableFormatRevision=2
   2692  1.1  riastrad //ucTableContentRevision=2
   2693  1.1  riastrad typedef struct _ATOM_FIRMWARE_INFO_V2_2
   2694  1.1  riastrad {
   2695  1.1  riastrad   ATOM_COMMON_TABLE_HEADER        sHeader;
   2696  1.1  riastrad   ULONG                           ulFirmwareRevision;
   2697  1.1  riastrad   ULONG                           ulDefaultEngineClock;       //In 10Khz unit
   2698  1.1  riastrad   ULONG                           ulDefaultMemoryClock;       //In 10Khz unit
   2699  1.1  riastrad   ULONG                           ulSPLL_OutputFreq;          //In 10Khz unit
   2700  1.1  riastrad   ULONG                           ulGPUPLL_OutputFreq;        //In 10Khz unit
   2701  1.1  riastrad   ULONG                           ulReserved1;                //Was ulMaxEngineClockPLL_Output; //In 10Khz unit*
   2702  1.1  riastrad   ULONG                           ulReserved2;                //Was ulMaxMemoryClockPLL_Output; //In 10Khz unit*
   2703  1.1  riastrad   ULONG                           ulMaxPixelClockPLL_Output;  //In 10Khz unit
   2704  1.1  riastrad   ULONG                           ulBinaryAlteredInfo;        //Was ulASICMaxEngineClock  ?
   2705  1.1  riastrad   ULONG                           ulDefaultDispEngineClkFreq; //In 10Khz unit. This is the frequency before DCDTO, corresponding to usBootUpVDDCVoltage.
   2706  1.1  riastrad   UCHAR                           ucReserved3;                //Was ucASICMaxTemperature;
   2707  1.1  riastrad   UCHAR                           ucMinAllowedBL_Level;
   2708  1.1  riastrad   USHORT                          usBootUpVDDCVoltage;        //In MV unit
   2709  1.1  riastrad   USHORT                          usLcdMinPixelClockPLL_Output; // In MHz unit
   2710  1.1  riastrad   USHORT                          usLcdMaxPixelClockPLL_Output; // In MHz unit
   2711  1.1  riastrad   ULONG                           ulReserved4;                //Was ulAsicMaximumVoltage
   2712  1.1  riastrad   ULONG                           ulMinPixelClockPLL_Output;  //In 10Khz unit
   2713  1.1  riastrad   UCHAR                           ucRemoteDisplayConfig;
   2714  1.1  riastrad   UCHAR                           ucReserved5[3];             //Was usMinEngineClockPLL_Input and usMaxEngineClockPLL_Input
   2715  1.1  riastrad   ULONG                           ulReserved6;                //Was usMinEngineClockPLL_Output and usMinMemoryClockPLL_Input
   2716  1.1  riastrad   ULONG                           ulReserved7;                //Was usMaxMemoryClockPLL_Input and usMinMemoryClockPLL_Output
   2717  1.1  riastrad   USHORT                          usReserved11;               //Was usMaxPixelClock;  //In 10Khz unit, Max.  Pclk used only for DAC
   2718  1.1  riastrad   USHORT                          usMinPixelClockPLL_Input;   //In 10Khz unit
   2719  1.1  riastrad   USHORT                          usMaxPixelClockPLL_Input;   //In 10Khz unit
   2720  1.1  riastrad   USHORT                          usBootUpVDDCIVoltage;       //In unit of mv; Was usMinPixelClockPLL_Output;
   2721  1.1  riastrad   ATOM_FIRMWARE_CAPABILITY_ACCESS usFirmwareCapability;
   2722  1.1  riastrad   USHORT                          usCoreReferenceClock;       //In 10Khz unit
   2723  1.1  riastrad   USHORT                          usMemoryReferenceClock;     //In 10Khz unit
   2724  1.1  riastrad   USHORT                          usUniphyDPModeExtClkFreq;   //In 10Khz unit, if it is 0, In DP Mode Uniphy Input clock from internal PPLL, otherwise Input clock from external Spread clock
   2725  1.1  riastrad   UCHAR                           ucMemoryModule_ID;          //Indicate what is the board design
   2726  1.1  riastrad   UCHAR                           ucReserved9[3];
   2727  1.1  riastrad   USHORT                          usBootUpMVDDCVoltage;       //In unit of mv; Was usMinPixelClockPLL_Output;
   2728  1.1  riastrad   USHORT                          usReserved12;
   2729  1.1  riastrad   ULONG                           ulReserved10[3];            // New added comparing to previous version
   2730  1.1  riastrad }ATOM_FIRMWARE_INFO_V2_2;
   2731  1.1  riastrad 
   2732  1.1  riastrad #define ATOM_FIRMWARE_INFO_LAST  ATOM_FIRMWARE_INFO_V2_2
   2733  1.1  riastrad 
   2734  1.1  riastrad 
   2735  1.1  riastrad // definition of ucRemoteDisplayConfig
   2736  1.1  riastrad #define REMOTE_DISPLAY_DISABLE                   0x00
   2737  1.1  riastrad #define REMOTE_DISPLAY_ENABLE                    0x01
   2738  1.1  riastrad 
   2739  1.1  riastrad /****************************************************************************/
   2740  1.1  riastrad // Structures used in IntegratedSystemInfoTable
   2741  1.1  riastrad /****************************************************************************/
   2742  1.1  riastrad #define IGP_CAP_FLAG_DYNAMIC_CLOCK_EN      0x2
   2743  1.1  riastrad #define IGP_CAP_FLAG_AC_CARD               0x4
   2744  1.1  riastrad #define IGP_CAP_FLAG_SDVO_CARD             0x8
   2745  1.1  riastrad #define IGP_CAP_FLAG_POSTDIV_BY_2_MODE     0x10
   2746  1.1  riastrad 
   2747  1.1  riastrad typedef struct _ATOM_INTEGRATED_SYSTEM_INFO
   2748  1.1  riastrad {
   2749  1.1  riastrad   ATOM_COMMON_TABLE_HEADER        sHeader;
   2750  1.1  riastrad   ULONG	                          ulBootUpEngineClock;		    //in 10kHz unit
   2751  1.1  riastrad   ULONG	                          ulBootUpMemoryClock;		    //in 10kHz unit
   2752  1.1  riastrad   ULONG	                          ulMaxSystemMemoryClock;	    //in 10kHz unit
   2753  1.1  riastrad   ULONG	                          ulMinSystemMemoryClock;	    //in 10kHz unit
   2754  1.1  riastrad   UCHAR                           ucNumberOfCyclesInPeriodHi;
   2755  1.1  riastrad   UCHAR                           ucLCDTimingSel;             //=0:not valid.!=0 sel this timing descriptor from LCD EDID.
   2756  1.1  riastrad   USHORT                          usReserved1;
   2757  1.1  riastrad   USHORT                          usInterNBVoltageLow;        //An intermidiate PMW value to set the voltage
   2758  1.1  riastrad   USHORT                          usInterNBVoltageHigh;       //Another intermidiate PMW value to set the voltage
   2759  1.1  riastrad   ULONG	                          ulReserved[2];
   2760  1.1  riastrad 
   2761  1.1  riastrad   USHORT	                        usFSBClock;			            //In MHz unit
   2762  1.1  riastrad   USHORT                          usCapabilityFlag;		        //Bit0=1 indicates the fake HDMI support,Bit1=0/1 for Dynamic clocking dis/enable
   2763  1.1  riastrad 																                              //Bit[3:2]== 0:No PCIE card, 1:AC card, 2:SDVO card
   2764  1.1  riastrad                                                               //Bit[4]==1: P/2 mode, ==0: P/1 mode
   2765  1.1  riastrad   USHORT	                        usPCIENBCfgReg7;				    //bit[7:0]=MUX_Sel, bit[9:8]=MUX_SEL_LEVEL2, bit[10]=Lane_Reversal
   2766  1.1  riastrad   USHORT	                        usK8MemoryClock;            //in MHz unit
   2767  1.1  riastrad   USHORT	                        usK8SyncStartDelay;         //in 0.01 us unit
   2768  1.1  riastrad   USHORT	                        usK8DataReturnTime;         //in 0.01 us unit
   2769  1.1  riastrad   UCHAR                           ucMaxNBVoltage;
   2770  1.1  riastrad   UCHAR                           ucMinNBVoltage;
   2771  1.1  riastrad   UCHAR                           ucMemoryType;					      //[7:4]=1:DDR1;=2:DDR2;=3:DDR3.[3:0] is reserved
   2772  1.1  riastrad   UCHAR                           ucNumberOfCyclesInPeriod;		//CG.FVTHROT_PWM_CTRL_REG0.NumberOfCyclesInPeriod
   2773  1.1  riastrad   UCHAR                           ucStartingPWM_HighTime;     //CG.FVTHROT_PWM_CTRL_REG0.StartingPWM_HighTime
   2774  1.1  riastrad   UCHAR                           ucHTLinkWidth;              //16 bit vs. 8 bit
   2775  1.1  riastrad   UCHAR                           ucMaxNBVoltageHigh;
   2776  1.1  riastrad   UCHAR                           ucMinNBVoltageHigh;
   2777  1.1  riastrad }ATOM_INTEGRATED_SYSTEM_INFO;
   2778  1.1  riastrad 
   2779  1.1  riastrad /* Explanation on entries in ATOM_INTEGRATED_SYSTEM_INFO
   2780  1.1  riastrad ulBootUpMemoryClock:    For Intel IGP,it's the UMA system memory clock
   2781  1.1  riastrad                         For AMD IGP,it's 0 if no SidePort memory installed or it's the boot-up SidePort memory clock
   2782  1.1  riastrad ulMaxSystemMemoryClock: For Intel IGP,it's the Max freq from memory SPD if memory runs in ASYNC mode or otherwise (SYNC mode) it's 0
   2783  1.1  riastrad                         For AMD IGP,for now this can be 0
   2784  1.1  riastrad ulMinSystemMemoryClock: For Intel IGP,it's 133MHz if memory runs in ASYNC mode or otherwise (SYNC mode) it's 0
   2785  1.1  riastrad                         For AMD IGP,for now this can be 0
   2786  1.1  riastrad 
   2787  1.1  riastrad usFSBClock:             For Intel IGP,it's FSB Freq
   2788  1.1  riastrad                         For AMD IGP,it's HT Link Speed
   2789  1.1  riastrad 
   2790  1.1  riastrad usK8MemoryClock:        For AMD IGP only. For RevF CPU, set it to 200
   2791  1.1  riastrad usK8SyncStartDelay:     For AMD IGP only. Memory access latency in K8, required for watermark calculation
   2792  1.1  riastrad usK8DataReturnTime:     For AMD IGP only. Memory access latency in K8, required for watermark calculation
   2793  1.1  riastrad 
   2794  1.1  riastrad VC:Voltage Control
   2795  1.1  riastrad ucMaxNBVoltage:         Voltage regulator dependent PWM value. Low 8 bits of the value for the max voltage.Set this one to 0xFF if VC without PWM. Set this to 0x0 if no VC at all.
   2796  1.1  riastrad ucMinNBVoltage:         Voltage regulator dependent PWM value. Low 8 bits of the value for the min voltage.Set this one to 0x00 if VC without PWM or no VC at all.
   2797  1.1  riastrad 
   2798  1.1  riastrad ucNumberOfCyclesInPeriod:   Indicate how many cycles when PWM duty is 100%. low 8 bits of the value.
   2799  1.1  riastrad ucNumberOfCyclesInPeriodHi: Indicate how many cycles when PWM duty is 100%. high 8 bits of the value.If the PWM has an inverter,set bit [7]==1,otherwise set it 0
   2800  1.1  riastrad 
   2801  1.1  riastrad ucMaxNBVoltageHigh:     Voltage regulator dependent PWM value. High 8 bits of  the value for the max voltage.Set this one to 0xFF if VC without PWM. Set this to 0x0 if no VC at all.
   2802  1.1  riastrad ucMinNBVoltageHigh:     Voltage regulator dependent PWM value. High 8 bits of the value for the min voltage.Set this one to 0x00 if VC without PWM or no VC at all.
   2803  1.1  riastrad 
   2804  1.1  riastrad 
   2805  1.1  riastrad usInterNBVoltageLow:    Voltage regulator dependent PWM value. The value makes the the voltage >=Min NB voltage but <=InterNBVoltageHigh. Set this to 0x0000 if VC without PWM or no VC at all.
   2806  1.1  riastrad usInterNBVoltageHigh:   Voltage regulator dependent PWM value. The value makes the the voltage >=InterNBVoltageLow but <=Max NB voltage.Set this to 0x0000 if VC without PWM or no VC at all.
   2807  1.1  riastrad */
   2808  1.1  riastrad 
   2809  1.1  riastrad 
   2810  1.1  riastrad /*
   2811  1.1  riastrad The following IGP table is introduced from RS780, which is supposed to be put by SBIOS in FB before IGP VBIOS starts VPOST;
   2812  1.1  riastrad Then VBIOS will copy the whole structure to its image so all GPU SW components can access this data structure to get whatever they need.
   2813  1.1  riastrad The enough reservation should allow us to never change table revisions. Whenever needed, a GPU SW component can use reserved portion for new data entries.
   2814  1.1  riastrad 
   2815  1.1  riastrad SW components can access the IGP system infor structure in the same way as before
   2816  1.1  riastrad */
   2817  1.1  riastrad 
   2818  1.1  riastrad 
   2819  1.1  riastrad typedef struct _ATOM_INTEGRATED_SYSTEM_INFO_V2
   2820  1.1  riastrad {
   2821  1.1  riastrad   ATOM_COMMON_TABLE_HEADER   sHeader;
   2822  1.1  riastrad   ULONG	                     ulBootUpEngineClock;       //in 10kHz unit
   2823  1.1  riastrad   ULONG			     ulReserved1[2];            //must be 0x0 for the reserved
   2824  1.1  riastrad   ULONG	                     ulBootUpUMAClock;          //in 10kHz unit
   2825  1.1  riastrad   ULONG	                     ulBootUpSidePortClock;     //in 10kHz unit
   2826  1.1  riastrad   ULONG	                     ulMinSidePortClock;        //in 10kHz unit
   2827  1.1  riastrad   ULONG			     ulReserved2[6];            //must be 0x0 for the reserved
   2828  1.1  riastrad   ULONG                      ulSystemConfig;            //see explanation below
   2829  1.1  riastrad   ULONG                      ulBootUpReqDisplayVector;
   2830  1.1  riastrad   ULONG                      ulOtherDisplayMisc;
   2831  1.1  riastrad   ULONG                      ulDDISlot1Config;
   2832  1.1  riastrad   ULONG                      ulDDISlot2Config;
   2833  1.1  riastrad   UCHAR                      ucMemoryType;              //[3:0]=1:DDR1;=2:DDR2;=3:DDR3.[7:4] is reserved
   2834  1.1  riastrad   UCHAR                      ucUMAChannelNumber;
   2835  1.1  riastrad   UCHAR                      ucDockingPinBit;
   2836  1.1  riastrad   UCHAR                      ucDockingPinPolarity;
   2837  1.1  riastrad   ULONG                      ulDockingPinCFGInfo;
   2838  1.1  riastrad   ULONG                      ulCPUCapInfo;
   2839  1.1  riastrad   USHORT                     usNumberOfCyclesInPeriod;
   2840  1.1  riastrad   USHORT                     usMaxNBVoltage;
   2841  1.1  riastrad   USHORT                     usMinNBVoltage;
   2842  1.1  riastrad   USHORT                     usBootUpNBVoltage;
   2843  1.1  riastrad   ULONG                      ulHTLinkFreq;              //in 10Khz
   2844  1.1  riastrad   USHORT                     usMinHTLinkWidth;
   2845  1.1  riastrad   USHORT                     usMaxHTLinkWidth;
   2846  1.1  riastrad   USHORT                     usUMASyncStartDelay;
   2847  1.1  riastrad   USHORT                     usUMADataReturnTime;
   2848  1.1  riastrad   USHORT                     usLinkStatusZeroTime;
   2849  1.1  riastrad   USHORT                     usDACEfuse;				//for storing badgap value (for RS880 only)
   2850  1.1  riastrad   ULONG                      ulHighVoltageHTLinkFreq;     // in 10Khz
   2851  1.1  riastrad   ULONG                      ulLowVoltageHTLinkFreq;      // in 10Khz
   2852  1.1  riastrad   USHORT                     usMaxUpStreamHTLinkWidth;
   2853  1.1  riastrad   USHORT                     usMaxDownStreamHTLinkWidth;
   2854  1.1  riastrad   USHORT                     usMinUpStreamHTLinkWidth;
   2855  1.1  riastrad   USHORT                     usMinDownStreamHTLinkWidth;
   2856  1.1  riastrad   USHORT                     usFirmwareVersion;         //0 means FW is not supported. Otherwise it's the FW version loaded by SBIOS and driver should enable FW.
   2857  1.1  riastrad   USHORT                     usFullT0Time;             // Input to calculate minimum HT link change time required by NB P-State. Unit is 0.01us.
   2858  1.1  riastrad   ULONG                      ulReserved3[96];          //must be 0x0
   2859  1.1  riastrad }ATOM_INTEGRATED_SYSTEM_INFO_V2;
   2860  1.1  riastrad 
   2861  1.1  riastrad /*
   2862  1.1  riastrad ulBootUpEngineClock:   Boot-up Engine Clock in 10Khz;
   2863  1.1  riastrad ulBootUpUMAClock:      Boot-up UMA Clock in 10Khz; it must be 0x0 when UMA is not present
   2864  1.1  riastrad ulBootUpSidePortClock: Boot-up SidePort Clock in 10Khz; it must be 0x0 when SidePort Memory is not present,this could be equal to or less than maximum supported Sideport memory clock
   2865  1.1  riastrad 
   2866  1.1  riastrad ulSystemConfig:
   2867  1.1  riastrad Bit[0]=1: PowerExpress mode =0 Non-PowerExpress mode;
   2868  1.1  riastrad Bit[1]=1: system boots up at AMD overdrived state or user customized  mode. In this case, driver will just stick to this boot-up mode. No other PowerPlay state
   2869  1.1  riastrad       =0: system boots up at driver control state. Power state depends on PowerPlay table.
   2870  1.1  riastrad Bit[2]=1: PWM method is used on NB voltage control. =0: GPIO method is used.
   2871  1.1  riastrad Bit[3]=1: Only one power state(Performance) will be supported.
   2872  1.1  riastrad       =0: Multiple power states supported from PowerPlay table.
   2873  1.1  riastrad Bit[4]=1: CLMC is supported and enabled on current system.
   2874  1.1  riastrad       =0: CLMC is not supported or enabled on current system. SBIOS need to support HT link/freq change through ATIF interface.
   2875  1.1  riastrad Bit[5]=1: Enable CDLW for all driver control power states. Max HT width is from SBIOS, while Min HT width is determined by display requirement.
   2876  1.1  riastrad       =0: CDLW is disabled. If CLMC is enabled case, Min HT width will be set equal to Max HT width. If CLMC disabled case, Max HT width will be applied.
   2877  1.1  riastrad Bit[6]=1: High Voltage requested for all power states. In this case, voltage will be forced at 1.1v and powerplay table voltage drop/throttling request will be ignored.
   2878  1.1  riastrad       =0: Voltage settings is determined by powerplay table.
   2879  1.1  riastrad Bit[7]=1: Enable CLMC as hybrid Mode. CDLD and CILR will be disabled in this case and we're using legacy C1E. This is workaround for CPU(Griffin) performance issue.
   2880  1.1  riastrad       =0: Enable CLMC as regular mode, CDLD and CILR will be enabled.
   2881  1.1  riastrad Bit[8]=1: CDLF is supported and enabled on current system.
   2882  1.1  riastrad       =0: CDLF is not supported or enabled on current system.
   2883  1.1  riastrad Bit[9]=1: DLL Shut Down feature is enabled on current system.
   2884  1.1  riastrad       =0: DLL Shut Down feature is not enabled or supported on current system.
   2885  1.1  riastrad 
   2886  1.1  riastrad ulBootUpReqDisplayVector: This dword is a bit vector indicates what display devices are requested during boot-up. Refer to ATOM_DEVICE_xxx_SUPPORT for the bit vector definitions.
   2887  1.1  riastrad 
   2888  1.1  riastrad ulOtherDisplayMisc: [15:8]- Bootup LCD Expansion selection; 0-center, 1-full panel size expansion;
   2889  1.1  riastrad 			              [7:0] - BootupTV standard selection; This is a bit vector to indicate what TV standards are supported by the system. Refer to ucTVSupportedStd definition;
   2890  1.1  riastrad 
   2891  1.1  riastrad ulDDISlot1Config: Describes the PCIE lane configuration on this DDI PCIE slot (ADD2 card) or connector (Mobile design).
   2892  1.1  riastrad       [3:0]  - Bit vector to indicate PCIE lane config of the DDI slot/connector on chassis (bit 0=1 lane 3:0; bit 1=1 lane 7:4; bit 2=1 lane 11:8; bit 3=1 lane 15:12)
   2893  1.1  riastrad 			[7:4]  - Bit vector to indicate PCIE lane config of the same DDI slot/connector on docking station (bit 4=1 lane 3:0; bit 5=1 lane 7:4; bit 6=1 lane 11:8; bit 7=1 lane 15:12)
   2894  1.1  riastrad       When a DDI connector is not "paired" (meaming two connections mutualexclusive on chassis or docking, only one of them can be connected at one time.
   2895  1.1  riastrad       in both chassis and docking, SBIOS has to duplicate the same PCIE lane info from chassis to docking or vice versa. For example:
   2896  1.1  riastrad       one DDI connector is only populated in docking with PCIE lane 8-11, but there is no paired connection on chassis, SBIOS has to copy bit 6 to bit 2.
   2897  1.1  riastrad 
   2898  1.1  riastrad 			[15:8] - Lane configuration attribute;
   2899  1.1  riastrad       [23:16]- Connector type, possible value:
   2900  1.1  riastrad                CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_D
   2901  1.1  riastrad                CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D
   2902  1.1  riastrad                CONNECTOR_OBJECT_ID_HDMI_TYPE_A
   2903  1.1  riastrad                CONNECTOR_OBJECT_ID_DISPLAYPORT
   2904  1.1  riastrad                CONNECTOR_OBJECT_ID_eDP
   2905  1.1  riastrad 			[31:24]- Reserved
   2906  1.1  riastrad 
   2907  1.1  riastrad ulDDISlot2Config: Same as Slot1.
   2908  1.1  riastrad ucMemoryType: SidePort memory type, set it to 0x0 when Sideport memory is not installed. Driver needs this info to change sideport memory clock. Not for display in CCC.
   2909  1.1  riastrad For IGP, Hypermemory is the only memory type showed in CCC.
   2910  1.1  riastrad 
   2911  1.1  riastrad ucUMAChannelNumber:  how many channels for the UMA;
   2912  1.1  riastrad 
   2913  1.1  riastrad ulDockingPinCFGInfo: [15:0]-Bus/Device/Function # to CFG to read this Docking Pin; [31:16]-reg offset in CFG to read this pin
   2914  1.1  riastrad ucDockingPinBit:     which bit in this register to read the pin status;
   2915  1.1  riastrad ucDockingPinPolarity:Polarity of the pin when docked;
   2916  1.1  riastrad 
   2917  1.1  riastrad ulCPUCapInfo:        [7:0]=1:Griffin;[7:0]=2:Greyhound;[7:0]=3:K8, [7:0]=4:Pharaoh, other bits reserved for now and must be 0x0
   2918  1.1  riastrad 
   2919  1.1  riastrad usNumberOfCyclesInPeriod:Indicate how many cycles when PWM duty is 100%.
   2920  1.1  riastrad 
   2921  1.1  riastrad usMaxNBVoltage:Max. voltage control value in either PWM or GPIO mode.
   2922  1.1  riastrad usMinNBVoltage:Min. voltage control value in either PWM or GPIO mode.
   2923  1.1  riastrad                     GPIO mode: both usMaxNBVoltage & usMinNBVoltage have a valid value ulSystemConfig.SYSTEM_CONFIG_USE_PWM_ON_VOLTAGE=0
   2924  1.1  riastrad                     PWM mode: both usMaxNBVoltage & usMinNBVoltage have a valid value ulSystemConfig.SYSTEM_CONFIG_USE_PWM_ON_VOLTAGE=1
   2925  1.1  riastrad                     GPU SW don't control mode: usMaxNBVoltage & usMinNBVoltage=0 and no care about ulSystemConfig.SYSTEM_CONFIG_USE_PWM_ON_VOLTAGE
   2926  1.1  riastrad 
   2927  1.1  riastrad usBootUpNBVoltage:Boot-up voltage regulator dependent PWM value.
   2928  1.1  riastrad 
   2929  1.1  riastrad ulHTLinkFreq:       Bootup HT link Frequency in 10Khz.
   2930  1.1  riastrad usMinHTLinkWidth:   Bootup minimum HT link width. If CDLW disabled, this is equal to usMaxHTLinkWidth.
   2931  1.1  riastrad                     If CDLW enabled, both upstream and downstream width should be the same during bootup.
   2932  1.1  riastrad usMaxHTLinkWidth:   Bootup maximum HT link width. If CDLW disabled, this is equal to usMinHTLinkWidth.
   2933  1.1  riastrad                     If CDLW enabled, both upstream and downstream width should be the same during bootup.
   2934  1.1  riastrad 
   2935  1.1  riastrad usUMASyncStartDelay: Memory access latency, required for watermark calculation
   2936  1.1  riastrad usUMADataReturnTime: Memory access latency, required for watermark calculation
   2937  1.1  riastrad usLinkStatusZeroTime:Memory access latency required for watermark calculation, set this to 0x0 for K8 CPU, set a proper value in 0.01 the unit of us
   2938  1.1  riastrad for Griffin or Greyhound. SBIOS needs to convert to actual time by:
   2939  1.1  riastrad                      if T0Ttime [5:4]=00b, then usLinkStatusZeroTime=T0Ttime [3:0]*0.1us (0.0 to 1.5us)
   2940  1.1  riastrad                      if T0Ttime [5:4]=01b, then usLinkStatusZeroTime=T0Ttime [3:0]*0.5us (0.0 to 7.5us)
   2941  1.1  riastrad                      if T0Ttime [5:4]=10b, then usLinkStatusZeroTime=T0Ttime [3:0]*2.0us (0.0 to 30us)
   2942  1.1  riastrad                      if T0Ttime [5:4]=11b, and T0Ttime [3:0]=0x0 to 0xa, then usLinkStatusZeroTime=T0Ttime [3:0]*20us (0.0 to 200us)
   2943  1.1  riastrad 
   2944  1.1  riastrad ulHighVoltageHTLinkFreq:     HT link frequency for power state with low voltage. If boot up runs in HT1, this must be 0.
   2945  1.1  riastrad                              This must be less than or equal to ulHTLinkFreq(bootup frequency).
   2946  1.1  riastrad ulLowVoltageHTLinkFreq:      HT link frequency for power state with low voltage or voltage scaling 1.0v~1.1v. If boot up runs in HT1, this must be 0.
   2947  1.1  riastrad                              This must be less than or equal to ulHighVoltageHTLinkFreq.
   2948  1.1  riastrad 
   2949  1.1  riastrad usMaxUpStreamHTLinkWidth:    Asymmetric link width support in the future, to replace usMaxHTLinkWidth. Not used for now.
   2950  1.1  riastrad usMaxDownStreamHTLinkWidth:  same as above.
   2951  1.1  riastrad usMinUpStreamHTLinkWidth:    Asymmetric link width support in the future, to replace usMinHTLinkWidth. Not used for now.
   2952  1.1  riastrad usMinDownStreamHTLinkWidth:  same as above.
   2953  1.1  riastrad */
   2954  1.1  riastrad 
   2955  1.1  riastrad // ATOM_INTEGRATED_SYSTEM_INFO::ulCPUCapInfo  - CPU type definition
   2956  1.1  riastrad #define    INTEGRATED_SYSTEM_INFO__UNKNOWN_CPU             0
   2957  1.1  riastrad #define    INTEGRATED_SYSTEM_INFO__AMD_CPU__GRIFFIN        1
   2958  1.1  riastrad #define    INTEGRATED_SYSTEM_INFO__AMD_CPU__GREYHOUND      2
   2959  1.1  riastrad #define    INTEGRATED_SYSTEM_INFO__AMD_CPU__K8             3
   2960  1.1  riastrad #define    INTEGRATED_SYSTEM_INFO__AMD_CPU__PHARAOH        4
   2961  1.1  riastrad #define    INTEGRATED_SYSTEM_INFO__AMD_CPU__OROCHI         5
   2962  1.1  riastrad 
   2963  1.1  riastrad #define    INTEGRATED_SYSTEM_INFO__AMD_CPU__MAX_CODE       INTEGRATED_SYSTEM_INFO__AMD_CPU__OROCHI    // this deff reflects max defined CPU code
   2964  1.1  riastrad 
   2965  1.1  riastrad #define SYSTEM_CONFIG_POWEREXPRESS_ENABLE                 0x00000001
   2966  1.1  riastrad #define SYSTEM_CONFIG_RUN_AT_OVERDRIVE_ENGINE             0x00000002
   2967  1.1  riastrad #define SYSTEM_CONFIG_USE_PWM_ON_VOLTAGE                  0x00000004
   2968  1.1  riastrad #define SYSTEM_CONFIG_PERFORMANCE_POWERSTATE_ONLY         0x00000008
   2969  1.1  riastrad #define SYSTEM_CONFIG_CLMC_ENABLED                        0x00000010
   2970  1.1  riastrad #define SYSTEM_CONFIG_CDLW_ENABLED                        0x00000020
   2971  1.1  riastrad #define SYSTEM_CONFIG_HIGH_VOLTAGE_REQUESTED              0x00000040
   2972  1.1  riastrad #define SYSTEM_CONFIG_CLMC_HYBRID_MODE_ENABLED            0x00000080
   2973  1.1  riastrad #define SYSTEM_CONFIG_CDLF_ENABLED                        0x00000100
   2974  1.1  riastrad #define SYSTEM_CONFIG_DLL_SHUTDOWN_ENABLED                0x00000200
   2975  1.1  riastrad 
   2976  1.1  riastrad #define IGP_DDI_SLOT_LANE_CONFIG_MASK                     0x000000FF
   2977  1.1  riastrad 
   2978  1.1  riastrad #define b0IGP_DDI_SLOT_LANE_MAP_MASK                      0x0F
   2979  1.1  riastrad #define b0IGP_DDI_SLOT_DOCKING_LANE_MAP_MASK              0xF0
   2980  1.1  riastrad #define b0IGP_DDI_SLOT_CONFIG_LANE_0_3                    0x01
   2981  1.1  riastrad #define b0IGP_DDI_SLOT_CONFIG_LANE_4_7                    0x02
   2982  1.1  riastrad #define b0IGP_DDI_SLOT_CONFIG_LANE_8_11                   0x04
   2983  1.1  riastrad #define b0IGP_DDI_SLOT_CONFIG_LANE_12_15                  0x08
   2984  1.1  riastrad 
   2985  1.1  riastrad #define IGP_DDI_SLOT_ATTRIBUTE_MASK                       0x0000FF00
   2986  1.1  riastrad #define IGP_DDI_SLOT_CONFIG_REVERSED                      0x00000100
   2987  1.1  riastrad #define b1IGP_DDI_SLOT_CONFIG_REVERSED                    0x01
   2988  1.1  riastrad 
   2989  1.1  riastrad #define IGP_DDI_SLOT_CONNECTOR_TYPE_MASK                  0x00FF0000
   2990  1.1  riastrad 
   2991  1.1  riastrad // IntegratedSystemInfoTable new Rev is V5 after V2, because of the real rev of V2 is v1.4. This rev is used for RR
   2992  1.1  riastrad typedef struct _ATOM_INTEGRATED_SYSTEM_INFO_V5
   2993  1.1  riastrad {
   2994  1.1  riastrad   ATOM_COMMON_TABLE_HEADER   sHeader;
   2995  1.1  riastrad   ULONG	                     ulBootUpEngineClock;       //in 10kHz unit
   2996  1.1  riastrad   ULONG                      ulDentistVCOFreq;          //Dentist VCO clock in 10kHz unit, the source of GPU SCLK, LCLK, UCLK and VCLK.
   2997  1.1  riastrad   ULONG                      ulLClockFreq;              //GPU Lclk freq in 10kHz unit, have relationship with NCLK in NorthBridge
   2998  1.1  riastrad   ULONG	                     ulBootUpUMAClock;          //in 10kHz unit
   2999  1.1  riastrad   ULONG                      ulReserved1[8];            //must be 0x0 for the reserved
   3000  1.1  riastrad   ULONG                      ulBootUpReqDisplayVector;
   3001  1.1  riastrad   ULONG                      ulOtherDisplayMisc;
   3002  1.1  riastrad   ULONG                      ulReserved2[4];            //must be 0x0 for the reserved
   3003  1.1  riastrad   ULONG                      ulSystemConfig;            //TBD
   3004  1.1  riastrad   ULONG                      ulCPUCapInfo;              //TBD
   3005  1.1  riastrad   USHORT                     usMaxNBVoltage;            //high NB voltage, calculated using current VDDNB (D24F2xDC) and VDDNB offset fuse;
   3006  1.1  riastrad   USHORT                     usMinNBVoltage;            //low NB voltage, calculated using current VDDNB (D24F2xDC) and VDDNB offset fuse;
   3007  1.1  riastrad   USHORT                     usBootUpNBVoltage;         //boot up NB voltage
   3008  1.1  riastrad   UCHAR                      ucHtcTmpLmt;               //bit [22:16] of D24F3x64 Hardware Thermal Control (HTC) Register, may not be needed, TBD
   3009  1.1  riastrad   UCHAR                      ucTjOffset;                //bit [28:22] of D24F3xE4 Thermtrip Status Register,may not be needed, TBD
   3010  1.1  riastrad   ULONG                      ulReserved3[4];            //must be 0x0 for the reserved
   3011  1.1  riastrad   ULONG                      ulDDISlot1Config;          //see above ulDDISlot1Config definition
   3012  1.1  riastrad   ULONG                      ulDDISlot2Config;
   3013  1.1  riastrad   ULONG                      ulDDISlot3Config;
   3014  1.1  riastrad   ULONG                      ulDDISlot4Config;
   3015  1.1  riastrad   ULONG                      ulReserved4[4];            //must be 0x0 for the reserved
   3016  1.1  riastrad   UCHAR                      ucMemoryType;              //[3:0]=1:DDR1;=2:DDR2;=3:DDR3.[7:4] is reserved
   3017  1.1  riastrad   UCHAR                      ucUMAChannelNumber;
   3018  1.1  riastrad   USHORT                     usReserved;
   3019  1.1  riastrad   ULONG                      ulReserved5[4];            //must be 0x0 for the reserved
   3020  1.1  riastrad   ULONG                      ulCSR_M3_ARB_CNTL_DEFAULT[10];//arrays with values for CSR M3 arbiter for default
   3021  1.1  riastrad   ULONG                      ulCSR_M3_ARB_CNTL_UVD[10]; //arrays with values for CSR M3 arbiter for UVD playback
   3022  1.1  riastrad   ULONG                      ulCSR_M3_ARB_CNTL_FS3D[10];//arrays with values for CSR M3 arbiter for Full Screen 3D applications
   3023  1.1  riastrad   ULONG                      ulReserved6[61];           //must be 0x0
   3024  1.1  riastrad }ATOM_INTEGRATED_SYSTEM_INFO_V5;
   3025  1.1  riastrad 
   3026  1.1  riastrad #define ATOM_CRT_INT_ENCODER1_INDEX                       0x00000000
   3027  1.1  riastrad #define ATOM_LCD_INT_ENCODER1_INDEX                       0x00000001
   3028  1.1  riastrad #define ATOM_TV_INT_ENCODER1_INDEX                        0x00000002
   3029  1.1  riastrad #define ATOM_DFP_INT_ENCODER1_INDEX                       0x00000003
   3030  1.1  riastrad #define ATOM_CRT_INT_ENCODER2_INDEX                       0x00000004
   3031  1.1  riastrad #define ATOM_LCD_EXT_ENCODER1_INDEX                       0x00000005
   3032  1.1  riastrad #define ATOM_TV_EXT_ENCODER1_INDEX                        0x00000006
   3033  1.1  riastrad #define ATOM_DFP_EXT_ENCODER1_INDEX                       0x00000007
   3034  1.1  riastrad #define ATOM_CV_INT_ENCODER1_INDEX                        0x00000008
   3035  1.1  riastrad #define ATOM_DFP_INT_ENCODER2_INDEX                       0x00000009
   3036  1.1  riastrad #define ATOM_CRT_EXT_ENCODER1_INDEX                       0x0000000A
   3037  1.1  riastrad #define ATOM_CV_EXT_ENCODER1_INDEX                        0x0000000B
   3038  1.1  riastrad #define ATOM_DFP_INT_ENCODER3_INDEX                       0x0000000C
   3039  1.1  riastrad #define ATOM_DFP_INT_ENCODER4_INDEX                       0x0000000D
   3040  1.1  riastrad 
   3041  1.1  riastrad // define ASIC internal encoder id ( bit vector ), used for CRTC_SourceSelTable
   3042  1.1  riastrad #define ASIC_INT_DAC1_ENCODER_ID    											0x00
   3043  1.1  riastrad #define ASIC_INT_TV_ENCODER_ID														0x02
   3044  1.1  riastrad #define ASIC_INT_DIG1_ENCODER_ID													0x03
   3045  1.1  riastrad #define ASIC_INT_DAC2_ENCODER_ID													0x04
   3046  1.1  riastrad #define ASIC_EXT_TV_ENCODER_ID														0x06
   3047  1.1  riastrad #define ASIC_INT_DVO_ENCODER_ID														0x07
   3048  1.1  riastrad #define ASIC_INT_DIG2_ENCODER_ID													0x09
   3049  1.1  riastrad #define ASIC_EXT_DIG_ENCODER_ID														0x05
   3050  1.1  riastrad #define ASIC_EXT_DIG2_ENCODER_ID													0x08
   3051  1.1  riastrad #define ASIC_INT_DIG3_ENCODER_ID													0x0a
   3052  1.1  riastrad #define ASIC_INT_DIG4_ENCODER_ID													0x0b
   3053  1.1  riastrad #define ASIC_INT_DIG5_ENCODER_ID													0x0c
   3054  1.1  riastrad #define ASIC_INT_DIG6_ENCODER_ID													0x0d
   3055  1.1  riastrad #define ASIC_INT_DIG7_ENCODER_ID													0x0e
   3056  1.1  riastrad 
   3057  1.1  riastrad //define Encoder attribute
   3058  1.1  riastrad #define ATOM_ANALOG_ENCODER																0
   3059  1.1  riastrad #define ATOM_DIGITAL_ENCODER															1
   3060  1.1  riastrad #define ATOM_DP_ENCODER															      2
   3061  1.1  riastrad 
   3062  1.1  riastrad #define ATOM_ENCODER_ENUM_MASK                            0x70
   3063  1.1  riastrad #define ATOM_ENCODER_ENUM_ID1                             0x00
   3064  1.1  riastrad #define ATOM_ENCODER_ENUM_ID2                             0x10
   3065  1.1  riastrad #define ATOM_ENCODER_ENUM_ID3                             0x20
   3066  1.1  riastrad #define ATOM_ENCODER_ENUM_ID4                             0x30
   3067  1.1  riastrad #define ATOM_ENCODER_ENUM_ID5                             0x40
   3068  1.1  riastrad #define ATOM_ENCODER_ENUM_ID6                             0x50
   3069  1.1  riastrad 
   3070  1.1  riastrad #define ATOM_DEVICE_CRT1_INDEX                            0x00000000
   3071  1.1  riastrad #define ATOM_DEVICE_LCD1_INDEX                            0x00000001
   3072  1.1  riastrad #define ATOM_DEVICE_TV1_INDEX                             0x00000002
   3073  1.1  riastrad #define ATOM_DEVICE_DFP1_INDEX                            0x00000003
   3074  1.1  riastrad #define ATOM_DEVICE_CRT2_INDEX                            0x00000004
   3075  1.1  riastrad #define ATOM_DEVICE_LCD2_INDEX                            0x00000005
   3076  1.1  riastrad #define ATOM_DEVICE_DFP6_INDEX                            0x00000006
   3077  1.1  riastrad #define ATOM_DEVICE_DFP2_INDEX                            0x00000007
   3078  1.1  riastrad #define ATOM_DEVICE_CV_INDEX                              0x00000008
   3079  1.1  riastrad #define ATOM_DEVICE_DFP3_INDEX                            0x00000009
   3080  1.1  riastrad #define ATOM_DEVICE_DFP4_INDEX                            0x0000000A
   3081  1.1  riastrad #define ATOM_DEVICE_DFP5_INDEX                            0x0000000B
   3082  1.1  riastrad 
   3083  1.1  riastrad #define ATOM_DEVICE_RESERVEDC_INDEX                       0x0000000C
   3084  1.1  riastrad #define ATOM_DEVICE_RESERVEDD_INDEX                       0x0000000D
   3085  1.1  riastrad #define ATOM_DEVICE_RESERVEDE_INDEX                       0x0000000E
   3086  1.1  riastrad #define ATOM_DEVICE_RESERVEDF_INDEX                       0x0000000F
   3087  1.1  riastrad #define ATOM_MAX_SUPPORTED_DEVICE_INFO                    (ATOM_DEVICE_DFP3_INDEX+1)
   3088  1.1  riastrad #define ATOM_MAX_SUPPORTED_DEVICE_INFO_2                  ATOM_MAX_SUPPORTED_DEVICE_INFO
   3089  1.1  riastrad #define ATOM_MAX_SUPPORTED_DEVICE_INFO_3                  (ATOM_DEVICE_DFP5_INDEX + 1 )
   3090  1.1  riastrad 
   3091  1.1  riastrad #define ATOM_MAX_SUPPORTED_DEVICE                         (ATOM_DEVICE_RESERVEDF_INDEX+1)
   3092  1.1  riastrad 
   3093  1.1  riastrad #define ATOM_DEVICE_CRT1_SUPPORT                          (0x1L << ATOM_DEVICE_CRT1_INDEX )
   3094  1.1  riastrad #define ATOM_DEVICE_LCD1_SUPPORT                          (0x1L << ATOM_DEVICE_LCD1_INDEX )
   3095  1.1  riastrad #define ATOM_DEVICE_TV1_SUPPORT                           (0x1L << ATOM_DEVICE_TV1_INDEX  )
   3096  1.1  riastrad #define ATOM_DEVICE_DFP1_SUPPORT                          (0x1L << ATOM_DEVICE_DFP1_INDEX )
   3097  1.1  riastrad #define ATOM_DEVICE_CRT2_SUPPORT                          (0x1L << ATOM_DEVICE_CRT2_INDEX )
   3098  1.1  riastrad #define ATOM_DEVICE_LCD2_SUPPORT                          (0x1L << ATOM_DEVICE_LCD2_INDEX )
   3099  1.1  riastrad #define ATOM_DEVICE_DFP6_SUPPORT                          (0x1L << ATOM_DEVICE_DFP6_INDEX )
   3100  1.1  riastrad #define ATOM_DEVICE_DFP2_SUPPORT                          (0x1L << ATOM_DEVICE_DFP2_INDEX )
   3101  1.1  riastrad #define ATOM_DEVICE_CV_SUPPORT                            (0x1L << ATOM_DEVICE_CV_INDEX   )
   3102  1.1  riastrad #define ATOM_DEVICE_DFP3_SUPPORT                          (0x1L << ATOM_DEVICE_DFP3_INDEX )
   3103  1.1  riastrad #define ATOM_DEVICE_DFP4_SUPPORT                          (0x1L << ATOM_DEVICE_DFP4_INDEX )
   3104  1.1  riastrad #define ATOM_DEVICE_DFP5_SUPPORT                          (0x1L << ATOM_DEVICE_DFP5_INDEX )
   3105  1.1  riastrad 
   3106  1.1  riastrad #define ATOM_DEVICE_CRT_SUPPORT                           (ATOM_DEVICE_CRT1_SUPPORT | ATOM_DEVICE_CRT2_SUPPORT)
   3107  1.1  riastrad #define ATOM_DEVICE_DFP_SUPPORT                           (ATOM_DEVICE_DFP1_SUPPORT | ATOM_DEVICE_DFP2_SUPPORT |  ATOM_DEVICE_DFP3_SUPPORT | ATOM_DEVICE_DFP4_SUPPORT | ATOM_DEVICE_DFP5_SUPPORT | ATOM_DEVICE_DFP6_SUPPORT)
   3108  1.1  riastrad #define ATOM_DEVICE_TV_SUPPORT                            (ATOM_DEVICE_TV1_SUPPORT)
   3109  1.1  riastrad #define ATOM_DEVICE_LCD_SUPPORT                           (ATOM_DEVICE_LCD1_SUPPORT | ATOM_DEVICE_LCD2_SUPPORT)
   3110  1.1  riastrad 
   3111  1.1  riastrad #define ATOM_DEVICE_CONNECTOR_TYPE_MASK                   0x000000F0
   3112  1.1  riastrad #define ATOM_DEVICE_CONNECTOR_TYPE_SHIFT                  0x00000004
   3113  1.1  riastrad #define ATOM_DEVICE_CONNECTOR_VGA                         0x00000001
   3114  1.1  riastrad #define ATOM_DEVICE_CONNECTOR_DVI_I                       0x00000002
   3115  1.1  riastrad #define ATOM_DEVICE_CONNECTOR_DVI_D                       0x00000003
   3116  1.1  riastrad #define ATOM_DEVICE_CONNECTOR_DVI_A                       0x00000004
   3117  1.1  riastrad #define ATOM_DEVICE_CONNECTOR_SVIDEO                      0x00000005
   3118  1.1  riastrad #define ATOM_DEVICE_CONNECTOR_COMPOSITE                   0x00000006
   3119  1.1  riastrad #define ATOM_DEVICE_CONNECTOR_LVDS                        0x00000007
   3120  1.1  riastrad #define ATOM_DEVICE_CONNECTOR_DIGI_LINK                   0x00000008
   3121  1.1  riastrad #define ATOM_DEVICE_CONNECTOR_SCART                       0x00000009
   3122  1.1  riastrad #define ATOM_DEVICE_CONNECTOR_HDMI_TYPE_A                 0x0000000A
   3123  1.1  riastrad #define ATOM_DEVICE_CONNECTOR_HDMI_TYPE_B                 0x0000000B
   3124  1.1  riastrad #define ATOM_DEVICE_CONNECTOR_CASE_1                      0x0000000E
   3125  1.1  riastrad #define ATOM_DEVICE_CONNECTOR_DISPLAYPORT                 0x0000000F
   3126  1.1  riastrad 
   3127  1.1  riastrad 
   3128  1.1  riastrad #define ATOM_DEVICE_DAC_INFO_MASK                         0x0000000F
   3129  1.1  riastrad #define ATOM_DEVICE_DAC_INFO_SHIFT                        0x00000000
   3130  1.1  riastrad #define ATOM_DEVICE_DAC_INFO_NODAC                        0x00000000
   3131  1.1  riastrad #define ATOM_DEVICE_DAC_INFO_DACA                         0x00000001
   3132  1.1  riastrad #define ATOM_DEVICE_DAC_INFO_DACB                         0x00000002
   3133  1.1  riastrad #define ATOM_DEVICE_DAC_INFO_EXDAC                        0x00000003
   3134  1.1  riastrad 
   3135  1.1  riastrad #define ATOM_DEVICE_I2C_ID_NOI2C                          0x00000000
   3136  1.1  riastrad 
   3137  1.1  riastrad #define ATOM_DEVICE_I2C_LINEMUX_MASK                      0x0000000F
   3138  1.1  riastrad #define ATOM_DEVICE_I2C_LINEMUX_SHIFT                     0x00000000
   3139  1.1  riastrad 
   3140  1.1  riastrad #define ATOM_DEVICE_I2C_ID_MASK                           0x00000070
   3141  1.1  riastrad #define ATOM_DEVICE_I2C_ID_SHIFT                          0x00000004
   3142  1.1  riastrad #define ATOM_DEVICE_I2C_ID_IS_FOR_NON_MM_USE              0x00000001
   3143  1.1  riastrad #define ATOM_DEVICE_I2C_ID_IS_FOR_MM_USE                  0x00000002
   3144  1.1  riastrad #define ATOM_DEVICE_I2C_ID_IS_FOR_SDVO_USE                0x00000003    //For IGP RS600
   3145  1.1  riastrad #define ATOM_DEVICE_I2C_ID_IS_FOR_DAC_SCL                 0x00000004    //For IGP RS690
   3146  1.1  riastrad 
   3147  1.1  riastrad #define ATOM_DEVICE_I2C_HARDWARE_CAP_MASK                 0x00000080
   3148  1.1  riastrad #define ATOM_DEVICE_I2C_HARDWARE_CAP_SHIFT                0x00000007
   3149  1.1  riastrad #define	ATOM_DEVICE_USES_SOFTWARE_ASSISTED_I2C            0x00000000
   3150  1.1  riastrad #define	ATOM_DEVICE_USES_HARDWARE_ASSISTED_I2C            0x00000001
   3151  1.1  riastrad 
   3152  1.1  riastrad //  usDeviceSupport:
   3153  1.1  riastrad //  Bits0	= 0 - no CRT1 support= 1- CRT1 is supported
   3154  1.1  riastrad //  Bit 1	= 0 - no LCD1 support= 1- LCD1 is supported
   3155  1.1  riastrad //  Bit 2	= 0 - no TV1  support= 1- TV1  is supported
   3156  1.1  riastrad //  Bit 3	= 0 - no DFP1 support= 1- DFP1 is supported
   3157  1.1  riastrad //  Bit 4	= 0 - no CRT2 support= 1- CRT2 is supported
   3158  1.1  riastrad //  Bit 5	= 0 - no LCD2 support= 1- LCD2 is supported
   3159  1.1  riastrad //  Bit 6	= 0 - no DFP6 support= 1- DFP6 is supported
   3160  1.1  riastrad //  Bit 7	= 0 - no DFP2 support= 1- DFP2 is supported
   3161  1.1  riastrad //  Bit 8	= 0 - no CV   support= 1- CV   is supported
   3162  1.1  riastrad //  Bit 9	= 0 - no DFP3 support= 1- DFP3 is supported
   3163  1.1  riastrad //  Bit 10      = 0 - no DFP4 support= 1- DFP4 is supported
   3164  1.1  riastrad //  Bit 11      = 0 - no DFP5 support= 1- DFP5 is supported
   3165  1.1  riastrad //
   3166  1.1  riastrad //
   3167  1.1  riastrad 
   3168  1.1  riastrad /****************************************************************************/
   3169  1.1  riastrad /* Structure used in MclkSS_InfoTable                                       */
   3170  1.1  riastrad /****************************************************************************/
   3171  1.1  riastrad //		ucI2C_ConfigID
   3172  1.1  riastrad //    [7:0] - I2C LINE Associate ID
   3173  1.1  riastrad //          = 0   - no I2C
   3174  1.1  riastrad //    [7]		-	HW_Cap        =	1,  [6:0]=HW assisted I2C ID(HW line selection)
   3175  1.1  riastrad //                          =	0,  [6:0]=SW assisted I2C ID
   3176  1.1  riastrad //    [6-4]	- HW_ENGINE_ID  =	1,  HW engine for NON multimedia use
   3177  1.1  riastrad //                          =	2,	HW engine for Multimedia use
   3178  1.1  riastrad //                          =	3-7	Reserved for future I2C engines
   3179  1.1  riastrad //		[3-0] - I2C_LINE_MUX  = A Mux number when it's HW assisted I2C or GPIO ID when it's SW I2C
   3180  1.1  riastrad 
   3181  1.1  riastrad typedef struct _ATOM_I2C_ID_CONFIG
   3182  1.1  riastrad {
   3183  1.1  riastrad #if ATOM_BIG_ENDIAN
   3184  1.1  riastrad   UCHAR   bfHW_Capable:1;
   3185  1.1  riastrad   UCHAR   bfHW_EngineID:3;
   3186  1.1  riastrad   UCHAR   bfI2C_LineMux:4;
   3187  1.1  riastrad #else
   3188  1.1  riastrad   UCHAR   bfI2C_LineMux:4;
   3189  1.1  riastrad   UCHAR   bfHW_EngineID:3;
   3190  1.1  riastrad   UCHAR   bfHW_Capable:1;
   3191  1.1  riastrad #endif
   3192  1.1  riastrad }ATOM_I2C_ID_CONFIG;
   3193  1.1  riastrad 
   3194  1.1  riastrad typedef union _ATOM_I2C_ID_CONFIG_ACCESS
   3195  1.1  riastrad {
   3196  1.1  riastrad   ATOM_I2C_ID_CONFIG sbfAccess;
   3197  1.1  riastrad   UCHAR              ucAccess;
   3198  1.1  riastrad }ATOM_I2C_ID_CONFIG_ACCESS;
   3199  1.1  riastrad 
   3200  1.1  riastrad 
   3201  1.1  riastrad /****************************************************************************/
   3202  1.1  riastrad // Structure used in GPIO_I2C_InfoTable
   3203  1.1  riastrad /****************************************************************************/
   3204  1.1  riastrad typedef struct _ATOM_GPIO_I2C_ASSIGMENT
   3205  1.1  riastrad {
   3206  1.1  riastrad   USHORT                    usClkMaskRegisterIndex;
   3207  1.1  riastrad   USHORT                    usClkEnRegisterIndex;
   3208  1.1  riastrad   USHORT                    usClkY_RegisterIndex;
   3209  1.1  riastrad   USHORT                    usClkA_RegisterIndex;
   3210  1.1  riastrad   USHORT                    usDataMaskRegisterIndex;
   3211  1.1  riastrad   USHORT                    usDataEnRegisterIndex;
   3212  1.1  riastrad   USHORT                    usDataY_RegisterIndex;
   3213  1.1  riastrad   USHORT                    usDataA_RegisterIndex;
   3214  1.1  riastrad   ATOM_I2C_ID_CONFIG_ACCESS sucI2cId;
   3215  1.1  riastrad   UCHAR                     ucClkMaskShift;
   3216  1.1  riastrad   UCHAR                     ucClkEnShift;
   3217  1.1  riastrad   UCHAR                     ucClkY_Shift;
   3218  1.1  riastrad   UCHAR                     ucClkA_Shift;
   3219  1.1  riastrad   UCHAR                     ucDataMaskShift;
   3220  1.1  riastrad   UCHAR                     ucDataEnShift;
   3221  1.1  riastrad   UCHAR                     ucDataY_Shift;
   3222  1.1  riastrad   UCHAR                     ucDataA_Shift;
   3223  1.1  riastrad   UCHAR                     ucReserved1;
   3224  1.1  riastrad   UCHAR                     ucReserved2;
   3225  1.1  riastrad }ATOM_GPIO_I2C_ASSIGMENT;
   3226  1.1  riastrad 
   3227  1.1  riastrad typedef struct _ATOM_GPIO_I2C_INFO
   3228  1.1  riastrad {
   3229  1.1  riastrad   ATOM_COMMON_TABLE_HEADER	sHeader;
   3230  1.1  riastrad   ATOM_GPIO_I2C_ASSIGMENT   asGPIO_Info[ATOM_MAX_SUPPORTED_DEVICE];
   3231  1.1  riastrad }ATOM_GPIO_I2C_INFO;
   3232  1.1  riastrad 
   3233  1.1  riastrad /****************************************************************************/
   3234  1.1  riastrad // Common Structure used in other structures
   3235  1.1  riastrad /****************************************************************************/
   3236  1.1  riastrad 
   3237  1.1  riastrad #ifndef _H2INC
   3238  1.1  riastrad 
   3239  1.1  riastrad //Please don't add or expand this bitfield structure below, this one will retire soon.!
   3240  1.1  riastrad typedef struct _ATOM_MODE_MISC_INFO
   3241  1.1  riastrad {
   3242  1.1  riastrad #if ATOM_BIG_ENDIAN
   3243  1.1  riastrad   USHORT Reserved:6;
   3244  1.1  riastrad   USHORT RGB888:1;
   3245  1.1  riastrad   USHORT DoubleClock:1;
   3246  1.1  riastrad   USHORT Interlace:1;
   3247  1.1  riastrad   USHORT CompositeSync:1;
   3248  1.1  riastrad   USHORT V_ReplicationBy2:1;
   3249  1.1  riastrad   USHORT H_ReplicationBy2:1;
   3250  1.1  riastrad   USHORT VerticalCutOff:1;
   3251  1.1  riastrad   USHORT VSyncPolarity:1;      //0=Active High, 1=Active Low
   3252  1.1  riastrad   USHORT HSyncPolarity:1;      //0=Active High, 1=Active Low
   3253  1.1  riastrad   USHORT HorizontalCutOff:1;
   3254  1.1  riastrad #else
   3255  1.1  riastrad   USHORT HorizontalCutOff:1;
   3256  1.1  riastrad   USHORT HSyncPolarity:1;      //0=Active High, 1=Active Low
   3257  1.1  riastrad   USHORT VSyncPolarity:1;      //0=Active High, 1=Active Low
   3258  1.1  riastrad   USHORT VerticalCutOff:1;
   3259  1.1  riastrad   USHORT H_ReplicationBy2:1;
   3260  1.1  riastrad   USHORT V_ReplicationBy2:1;
   3261  1.1  riastrad   USHORT CompositeSync:1;
   3262  1.1  riastrad   USHORT Interlace:1;
   3263  1.1  riastrad   USHORT DoubleClock:1;
   3264  1.1  riastrad   USHORT RGB888:1;
   3265  1.1  riastrad   USHORT Reserved:6;
   3266  1.1  riastrad #endif
   3267  1.1  riastrad }ATOM_MODE_MISC_INFO;
   3268  1.1  riastrad 
   3269  1.1  riastrad typedef union _ATOM_MODE_MISC_INFO_ACCESS
   3270  1.1  riastrad {
   3271  1.1  riastrad   ATOM_MODE_MISC_INFO sbfAccess;
   3272  1.1  riastrad   USHORT              usAccess;
   3273  1.1  riastrad }ATOM_MODE_MISC_INFO_ACCESS;
   3274  1.1  riastrad 
   3275  1.1  riastrad #else
   3276  1.1  riastrad 
   3277  1.1  riastrad typedef union _ATOM_MODE_MISC_INFO_ACCESS
   3278  1.1  riastrad {
   3279  1.1  riastrad   USHORT              usAccess;
   3280  1.1  riastrad }ATOM_MODE_MISC_INFO_ACCESS;
   3281  1.1  riastrad 
   3282  1.1  riastrad #endif
   3283  1.1  riastrad 
   3284  1.1  riastrad // usModeMiscInfo-
   3285  1.1  riastrad #define ATOM_H_CUTOFF           0x01
   3286  1.1  riastrad #define ATOM_HSYNC_POLARITY     0x02             //0=Active High, 1=Active Low
   3287  1.1  riastrad #define ATOM_VSYNC_POLARITY     0x04             //0=Active High, 1=Active Low
   3288  1.1  riastrad #define ATOM_V_CUTOFF           0x08
   3289  1.1  riastrad #define ATOM_H_REPLICATIONBY2   0x10
   3290  1.1  riastrad #define ATOM_V_REPLICATIONBY2   0x20
   3291  1.1  riastrad #define ATOM_COMPOSITESYNC      0x40
   3292  1.1  riastrad #define ATOM_INTERLACE          0x80
   3293  1.1  riastrad #define ATOM_DOUBLE_CLOCK_MODE  0x100
   3294  1.1  riastrad #define ATOM_RGB888_MODE        0x200
   3295  1.1  riastrad 
   3296  1.1  riastrad //usRefreshRate-
   3297  1.1  riastrad #define ATOM_REFRESH_43         43
   3298  1.1  riastrad #define ATOM_REFRESH_47         47
   3299  1.1  riastrad #define ATOM_REFRESH_56         56
   3300  1.1  riastrad #define ATOM_REFRESH_60         60
   3301  1.1  riastrad #define ATOM_REFRESH_65         65
   3302  1.1  riastrad #define ATOM_REFRESH_70         70
   3303  1.1  riastrad #define ATOM_REFRESH_72         72
   3304  1.1  riastrad #define ATOM_REFRESH_75         75
   3305  1.1  riastrad #define ATOM_REFRESH_85         85
   3306  1.1  riastrad 
   3307  1.1  riastrad // ATOM_MODE_TIMING data are exactly the same as VESA timing data.
   3308  1.1  riastrad // Translation from EDID to ATOM_MODE_TIMING, use the following formula.
   3309  1.1  riastrad //
   3310  1.1  riastrad //	VESA_HTOTAL			=	VESA_ACTIVE + 2* VESA_BORDER + VESA_BLANK
   3311  1.1  riastrad //						=	EDID_HA + EDID_HBL
   3312  1.1  riastrad //	VESA_HDISP			=	VESA_ACTIVE	=	EDID_HA
   3313  1.1  riastrad //	VESA_HSYNC_START	=	VESA_ACTIVE + VESA_BORDER + VESA_FRONT_PORCH
   3314  1.1  riastrad //						=	EDID_HA + EDID_HSO
   3315  1.1  riastrad //	VESA_HSYNC_WIDTH	=	VESA_HSYNC_TIME	=	EDID_HSPW
   3316  1.1  riastrad //	VESA_BORDER			=	EDID_BORDER
   3317  1.1  riastrad 
   3318  1.1  riastrad /****************************************************************************/
   3319  1.1  riastrad // Structure used in SetCRTC_UsingDTDTimingTable
   3320  1.1  riastrad /****************************************************************************/
   3321  1.1  riastrad typedef struct _SET_CRTC_USING_DTD_TIMING_PARAMETERS
   3322  1.1  riastrad {
   3323  1.1  riastrad   USHORT  usH_Size;
   3324  1.1  riastrad   USHORT  usH_Blanking_Time;
   3325  1.1  riastrad   USHORT  usV_Size;
   3326  1.1  riastrad   USHORT  usV_Blanking_Time;
   3327  1.1  riastrad   USHORT  usH_SyncOffset;
   3328  1.1  riastrad   USHORT  usH_SyncWidth;
   3329  1.1  riastrad   USHORT  usV_SyncOffset;
   3330  1.1  riastrad   USHORT  usV_SyncWidth;
   3331  1.1  riastrad   ATOM_MODE_MISC_INFO_ACCESS  susModeMiscInfo;
   3332  1.1  riastrad   UCHAR   ucH_Border;         // From DFP EDID
   3333  1.1  riastrad   UCHAR   ucV_Border;
   3334  1.1  riastrad   UCHAR   ucCRTC;             // ATOM_CRTC1 or ATOM_CRTC2
   3335  1.1  riastrad   UCHAR   ucPadding[3];
   3336  1.1  riastrad }SET_CRTC_USING_DTD_TIMING_PARAMETERS;
   3337  1.1  riastrad 
   3338  1.1  riastrad /****************************************************************************/
   3339  1.1  riastrad // Structure used in SetCRTC_TimingTable
   3340  1.1  riastrad /****************************************************************************/
   3341  1.1  riastrad typedef struct _SET_CRTC_TIMING_PARAMETERS
   3342  1.1  riastrad {
   3343  1.1  riastrad   USHORT                      usH_Total;        // horizontal total
   3344  1.1  riastrad   USHORT                      usH_Disp;         // horizontal display
   3345  1.1  riastrad   USHORT                      usH_SyncStart;    // horozontal Sync start
   3346  1.1  riastrad   USHORT                      usH_SyncWidth;    // horizontal Sync width
   3347  1.1  riastrad   USHORT                      usV_Total;        // vertical total
   3348  1.1  riastrad   USHORT                      usV_Disp;         // vertical display
   3349  1.1  riastrad   USHORT                      usV_SyncStart;    // vertical Sync start
   3350  1.1  riastrad   USHORT                      usV_SyncWidth;    // vertical Sync width
   3351  1.1  riastrad   ATOM_MODE_MISC_INFO_ACCESS  susModeMiscInfo;
   3352  1.1  riastrad   UCHAR                       ucCRTC;           // ATOM_CRTC1 or ATOM_CRTC2
   3353  1.1  riastrad   UCHAR                       ucOverscanRight;  // right
   3354  1.1  riastrad   UCHAR                       ucOverscanLeft;   // left
   3355  1.1  riastrad   UCHAR                       ucOverscanBottom; // bottom
   3356  1.1  riastrad   UCHAR                       ucOverscanTop;    // top
   3357  1.1  riastrad   UCHAR                       ucReserved;
   3358  1.1  riastrad }SET_CRTC_TIMING_PARAMETERS;
   3359  1.1  riastrad #define SET_CRTC_TIMING_PARAMETERS_PS_ALLOCATION SET_CRTC_TIMING_PARAMETERS
   3360  1.1  riastrad 
   3361  1.1  riastrad /****************************************************************************/
   3362  1.1  riastrad // Structure used in StandardVESA_TimingTable
   3363  1.1  riastrad //                   AnalogTV_InfoTable
   3364  1.1  riastrad //                   ComponentVideoInfoTable
   3365  1.1  riastrad /****************************************************************************/
   3366  1.1  riastrad typedef struct _ATOM_MODE_TIMING
   3367  1.1  riastrad {
   3368  1.1  riastrad   USHORT  usCRTC_H_Total;
   3369  1.1  riastrad   USHORT  usCRTC_H_Disp;
   3370  1.1  riastrad   USHORT  usCRTC_H_SyncStart;
   3371  1.1  riastrad   USHORT  usCRTC_H_SyncWidth;
   3372  1.1  riastrad   USHORT  usCRTC_V_Total;
   3373  1.1  riastrad   USHORT  usCRTC_V_Disp;
   3374  1.1  riastrad   USHORT  usCRTC_V_SyncStart;
   3375  1.1  riastrad   USHORT  usCRTC_V_SyncWidth;
   3376  1.1  riastrad   USHORT  usPixelClock;					                 //in 10Khz unit
   3377  1.1  riastrad   ATOM_MODE_MISC_INFO_ACCESS  susModeMiscInfo;
   3378  1.1  riastrad   USHORT  usCRTC_OverscanRight;
   3379  1.1  riastrad   USHORT  usCRTC_OverscanLeft;
   3380  1.1  riastrad   USHORT  usCRTC_OverscanBottom;
   3381  1.1  riastrad   USHORT  usCRTC_OverscanTop;
   3382  1.1  riastrad   USHORT  usReserve;
   3383  1.1  riastrad   UCHAR   ucInternalModeNumber;
   3384  1.1  riastrad   UCHAR   ucRefreshRate;
   3385  1.1  riastrad }ATOM_MODE_TIMING;
   3386  1.1  riastrad 
   3387  1.1  riastrad typedef struct _ATOM_DTD_FORMAT
   3388  1.1  riastrad {
   3389  1.1  riastrad   USHORT  usPixClk;
   3390  1.1  riastrad   USHORT  usHActive;
   3391  1.1  riastrad   USHORT  usHBlanking_Time;
   3392  1.1  riastrad   USHORT  usVActive;
   3393  1.1  riastrad   USHORT  usVBlanking_Time;
   3394  1.1  riastrad   USHORT  usHSyncOffset;
   3395  1.1  riastrad   USHORT  usHSyncWidth;
   3396  1.1  riastrad   USHORT  usVSyncOffset;
   3397  1.1  riastrad   USHORT  usVSyncWidth;
   3398  1.1  riastrad   USHORT  usImageHSize;
   3399  1.1  riastrad   USHORT  usImageVSize;
   3400  1.1  riastrad   UCHAR   ucHBorder;
   3401  1.1  riastrad   UCHAR   ucVBorder;
   3402  1.1  riastrad   ATOM_MODE_MISC_INFO_ACCESS susModeMiscInfo;
   3403  1.1  riastrad   UCHAR   ucInternalModeNumber;
   3404  1.1  riastrad   UCHAR   ucRefreshRate;
   3405  1.1  riastrad }ATOM_DTD_FORMAT;
   3406  1.1  riastrad 
   3407  1.1  riastrad /****************************************************************************/
   3408  1.1  riastrad // Structure used in LVDS_InfoTable
   3409  1.1  riastrad //  * Need a document to describe this table
   3410  1.1  riastrad /****************************************************************************/
   3411  1.1  riastrad #define SUPPORTED_LCD_REFRESHRATE_30Hz          0x0004
   3412  1.1  riastrad #define SUPPORTED_LCD_REFRESHRATE_40Hz          0x0008
   3413  1.1  riastrad #define SUPPORTED_LCD_REFRESHRATE_50Hz          0x0010
   3414  1.1  riastrad #define SUPPORTED_LCD_REFRESHRATE_60Hz          0x0020
   3415  1.1  riastrad 
   3416  1.1  riastrad //ucTableFormatRevision=1
   3417  1.1  riastrad //ucTableContentRevision=1
   3418  1.1  riastrad typedef struct _ATOM_LVDS_INFO
   3419  1.1  riastrad {
   3420  1.1  riastrad   ATOM_COMMON_TABLE_HEADER sHeader;
   3421  1.1  riastrad   ATOM_DTD_FORMAT     sLCDTiming;
   3422  1.1  riastrad   USHORT              usModePatchTableOffset;
   3423  1.1  riastrad   USHORT              usSupportedRefreshRate;     //Refer to panel info table in ATOMBIOS extension Spec.
   3424  1.1  riastrad   USHORT              usOffDelayInMs;
   3425  1.1  riastrad   UCHAR               ucPowerSequenceDigOntoDEin10Ms;
   3426  1.1  riastrad   UCHAR               ucPowerSequenceDEtoBLOnin10Ms;
   3427  1.1  riastrad   UCHAR               ucLVDS_Misc;               // Bit0:{=0:single, =1:dual},Bit1 {=0:666RGB, =1:888RGB},Bit2:3:{Grey level}
   3428  1.1  riastrad                                                  // Bit4:{=0:LDI format for RGB888, =1 FPDI format for RGB888}
   3429  1.1  riastrad                                                  // Bit5:{=0:Spatial Dithering disabled;1 Spatial Dithering enabled}
   3430  1.1  riastrad                                                  // Bit6:{=0:Temporal Dithering disabled;1 Temporal Dithering enabled}
   3431  1.1  riastrad   UCHAR               ucPanelDefaultRefreshRate;
   3432  1.1  riastrad   UCHAR               ucPanelIdentification;
   3433  1.1  riastrad   UCHAR               ucSS_Id;
   3434  1.1  riastrad }ATOM_LVDS_INFO;
   3435  1.1  riastrad 
   3436  1.1  riastrad //ucTableFormatRevision=1
   3437  1.1  riastrad //ucTableContentRevision=2
   3438  1.1  riastrad typedef struct _ATOM_LVDS_INFO_V12
   3439  1.1  riastrad {
   3440  1.1  riastrad   ATOM_COMMON_TABLE_HEADER sHeader;
   3441  1.1  riastrad   ATOM_DTD_FORMAT     sLCDTiming;
   3442  1.1  riastrad   USHORT              usExtInfoTableOffset;
   3443  1.1  riastrad   USHORT              usSupportedRefreshRate;     //Refer to panel info table in ATOMBIOS extension Spec.
   3444  1.1  riastrad   USHORT              usOffDelayInMs;
   3445  1.1  riastrad   UCHAR               ucPowerSequenceDigOntoDEin10Ms;
   3446  1.1  riastrad   UCHAR               ucPowerSequenceDEtoBLOnin10Ms;
   3447  1.1  riastrad   UCHAR               ucLVDS_Misc;               // Bit0:{=0:single, =1:dual},Bit1 {=0:666RGB, =1:888RGB},Bit2:3:{Grey level}
   3448  1.1  riastrad                                                  // Bit4:{=0:LDI format for RGB888, =1 FPDI format for RGB888}
   3449  1.1  riastrad                                                  // Bit5:{=0:Spatial Dithering disabled;1 Spatial Dithering enabled}
   3450  1.1  riastrad                                                  // Bit6:{=0:Temporal Dithering disabled;1 Temporal Dithering enabled}
   3451  1.1  riastrad   UCHAR               ucPanelDefaultRefreshRate;
   3452  1.1  riastrad   UCHAR               ucPanelIdentification;
   3453  1.1  riastrad   UCHAR               ucSS_Id;
   3454  1.1  riastrad   USHORT              usLCDVenderID;
   3455  1.1  riastrad   USHORT              usLCDProductID;
   3456  1.1  riastrad   UCHAR               ucLCDPanel_SpecialHandlingCap;
   3457  1.1  riastrad 	UCHAR								ucPanelInfoSize;					//  start from ATOM_DTD_FORMAT to end of panel info, include ExtInfoTable
   3458  1.1  riastrad   UCHAR               ucReserved[2];
   3459  1.1  riastrad }ATOM_LVDS_INFO_V12;
   3460  1.1  riastrad 
   3461  1.1  riastrad //Definitions for ucLCDPanel_SpecialHandlingCap:
   3462  1.1  riastrad 
   3463  1.1  riastrad //Once DAL sees this CAP is set, it will read EDID from LCD on its own instead of using sLCDTiming in ATOM_LVDS_INFO_V12.
   3464  1.1  riastrad //Other entries in ATOM_LVDS_INFO_V12 are still valid/useful to DAL
   3465  1.1  riastrad #define	LCDPANEL_CAP_READ_EDID                  0x1
   3466  1.1  riastrad 
   3467  1.1  riastrad //If a design supports DRR (dynamic refresh rate) on internal panels (LVDS or EDP), this cap is set in ucLCDPanel_SpecialHandlingCap together
   3468  1.1  riastrad //with multiple supported refresh rates@usSupportedRefreshRate. This cap should not be set when only slow refresh rate is supported (static
   3469  1.1  riastrad //refresh rate switch by SW. This is only valid from ATOM_LVDS_INFO_V12
   3470  1.1  riastrad #define	LCDPANEL_CAP_DRR_SUPPORTED              0x2
   3471  1.1  riastrad 
   3472  1.1  riastrad //Use this cap bit for a quick reference whether an embadded panel (LCD1 ) is LVDS or eDP.
   3473  1.1  riastrad #define	LCDPANEL_CAP_eDP                        0x4
   3474  1.1  riastrad 
   3475  1.1  riastrad 
   3476  1.1  riastrad //Color Bit Depth definition in EDID V1.4 @BYTE 14h
   3477  1.1  riastrad //Bit 6  5  4
   3478  1.1  riastrad                               //      0  0  0  -  Color bit depth is undefined
   3479  1.1  riastrad                               //      0  0  1  -  6 Bits per Primary Color
   3480  1.1  riastrad                               //      0  1  0  -  8 Bits per Primary Color
   3481  1.1  riastrad                               //      0  1  1  - 10 Bits per Primary Color
   3482  1.1  riastrad                               //      1  0  0  - 12 Bits per Primary Color
   3483  1.1  riastrad                               //      1  0  1  - 14 Bits per Primary Color
   3484  1.1  riastrad                               //      1  1  0  - 16 Bits per Primary Color
   3485  1.1  riastrad                               //      1  1  1  - Reserved
   3486  1.1  riastrad 
   3487  1.1  riastrad #define PANEL_COLOR_BIT_DEPTH_MASK    0x70
   3488  1.1  riastrad 
   3489  1.1  riastrad // Bit7:{=0:Random Dithering disabled;1 Random Dithering enabled}
   3490  1.1  riastrad #define PANEL_RANDOM_DITHER   0x80
   3491  1.1  riastrad #define PANEL_RANDOM_DITHER_MASK   0x80
   3492  1.1  riastrad 
   3493  1.1  riastrad #define ATOM_LVDS_INFO_LAST  ATOM_LVDS_INFO_V12   // no need to change this
   3494  1.1  riastrad 
   3495  1.1  riastrad /****************************************************************************/
   3496  1.1  riastrad // Structures used by LCD_InfoTable V1.3    Note: previous version was called ATOM_LVDS_INFO_V12
   3497  1.1  riastrad // ASIC Families:  NI
   3498  1.1  riastrad // ucTableFormatRevision=1
   3499  1.1  riastrad // ucTableContentRevision=3
   3500  1.1  riastrad /****************************************************************************/
   3501  1.1  riastrad typedef struct _ATOM_LCD_INFO_V13
   3502  1.1  riastrad {
   3503  1.1  riastrad   ATOM_COMMON_TABLE_HEADER sHeader;
   3504  1.1  riastrad   ATOM_DTD_FORMAT     sLCDTiming;
   3505  1.1  riastrad   USHORT              usExtInfoTableOffset;
   3506  1.1  riastrad   USHORT              usSupportedRefreshRate;     //Refer to panel info table in ATOMBIOS extension Spec.
   3507  1.1  riastrad   ULONG               ulReserved0;
   3508  1.1  riastrad   UCHAR               ucLCD_Misc;                // Reorganized in V13
   3509  1.1  riastrad                                                  // Bit0: {=0:single, =1:dual},
   3510  1.1  riastrad                                                  // Bit1: {=0:LDI format for RGB888, =1 FPDI format for RGB888}  // was {=0:666RGB, =1:888RGB},
   3511  1.1  riastrad                                                  // Bit3:2: {Grey level}
   3512  1.1  riastrad                                                  // Bit6:4 Color Bit Depth definition (see below definition in EDID V1.4 @BYTE 14h)
   3513  1.1  riastrad                                                  // Bit7   Reserved.  was for ATOM_PANEL_MISC_API_ENABLED, still need it?
   3514  1.1  riastrad   UCHAR               ucPanelDefaultRefreshRate;
   3515  1.1  riastrad   UCHAR               ucPanelIdentification;
   3516  1.1  riastrad   UCHAR               ucSS_Id;
   3517  1.1  riastrad   USHORT              usLCDVenderID;
   3518  1.1  riastrad   USHORT              usLCDProductID;
   3519  1.1  riastrad   UCHAR               ucLCDPanel_SpecialHandlingCap;  // Reorganized in V13
   3520  1.1  riastrad                                                  // Bit0: Once DAL sees this CAP is set, it will read EDID from LCD on its own
   3521  1.1  riastrad                                                  // Bit1: See LCDPANEL_CAP_DRR_SUPPORTED
   3522  1.1  riastrad                                                  // Bit2: a quick reference whether an embadded panel (LCD1 ) is LVDS (0) or eDP (1)
   3523  1.1  riastrad                                                  // Bit7-3: Reserved
   3524  1.1  riastrad   UCHAR               ucPanelInfoSize;					 //  start from ATOM_DTD_FORMAT to end of panel info, include ExtInfoTable
   3525  1.1  riastrad   USHORT              usBacklightPWM;            //  Backlight PWM in Hz. New in _V13
   3526  1.1  riastrad 
   3527  1.1  riastrad   UCHAR               ucPowerSequenceDIGONtoDE_in4Ms;
   3528  1.1  riastrad   UCHAR               ucPowerSequenceDEtoVARY_BL_in4Ms;
   3529  1.1  riastrad   UCHAR               ucPowerSequenceVARY_BLtoDE_in4Ms;
   3530  1.1  riastrad   UCHAR               ucPowerSequenceDEtoDIGON_in4Ms;
   3531  1.1  riastrad 
   3532  1.1  riastrad   UCHAR               ucOffDelay_in4Ms;
   3533  1.1  riastrad   UCHAR               ucPowerSequenceVARY_BLtoBLON_in4Ms;
   3534  1.1  riastrad   UCHAR               ucPowerSequenceBLONtoVARY_BL_in4Ms;
   3535  1.1  riastrad   UCHAR               ucReserved1;
   3536  1.1  riastrad 
   3537  1.1  riastrad   UCHAR               ucDPCD_eDP_CONFIGURATION_CAP;     // dpcd 0dh
   3538  1.1  riastrad   UCHAR               ucDPCD_MAX_LINK_RATE;             // dpcd 01h
   3539  1.1  riastrad   UCHAR               ucDPCD_MAX_LANE_COUNT;            // dpcd 02h
   3540  1.1  riastrad   UCHAR               ucDPCD_MAX_DOWNSPREAD;            // dpcd 03h
   3541  1.1  riastrad 
   3542  1.1  riastrad   USHORT              usMaxPclkFreqInSingleLink;        // Max PixelClock frequency in single link mode.
   3543  1.1  riastrad   UCHAR               uceDPToLVDSRxId;
   3544  1.1  riastrad   UCHAR               ucLcdReservd;
   3545  1.1  riastrad   ULONG               ulReserved[2];
   3546  1.1  riastrad }ATOM_LCD_INFO_V13;
   3547  1.1  riastrad 
   3548  1.1  riastrad #define ATOM_LCD_INFO_LAST  ATOM_LCD_INFO_V13
   3549  1.1  riastrad 
   3550  1.1  riastrad //Definitions for ucLCD_Misc
   3551  1.1  riastrad #define ATOM_PANEL_MISC_V13_DUAL                   0x00000001
   3552  1.1  riastrad #define ATOM_PANEL_MISC_V13_FPDI                   0x00000002
   3553  1.1  riastrad #define ATOM_PANEL_MISC_V13_GREY_LEVEL             0x0000000C
   3554  1.1  riastrad #define ATOM_PANEL_MISC_V13_GREY_LEVEL_SHIFT       2
   3555  1.1  riastrad #define ATOM_PANEL_MISC_V13_COLOR_BIT_DEPTH_MASK   0x70
   3556  1.1  riastrad #define ATOM_PANEL_MISC_V13_6BIT_PER_COLOR         0x10
   3557  1.1  riastrad #define ATOM_PANEL_MISC_V13_8BIT_PER_COLOR         0x20
   3558  1.1  riastrad 
   3559  1.1  riastrad //Color Bit Depth definition in EDID V1.4 @BYTE 14h
   3560  1.1  riastrad //Bit 6  5  4
   3561  1.1  riastrad                               //      0  0  0  -  Color bit depth is undefined
   3562  1.1  riastrad                               //      0  0  1  -  6 Bits per Primary Color
   3563  1.1  riastrad                               //      0  1  0  -  8 Bits per Primary Color
   3564  1.1  riastrad                               //      0  1  1  - 10 Bits per Primary Color
   3565  1.1  riastrad                               //      1  0  0  - 12 Bits per Primary Color
   3566  1.1  riastrad                               //      1  0  1  - 14 Bits per Primary Color
   3567  1.1  riastrad                               //      1  1  0  - 16 Bits per Primary Color
   3568  1.1  riastrad                               //      1  1  1  - Reserved
   3569  1.1  riastrad 
   3570  1.1  riastrad //Definitions for ucLCDPanel_SpecialHandlingCap:
   3571  1.1  riastrad 
   3572  1.1  riastrad //Once DAL sees this CAP is set, it will read EDID from LCD on its own instead of using sLCDTiming in ATOM_LVDS_INFO_V12.
   3573  1.1  riastrad //Other entries in ATOM_LVDS_INFO_V12 are still valid/useful to DAL
   3574  1.1  riastrad #define	LCDPANEL_CAP_V13_READ_EDID              0x1        // = LCDPANEL_CAP_READ_EDID no change comparing to previous version
   3575  1.1  riastrad 
   3576  1.1  riastrad //If a design supports DRR (dynamic refresh rate) on internal panels (LVDS or EDP), this cap is set in ucLCDPanel_SpecialHandlingCap together
   3577  1.1  riastrad //with multiple supported refresh rates@usSupportedRefreshRate. This cap should not be set when only slow refresh rate is supported (static
   3578  1.1  riastrad //refresh rate switch by SW. This is only valid from ATOM_LVDS_INFO_V12
   3579  1.1  riastrad #define	LCDPANEL_CAP_V13_DRR_SUPPORTED          0x2        // = LCDPANEL_CAP_DRR_SUPPORTED no change comparing to previous version
   3580  1.1  riastrad 
   3581  1.1  riastrad //Use this cap bit for a quick reference whether an embadded panel (LCD1 ) is LVDS or eDP.
   3582  1.1  riastrad #define	LCDPANEL_CAP_V13_eDP                    0x4        // = LCDPANEL_CAP_eDP no change comparing to previous version
   3583  1.1  riastrad 
   3584  1.1  riastrad //uceDPToLVDSRxId
   3585  1.1  riastrad #define eDP_TO_LVDS_RX_DISABLE                  0x00       // no eDP->LVDS translator chip
   3586  1.1  riastrad #define eDP_TO_LVDS_COMMON_ID                   0x01       // common eDP->LVDS translator chip without AMD SW init
   3587  1.1  riastrad #define eDP_TO_LVDS_RT_ID                       0x02       // RT tanslator which require AMD SW init
   3588  1.1  riastrad 
   3589  1.1  riastrad typedef struct  _ATOM_PATCH_RECORD_MODE
   3590  1.1  riastrad {
   3591  1.1  riastrad   UCHAR     ucRecordType;
   3592  1.1  riastrad   USHORT    usHDisp;
   3593  1.1  riastrad   USHORT    usVDisp;
   3594  1.1  riastrad }ATOM_PATCH_RECORD_MODE;
   3595  1.1  riastrad 
   3596  1.1  riastrad typedef struct  _ATOM_LCD_RTS_RECORD
   3597  1.1  riastrad {
   3598  1.1  riastrad   UCHAR     ucRecordType;
   3599  1.1  riastrad   UCHAR     ucRTSValue;
   3600  1.1  riastrad }ATOM_LCD_RTS_RECORD;
   3601  1.1  riastrad 
   3602  1.1  riastrad //!! If the record below exits, it shoud always be the first record for easy use in command table!!!
   3603  1.1  riastrad // The record below is only used when LVDS_Info is present. From ATOM_LVDS_INFO_V12, use ucLCDPanel_SpecialHandlingCap instead.
   3604  1.1  riastrad typedef struct  _ATOM_LCD_MODE_CONTROL_CAP
   3605  1.1  riastrad {
   3606  1.1  riastrad   UCHAR     ucRecordType;
   3607  1.1  riastrad   USHORT    usLCDCap;
   3608  1.1  riastrad }ATOM_LCD_MODE_CONTROL_CAP;
   3609  1.1  riastrad 
   3610  1.1  riastrad #define LCD_MODE_CAP_BL_OFF                   1
   3611  1.1  riastrad #define LCD_MODE_CAP_CRTC_OFF                 2
   3612  1.1  riastrad #define LCD_MODE_CAP_PANEL_OFF                4
   3613  1.1  riastrad 
   3614  1.1  riastrad typedef struct _ATOM_FAKE_EDID_PATCH_RECORD
   3615  1.1  riastrad {
   3616  1.1  riastrad   UCHAR ucRecordType;
   3617  1.1  riastrad   UCHAR ucFakeEDIDLength;
   3618  1.1  riastrad   UCHAR ucFakeEDIDString[1];    // This actually has ucFakeEdidLength elements.
   3619  1.1  riastrad } ATOM_FAKE_EDID_PATCH_RECORD;
   3620  1.1  riastrad 
   3621  1.1  riastrad typedef struct  _ATOM_PANEL_RESOLUTION_PATCH_RECORD
   3622  1.1  riastrad {
   3623  1.1  riastrad    UCHAR    ucRecordType;
   3624  1.1  riastrad    USHORT		usHSize;
   3625  1.1  riastrad    USHORT		usVSize;
   3626  1.1  riastrad }ATOM_PANEL_RESOLUTION_PATCH_RECORD;
   3627  1.1  riastrad 
   3628  1.1  riastrad #define LCD_MODE_PATCH_RECORD_MODE_TYPE       1
   3629  1.1  riastrad #define LCD_RTS_RECORD_TYPE                   2
   3630  1.1  riastrad #define LCD_CAP_RECORD_TYPE                   3
   3631  1.1  riastrad #define LCD_FAKE_EDID_PATCH_RECORD_TYPE       4
   3632  1.1  riastrad #define LCD_PANEL_RESOLUTION_RECORD_TYPE      5
   3633  1.1  riastrad #define LCD_EDID_OFFSET_PATCH_RECORD_TYPE     6
   3634  1.1  riastrad #define ATOM_RECORD_END_TYPE                  0xFF
   3635  1.1  riastrad 
   3636  1.1  riastrad /****************************Spread Spectrum Info Table Definitions **********************/
   3637  1.1  riastrad 
   3638  1.1  riastrad //ucTableFormatRevision=1
   3639  1.1  riastrad //ucTableContentRevision=2
   3640  1.1  riastrad typedef struct _ATOM_SPREAD_SPECTRUM_ASSIGNMENT
   3641  1.1  riastrad {
   3642  1.1  riastrad   USHORT              usSpreadSpectrumPercentage;
   3643  1.1  riastrad   UCHAR               ucSpreadSpectrumType;	    //Bit1=0 Down Spread,=1 Center Spread. Bit1=1 Ext. =0 Int. Bit2=1: PCIE REFCLK SS =0 iternal PPLL SS  Others:TBD
   3644  1.1  riastrad   UCHAR               ucSS_Step;
   3645  1.1  riastrad   UCHAR               ucSS_Delay;
   3646  1.1  riastrad   UCHAR               ucSS_Id;
   3647  1.1  riastrad   UCHAR               ucRecommendedRef_Div;
   3648  1.1  riastrad   UCHAR               ucSS_Range;               //it was reserved for V11
   3649  1.1  riastrad }ATOM_SPREAD_SPECTRUM_ASSIGNMENT;
   3650  1.1  riastrad 
   3651  1.1  riastrad #define ATOM_MAX_SS_ENTRY                      16
   3652  1.1  riastrad #define ATOM_DP_SS_ID1												 0x0f1			// SS ID for internal DP stream at 2.7Ghz. if ATOM_DP_SS_ID2 does not exist in SS_InfoTable, it is used for internal DP stream at 1.62Ghz as well.
   3653  1.1  riastrad #define ATOM_DP_SS_ID2												 0x0f2			// SS ID for internal DP stream at 1.62Ghz, if it exists in SS_InfoTable.
   3654  1.1  riastrad #define ATOM_LVLINK_2700MHz_SS_ID              0x0f3      // SS ID for LV link translator chip at 2.7Ghz
   3655  1.1  riastrad #define ATOM_LVLINK_1620MHz_SS_ID              0x0f4      // SS ID for LV link translator chip at 1.62Ghz
   3656  1.1  riastrad 
   3657  1.1  riastrad 
   3658  1.1  riastrad #define ATOM_SS_DOWN_SPREAD_MODE_MASK          0x00000000
   3659  1.1  riastrad #define ATOM_SS_DOWN_SPREAD_MODE               0x00000000
   3660  1.1  riastrad #define ATOM_SS_CENTRE_SPREAD_MODE_MASK        0x00000001
   3661  1.1  riastrad #define ATOM_SS_CENTRE_SPREAD_MODE             0x00000001
   3662  1.1  riastrad #define ATOM_INTERNAL_SS_MASK                  0x00000000
   3663  1.1  riastrad #define ATOM_EXTERNAL_SS_MASK                  0x00000002
   3664  1.1  riastrad #define EXEC_SS_STEP_SIZE_SHIFT                2
   3665  1.1  riastrad #define EXEC_SS_DELAY_SHIFT                    4
   3666  1.1  riastrad #define ACTIVEDATA_TO_BLON_DELAY_SHIFT         4
   3667  1.1  riastrad 
   3668  1.1  riastrad typedef struct _ATOM_SPREAD_SPECTRUM_INFO
   3669  1.1  riastrad {
   3670  1.1  riastrad   ATOM_COMMON_TABLE_HEADER	sHeader;
   3671  1.1  riastrad   ATOM_SPREAD_SPECTRUM_ASSIGNMENT   asSS_Info[ATOM_MAX_SS_ENTRY];
   3672  1.1  riastrad }ATOM_SPREAD_SPECTRUM_INFO;
   3673  1.1  riastrad 
   3674  1.1  riastrad /****************************************************************************/
   3675  1.1  riastrad // Structure used in AnalogTV_InfoTable (Top level)
   3676  1.1  riastrad /****************************************************************************/
   3677  1.1  riastrad //ucTVBootUpDefaultStd definition:
   3678  1.1  riastrad 
   3679  1.1  riastrad //ATOM_TV_NTSC                1
   3680  1.1  riastrad //ATOM_TV_NTSCJ               2
   3681  1.1  riastrad //ATOM_TV_PAL                 3
   3682  1.1  riastrad //ATOM_TV_PALM                4
   3683  1.1  riastrad //ATOM_TV_PALCN               5
   3684  1.1  riastrad //ATOM_TV_PALN                6
   3685  1.1  riastrad //ATOM_TV_PAL60               7
   3686  1.1  riastrad //ATOM_TV_SECAM               8
   3687  1.1  riastrad 
   3688  1.1  riastrad //ucTVSupportedStd definition:
   3689  1.1  riastrad #define NTSC_SUPPORT          0x1
   3690  1.1  riastrad #define NTSCJ_SUPPORT         0x2
   3691  1.1  riastrad 
   3692  1.1  riastrad #define PAL_SUPPORT           0x4
   3693  1.1  riastrad #define PALM_SUPPORT          0x8
   3694  1.1  riastrad #define PALCN_SUPPORT         0x10
   3695  1.1  riastrad #define PALN_SUPPORT          0x20
   3696  1.1  riastrad #define PAL60_SUPPORT         0x40
   3697  1.1  riastrad #define SECAM_SUPPORT         0x80
   3698  1.1  riastrad 
   3699  1.1  riastrad #define MAX_SUPPORTED_TV_TIMING    2
   3700  1.1  riastrad 
   3701  1.1  riastrad typedef struct _ATOM_ANALOG_TV_INFO
   3702  1.1  riastrad {
   3703  1.1  riastrad   ATOM_COMMON_TABLE_HEADER sHeader;
   3704  1.1  riastrad   UCHAR                    ucTV_SupportedStandard;
   3705  1.1  riastrad   UCHAR                    ucTV_BootUpDefaultStandard;
   3706  1.1  riastrad   UCHAR                    ucExt_TV_ASIC_ID;
   3707  1.1  riastrad   UCHAR                    ucExt_TV_ASIC_SlaveAddr;
   3708  1.1  riastrad   /*ATOM_DTD_FORMAT          aModeTimings[MAX_SUPPORTED_TV_TIMING];*/
   3709  1.1  riastrad   ATOM_MODE_TIMING         aModeTimings[MAX_SUPPORTED_TV_TIMING];
   3710  1.1  riastrad }ATOM_ANALOG_TV_INFO;
   3711  1.1  riastrad 
   3712  1.1  riastrad #define MAX_SUPPORTED_TV_TIMING_V1_2    3
   3713  1.1  riastrad 
   3714  1.1  riastrad typedef struct _ATOM_ANALOG_TV_INFO_V1_2
   3715  1.1  riastrad {
   3716  1.1  riastrad   ATOM_COMMON_TABLE_HEADER sHeader;
   3717  1.1  riastrad   UCHAR                    ucTV_SupportedStandard;
   3718  1.1  riastrad   UCHAR                    ucTV_BootUpDefaultStandard;
   3719  1.1  riastrad   UCHAR                    ucExt_TV_ASIC_ID;
   3720  1.1  riastrad   UCHAR                    ucExt_TV_ASIC_SlaveAddr;
   3721  1.1  riastrad   ATOM_DTD_FORMAT          aModeTimings[MAX_SUPPORTED_TV_TIMING_V1_2];
   3722  1.1  riastrad }ATOM_ANALOG_TV_INFO_V1_2;
   3723  1.1  riastrad 
   3724  1.1  riastrad typedef struct _ATOM_DPCD_INFO
   3725  1.1  riastrad {
   3726  1.1  riastrad   UCHAR   ucRevisionNumber;        //10h : Revision 1.0; 11h : Revision 1.1
   3727  1.1  riastrad   UCHAR   ucMaxLinkRate;           //06h : 1.62Gbps per lane; 0Ah = 2.7Gbps per lane
   3728  1.1  riastrad   UCHAR   ucMaxLane;               //Bits 4:0 = MAX_LANE_COUNT (1/2/4). Bit 7 = ENHANCED_FRAME_CAP
   3729  1.1  riastrad   UCHAR   ucMaxDownSpread;         //Bit0 = 0: No Down spread; Bit0 = 1: 0.5% (Subject to change according to DP spec)
   3730  1.1  riastrad }ATOM_DPCD_INFO;
   3731  1.1  riastrad 
   3732  1.1  riastrad #define ATOM_DPCD_MAX_LANE_MASK    0x1F
   3733  1.1  riastrad 
   3734  1.1  riastrad /**************************************************************************/
   3735  1.2       wiz // VRAM usage and their definitions
   3736  1.1  riastrad 
   3737  1.1  riastrad // One chunk of VRAM used by Bios are for HWICON surfaces,EDID data.
   3738  1.1  riastrad // Current Mode timing and Dail Timing and/or STD timing data EACH device. They can be broken down as below.
   3739  1.1  riastrad // All the addresses below are the offsets from the frame buffer start.They all MUST be Dword aligned!
   3740  1.1  riastrad // To driver: The physical address of this memory portion=mmFB_START(4K aligned)+ATOMBIOS_VRAM_USAGE_START_ADDR+ATOM_x_ADDR
   3741  1.1  riastrad // To Bios:  ATOMBIOS_VRAM_USAGE_START_ADDR+ATOM_x_ADDR->MM_INDEX
   3742  1.1  riastrad 
   3743  1.1  riastrad #ifndef VESA_MEMORY_IN_64K_BLOCK
   3744  1.1  riastrad #define VESA_MEMORY_IN_64K_BLOCK        0x100       //256*64K=16Mb (Max. VESA memory is 16Mb!)
   3745  1.1  riastrad #endif
   3746  1.1  riastrad 
   3747  1.1  riastrad #define ATOM_EDID_RAW_DATASIZE          256         //In Bytes
   3748  1.1  riastrad #define ATOM_HWICON_SURFACE_SIZE        4096        //In Bytes
   3749  1.1  riastrad #define ATOM_HWICON_INFOTABLE_SIZE      32
   3750  1.1  riastrad #define MAX_DTD_MODE_IN_VRAM            6
   3751  1.1  riastrad #define ATOM_DTD_MODE_SUPPORT_TBL_SIZE  (MAX_DTD_MODE_IN_VRAM*28)    //28= (SIZEOF ATOM_DTD_FORMAT)
   3752  1.1  riastrad #define ATOM_STD_MODE_SUPPORT_TBL_SIZE  32*8                         //32 is a predefined number,8= (SIZEOF ATOM_STD_FORMAT)
   3753  1.1  riastrad //20 bytes for Encoder Type and DPCD in STD EDID area
   3754  1.1  riastrad #define DFP_ENCODER_TYPE_OFFSET         (ATOM_EDID_RAW_DATASIZE + ATOM_DTD_MODE_SUPPORT_TBL_SIZE + ATOM_STD_MODE_SUPPORT_TBL_SIZE - 20)
   3755  1.1  riastrad #define ATOM_DP_DPCD_OFFSET             (DFP_ENCODER_TYPE_OFFSET + 4 )
   3756  1.1  riastrad 
   3757  1.1  riastrad #define ATOM_HWICON1_SURFACE_ADDR       0
   3758  1.1  riastrad #define ATOM_HWICON2_SURFACE_ADDR       (ATOM_HWICON1_SURFACE_ADDR + ATOM_HWICON_SURFACE_SIZE)
   3759  1.1  riastrad #define ATOM_HWICON_INFOTABLE_ADDR      (ATOM_HWICON2_SURFACE_ADDR + ATOM_HWICON_SURFACE_SIZE)
   3760  1.1  riastrad #define ATOM_CRT1_EDID_ADDR             (ATOM_HWICON_INFOTABLE_ADDR + ATOM_HWICON_INFOTABLE_SIZE)
   3761  1.1  riastrad #define ATOM_CRT1_DTD_MODE_TBL_ADDR     (ATOM_CRT1_EDID_ADDR + ATOM_EDID_RAW_DATASIZE)
   3762  1.1  riastrad #define ATOM_CRT1_STD_MODE_TBL_ADDR	    (ATOM_CRT1_DTD_MODE_TBL_ADDR + ATOM_DTD_MODE_SUPPORT_TBL_SIZE)
   3763  1.1  riastrad 
   3764  1.1  riastrad #define ATOM_LCD1_EDID_ADDR             (ATOM_CRT1_STD_MODE_TBL_ADDR + ATOM_STD_MODE_SUPPORT_TBL_SIZE)
   3765  1.1  riastrad #define ATOM_LCD1_DTD_MODE_TBL_ADDR     (ATOM_LCD1_EDID_ADDR + ATOM_EDID_RAW_DATASIZE)
   3766  1.1  riastrad #define ATOM_LCD1_STD_MODE_TBL_ADDR   	(ATOM_LCD1_DTD_MODE_TBL_ADDR + ATOM_DTD_MODE_SUPPORT_TBL_SIZE)
   3767  1.1  riastrad 
   3768  1.1  riastrad #define ATOM_TV1_DTD_MODE_TBL_ADDR      (ATOM_LCD1_STD_MODE_TBL_ADDR + ATOM_STD_MODE_SUPPORT_TBL_SIZE)
   3769  1.1  riastrad 
   3770  1.1  riastrad #define ATOM_DFP1_EDID_ADDR             (ATOM_TV1_DTD_MODE_TBL_ADDR + ATOM_DTD_MODE_SUPPORT_TBL_SIZE)
   3771  1.1  riastrad #define ATOM_DFP1_DTD_MODE_TBL_ADDR     (ATOM_DFP1_EDID_ADDR + ATOM_EDID_RAW_DATASIZE)
   3772  1.1  riastrad #define ATOM_DFP1_STD_MODE_TBL_ADDR	    (ATOM_DFP1_DTD_MODE_TBL_ADDR + ATOM_DTD_MODE_SUPPORT_TBL_SIZE)
   3773  1.1  riastrad 
   3774  1.1  riastrad #define ATOM_CRT2_EDID_ADDR             (ATOM_DFP1_STD_MODE_TBL_ADDR + ATOM_STD_MODE_SUPPORT_TBL_SIZE)
   3775  1.1  riastrad #define ATOM_CRT2_DTD_MODE_TBL_ADDR     (ATOM_CRT2_EDID_ADDR + ATOM_EDID_RAW_DATASIZE)
   3776  1.1  riastrad #define ATOM_CRT2_STD_MODE_TBL_ADDR	    (ATOM_CRT2_DTD_MODE_TBL_ADDR + ATOM_DTD_MODE_SUPPORT_TBL_SIZE)
   3777  1.1  riastrad 
   3778  1.1  riastrad #define ATOM_LCD2_EDID_ADDR             (ATOM_CRT2_STD_MODE_TBL_ADDR + ATOM_STD_MODE_SUPPORT_TBL_SIZE)
   3779  1.1  riastrad #define ATOM_LCD2_DTD_MODE_TBL_ADDR     (ATOM_LCD2_EDID_ADDR + ATOM_EDID_RAW_DATASIZE)
   3780  1.1  riastrad #define ATOM_LCD2_STD_MODE_TBL_ADDR   	(ATOM_LCD2_DTD_MODE_TBL_ADDR + ATOM_DTD_MODE_SUPPORT_TBL_SIZE)
   3781  1.1  riastrad 
   3782  1.1  riastrad #define ATOM_DFP6_EDID_ADDR             (ATOM_LCD2_STD_MODE_TBL_ADDR + ATOM_STD_MODE_SUPPORT_TBL_SIZE)
   3783  1.1  riastrad #define ATOM_DFP6_DTD_MODE_TBL_ADDR     (ATOM_DFP6_EDID_ADDR + ATOM_EDID_RAW_DATASIZE)
   3784  1.1  riastrad #define ATOM_DFP6_STD_MODE_TBL_ADDR     (ATOM_DFP6_DTD_MODE_TBL_ADDR + ATOM_DTD_MODE_SUPPORT_TBL_SIZE)
   3785  1.1  riastrad 
   3786  1.1  riastrad #define ATOM_DFP2_EDID_ADDR             (ATOM_DFP6_STD_MODE_TBL_ADDR + ATOM_STD_MODE_SUPPORT_TBL_SIZE)
   3787  1.1  riastrad #define ATOM_DFP2_DTD_MODE_TBL_ADDR     (ATOM_DFP2_EDID_ADDR + ATOM_EDID_RAW_DATASIZE)
   3788  1.1  riastrad #define ATOM_DFP2_STD_MODE_TBL_ADDR     (ATOM_DFP2_DTD_MODE_TBL_ADDR + ATOM_DTD_MODE_SUPPORT_TBL_SIZE)
   3789  1.1  riastrad 
   3790  1.1  riastrad #define ATOM_CV_EDID_ADDR               (ATOM_DFP2_STD_MODE_TBL_ADDR + ATOM_STD_MODE_SUPPORT_TBL_SIZE)
   3791  1.1  riastrad #define ATOM_CV_DTD_MODE_TBL_ADDR       (ATOM_CV_EDID_ADDR + ATOM_EDID_RAW_DATASIZE)
   3792  1.1  riastrad #define ATOM_CV_STD_MODE_TBL_ADDR       (ATOM_CV_DTD_MODE_TBL_ADDR + ATOM_DTD_MODE_SUPPORT_TBL_SIZE)
   3793  1.1  riastrad 
   3794  1.1  riastrad #define ATOM_DFP3_EDID_ADDR             (ATOM_CV_STD_MODE_TBL_ADDR + ATOM_STD_MODE_SUPPORT_TBL_SIZE)
   3795  1.1  riastrad #define ATOM_DFP3_DTD_MODE_TBL_ADDR     (ATOM_DFP3_EDID_ADDR + ATOM_EDID_RAW_DATASIZE)
   3796  1.1  riastrad #define ATOM_DFP3_STD_MODE_TBL_ADDR     (ATOM_DFP3_DTD_MODE_TBL_ADDR + ATOM_DTD_MODE_SUPPORT_TBL_SIZE)
   3797  1.1  riastrad 
   3798  1.1  riastrad #define ATOM_DFP4_EDID_ADDR             (ATOM_DFP3_STD_MODE_TBL_ADDR + ATOM_STD_MODE_SUPPORT_TBL_SIZE)
   3799  1.1  riastrad #define ATOM_DFP4_DTD_MODE_TBL_ADDR     (ATOM_DFP4_EDID_ADDR + ATOM_EDID_RAW_DATASIZE)
   3800  1.1  riastrad #define ATOM_DFP4_STD_MODE_TBL_ADDR     (ATOM_DFP4_DTD_MODE_TBL_ADDR + ATOM_DTD_MODE_SUPPORT_TBL_SIZE)
   3801  1.1  riastrad 
   3802  1.1  riastrad #define ATOM_DFP5_EDID_ADDR             (ATOM_DFP4_STD_MODE_TBL_ADDR + ATOM_STD_MODE_SUPPORT_TBL_SIZE)
   3803  1.1  riastrad #define ATOM_DFP5_DTD_MODE_TBL_ADDR     (ATOM_DFP5_EDID_ADDR + ATOM_EDID_RAW_DATASIZE)
   3804  1.1  riastrad #define ATOM_DFP5_STD_MODE_TBL_ADDR     (ATOM_DFP5_DTD_MODE_TBL_ADDR + ATOM_DTD_MODE_SUPPORT_TBL_SIZE)
   3805  1.1  riastrad 
   3806  1.1  riastrad #define ATOM_DP_TRAINING_TBL_ADDR       (ATOM_DFP5_STD_MODE_TBL_ADDR + ATOM_STD_MODE_SUPPORT_TBL_SIZE)
   3807  1.1  riastrad 
   3808  1.1  riastrad #define ATOM_STACK_STORAGE_START        (ATOM_DP_TRAINING_TBL_ADDR + 1024)
   3809  1.1  riastrad #define ATOM_STACK_STORAGE_END          ATOM_STACK_STORAGE_START + 512
   3810  1.1  riastrad 
   3811  1.1  riastrad //The size below is in Kb!
   3812  1.1  riastrad #define ATOM_VRAM_RESERVE_SIZE         ((((ATOM_STACK_STORAGE_END - ATOM_HWICON1_SURFACE_ADDR)>>10)+4)&0xFFFC)
   3813  1.1  riastrad 
   3814  1.1  riastrad #define ATOM_VRAM_RESERVE_V2_SIZE      32
   3815  1.1  riastrad 
   3816  1.1  riastrad #define	ATOM_VRAM_OPERATION_FLAGS_MASK         0xC0000000L
   3817  1.1  riastrad #define ATOM_VRAM_OPERATION_FLAGS_SHIFT        30
   3818  1.1  riastrad #define	ATOM_VRAM_BLOCK_NEEDS_NO_RESERVATION   0x1
   3819  1.1  riastrad #define	ATOM_VRAM_BLOCK_NEEDS_RESERVATION      0x0
   3820  1.1  riastrad 
   3821  1.1  riastrad /***********************************************************************************/
   3822  1.1  riastrad // Structure used in VRAM_UsageByFirmwareTable
   3823  1.1  riastrad // Note1: This table is filled by SetBiosReservationStartInFB in CoreCommSubs.asm
   3824  1.1  riastrad //        at running time.
   3825  1.1  riastrad // note2: From RV770, the memory is more than 32bit addressable, so we will change
   3826  1.1  riastrad //        ucTableFormatRevision=1,ucTableContentRevision=4, the strcuture remains
   3827  1.1  riastrad //        exactly same as 1.1 and 1.2 (1.3 is never in use), but ulStartAddrUsedByFirmware
   3828  1.1  riastrad //        (in offset to start of memory address) is KB aligned instead of byte aligend.
   3829  1.1  riastrad /***********************************************************************************/
   3830  1.1  riastrad // Note3:
   3831  1.1  riastrad /* If we change usReserved to "usFBUsedbyDrvInKB", then to VBIOS this usFBUsedbyDrvInKB is a predefined, unchanged constant across VGA or non VGA adapter,
   3832  1.1  riastrad for CAIL, The size of FB access area is known, only thing missing is the Offset of FB Access area, so we can  have:
   3833  1.1  riastrad 
   3834  1.1  riastrad If (ulStartAddrUsedByFirmware!=0)
   3835  1.1  riastrad FBAccessAreaOffset= ulStartAddrUsedByFirmware - usFBUsedbyDrvInKB;
   3836  1.1  riastrad Reserved area has been claimed by VBIOS including this FB access area; CAIL doesn't need to reserve any extra area for this purpose
   3837  1.1  riastrad else	//Non VGA case
   3838  1.1  riastrad  if (FB_Size<=2Gb)
   3839  1.1  riastrad     FBAccessAreaOffset= FB_Size - usFBUsedbyDrvInKB;
   3840  1.1  riastrad  else
   3841  1.1  riastrad 	  FBAccessAreaOffset= Aper_Size - usFBUsedbyDrvInKB
   3842  1.1  riastrad 
   3843  1.1  riastrad CAIL needs to claim an reserved area defined by FBAccessAreaOffset and usFBUsedbyDrvInKB in non VGA case.*/
   3844  1.1  riastrad 
   3845  1.1  riastrad /***********************************************************************************/
   3846  1.1  riastrad #define ATOM_MAX_FIRMWARE_VRAM_USAGE_INFO			1
   3847  1.1  riastrad 
   3848  1.1  riastrad typedef struct _ATOM_FIRMWARE_VRAM_RESERVE_INFO
   3849  1.1  riastrad {
   3850  1.1  riastrad   ULONG   ulStartAddrUsedByFirmware;
   3851  1.1  riastrad   USHORT  usFirmwareUseInKb;
   3852  1.1  riastrad   USHORT  usReserved;
   3853  1.1  riastrad }ATOM_FIRMWARE_VRAM_RESERVE_INFO;
   3854  1.1  riastrad 
   3855  1.1  riastrad typedef struct _ATOM_VRAM_USAGE_BY_FIRMWARE
   3856  1.1  riastrad {
   3857  1.1  riastrad   ATOM_COMMON_TABLE_HEADER sHeader;
   3858  1.1  riastrad   ATOM_FIRMWARE_VRAM_RESERVE_INFO	asFirmwareVramReserveInfo[ATOM_MAX_FIRMWARE_VRAM_USAGE_INFO];
   3859  1.1  riastrad }ATOM_VRAM_USAGE_BY_FIRMWARE;
   3860  1.1  riastrad 
   3861  1.1  riastrad // change verion to 1.5, when allow driver to allocate the vram area for command table access.
   3862  1.1  riastrad typedef struct _ATOM_FIRMWARE_VRAM_RESERVE_INFO_V1_5
   3863  1.1  riastrad {
   3864  1.1  riastrad   ULONG   ulStartAddrUsedByFirmware;
   3865  1.1  riastrad   USHORT  usFirmwareUseInKb;
   3866  1.1  riastrad   USHORT  usFBUsedByDrvInKb;
   3867  1.1  riastrad }ATOM_FIRMWARE_VRAM_RESERVE_INFO_V1_5;
   3868  1.1  riastrad 
   3869  1.1  riastrad typedef struct _ATOM_VRAM_USAGE_BY_FIRMWARE_V1_5
   3870  1.1  riastrad {
   3871  1.1  riastrad   ATOM_COMMON_TABLE_HEADER sHeader;
   3872  1.1  riastrad   ATOM_FIRMWARE_VRAM_RESERVE_INFO_V1_5	asFirmwareVramReserveInfo[ATOM_MAX_FIRMWARE_VRAM_USAGE_INFO];
   3873  1.1  riastrad }ATOM_VRAM_USAGE_BY_FIRMWARE_V1_5;
   3874  1.1  riastrad 
   3875  1.1  riastrad /****************************************************************************/
   3876  1.1  riastrad // Structure used in GPIO_Pin_LUTTable
   3877  1.1  riastrad /****************************************************************************/
   3878  1.1  riastrad typedef struct _ATOM_GPIO_PIN_ASSIGNMENT
   3879  1.1  riastrad {
   3880  1.1  riastrad   USHORT                   usGpioPin_AIndex;
   3881  1.1  riastrad   UCHAR                    ucGpioPinBitShift;
   3882  1.1  riastrad   UCHAR                    ucGPIO_ID;
   3883  1.1  riastrad }ATOM_GPIO_PIN_ASSIGNMENT;
   3884  1.1  riastrad 
   3885  1.1  riastrad //ucGPIO_ID pre-define id for multiple usage
   3886  1.1  riastrad //from SMU7.x, if ucGPIO_ID=PP_AC_DC_SWITCH_GPIO_PINID in GPIO_LUTTable, AC/DC swithing feature is enable
   3887  1.1  riastrad #define PP_AC_DC_SWITCH_GPIO_PINID          60
   3888  1.1  riastrad //from SMU7.x, if ucGPIO_ID=VDDC_REGULATOR_VRHOT_GPIO_PINID in GPIO_LUTable, VRHot feature is enable
   3889  1.1  riastrad #define VDDC_VRHOT_GPIO_PINID               61
   3890  1.1  riastrad //if ucGPIO_ID=VDDC_PCC_GPIO_PINID in GPIO_LUTable, Peak Current Control feature is enabled
   3891  1.1  riastrad #define VDDC_PCC_GPIO_PINID                 62
   3892  1.1  riastrad 
   3893  1.1  riastrad typedef struct _ATOM_GPIO_PIN_LUT
   3894  1.1  riastrad {
   3895  1.1  riastrad   ATOM_COMMON_TABLE_HEADER  sHeader;
   3896  1.1  riastrad   ATOM_GPIO_PIN_ASSIGNMENT	asGPIO_Pin[1];
   3897  1.1  riastrad }ATOM_GPIO_PIN_LUT;
   3898  1.1  riastrad 
   3899  1.1  riastrad /****************************************************************************/
   3900  1.1  riastrad // Structure used in ComponentVideoInfoTable
   3901  1.1  riastrad /****************************************************************************/
   3902  1.1  riastrad #define GPIO_PIN_ACTIVE_HIGH          0x1
   3903  1.1  riastrad 
   3904  1.1  riastrad #define MAX_SUPPORTED_CV_STANDARDS    5
   3905  1.1  riastrad 
   3906  1.1  riastrad // definitions for ATOM_D_INFO.ucSettings
   3907  1.1  riastrad #define ATOM_GPIO_SETTINGS_BITSHIFT_MASK  0x1F    // [4:0]
   3908  1.1  riastrad #define ATOM_GPIO_SETTINGS_RESERVED_MASK  0x60    // [6:5] = must be zeroed out
   3909  1.1  riastrad #define ATOM_GPIO_SETTINGS_ACTIVE_MASK    0x80    // [7]
   3910  1.1  riastrad 
   3911  1.1  riastrad typedef struct _ATOM_GPIO_INFO
   3912  1.1  riastrad {
   3913  1.1  riastrad   USHORT  usAOffset;
   3914  1.1  riastrad   UCHAR   ucSettings;
   3915  1.1  riastrad   UCHAR   ucReserved;
   3916  1.1  riastrad }ATOM_GPIO_INFO;
   3917  1.1  riastrad 
   3918  1.1  riastrad // definitions for ATOM_COMPONENT_VIDEO_INFO.ucMiscInfo (bit vector)
   3919  1.1  riastrad #define ATOM_CV_RESTRICT_FORMAT_SELECTION           0x2
   3920  1.1  riastrad 
   3921  1.1  riastrad // definitions for ATOM_COMPONENT_VIDEO_INFO.uc480i/uc480p/uc720p/uc1080i
   3922  1.1  riastrad #define ATOM_GPIO_DEFAULT_MODE_EN                   0x80 //[7];
   3923  1.1  riastrad #define ATOM_GPIO_SETTING_PERMODE_MASK              0x7F //[6:0]
   3924  1.1  riastrad 
   3925  1.1  riastrad // definitions for ATOM_COMPONENT_VIDEO_INFO.ucLetterBoxMode
   3926  1.1  riastrad //Line 3 out put 5V.
   3927  1.1  riastrad #define ATOM_CV_LINE3_ASPECTRATIO_16_9_GPIO_A       0x01     //represent gpio 3 state for 16:9
   3928  1.1  riastrad #define ATOM_CV_LINE3_ASPECTRATIO_16_9_GPIO_B       0x02     //represent gpio 4 state for 16:9
   3929  1.1  riastrad #define ATOM_CV_LINE3_ASPECTRATIO_16_9_GPIO_SHIFT   0x0
   3930  1.1  riastrad 
   3931  1.1  riastrad //Line 3 out put 2.2V
   3932  1.1  riastrad #define ATOM_CV_LINE3_ASPECTRATIO_4_3_LETBOX_GPIO_A 0x04     //represent gpio 3 state for 4:3 Letter box
   3933  1.1  riastrad #define ATOM_CV_LINE3_ASPECTRATIO_4_3_LETBOX_GPIO_B 0x08     //represent gpio 4 state for 4:3 Letter box
   3934  1.1  riastrad #define ATOM_CV_LINE3_ASPECTRATIO_4_3_LETBOX_GPIO_SHIFT 0x2
   3935  1.1  riastrad 
   3936  1.1  riastrad //Line 3 out put 0V
   3937  1.1  riastrad #define ATOM_CV_LINE3_ASPECTRATIO_4_3_GPIO_A        0x10     //represent gpio 3 state for 4:3
   3938  1.1  riastrad #define ATOM_CV_LINE3_ASPECTRATIO_4_3_GPIO_B        0x20     //represent gpio 4 state for 4:3
   3939  1.1  riastrad #define ATOM_CV_LINE3_ASPECTRATIO_4_3_GPIO_SHIFT    0x4
   3940  1.1  riastrad 
   3941  1.1  riastrad #define ATOM_CV_LINE3_ASPECTRATIO_MASK              0x3F     // bit [5:0]
   3942  1.1  riastrad 
   3943  1.1  riastrad #define ATOM_CV_LINE3_ASPECTRATIO_EXIST             0x80     //bit 7
   3944  1.1  riastrad 
   3945  1.1  riastrad //GPIO bit index in gpio setting per mode value, also represend the block no. in gpio blocks.
   3946  1.1  riastrad #define ATOM_GPIO_INDEX_LINE3_ASPECRATIO_GPIO_A   3   //bit 3 in uc480i/uc480p/uc720p/uc1080i, which represend the default gpio bit setting for the mode.
   3947  1.1  riastrad #define ATOM_GPIO_INDEX_LINE3_ASPECRATIO_GPIO_B   4   //bit 4 in uc480i/uc480p/uc720p/uc1080i, which represend the default gpio bit setting for the mode.
   3948  1.1  riastrad 
   3949  1.1  riastrad 
   3950  1.1  riastrad typedef struct _ATOM_COMPONENT_VIDEO_INFO
   3951  1.1  riastrad {
   3952  1.1  riastrad   ATOM_COMMON_TABLE_HEADER sHeader;
   3953  1.1  riastrad   USHORT             usMask_PinRegisterIndex;
   3954  1.1  riastrad   USHORT             usEN_PinRegisterIndex;
   3955  1.1  riastrad   USHORT             usY_PinRegisterIndex;
   3956  1.1  riastrad   USHORT             usA_PinRegisterIndex;
   3957  1.1  riastrad   UCHAR              ucBitShift;
   3958  1.1  riastrad   UCHAR              ucPinActiveState;  //ucPinActiveState: Bit0=1 active high, =0 active low
   3959  1.1  riastrad   ATOM_DTD_FORMAT    sReserved;         // must be zeroed out
   3960  1.1  riastrad   UCHAR              ucMiscInfo;
   3961  1.1  riastrad   UCHAR              uc480i;
   3962  1.1  riastrad   UCHAR              uc480p;
   3963  1.1  riastrad   UCHAR              uc720p;
   3964  1.1  riastrad   UCHAR              uc1080i;
   3965  1.1  riastrad   UCHAR              ucLetterBoxMode;
   3966  1.1  riastrad   UCHAR              ucReserved[3];
   3967  1.1  riastrad   UCHAR              ucNumOfWbGpioBlocks; //For Component video D-Connector support. If zere, NTSC type connector
   3968  1.1  riastrad   ATOM_GPIO_INFO     aWbGpioStateBlock[MAX_SUPPORTED_CV_STANDARDS];
   3969  1.1  riastrad   ATOM_DTD_FORMAT    aModeTimings[MAX_SUPPORTED_CV_STANDARDS];
   3970  1.1  riastrad }ATOM_COMPONENT_VIDEO_INFO;
   3971  1.1  riastrad 
   3972  1.1  riastrad //ucTableFormatRevision=2
   3973  1.1  riastrad //ucTableContentRevision=1
   3974  1.1  riastrad typedef struct _ATOM_COMPONENT_VIDEO_INFO_V21
   3975  1.1  riastrad {
   3976  1.1  riastrad   ATOM_COMMON_TABLE_HEADER sHeader;
   3977  1.1  riastrad   UCHAR              ucMiscInfo;
   3978  1.1  riastrad   UCHAR              uc480i;
   3979  1.1  riastrad   UCHAR              uc480p;
   3980  1.1  riastrad   UCHAR              uc720p;
   3981  1.1  riastrad   UCHAR              uc1080i;
   3982  1.1  riastrad   UCHAR              ucReserved;
   3983  1.1  riastrad   UCHAR              ucLetterBoxMode;
   3984  1.1  riastrad   UCHAR              ucNumOfWbGpioBlocks; //For Component video D-Connector support. If zere, NTSC type connector
   3985  1.1  riastrad   ATOM_GPIO_INFO     aWbGpioStateBlock[MAX_SUPPORTED_CV_STANDARDS];
   3986  1.1  riastrad   ATOM_DTD_FORMAT    aModeTimings[MAX_SUPPORTED_CV_STANDARDS];
   3987  1.1  riastrad }ATOM_COMPONENT_VIDEO_INFO_V21;
   3988  1.1  riastrad 
   3989  1.1  riastrad #define ATOM_COMPONENT_VIDEO_INFO_LAST  ATOM_COMPONENT_VIDEO_INFO_V21
   3990  1.1  riastrad 
   3991  1.1  riastrad /****************************************************************************/
   3992  1.1  riastrad // Structure used in object_InfoTable
   3993  1.1  riastrad /****************************************************************************/
   3994  1.1  riastrad typedef struct _ATOM_OBJECT_HEADER
   3995  1.1  riastrad {
   3996  1.1  riastrad   ATOM_COMMON_TABLE_HEADER	sHeader;
   3997  1.1  riastrad   USHORT                    usDeviceSupport;
   3998  1.1  riastrad   USHORT                    usConnectorObjectTableOffset;
   3999  1.1  riastrad   USHORT                    usRouterObjectTableOffset;
   4000  1.1  riastrad   USHORT                    usEncoderObjectTableOffset;
   4001  1.1  riastrad   USHORT                    usProtectionObjectTableOffset; //only available when Protection block is independent.
   4002  1.1  riastrad   USHORT                    usDisplayPathTableOffset;
   4003  1.1  riastrad }ATOM_OBJECT_HEADER;
   4004  1.1  riastrad 
   4005  1.1  riastrad typedef struct _ATOM_OBJECT_HEADER_V3
   4006  1.1  riastrad {
   4007  1.1  riastrad   ATOM_COMMON_TABLE_HEADER	sHeader;
   4008  1.1  riastrad   USHORT                    usDeviceSupport;
   4009  1.1  riastrad   USHORT                    usConnectorObjectTableOffset;
   4010  1.1  riastrad   USHORT                    usRouterObjectTableOffset;
   4011  1.1  riastrad   USHORT                    usEncoderObjectTableOffset;
   4012  1.1  riastrad   USHORT                    usProtectionObjectTableOffset; //only available when Protection block is independent.
   4013  1.1  riastrad   USHORT                    usDisplayPathTableOffset;
   4014  1.1  riastrad   USHORT                    usMiscObjectTableOffset;
   4015  1.1  riastrad }ATOM_OBJECT_HEADER_V3;
   4016  1.1  riastrad 
   4017  1.1  riastrad typedef struct  _ATOM_DISPLAY_OBJECT_PATH
   4018  1.1  riastrad {
   4019  1.1  riastrad   USHORT    usDeviceTag;                                   //supported device
   4020  1.1  riastrad   USHORT    usSize;                                        //the size of ATOM_DISPLAY_OBJECT_PATH
   4021  1.1  riastrad   USHORT    usConnObjectId;                                //Connector Object ID
   4022  1.1  riastrad   USHORT    usGPUObjectId;                                 //GPU ID
   4023  1.1  riastrad   USHORT    usGraphicObjIds[1];                             //1st Encoder Obj source from GPU to last Graphic Obj destinate to connector.
   4024  1.1  riastrad }ATOM_DISPLAY_OBJECT_PATH;
   4025  1.1  riastrad 
   4026  1.1  riastrad typedef struct  _ATOM_DISPLAY_EXTERNAL_OBJECT_PATH
   4027  1.1  riastrad {
   4028  1.1  riastrad   USHORT    usDeviceTag;                                   //supported device
   4029  1.1  riastrad   USHORT    usSize;                                        //the size of ATOM_DISPLAY_OBJECT_PATH
   4030  1.1  riastrad   USHORT    usConnObjectId;                                //Connector Object ID
   4031  1.1  riastrad   USHORT    usGPUObjectId;                                 //GPU ID
   4032  1.1  riastrad   USHORT    usGraphicObjIds[2];                            //usGraphicObjIds[0]= GPU internal encoder, usGraphicObjIds[1]= external encoder
   4033  1.1  riastrad }ATOM_DISPLAY_EXTERNAL_OBJECT_PATH;
   4034  1.1  riastrad 
   4035  1.1  riastrad typedef struct _ATOM_DISPLAY_OBJECT_PATH_TABLE
   4036  1.1  riastrad {
   4037  1.1  riastrad   UCHAR                           ucNumOfDispPath;
   4038  1.1  riastrad   UCHAR                           ucVersion;
   4039  1.1  riastrad   UCHAR                           ucPadding[2];
   4040  1.1  riastrad   ATOM_DISPLAY_OBJECT_PATH        asDispPath[1];
   4041  1.1  riastrad }ATOM_DISPLAY_OBJECT_PATH_TABLE;
   4042  1.1  riastrad 
   4043  1.1  riastrad 
   4044  1.1  riastrad typedef struct _ATOM_OBJECT                                //each object has this structure
   4045  1.1  riastrad {
   4046  1.1  riastrad   USHORT              usObjectID;
   4047  1.1  riastrad   USHORT              usSrcDstTableOffset;
   4048  1.1  riastrad   USHORT              usRecordOffset;                     //this pointing to a bunch of records defined below
   4049  1.1  riastrad   USHORT              usReserved;
   4050  1.1  riastrad }ATOM_OBJECT;
   4051  1.1  riastrad 
   4052  1.1  riastrad typedef struct _ATOM_OBJECT_TABLE                         //Above 4 object table offset pointing to a bunch of objects all have this structure
   4053  1.1  riastrad {
   4054  1.1  riastrad   UCHAR               ucNumberOfObjects;
   4055  1.1  riastrad   UCHAR               ucPadding[3];
   4056  1.1  riastrad   ATOM_OBJECT         asObjects[1];
   4057  1.1  riastrad }ATOM_OBJECT_TABLE;
   4058  1.1  riastrad 
   4059  1.1  riastrad typedef struct _ATOM_SRC_DST_TABLE_FOR_ONE_OBJECT         //usSrcDstTableOffset pointing to this structure
   4060  1.1  riastrad {
   4061  1.1  riastrad   UCHAR               ucNumberOfSrc;
   4062  1.1  riastrad   USHORT              usSrcObjectID[1];
   4063  1.1  riastrad   UCHAR               ucNumberOfDst;
   4064  1.1  riastrad   USHORT              usDstObjectID[1];
   4065  1.1  riastrad }ATOM_SRC_DST_TABLE_FOR_ONE_OBJECT;
   4066  1.1  riastrad 
   4067  1.1  riastrad 
   4068  1.1  riastrad //Two definitions below are for OPM on MXM module designs
   4069  1.1  riastrad 
   4070  1.1  riastrad #define EXT_HPDPIN_LUTINDEX_0                   0
   4071  1.1  riastrad #define EXT_HPDPIN_LUTINDEX_1                   1
   4072  1.1  riastrad #define EXT_HPDPIN_LUTINDEX_2                   2
   4073  1.1  riastrad #define EXT_HPDPIN_LUTINDEX_3                   3
   4074  1.1  riastrad #define EXT_HPDPIN_LUTINDEX_4                   4
   4075  1.1  riastrad #define EXT_HPDPIN_LUTINDEX_5                   5
   4076  1.1  riastrad #define EXT_HPDPIN_LUTINDEX_6                   6
   4077  1.1  riastrad #define EXT_HPDPIN_LUTINDEX_7                   7
   4078  1.1  riastrad #define MAX_NUMBER_OF_EXT_HPDPIN_LUT_ENTRIES   (EXT_HPDPIN_LUTINDEX_7+1)
   4079  1.1  riastrad 
   4080  1.1  riastrad #define EXT_AUXDDC_LUTINDEX_0                   0
   4081  1.1  riastrad #define EXT_AUXDDC_LUTINDEX_1                   1
   4082  1.1  riastrad #define EXT_AUXDDC_LUTINDEX_2                   2
   4083  1.1  riastrad #define EXT_AUXDDC_LUTINDEX_3                   3
   4084  1.1  riastrad #define EXT_AUXDDC_LUTINDEX_4                   4
   4085  1.1  riastrad #define EXT_AUXDDC_LUTINDEX_5                   5
   4086  1.1  riastrad #define EXT_AUXDDC_LUTINDEX_6                   6
   4087  1.1  riastrad #define EXT_AUXDDC_LUTINDEX_7                   7
   4088  1.1  riastrad #define MAX_NUMBER_OF_EXT_AUXDDC_LUT_ENTRIES   (EXT_AUXDDC_LUTINDEX_7+1)
   4089  1.1  riastrad 
   4090  1.1  riastrad //ucChannelMapping are defined as following
   4091  1.1  riastrad //for DP connector, eDP, DP to VGA/LVDS
   4092  1.1  riastrad //Bit[1:0]: Define which pin connect to DP connector DP_Lane0, =0: source from GPU pin TX0, =1: from GPU pin TX1, =2: from GPU pin TX2, =3 from GPU pin TX3
   4093  1.1  riastrad //Bit[3:2]: Define which pin connect to DP connector DP_Lane1, =0: source from GPU pin TX0, =1: from GPU pin TX1, =2: from GPU pin TX2, =3 from GPU pin TX3
   4094  1.1  riastrad //Bit[5:4]: Define which pin connect to DP connector DP_Lane2, =0: source from GPU pin TX0, =1: from GPU pin TX1, =2: from GPU pin TX2, =3 from GPU pin TX3
   4095  1.1  riastrad //Bit[7:6]: Define which pin connect to DP connector DP_Lane3, =0: source from GPU pin TX0, =1: from GPU pin TX1, =2: from GPU pin TX2, =3 from GPU pin TX3
   4096  1.1  riastrad typedef struct _ATOM_DP_CONN_CHANNEL_MAPPING
   4097  1.1  riastrad {
   4098  1.1  riastrad #if ATOM_BIG_ENDIAN
   4099  1.1  riastrad   UCHAR ucDP_Lane3_Source:2;
   4100  1.1  riastrad   UCHAR ucDP_Lane2_Source:2;
   4101  1.1  riastrad   UCHAR ucDP_Lane1_Source:2;
   4102  1.1  riastrad   UCHAR ucDP_Lane0_Source:2;
   4103  1.1  riastrad #else
   4104  1.1  riastrad   UCHAR ucDP_Lane0_Source:2;
   4105  1.1  riastrad   UCHAR ucDP_Lane1_Source:2;
   4106  1.1  riastrad   UCHAR ucDP_Lane2_Source:2;
   4107  1.1  riastrad   UCHAR ucDP_Lane3_Source:2;
   4108  1.1  riastrad #endif
   4109  1.1  riastrad }ATOM_DP_CONN_CHANNEL_MAPPING;
   4110  1.1  riastrad 
   4111  1.1  riastrad //for DVI/HDMI, in dual link case, both links have to have same mapping.
   4112  1.1  riastrad //Bit[1:0]: Define which pin connect to DVI connector data Lane2, =0: source from GPU pin TX0, =1: from GPU pin TX1, =2: from GPU pin TX2, =3 from GPU pin TX3
   4113  1.1  riastrad //Bit[3:2]: Define which pin connect to DVI connector data Lane1, =0: source from GPU pin TX0, =1: from GPU pin TX1, =2: from GPU pin TX2, =3 from GPU pin TX3
   4114  1.1  riastrad //Bit[5:4]: Define which pin connect to DVI connector data Lane0, =0: source from GPU pin TX0, =1: from GPU pin TX1, =2: from GPU pin TX2, =3 from GPU pin TX3
   4115  1.1  riastrad //Bit[7:6]: Define which pin connect to DVI connector clock lane, =0: source from GPU pin TX0, =1: from GPU pin TX1, =2: from GPU pin TX2, =3 from GPU pin TX3
   4116  1.1  riastrad typedef struct _ATOM_DVI_CONN_CHANNEL_MAPPING
   4117  1.1  riastrad {
   4118  1.1  riastrad #if ATOM_BIG_ENDIAN
   4119  1.1  riastrad   UCHAR ucDVI_CLK_Source:2;
   4120  1.1  riastrad   UCHAR ucDVI_DATA0_Source:2;
   4121  1.1  riastrad   UCHAR ucDVI_DATA1_Source:2;
   4122  1.1  riastrad   UCHAR ucDVI_DATA2_Source:2;
   4123  1.1  riastrad #else
   4124  1.1  riastrad   UCHAR ucDVI_DATA2_Source:2;
   4125  1.1  riastrad   UCHAR ucDVI_DATA1_Source:2;
   4126  1.1  riastrad   UCHAR ucDVI_DATA0_Source:2;
   4127  1.1  riastrad   UCHAR ucDVI_CLK_Source:2;
   4128  1.1  riastrad #endif
   4129  1.1  riastrad }ATOM_DVI_CONN_CHANNEL_MAPPING;
   4130  1.1  riastrad 
   4131  1.1  riastrad typedef struct _EXT_DISPLAY_PATH
   4132  1.1  riastrad {
   4133  1.1  riastrad   USHORT  usDeviceTag;                    //A bit vector to show what devices are supported
   4134  1.1  riastrad   USHORT  usDeviceACPIEnum;               //16bit device ACPI id.
   4135  1.1  riastrad   USHORT  usDeviceConnector;              //A physical connector for displays to plug in, using object connector definitions
   4136  1.1  riastrad   UCHAR   ucExtAUXDDCLutIndex;            //An index into external AUX/DDC channel LUT
   4137  1.1  riastrad   UCHAR   ucExtHPDPINLutIndex;            //An index into external HPD pin LUT
   4138  1.1  riastrad   USHORT  usExtEncoderObjId;              //external encoder object id
   4139  1.1  riastrad   union{
   4140  1.1  riastrad     UCHAR   ucChannelMapping;                  // if ucChannelMapping=0, using default one to one mapping
   4141  1.1  riastrad     ATOM_DP_CONN_CHANNEL_MAPPING asDPMapping;
   4142  1.1  riastrad     ATOM_DVI_CONN_CHANNEL_MAPPING asDVIMapping;
   4143  1.1  riastrad   };
   4144  1.1  riastrad   UCHAR   ucChPNInvert;                   // bit vector for up to 8 lanes, =0: P and N is not invert, =1 P and N is inverted
   4145  1.1  riastrad   USHORT  usCaps;
   4146  1.1  riastrad   USHORT  usReserved;
   4147  1.1  riastrad }EXT_DISPLAY_PATH;
   4148  1.1  riastrad 
   4149  1.1  riastrad #define NUMBER_OF_UCHAR_FOR_GUID          16
   4150  1.1  riastrad #define MAX_NUMBER_OF_EXT_DISPLAY_PATH    7
   4151  1.1  riastrad 
   4152  1.1  riastrad //usCaps
   4153  1.1  riastrad #define  EXT_DISPLAY_PATH_CAPS__HBR2_DISABLE          0x01
   4154  1.1  riastrad #define  EXT_DISPLAY_PATH_CAPS__DP_FIXED_VS_EN        0x02
   4155  1.1  riastrad 
   4156  1.1  riastrad typedef  struct _ATOM_EXTERNAL_DISPLAY_CONNECTION_INFO
   4157  1.1  riastrad {
   4158  1.1  riastrad   ATOM_COMMON_TABLE_HEADER sHeader;
   4159  1.1  riastrad   UCHAR                    ucGuid [NUMBER_OF_UCHAR_FOR_GUID];     // a GUID is a 16 byte long string
   4160  1.1  riastrad   EXT_DISPLAY_PATH         sPath[MAX_NUMBER_OF_EXT_DISPLAY_PATH]; // total of fixed 7 entries.
   4161  1.1  riastrad   UCHAR                    ucChecksum;                            // a simple Checksum of the sum of whole structure equal to 0x0.
   4162  1.1  riastrad   UCHAR                    uc3DStereoPinId;                       // use for eDP panel
   4163  1.1  riastrad   UCHAR                    ucRemoteDisplayConfig;
   4164  1.1  riastrad   UCHAR                    uceDPToLVDSRxId;
   4165  1.1  riastrad   UCHAR                    ucFixDPVoltageSwing;                   // usCaps[1]=1, this indicate DP_LANE_SET value
   4166  1.1  riastrad   UCHAR                    Reserved[3];                           // for potential expansion
   4167  1.1  riastrad }ATOM_EXTERNAL_DISPLAY_CONNECTION_INFO;
   4168  1.1  riastrad 
   4169  1.1  riastrad //Related definitions, all records are different but they have a commond header
   4170  1.1  riastrad typedef struct _ATOM_COMMON_RECORD_HEADER
   4171  1.1  riastrad {
   4172  1.1  riastrad   UCHAR               ucRecordType;                      //An emun to indicate the record type
   4173  1.1  riastrad   UCHAR               ucRecordSize;                      //The size of the whole record in byte
   4174  1.1  riastrad }ATOM_COMMON_RECORD_HEADER;
   4175  1.1  riastrad 
   4176  1.1  riastrad 
   4177  1.1  riastrad #define ATOM_I2C_RECORD_TYPE                           1
   4178  1.1  riastrad #define ATOM_HPD_INT_RECORD_TYPE                       2
   4179  1.1  riastrad #define ATOM_OUTPUT_PROTECTION_RECORD_TYPE             3
   4180  1.1  riastrad #define ATOM_CONNECTOR_DEVICE_TAG_RECORD_TYPE          4
   4181  1.1  riastrad #define	ATOM_CONNECTOR_DVI_EXT_INPUT_RECORD_TYPE	     5 //Obsolete, switch to use GPIO_CNTL_RECORD_TYPE
   4182  1.1  riastrad #define ATOM_ENCODER_FPGA_CONTROL_RECORD_TYPE          6 //Obsolete, switch to use GPIO_CNTL_RECORD_TYPE
   4183  1.1  riastrad #define ATOM_CONNECTOR_CVTV_SHARE_DIN_RECORD_TYPE      7
   4184  1.1  riastrad #define ATOM_JTAG_RECORD_TYPE                          8 //Obsolete, switch to use GPIO_CNTL_RECORD_TYPE
   4185  1.1  riastrad #define ATOM_OBJECT_GPIO_CNTL_RECORD_TYPE              9
   4186  1.1  riastrad #define ATOM_ENCODER_DVO_CF_RECORD_TYPE               10
   4187  1.1  riastrad #define ATOM_CONNECTOR_CF_RECORD_TYPE                 11
   4188  1.1  riastrad #define	ATOM_CONNECTOR_HARDCODE_DTD_RECORD_TYPE	      12
   4189  1.1  riastrad #define ATOM_CONNECTOR_PCIE_SUBCONNECTOR_RECORD_TYPE  13
   4190  1.1  riastrad #define ATOM_ROUTER_DDC_PATH_SELECT_RECORD_TYPE	      14
   4191  1.1  riastrad #define ATOM_ROUTER_DATA_CLOCK_PATH_SELECT_RECORD_TYPE	15
   4192  1.1  riastrad #define ATOM_CONNECTOR_HPDPIN_LUT_RECORD_TYPE          16 //This is for the case when connectors are not known to object table
   4193  1.1  riastrad #define ATOM_CONNECTOR_AUXDDC_LUT_RECORD_TYPE          17 //This is for the case when connectors are not known to object table
   4194  1.1  riastrad #define ATOM_OBJECT_LINK_RECORD_TYPE                   18 //Once this record is present under one object, it indicats the oobject is linked to another obj described by the record
   4195  1.1  riastrad #define ATOM_CONNECTOR_REMOTE_CAP_RECORD_TYPE          19
   4196  1.1  riastrad #define ATOM_ENCODER_CAP_RECORD_TYPE                   20
   4197  1.1  riastrad #define ATOM_BRACKET_LAYOUT_RECORD_TYPE                21
   4198  1.1  riastrad 
   4199  1.1  riastrad //Must be updated when new record type is added,equal to that record definition!
   4200  1.1  riastrad #define ATOM_MAX_OBJECT_RECORD_NUMBER             ATOM_BRACKET_LAYOUT_RECORD_TYPE
   4201  1.1  riastrad 
   4202  1.1  riastrad typedef struct  _ATOM_I2C_RECORD
   4203  1.1  riastrad {
   4204  1.1  riastrad   ATOM_COMMON_RECORD_HEADER   sheader;
   4205  1.1  riastrad   ATOM_I2C_ID_CONFIG          sucI2cId;
   4206  1.1  riastrad   UCHAR                       ucI2CAddr;              //The slave address, it's 0 when the record is attached to connector for DDC
   4207  1.1  riastrad }ATOM_I2C_RECORD;
   4208  1.1  riastrad 
   4209  1.1  riastrad typedef struct  _ATOM_HPD_INT_RECORD
   4210  1.1  riastrad {
   4211  1.1  riastrad   ATOM_COMMON_RECORD_HEADER   sheader;
   4212  1.1  riastrad   UCHAR                       ucHPDIntGPIOID;         //Corresponding block in GPIO_PIN_INFO table gives the pin info
   4213  1.1  riastrad   UCHAR                       ucPlugged_PinState;
   4214  1.1  riastrad }ATOM_HPD_INT_RECORD;
   4215  1.1  riastrad 
   4216  1.1  riastrad 
   4217  1.1  riastrad typedef struct  _ATOM_OUTPUT_PROTECTION_RECORD
   4218  1.1  riastrad {
   4219  1.1  riastrad   ATOM_COMMON_RECORD_HEADER   sheader;
   4220  1.1  riastrad   UCHAR                       ucProtectionFlag;
   4221  1.1  riastrad   UCHAR                       ucReserved;
   4222  1.1  riastrad }ATOM_OUTPUT_PROTECTION_RECORD;
   4223  1.1  riastrad 
   4224  1.1  riastrad typedef struct  _ATOM_CONNECTOR_DEVICE_TAG
   4225  1.1  riastrad {
   4226  1.1  riastrad   ULONG                       ulACPIDeviceEnum;       //Reserved for now
   4227  1.1  riastrad   USHORT                      usDeviceID;             //This Id is same as "ATOM_DEVICE_XXX_SUPPORT"
   4228  1.1  riastrad   USHORT                      usPadding;
   4229  1.1  riastrad }ATOM_CONNECTOR_DEVICE_TAG;
   4230  1.1  riastrad 
   4231  1.1  riastrad typedef struct  _ATOM_CONNECTOR_DEVICE_TAG_RECORD
   4232  1.1  riastrad {
   4233  1.1  riastrad   ATOM_COMMON_RECORD_HEADER   sheader;
   4234  1.1  riastrad   UCHAR                       ucNumberOfDevice;
   4235  1.1  riastrad   UCHAR                       ucReserved;
   4236  1.1  riastrad   ATOM_CONNECTOR_DEVICE_TAG   asDeviceTag[1];         //This Id is same as "ATOM_DEVICE_XXX_SUPPORT", 1 is only for allocation
   4237  1.1  riastrad }ATOM_CONNECTOR_DEVICE_TAG_RECORD;
   4238  1.1  riastrad 
   4239  1.1  riastrad 
   4240  1.1  riastrad typedef struct  _ATOM_CONNECTOR_DVI_EXT_INPUT_RECORD
   4241  1.1  riastrad {
   4242  1.1  riastrad   ATOM_COMMON_RECORD_HEADER   sheader;
   4243  1.1  riastrad   UCHAR						            ucConfigGPIOID;
   4244  1.1  riastrad   UCHAR						            ucConfigGPIOState;	    //Set to 1 when it's active high to enable external flow in
   4245  1.1  riastrad   UCHAR                       ucFlowinGPIPID;
   4246  1.1  riastrad   UCHAR                       ucExtInGPIPID;
   4247  1.1  riastrad }ATOM_CONNECTOR_DVI_EXT_INPUT_RECORD;
   4248  1.1  riastrad 
   4249  1.1  riastrad typedef struct  _ATOM_ENCODER_FPGA_CONTROL_RECORD
   4250  1.1  riastrad {
   4251  1.1  riastrad   ATOM_COMMON_RECORD_HEADER   sheader;
   4252  1.1  riastrad   UCHAR                       ucCTL1GPIO_ID;
   4253  1.1  riastrad   UCHAR                       ucCTL1GPIOState;        //Set to 1 when it's active high
   4254  1.1  riastrad   UCHAR                       ucCTL2GPIO_ID;
   4255  1.1  riastrad   UCHAR                       ucCTL2GPIOState;        //Set to 1 when it's active high
   4256  1.1  riastrad   UCHAR                       ucCTL3GPIO_ID;
   4257  1.1  riastrad   UCHAR                       ucCTL3GPIOState;        //Set to 1 when it's active high
   4258  1.1  riastrad   UCHAR                       ucCTLFPGA_IN_ID;
   4259  1.1  riastrad   UCHAR                       ucPadding[3];
   4260  1.1  riastrad }ATOM_ENCODER_FPGA_CONTROL_RECORD;
   4261  1.1  riastrad 
   4262  1.1  riastrad typedef struct  _ATOM_CONNECTOR_CVTV_SHARE_DIN_RECORD
   4263  1.1  riastrad {
   4264  1.1  riastrad   ATOM_COMMON_RECORD_HEADER   sheader;
   4265  1.1  riastrad   UCHAR                       ucGPIOID;               //Corresponding block in GPIO_PIN_INFO table gives the pin info
   4266  1.1  riastrad   UCHAR                       ucTVActiveState;        //Indicating when the pin==0 or 1 when TV is connected
   4267  1.1  riastrad }ATOM_CONNECTOR_CVTV_SHARE_DIN_RECORD;
   4268  1.1  riastrad 
   4269  1.1  riastrad typedef struct  _ATOM_JTAG_RECORD
   4270  1.1  riastrad {
   4271  1.1  riastrad   ATOM_COMMON_RECORD_HEADER   sheader;
   4272  1.1  riastrad   UCHAR                       ucTMSGPIO_ID;
   4273  1.1  riastrad   UCHAR                       ucTMSGPIOState;         //Set to 1 when it's active high
   4274  1.1  riastrad   UCHAR                       ucTCKGPIO_ID;
   4275  1.1  riastrad   UCHAR                       ucTCKGPIOState;         //Set to 1 when it's active high
   4276  1.1  riastrad   UCHAR                       ucTDOGPIO_ID;
   4277  1.1  riastrad   UCHAR                       ucTDOGPIOState;         //Set to 1 when it's active high
   4278  1.1  riastrad   UCHAR                       ucTDIGPIO_ID;
   4279  1.1  riastrad   UCHAR                       ucTDIGPIOState;         //Set to 1 when it's active high
   4280  1.1  riastrad   UCHAR                       ucPadding[2];
   4281  1.1  riastrad }ATOM_JTAG_RECORD;
   4282  1.1  riastrad 
   4283  1.1  riastrad 
   4284  1.1  riastrad //The following generic object gpio pin control record type will replace JTAG_RECORD/FPGA_CONTROL_RECORD/DVI_EXT_INPUT_RECORD above gradually
   4285  1.1  riastrad typedef struct _ATOM_GPIO_PIN_CONTROL_PAIR
   4286  1.1  riastrad {
   4287  1.1  riastrad   UCHAR                       ucGPIOID;               // GPIO_ID, find the corresponding ID in GPIO_LUT table
   4288  1.1  riastrad   UCHAR                       ucGPIO_PinState;        // Pin state showing how to set-up the pin
   4289  1.1  riastrad }ATOM_GPIO_PIN_CONTROL_PAIR;
   4290  1.1  riastrad 
   4291  1.1  riastrad typedef struct  _ATOM_OBJECT_GPIO_CNTL_RECORD
   4292  1.1  riastrad {
   4293  1.1  riastrad   ATOM_COMMON_RECORD_HEADER   sheader;
   4294  1.1  riastrad   UCHAR                       ucFlags;                // Future expnadibility
   4295  1.1  riastrad   UCHAR                       ucNumberOfPins;         // Number of GPIO pins used to control the object
   4296  1.1  riastrad   ATOM_GPIO_PIN_CONTROL_PAIR  asGpio[1];              // the real gpio pin pair determined by number of pins ucNumberOfPins
   4297  1.1  riastrad }ATOM_OBJECT_GPIO_CNTL_RECORD;
   4298  1.1  riastrad 
   4299  1.1  riastrad //Definitions for GPIO pin state
   4300  1.1  riastrad #define GPIO_PIN_TYPE_INPUT             0x00
   4301  1.1  riastrad #define GPIO_PIN_TYPE_OUTPUT            0x10
   4302  1.1  riastrad #define GPIO_PIN_TYPE_HW_CONTROL        0x20
   4303  1.1  riastrad 
   4304  1.1  riastrad //For GPIO_PIN_TYPE_OUTPUT the following is defined
   4305  1.1  riastrad #define GPIO_PIN_OUTPUT_STATE_MASK      0x01
   4306  1.1  riastrad #define GPIO_PIN_OUTPUT_STATE_SHIFT     0
   4307  1.1  riastrad #define GPIO_PIN_STATE_ACTIVE_LOW       0x0
   4308  1.1  riastrad #define GPIO_PIN_STATE_ACTIVE_HIGH      0x1
   4309  1.1  riastrad 
   4310  1.1  riastrad // Indexes to GPIO array in GLSync record
   4311  1.1  riastrad // GLSync record is for Frame Lock/Gen Lock feature.
   4312  1.1  riastrad #define ATOM_GPIO_INDEX_GLSYNC_REFCLK    0
   4313  1.1  riastrad #define ATOM_GPIO_INDEX_GLSYNC_HSYNC     1
   4314  1.1  riastrad #define ATOM_GPIO_INDEX_GLSYNC_VSYNC     2
   4315  1.1  riastrad #define ATOM_GPIO_INDEX_GLSYNC_SWAP_REQ  3
   4316  1.1  riastrad #define ATOM_GPIO_INDEX_GLSYNC_SWAP_GNT  4
   4317  1.1  riastrad #define ATOM_GPIO_INDEX_GLSYNC_INTERRUPT 5
   4318  1.1  riastrad #define ATOM_GPIO_INDEX_GLSYNC_V_RESET   6
   4319  1.1  riastrad #define ATOM_GPIO_INDEX_GLSYNC_SWAP_CNTL 7
   4320  1.1  riastrad #define ATOM_GPIO_INDEX_GLSYNC_SWAP_SEL  8
   4321  1.1  riastrad #define ATOM_GPIO_INDEX_GLSYNC_MAX       9
   4322  1.1  riastrad 
   4323  1.1  riastrad typedef struct  _ATOM_ENCODER_DVO_CF_RECORD
   4324  1.1  riastrad {
   4325  1.1  riastrad   ATOM_COMMON_RECORD_HEADER   sheader;
   4326  1.1  riastrad   ULONG                       ulStrengthControl;      // DVOA strength control for CF
   4327  1.1  riastrad   UCHAR                       ucPadding[2];
   4328  1.1  riastrad }ATOM_ENCODER_DVO_CF_RECORD;
   4329  1.1  riastrad 
   4330  1.1  riastrad // Bit maps for ATOM_ENCODER_CAP_RECORD.ucEncoderCap
   4331  1.1  riastrad #define ATOM_ENCODER_CAP_RECORD_HBR2                  0x01         // DP1.2 HBR2 is supported by HW encoder
   4332  1.1  riastrad #define ATOM_ENCODER_CAP_RECORD_HBR2_EN               0x02         // DP1.2 HBR2 setting is qualified and HBR2 can be enabled
   4333  1.1  riastrad 
   4334  1.1  riastrad typedef struct  _ATOM_ENCODER_CAP_RECORD
   4335  1.1  riastrad {
   4336  1.1  riastrad   ATOM_COMMON_RECORD_HEADER   sheader;
   4337  1.1  riastrad   union {
   4338  1.1  riastrad     USHORT                    usEncoderCap;
   4339  1.1  riastrad     struct {
   4340  1.1  riastrad #if ATOM_BIG_ENDIAN
   4341  1.1  riastrad       USHORT                  usReserved:14;        // Bit1-15 may be defined for other capability in future
   4342  1.1  riastrad       USHORT                  usHBR2En:1;           // Bit1 is for DP1.2 HBR2 enable
   4343  1.1  riastrad       USHORT                  usHBR2Cap:1;          // Bit0 is for DP1.2 HBR2 capability.
   4344  1.1  riastrad #else
   4345  1.1  riastrad       USHORT                  usHBR2Cap:1;          // Bit0 is for DP1.2 HBR2 capability.
   4346  1.1  riastrad       USHORT                  usHBR2En:1;           // Bit1 is for DP1.2 HBR2 enable
   4347  1.1  riastrad       USHORT                  usReserved:14;        // Bit1-15 may be defined for other capability in future
   4348  1.1  riastrad #endif
   4349  1.1  riastrad     };
   4350  1.1  riastrad   };
   4351  1.1  riastrad }ATOM_ENCODER_CAP_RECORD;
   4352  1.1  riastrad 
   4353  1.1  riastrad // value for ATOM_CONNECTOR_CF_RECORD.ucConnectedDvoBundle
   4354  1.1  riastrad #define ATOM_CONNECTOR_CF_RECORD_CONNECTED_UPPER12BITBUNDLEA   1
   4355  1.1  riastrad #define ATOM_CONNECTOR_CF_RECORD_CONNECTED_LOWER12BITBUNDLEB   2
   4356  1.1  riastrad 
   4357  1.1  riastrad typedef struct  _ATOM_CONNECTOR_CF_RECORD
   4358  1.1  riastrad {
   4359  1.1  riastrad   ATOM_COMMON_RECORD_HEADER   sheader;
   4360  1.1  riastrad   USHORT                      usMaxPixClk;
   4361  1.1  riastrad   UCHAR                       ucFlowCntlGpioId;
   4362  1.1  riastrad   UCHAR                       ucSwapCntlGpioId;
   4363  1.1  riastrad   UCHAR                       ucConnectedDvoBundle;
   4364  1.1  riastrad   UCHAR                       ucPadding;
   4365  1.1  riastrad }ATOM_CONNECTOR_CF_RECORD;
   4366  1.1  riastrad 
   4367  1.1  riastrad typedef struct  _ATOM_CONNECTOR_HARDCODE_DTD_RECORD
   4368  1.1  riastrad {
   4369  1.1  riastrad   ATOM_COMMON_RECORD_HEADER   sheader;
   4370  1.1  riastrad 	ATOM_DTD_FORMAT							asTiming;
   4371  1.1  riastrad }ATOM_CONNECTOR_HARDCODE_DTD_RECORD;
   4372  1.1  riastrad 
   4373  1.1  riastrad typedef struct _ATOM_CONNECTOR_PCIE_SUBCONNECTOR_RECORD
   4374  1.1  riastrad {
   4375  1.1  riastrad   ATOM_COMMON_RECORD_HEADER   sheader;                //ATOM_CONNECTOR_PCIE_SUBCONNECTOR_RECORD_TYPE
   4376  1.1  riastrad   UCHAR                       ucSubConnectorType;     //CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_D|X_ID_DUAL_LINK_DVI_D|HDMI_TYPE_A
   4377  1.1  riastrad   UCHAR                       ucReserved;
   4378  1.1  riastrad }ATOM_CONNECTOR_PCIE_SUBCONNECTOR_RECORD;
   4379  1.1  riastrad 
   4380  1.1  riastrad 
   4381  1.1  riastrad typedef struct _ATOM_ROUTER_DDC_PATH_SELECT_RECORD
   4382  1.1  riastrad {
   4383  1.1  riastrad 	ATOM_COMMON_RECORD_HEADER   sheader;
   4384  1.1  riastrad 	UCHAR												ucMuxType;							//decide the number of ucMuxState, =0, no pin state, =1: single state with complement, >1: multiple state
   4385  1.1  riastrad 	UCHAR												ucMuxControlPin;
   4386  1.1  riastrad 	UCHAR												ucMuxState[2];					//for alligment purpose
   4387  1.1  riastrad }ATOM_ROUTER_DDC_PATH_SELECT_RECORD;
   4388  1.1  riastrad 
   4389  1.1  riastrad typedef struct _ATOM_ROUTER_DATA_CLOCK_PATH_SELECT_RECORD
   4390  1.1  riastrad {
   4391  1.1  riastrad 	ATOM_COMMON_RECORD_HEADER   sheader;
   4392  1.1  riastrad 	UCHAR												ucMuxType;
   4393  1.1  riastrad 	UCHAR												ucMuxControlPin;
   4394  1.1  riastrad 	UCHAR												ucMuxState[2];					//for alligment purpose
   4395  1.1  riastrad }ATOM_ROUTER_DATA_CLOCK_PATH_SELECT_RECORD;
   4396  1.1  riastrad 
   4397  1.1  riastrad // define ucMuxType
   4398  1.1  riastrad #define ATOM_ROUTER_MUX_PIN_STATE_MASK								0x0f
   4399  1.1  riastrad #define ATOM_ROUTER_MUX_PIN_SINGLE_STATE_COMPLEMENT		0x01
   4400  1.1  riastrad 
   4401  1.1  riastrad typedef struct _ATOM_CONNECTOR_HPDPIN_LUT_RECORD     //record for ATOM_CONNECTOR_HPDPIN_LUT_RECORD_TYPE
   4402  1.1  riastrad {
   4403  1.1  riastrad   ATOM_COMMON_RECORD_HEADER   sheader;
   4404  1.1  riastrad   UCHAR                       ucHPDPINMap[MAX_NUMBER_OF_EXT_HPDPIN_LUT_ENTRIES];  //An fixed size array which maps external pins to internal GPIO_PIN_INFO table
   4405  1.1  riastrad }ATOM_CONNECTOR_HPDPIN_LUT_RECORD;
   4406  1.1  riastrad 
   4407  1.1  riastrad typedef struct _ATOM_CONNECTOR_AUXDDC_LUT_RECORD  //record for ATOM_CONNECTOR_AUXDDC_LUT_RECORD_TYPE
   4408  1.1  riastrad {
   4409  1.1  riastrad   ATOM_COMMON_RECORD_HEADER   sheader;
   4410  1.1  riastrad   ATOM_I2C_ID_CONFIG          ucAUXDDCMap[MAX_NUMBER_OF_EXT_AUXDDC_LUT_ENTRIES];  //An fixed size array which maps external pins to internal DDC ID
   4411  1.1  riastrad }ATOM_CONNECTOR_AUXDDC_LUT_RECORD;
   4412  1.1  riastrad 
   4413  1.1  riastrad typedef struct _ATOM_OBJECT_LINK_RECORD
   4414  1.1  riastrad {
   4415  1.1  riastrad   ATOM_COMMON_RECORD_HEADER   sheader;
   4416  1.1  riastrad   USHORT                      usObjectID;         //could be connector, encorder or other object in object.h
   4417  1.1  riastrad }ATOM_OBJECT_LINK_RECORD;
   4418  1.1  riastrad 
   4419  1.1  riastrad typedef struct _ATOM_CONNECTOR_REMOTE_CAP_RECORD
   4420  1.1  riastrad {
   4421  1.1  riastrad   ATOM_COMMON_RECORD_HEADER   sheader;
   4422  1.1  riastrad   USHORT                      usReserved;
   4423  1.1  riastrad }ATOM_CONNECTOR_REMOTE_CAP_RECORD;
   4424  1.1  riastrad 
   4425  1.1  riastrad typedef struct  _ATOM_CONNECTOR_LAYOUT_INFO
   4426  1.1  riastrad {
   4427  1.1  riastrad    USHORT usConnectorObjectId;
   4428  1.1  riastrad    UCHAR  ucConnectorType;
   4429  1.1  riastrad    UCHAR  ucPosition;
   4430  1.1  riastrad }ATOM_CONNECTOR_LAYOUT_INFO;
   4431  1.1  riastrad 
   4432  1.1  riastrad // define ATOM_CONNECTOR_LAYOUT_INFO.ucConnectorType to describe the display connector size
   4433  1.1  riastrad #define CONNECTOR_TYPE_DVI_D                 1
   4434  1.1  riastrad #define CONNECTOR_TYPE_DVI_I                 2
   4435  1.1  riastrad #define CONNECTOR_TYPE_VGA                   3
   4436  1.1  riastrad #define CONNECTOR_TYPE_HDMI                  4
   4437  1.1  riastrad #define CONNECTOR_TYPE_DISPLAY_PORT          5
   4438  1.1  riastrad #define CONNECTOR_TYPE_MINI_DISPLAY_PORT     6
   4439  1.1  riastrad 
   4440  1.1  riastrad typedef struct  _ATOM_BRACKET_LAYOUT_RECORD
   4441  1.1  riastrad {
   4442  1.1  riastrad   ATOM_COMMON_RECORD_HEADER   sheader;
   4443  1.1  riastrad   UCHAR                       ucLength;
   4444  1.1  riastrad   UCHAR                       ucWidth;
   4445  1.1  riastrad   UCHAR                       ucConnNum;
   4446  1.1  riastrad   UCHAR                       ucReserved;
   4447  1.1  riastrad   ATOM_CONNECTOR_LAYOUT_INFO  asConnInfo[1];
   4448  1.1  riastrad }ATOM_BRACKET_LAYOUT_RECORD;
   4449  1.1  riastrad 
   4450  1.1  riastrad /****************************************************************************/
   4451  1.1  riastrad // ASIC voltage data table
   4452  1.1  riastrad /****************************************************************************/
   4453  1.1  riastrad typedef struct  _ATOM_VOLTAGE_INFO_HEADER
   4454  1.1  riastrad {
   4455  1.1  riastrad    USHORT   usVDDCBaseLevel;                //In number of 50mv unit
   4456  1.1  riastrad    USHORT   usReserved;                     //For possible extension table offset
   4457  1.1  riastrad    UCHAR    ucNumOfVoltageEntries;
   4458  1.1  riastrad    UCHAR    ucBytesPerVoltageEntry;
   4459  1.1  riastrad    UCHAR    ucVoltageStep;                  //Indicating in how many mv increament is one step, 0.5mv unit
   4460  1.1  riastrad    UCHAR    ucDefaultVoltageEntry;
   4461  1.1  riastrad    UCHAR    ucVoltageControlI2cLine;
   4462  1.1  riastrad    UCHAR    ucVoltageControlAddress;
   4463  1.1  riastrad    UCHAR    ucVoltageControlOffset;
   4464  1.1  riastrad }ATOM_VOLTAGE_INFO_HEADER;
   4465  1.1  riastrad 
   4466  1.1  riastrad typedef struct  _ATOM_VOLTAGE_INFO
   4467  1.1  riastrad {
   4468  1.1  riastrad    ATOM_COMMON_TABLE_HEADER	sHeader;
   4469  1.1  riastrad    ATOM_VOLTAGE_INFO_HEADER viHeader;
   4470  1.1  riastrad    UCHAR    ucVoltageEntries[64];            //64 is for allocation, the actual number of entry is present at ucNumOfVoltageEntries*ucBytesPerVoltageEntry
   4471  1.1  riastrad }ATOM_VOLTAGE_INFO;
   4472  1.1  riastrad 
   4473  1.1  riastrad 
   4474  1.1  riastrad typedef struct  _ATOM_VOLTAGE_FORMULA
   4475  1.1  riastrad {
   4476  1.1  riastrad    USHORT   usVoltageBaseLevel;             // In number of 1mv unit
   4477  1.1  riastrad    USHORT   usVoltageStep;                  // Indicating in how many mv increament is one step, 1mv unit
   4478  1.1  riastrad 	 UCHAR		ucNumOfVoltageEntries;					// Number of Voltage Entry, which indicate max Voltage
   4479  1.1  riastrad 	 UCHAR		ucFlag;													// bit0=0 :step is 1mv =1 0.5mv
   4480  1.1  riastrad 	 UCHAR		ucBaseVID;											// if there is no lookup table, VID= BaseVID + ( Vol - BaseLevle ) /VoltageStep
   4481  1.1  riastrad 	 UCHAR		ucReserved;
   4482  1.1  riastrad 	 UCHAR		ucVIDAdjustEntries[32];					// 32 is for allocation, the actual number of entry is present at ucNumOfVoltageEntries
   4483  1.1  riastrad }ATOM_VOLTAGE_FORMULA;
   4484  1.1  riastrad 
   4485  1.1  riastrad typedef struct  _VOLTAGE_LUT_ENTRY
   4486  1.1  riastrad {
   4487  1.1  riastrad 	 USHORT		usVoltageCode;									// The Voltage ID, either GPIO or I2C code
   4488  1.1  riastrad 	 USHORT		usVoltageValue;									// The corresponding Voltage Value, in mV
   4489  1.1  riastrad }VOLTAGE_LUT_ENTRY;
   4490  1.1  riastrad 
   4491  1.1  riastrad typedef struct  _ATOM_VOLTAGE_FORMULA_V2
   4492  1.1  riastrad {
   4493  1.1  riastrad 	 UCHAR		ucNumOfVoltageEntries;					// Number of Voltage Entry, which indicate max Voltage
   4494  1.1  riastrad 	 UCHAR		ucReserved[3];
   4495  1.1  riastrad 	 VOLTAGE_LUT_ENTRY asVIDAdjustEntries[32];// 32 is for allocation, the actual number of entries is in ucNumOfVoltageEntries
   4496  1.1  riastrad }ATOM_VOLTAGE_FORMULA_V2;
   4497  1.1  riastrad 
   4498  1.1  riastrad typedef struct _ATOM_VOLTAGE_CONTROL
   4499  1.1  riastrad {
   4500  1.1  riastrad 	UCHAR		 ucVoltageControlId;							//Indicate it is controlled by I2C or GPIO or HW state machine
   4501  1.1  riastrad   UCHAR    ucVoltageControlI2cLine;
   4502  1.1  riastrad   UCHAR    ucVoltageControlAddress;
   4503  1.1  riastrad   UCHAR    ucVoltageControlOffset;
   4504  1.1  riastrad   USHORT   usGpioPin_AIndex;								//GPIO_PAD register index
   4505  1.1  riastrad   UCHAR    ucGpioPinBitShift[9];						//at most 8 pin support 255 VIDs, termintate with 0xff
   4506  1.1  riastrad 	UCHAR		 ucReserved;
   4507  1.1  riastrad }ATOM_VOLTAGE_CONTROL;
   4508  1.1  riastrad 
   4509  1.1  riastrad // Define ucVoltageControlId
   4510  1.1  riastrad #define	VOLTAGE_CONTROLLED_BY_HW							0x00
   4511  1.1  riastrad #define	VOLTAGE_CONTROLLED_BY_I2C_MASK				0x7F
   4512  1.1  riastrad #define	VOLTAGE_CONTROLLED_BY_GPIO						0x80
   4513  1.1  riastrad #define	VOLTAGE_CONTROL_ID_LM64								0x01									//I2C control, used for R5xx Core Voltage
   4514  1.1  riastrad #define	VOLTAGE_CONTROL_ID_DAC								0x02									//I2C control, used for R5xx/R6xx MVDDC,MVDDQ or VDDCI
   4515  1.1  riastrad #define	VOLTAGE_CONTROL_ID_VT116xM						0x03									//I2C control, used for R6xx Core Voltage
   4516  1.1  riastrad #define VOLTAGE_CONTROL_ID_DS4402							0x04
   4517  1.1  riastrad #define VOLTAGE_CONTROL_ID_UP6266 						0x05
   4518  1.1  riastrad #define VOLTAGE_CONTROL_ID_SCORPIO						0x06
   4519  1.1  riastrad #define	VOLTAGE_CONTROL_ID_VT1556M						0x07
   4520  1.1  riastrad #define	VOLTAGE_CONTROL_ID_CHL822x						0x08
   4521  1.1  riastrad #define	VOLTAGE_CONTROL_ID_VT1586M						0x09
   4522  1.1  riastrad #define VOLTAGE_CONTROL_ID_UP1637 						0x0A
   4523  1.1  riastrad #define	VOLTAGE_CONTROL_ID_CHL8214            0x0B
   4524  1.1  riastrad #define	VOLTAGE_CONTROL_ID_UP1801             0x0C
   4525  1.1  riastrad #define	VOLTAGE_CONTROL_ID_ST6788A            0x0D
   4526  1.1  riastrad #define VOLTAGE_CONTROL_ID_CHLIR3564SVI2      0x0E
   4527  1.1  riastrad #define VOLTAGE_CONTROL_ID_AD527x      	      0x0F
   4528  1.1  riastrad #define VOLTAGE_CONTROL_ID_NCP81022    	      0x10
   4529  1.1  riastrad #define VOLTAGE_CONTROL_ID_LTC2635			  0x11
   4530  1.1  riastrad 
   4531  1.1  riastrad typedef struct  _ATOM_VOLTAGE_OBJECT
   4532  1.1  riastrad {
   4533  1.1  riastrad  	 UCHAR		ucVoltageType;									//Indicate Voltage Source: VDDC, MVDDC, MVDDQ or MVDDCI
   4534  1.1  riastrad 	 UCHAR		ucSize;													//Size of Object
   4535  1.1  riastrad 	 ATOM_VOLTAGE_CONTROL			asControl;			//describ how to control
   4536  1.1  riastrad  	 ATOM_VOLTAGE_FORMULA			asFormula;			//Indicate How to convert real Voltage to VID
   4537  1.1  riastrad }ATOM_VOLTAGE_OBJECT;
   4538  1.1  riastrad 
   4539  1.1  riastrad typedef struct  _ATOM_VOLTAGE_OBJECT_V2
   4540  1.1  riastrad {
   4541  1.1  riastrad  	 UCHAR		ucVoltageType;									//Indicate Voltage Source: VDDC, MVDDC, MVDDQ or MVDDCI
   4542  1.1  riastrad 	 UCHAR		ucSize;													//Size of Object
   4543  1.1  riastrad 	 ATOM_VOLTAGE_CONTROL			asControl;			//describ how to control
   4544  1.1  riastrad  	 ATOM_VOLTAGE_FORMULA_V2	asFormula;			//Indicate How to convert real Voltage to VID
   4545  1.1  riastrad }ATOM_VOLTAGE_OBJECT_V2;
   4546  1.1  riastrad 
   4547  1.1  riastrad typedef struct  _ATOM_VOLTAGE_OBJECT_INFO
   4548  1.1  riastrad {
   4549  1.1  riastrad    ATOM_COMMON_TABLE_HEADER	sHeader;
   4550  1.1  riastrad 	 ATOM_VOLTAGE_OBJECT			asVoltageObj[3];	//Info for Voltage control
   4551  1.1  riastrad }ATOM_VOLTAGE_OBJECT_INFO;
   4552  1.1  riastrad 
   4553  1.1  riastrad typedef struct  _ATOM_VOLTAGE_OBJECT_INFO_V2
   4554  1.1  riastrad {
   4555  1.1  riastrad    ATOM_COMMON_TABLE_HEADER	sHeader;
   4556  1.1  riastrad 	 ATOM_VOLTAGE_OBJECT_V2			asVoltageObj[3];	//Info for Voltage control
   4557  1.1  riastrad }ATOM_VOLTAGE_OBJECT_INFO_V2;
   4558  1.1  riastrad 
   4559  1.1  riastrad typedef struct  _ATOM_LEAKID_VOLTAGE
   4560  1.1  riastrad {
   4561  1.1  riastrad 	UCHAR		ucLeakageId;
   4562  1.1  riastrad 	UCHAR		ucReserved;
   4563  1.1  riastrad 	USHORT	usVoltage;
   4564  1.1  riastrad }ATOM_LEAKID_VOLTAGE;
   4565  1.1  riastrad 
   4566  1.1  riastrad typedef struct _ATOM_VOLTAGE_OBJECT_HEADER_V3{
   4567  1.1  riastrad  	 UCHAR		ucVoltageType;									//Indicate Voltage Source: VDDC, MVDDC, MVDDQ or MVDDCI
   4568  1.1  riastrad    UCHAR		ucVoltageMode;							    //Indicate voltage control mode: Init/Set/Leakage/Set phase
   4569  1.1  riastrad 	 USHORT		usSize;													//Size of Object
   4570  1.1  riastrad }ATOM_VOLTAGE_OBJECT_HEADER_V3;
   4571  1.1  riastrad 
   4572  1.1  riastrad // ATOM_VOLTAGE_OBJECT_HEADER_V3.ucVoltageMode
   4573  1.1  riastrad #define VOLTAGE_OBJ_GPIO_LUT                 0        //VOLTAGE and GPIO Lookup table ->ATOM_GPIO_VOLTAGE_OBJECT_V3
   4574  1.1  riastrad #define VOLTAGE_OBJ_VR_I2C_INIT_SEQ          3        //VOLTAGE REGULATOR INIT sequece through I2C -> ATOM_I2C_VOLTAGE_OBJECT_V3
   4575  1.1  riastrad #define VOLTAGE_OBJ_PHASE_LUT                4        //Set Vregulator Phase lookup table ->ATOM_GPIO_VOLTAGE_OBJECT_V3
   4576  1.1  riastrad #define VOLTAGE_OBJ_SVID2                    7        //Indicate voltage control by SVID2 ->ATOM_SVID2_VOLTAGE_OBJECT_V3
   4577  1.1  riastrad #define VOLTAGE_OBJ_EVV                      8
   4578  1.1  riastrad #define VOLTAGE_OBJ_PWRBOOST_LEAKAGE_LUT     0x10     //Powerboost Voltage and LeakageId lookup table->ATOM_LEAKAGE_VOLTAGE_OBJECT_V3
   4579  1.1  riastrad #define VOLTAGE_OBJ_HIGH_STATE_LEAKAGE_LUT   0x11     //High voltage state Voltage and LeakageId lookup table->ATOM_LEAKAGE_VOLTAGE_OBJECT_V3
   4580  1.1  riastrad #define VOLTAGE_OBJ_HIGH1_STATE_LEAKAGE_LUT  0x12     //High1 voltage state Voltage and LeakageId lookup table->ATOM_LEAKAGE_VOLTAGE_OBJECT_V3
   4581  1.1  riastrad 
   4582  1.1  riastrad typedef struct  _VOLTAGE_LUT_ENTRY_V2
   4583  1.1  riastrad {
   4584  1.1  riastrad 	 ULONG		ulVoltageId;									  // The Voltage ID which is used to program GPIO register
   4585  1.1  riastrad 	 USHORT		usVoltageValue;									// The corresponding Voltage Value, in mV
   4586  1.1  riastrad }VOLTAGE_LUT_ENTRY_V2;
   4587  1.1  riastrad 
   4588  1.1  riastrad typedef struct  _LEAKAGE_VOLTAGE_LUT_ENTRY_V2
   4589  1.1  riastrad {
   4590  1.1  riastrad   USHORT	usVoltageLevel; 							  // The Voltage ID which is used to program GPIO register
   4591  1.1  riastrad   USHORT  usVoltageId;
   4592  1.1  riastrad 	USHORT	usLeakageId;									  // The corresponding Voltage Value, in mV
   4593  1.1  riastrad }LEAKAGE_VOLTAGE_LUT_ENTRY_V2;
   4594  1.1  riastrad 
   4595  1.1  riastrad typedef struct  _ATOM_I2C_VOLTAGE_OBJECT_V3
   4596  1.1  riastrad {
   4597  1.1  riastrad    ATOM_VOLTAGE_OBJECT_HEADER_V3 sHeader;    // voltage mode = VOLTAGE_OBJ_VR_I2C_INIT_SEQ
   4598  1.1  riastrad    UCHAR	ucVoltageRegulatorId;					  //Indicate Voltage Regulator Id
   4599  1.1  riastrad    UCHAR    ucVoltageControlI2cLine;
   4600  1.1  riastrad    UCHAR    ucVoltageControlAddress;
   4601  1.1  riastrad    UCHAR    ucVoltageControlOffset;
   4602  1.1  riastrad    ULONG    ulReserved;
   4603  1.1  riastrad    VOLTAGE_LUT_ENTRY asVolI2cLut[1];        // end with 0xff
   4604  1.1  riastrad }ATOM_I2C_VOLTAGE_OBJECT_V3;
   4605  1.1  riastrad 
   4606  1.1  riastrad // ATOM_I2C_VOLTAGE_OBJECT_V3.ucVoltageControlFlag
   4607  1.1  riastrad #define VOLTAGE_DATA_ONE_BYTE                0
   4608  1.1  riastrad #define VOLTAGE_DATA_TWO_BYTE                1
   4609  1.1  riastrad 
   4610  1.1  riastrad typedef struct  _ATOM_GPIO_VOLTAGE_OBJECT_V3
   4611  1.1  riastrad {
   4612  1.1  riastrad    ATOM_VOLTAGE_OBJECT_HEADER_V3 sHeader;   // voltage mode = VOLTAGE_OBJ_GPIO_LUT or VOLTAGE_OBJ_PHASE_LUT
   4613  1.1  riastrad    UCHAR    ucVoltageGpioCntlId;         // default is 0 which indicate control through CG VID mode
   4614  1.1  riastrad    UCHAR    ucGpioEntryNum;              // indiate the entry numbers of Votlage/Gpio value Look up table
   4615  1.1  riastrad    UCHAR    ucPhaseDelay;                // phase delay in unit of micro second
   4616  1.1  riastrad    UCHAR    ucReserved;
   4617  1.1  riastrad    ULONG    ulGpioMaskVal;               // GPIO Mask value
   4618  1.1  riastrad    VOLTAGE_LUT_ENTRY_V2 asVolGpioLut[1];
   4619  1.1  riastrad }ATOM_GPIO_VOLTAGE_OBJECT_V3;
   4620  1.1  riastrad 
   4621  1.1  riastrad typedef struct  _ATOM_LEAKAGE_VOLTAGE_OBJECT_V3
   4622  1.1  riastrad {
   4623  1.1  riastrad    ATOM_VOLTAGE_OBJECT_HEADER_V3 sHeader;    // voltage mode = 0x10/0x11/0x12
   4624  1.1  riastrad    UCHAR    ucLeakageCntlId;             // default is 0
   4625  1.1  riastrad    UCHAR    ucLeakageEntryNum;           // indicate the entry number of LeakageId/Voltage Lut table
   4626  1.1  riastrad    UCHAR    ucReserved[2];
   4627  1.1  riastrad    ULONG    ulMaxVoltageLevel;
   4628  1.1  riastrad    LEAKAGE_VOLTAGE_LUT_ENTRY_V2 asLeakageIdLut[1];
   4629  1.1  riastrad }ATOM_LEAKAGE_VOLTAGE_OBJECT_V3;
   4630  1.1  riastrad 
   4631  1.1  riastrad 
   4632  1.1  riastrad typedef struct  _ATOM_SVID2_VOLTAGE_OBJECT_V3
   4633  1.1  riastrad {
   4634  1.1  riastrad    ATOM_VOLTAGE_OBJECT_HEADER_V3 sHeader;    // voltage mode = VOLTAGE_OBJ_SVID2
   4635  1.1  riastrad // 14:7  PSI0_VID
   4636  1.1  riastrad // 6  PSI0_EN
   4637  1.1  riastrad // 5  PSI1
   4638  1.1  riastrad // 4:2  load line slope trim.
   4639  1.1  riastrad // 1:0  offset trim,
   4640  1.1  riastrad    USHORT   usLoadLine_PSI;
   4641  1.1  riastrad // GPU GPIO pin Id to SVID2 regulator VRHot pin. possible value 0~31. 0 means GPIO0, 31 means GPIO31
   4642  1.1  riastrad    UCHAR    ucSVDGpioId;     //0~31 indicate GPIO0~31
   4643  1.1  riastrad    UCHAR    ucSVCGpioId;     //0~31 indicate GPIO0~31
   4644  1.1  riastrad    ULONG    ulReserved;
   4645  1.1  riastrad }ATOM_SVID2_VOLTAGE_OBJECT_V3;
   4646  1.1  riastrad 
   4647  1.1  riastrad typedef union _ATOM_VOLTAGE_OBJECT_V3{
   4648  1.1  riastrad   ATOM_GPIO_VOLTAGE_OBJECT_V3 asGpioVoltageObj;
   4649  1.1  riastrad   ATOM_I2C_VOLTAGE_OBJECT_V3 asI2cVoltageObj;
   4650  1.1  riastrad   ATOM_LEAKAGE_VOLTAGE_OBJECT_V3 asLeakageObj;
   4651  1.1  riastrad   ATOM_SVID2_VOLTAGE_OBJECT_V3 asSVID2Obj;
   4652  1.1  riastrad }ATOM_VOLTAGE_OBJECT_V3;
   4653  1.1  riastrad 
   4654  1.1  riastrad typedef struct  _ATOM_VOLTAGE_OBJECT_INFO_V3_1
   4655  1.1  riastrad {
   4656  1.1  riastrad    ATOM_COMMON_TABLE_HEADER	sHeader;
   4657  1.1  riastrad 	 ATOM_VOLTAGE_OBJECT_V3			asVoltageObj[3];	//Info for Voltage control
   4658  1.1  riastrad }ATOM_VOLTAGE_OBJECT_INFO_V3_1;
   4659  1.1  riastrad 
   4660  1.1  riastrad typedef struct  _ATOM_ASIC_PROFILE_VOLTAGE
   4661  1.1  riastrad {
   4662  1.1  riastrad 	UCHAR		ucProfileId;
   4663  1.1  riastrad 	UCHAR		ucReserved;
   4664  1.1  riastrad 	USHORT	usSize;
   4665  1.1  riastrad 	USHORT	usEfuseSpareStartAddr;
   4666  1.1  riastrad 	USHORT	usFuseIndex[8];												//from LSB to MSB, Max 8bit,end of 0xffff if less than 8 efuse id,
   4667  1.1  riastrad 	ATOM_LEAKID_VOLTAGE					asLeakVol[2];			//Leakid and relatd voltage
   4668  1.1  riastrad }ATOM_ASIC_PROFILE_VOLTAGE;
   4669  1.1  riastrad 
   4670  1.1  riastrad //ucProfileId
   4671  1.1  riastrad #define	ATOM_ASIC_PROFILE_ID_EFUSE_VOLTAGE			1
   4672  1.1  riastrad #define	ATOM_ASIC_PROFILE_ID_EFUSE_PERFORMANCE_VOLTAGE			1
   4673  1.1  riastrad #define	ATOM_ASIC_PROFILE_ID_EFUSE_THERMAL_VOLTAGE					2
   4674  1.1  riastrad 
   4675  1.1  riastrad typedef struct  _ATOM_ASIC_PROFILING_INFO
   4676  1.1  riastrad {
   4677  1.1  riastrad   ATOM_COMMON_TABLE_HEADER			asHeader;
   4678  1.1  riastrad 	ATOM_ASIC_PROFILE_VOLTAGE			asVoltage;
   4679  1.1  riastrad }ATOM_ASIC_PROFILING_INFO;
   4680  1.1  riastrad 
   4681  1.1  riastrad typedef struct  _ATOM_ASIC_PROFILING_INFO_V2_1
   4682  1.1  riastrad {
   4683  1.1  riastrad   ATOM_COMMON_TABLE_HEADER			asHeader;
   4684  1.1  riastrad   UCHAR  ucLeakageBinNum;                // indicate the entry number of LeakageId/Voltage Lut table
   4685  1.1  riastrad   USHORT usLeakageBinArrayOffset;        // offset of USHORT Leakage Bin list array ( from lower LeakageId to higher)
   4686  1.1  riastrad 
   4687  1.1  riastrad   UCHAR  ucElbVDDC_Num;
   4688  1.1  riastrad   USHORT usElbVDDC_IdArrayOffset;        // offset of USHORT virtual VDDC voltage id ( 0xff01~0xff08 )
   4689  1.1  riastrad   USHORT usElbVDDC_LevelArrayOffset;     // offset of 2 dimension voltage level USHORT array
   4690  1.1  riastrad 
   4691  1.1  riastrad   UCHAR  ucElbVDDCI_Num;
   4692  1.1  riastrad   USHORT usElbVDDCI_IdArrayOffset;       // offset of USHORT virtual VDDCI voltage id ( 0xff01~0xff08 )
   4693  1.1  riastrad   USHORT usElbVDDCI_LevelArrayOffset;    // offset of 2 dimension voltage level USHORT array
   4694  1.1  riastrad }ATOM_ASIC_PROFILING_INFO_V2_1;
   4695  1.1  riastrad 
   4696  1.1  riastrad typedef struct  _ATOM_ASIC_PROFILING_INFO_V3_1
   4697  1.1  riastrad {
   4698  1.1  riastrad   ATOM_COMMON_TABLE_HEADER         asHeader;
   4699  1.1  riastrad   ULONG  ulEvvDerateTdp;
   4700  1.1  riastrad   ULONG  ulEvvDerateTdc;
   4701  1.1  riastrad   ULONG  ulBoardCoreTemp;
   4702  1.1  riastrad   ULONG  ulMaxVddc;
   4703  1.1  riastrad   ULONG  ulMinVddc;
   4704  1.1  riastrad   ULONG  ulLoadLineSlop;
   4705  1.1  riastrad   ULONG  ulLeakageTemp;
   4706  1.1  riastrad   ULONG  ulLeakageVoltage;
   4707  1.1  riastrad   ULONG  ulCACmEncodeRange;
   4708  1.1  riastrad   ULONG  ulCACmEncodeAverage;
   4709  1.1  riastrad   ULONG  ulCACbEncodeRange;
   4710  1.1  riastrad   ULONG  ulCACbEncodeAverage;
   4711  1.1  riastrad   ULONG  ulKt_bEncodeRange;
   4712  1.1  riastrad   ULONG  ulKt_bEncodeAverage;
   4713  1.1  riastrad   ULONG  ulKv_mEncodeRange;
   4714  1.1  riastrad   ULONG  ulKv_mEncodeAverage;
   4715  1.1  riastrad   ULONG  ulKv_bEncodeRange;
   4716  1.1  riastrad   ULONG  ulKv_bEncodeAverage;
   4717  1.1  riastrad   ULONG  ulLkgEncodeLn_MaxDivMin;
   4718  1.1  riastrad   ULONG  ulLkgEncodeMin;
   4719  1.1  riastrad   ULONG  ulEfuseLogisticAlpha;
   4720  1.1  riastrad   USHORT usPowerDpm0;
   4721  1.1  riastrad   USHORT usCurrentDpm0;
   4722  1.1  riastrad   USHORT usPowerDpm1;
   4723  1.1  riastrad   USHORT usCurrentDpm1;
   4724  1.1  riastrad   USHORT usPowerDpm2;
   4725  1.1  riastrad   USHORT usCurrentDpm2;
   4726  1.1  riastrad   USHORT usPowerDpm3;
   4727  1.1  riastrad   USHORT usCurrentDpm3;
   4728  1.1  riastrad   USHORT usPowerDpm4;
   4729  1.1  riastrad   USHORT usCurrentDpm4;
   4730  1.1  riastrad   USHORT usPowerDpm5;
   4731  1.1  riastrad   USHORT usCurrentDpm5;
   4732  1.1  riastrad   USHORT usPowerDpm6;
   4733  1.1  riastrad   USHORT usCurrentDpm6;
   4734  1.1  riastrad   USHORT usPowerDpm7;
   4735  1.1  riastrad   USHORT usCurrentDpm7;
   4736  1.1  riastrad }ATOM_ASIC_PROFILING_INFO_V3_1;
   4737  1.1  riastrad 
   4738  1.1  riastrad 
   4739  1.1  riastrad typedef struct _ATOM_POWER_SOURCE_OBJECT
   4740  1.1  riastrad {
   4741  1.1  riastrad 	UCHAR	ucPwrSrcId;													// Power source
   4742  1.1  riastrad 	UCHAR	ucPwrSensorType;										// GPIO, I2C or none
   4743  1.1  riastrad 	UCHAR	ucPwrSensId;											  // if GPIO detect, it is GPIO id,  if I2C detect, it is I2C id
   4744  1.1  riastrad 	UCHAR	ucPwrSensSlaveAddr;									// Slave address if I2C detect
   4745  1.1  riastrad 	UCHAR ucPwrSensRegIndex;									// I2C register Index if I2C detect
   4746  1.1  riastrad 	UCHAR ucPwrSensRegBitMask;								// detect which bit is used if I2C detect
   4747  1.1  riastrad 	UCHAR	ucPwrSensActiveState;								// high active or low active
   4748  1.1  riastrad 	UCHAR	ucReserve[3];												// reserve
   4749  1.1  riastrad 	USHORT usSensPwr;													// in unit of watt
   4750  1.1  riastrad }ATOM_POWER_SOURCE_OBJECT;
   4751  1.1  riastrad 
   4752  1.1  riastrad typedef struct _ATOM_POWER_SOURCE_INFO
   4753  1.1  riastrad {
   4754  1.1  riastrad 		ATOM_COMMON_TABLE_HEADER		asHeader;
   4755  1.1  riastrad 		UCHAR												asPwrbehave[16];
   4756  1.1  riastrad 		ATOM_POWER_SOURCE_OBJECT		asPwrObj[1];
   4757  1.1  riastrad }ATOM_POWER_SOURCE_INFO;
   4758  1.1  riastrad 
   4759  1.1  riastrad 
   4760  1.1  riastrad //Define ucPwrSrcId
   4761  1.1  riastrad #define POWERSOURCE_PCIE_ID1						0x00
   4762  1.1  riastrad #define POWERSOURCE_6PIN_CONNECTOR_ID1	0x01
   4763  1.1  riastrad #define POWERSOURCE_8PIN_CONNECTOR_ID1	0x02
   4764  1.1  riastrad #define POWERSOURCE_6PIN_CONNECTOR_ID2	0x04
   4765  1.1  riastrad #define POWERSOURCE_8PIN_CONNECTOR_ID2	0x08
   4766  1.1  riastrad 
   4767  1.1  riastrad //define ucPwrSensorId
   4768  1.1  riastrad #define POWER_SENSOR_ALWAYS							0x00
   4769  1.1  riastrad #define POWER_SENSOR_GPIO								0x01
   4770  1.1  riastrad #define POWER_SENSOR_I2C								0x02
   4771  1.1  riastrad 
   4772  1.1  riastrad typedef struct _ATOM_CLK_VOLT_CAPABILITY
   4773  1.1  riastrad {
   4774  1.1  riastrad   ULONG      ulVoltageIndex;                      // The Voltage Index indicated by FUSE, same voltage index shared with SCLK DPM fuse table
   4775  1.1  riastrad   ULONG      ulMaximumSupportedCLK;               // Maximum clock supported with specified voltage index, unit in 10kHz
   4776  1.1  riastrad }ATOM_CLK_VOLT_CAPABILITY;
   4777  1.1  riastrad 
   4778  1.1  riastrad typedef struct _ATOM_AVAILABLE_SCLK_LIST
   4779  1.1  riastrad {
   4780  1.1  riastrad   ULONG      ulSupportedSCLK;               // Maximum clock supported with specified voltage index,  unit in 10kHz
   4781  1.1  riastrad   USHORT     usVoltageIndex;                // The Voltage Index indicated by FUSE for specified SCLK
   4782  1.1  riastrad   USHORT     usVoltageID;                   // The Voltage ID indicated by FUSE for specified SCLK
   4783  1.1  riastrad }ATOM_AVAILABLE_SCLK_LIST;
   4784  1.1  riastrad 
   4785  1.1  riastrad // ATOM_INTEGRATED_SYSTEM_INFO_V6 ulSystemConfig cap definition
   4786  1.1  riastrad #define ATOM_IGP_INFO_V6_SYSTEM_CONFIG__PCIE_POWER_GATING_ENABLE             1       // refer to ulSystemConfig bit[0]
   4787  1.1  riastrad 
   4788  1.1  riastrad // this IntegrateSystemInfoTable is used for Liano/Ontario APU
   4789  1.1  riastrad typedef struct _ATOM_INTEGRATED_SYSTEM_INFO_V6
   4790  1.1  riastrad {
   4791  1.1  riastrad   ATOM_COMMON_TABLE_HEADER   sHeader;
   4792  1.1  riastrad   ULONG  ulBootUpEngineClock;
   4793  1.1  riastrad   ULONG  ulDentistVCOFreq;
   4794  1.1  riastrad   ULONG  ulBootUpUMAClock;
   4795  1.1  riastrad   ATOM_CLK_VOLT_CAPABILITY   sDISPCLK_Voltage[4];
   4796  1.1  riastrad   ULONG  ulBootUpReqDisplayVector;
   4797  1.1  riastrad   ULONG  ulOtherDisplayMisc;
   4798  1.1  riastrad   ULONG  ulGPUCapInfo;
   4799  1.1  riastrad   ULONG  ulSB_MMIO_Base_Addr;
   4800  1.1  riastrad   USHORT usRequestedPWMFreqInHz;
   4801  1.1  riastrad   UCHAR  ucHtcTmpLmt;
   4802  1.1  riastrad   UCHAR  ucHtcHystLmt;
   4803  1.1  riastrad   ULONG  ulMinEngineClock;
   4804  1.1  riastrad   ULONG  ulSystemConfig;
   4805  1.1  riastrad   ULONG  ulCPUCapInfo;
   4806  1.1  riastrad   USHORT usNBP0Voltage;
   4807  1.1  riastrad   USHORT usNBP1Voltage;
   4808  1.1  riastrad   USHORT usBootUpNBVoltage;
   4809  1.1  riastrad   USHORT usExtDispConnInfoOffset;
   4810  1.1  riastrad   USHORT usPanelRefreshRateRange;
   4811  1.1  riastrad   UCHAR  ucMemoryType;
   4812  1.1  riastrad   UCHAR  ucUMAChannelNumber;
   4813  1.1  riastrad   ULONG  ulCSR_M3_ARB_CNTL_DEFAULT[10];
   4814  1.1  riastrad   ULONG  ulCSR_M3_ARB_CNTL_UVD[10];
   4815  1.1  riastrad   ULONG  ulCSR_M3_ARB_CNTL_FS3D[10];
   4816  1.1  riastrad   ATOM_AVAILABLE_SCLK_LIST   sAvail_SCLK[5];
   4817  1.1  riastrad   ULONG  ulGMCRestoreResetTime;
   4818  1.1  riastrad   ULONG  ulMinimumNClk;
   4819  1.1  riastrad   ULONG  ulIdleNClk;
   4820  1.1  riastrad   ULONG  ulDDR_DLL_PowerUpTime;
   4821  1.1  riastrad   ULONG  ulDDR_PLL_PowerUpTime;
   4822  1.1  riastrad   USHORT usPCIEClkSSPercentage;
   4823  1.1  riastrad   USHORT usPCIEClkSSType;
   4824  1.1  riastrad   USHORT usLvdsSSPercentage;
   4825  1.1  riastrad   USHORT usLvdsSSpreadRateIn10Hz;
   4826  1.1  riastrad   USHORT usHDMISSPercentage;
   4827  1.1  riastrad   USHORT usHDMISSpreadRateIn10Hz;
   4828  1.1  riastrad   USHORT usDVISSPercentage;
   4829  1.1  riastrad   USHORT usDVISSpreadRateIn10Hz;
   4830  1.1  riastrad   ULONG  SclkDpmBoostMargin;
   4831  1.1  riastrad   ULONG  SclkDpmThrottleMargin;
   4832  1.1  riastrad   USHORT SclkDpmTdpLimitPG;
   4833  1.1  riastrad   USHORT SclkDpmTdpLimitBoost;
   4834  1.1  riastrad   ULONG  ulBoostEngineCLock;
   4835  1.1  riastrad   UCHAR  ulBoostVid_2bit;
   4836  1.1  riastrad   UCHAR  EnableBoost;
   4837  1.1  riastrad   USHORT GnbTdpLimit;
   4838  1.1  riastrad   USHORT usMaxLVDSPclkFreqInSingleLink;
   4839  1.1  riastrad   UCHAR  ucLvdsMisc;
   4840  1.1  riastrad   UCHAR  ucLVDSReserved;
   4841  1.1  riastrad   ULONG  ulReserved3[15];
   4842  1.1  riastrad   ATOM_EXTERNAL_DISPLAY_CONNECTION_INFO sExtDispConnInfo;
   4843  1.1  riastrad }ATOM_INTEGRATED_SYSTEM_INFO_V6;
   4844  1.1  riastrad 
   4845  1.1  riastrad // ulGPUCapInfo
   4846  1.1  riastrad #define INTEGRATED_SYSTEM_INFO_V6_GPUCAPINFO__TMDSHDMI_COHERENT_SINGLEPLL_MODE       0x01
   4847  1.1  riastrad #define INTEGRATED_SYSTEM_INFO_V6_GPUCAPINFO__DISABLE_AUX_HW_MODE_DETECTION          0x08
   4848  1.1  riastrad 
   4849  1.1  riastrad //ucLVDSMisc:
   4850  1.1  riastrad #define SYS_INFO_LVDSMISC__888_FPDI_MODE                                             0x01
   4851  1.1  riastrad #define SYS_INFO_LVDSMISC__DL_CH_SWAP                                                0x02
   4852  1.1  riastrad #define SYS_INFO_LVDSMISC__888_BPC                                                   0x04
   4853  1.1  riastrad #define SYS_INFO_LVDSMISC__OVERRIDE_EN                                               0x08
   4854  1.1  riastrad #define SYS_INFO_LVDSMISC__BLON_ACTIVE_LOW                                           0x10
   4855  1.1  riastrad // new since Trinity
   4856  1.1  riastrad #define SYS_INFO_LVDSMISC__TRAVIS_LVDS_VOL_OVERRIDE_EN                               0x20
   4857  1.1  riastrad 
   4858  1.1  riastrad // not used any more
   4859  1.1  riastrad #define SYS_INFO_LVDSMISC__VSYNC_ACTIVE_LOW                                          0x04
   4860  1.1  riastrad #define SYS_INFO_LVDSMISC__HSYNC_ACTIVE_LOW                                          0x08
   4861  1.1  riastrad 
   4862  1.1  riastrad /**********************************************************************************************************************
   4863  1.1  riastrad   ATOM_INTEGRATED_SYSTEM_INFO_V6 Description
   4864  1.1  riastrad ulBootUpEngineClock:              VBIOS bootup Engine clock frequency, in 10kHz unit. if it is equal 0, then VBIOS use pre-defined bootup engine clock
   4865  1.1  riastrad ulDentistVCOFreq:                 Dentist VCO clock in 10kHz unit.
   4866  1.1  riastrad ulBootUpUMAClock:                 System memory boot up clock frequency in 10Khz unit.
   4867  1.1  riastrad sDISPCLK_Voltage:                 Report Display clock voltage requirement.
   4868  1.1  riastrad 
   4869  1.1  riastrad ulBootUpReqDisplayVector:         VBIOS boot up display IDs, following are supported devices in Liano/Ontaio projects:
   4870  1.1  riastrad                                   ATOM_DEVICE_CRT1_SUPPORT                  0x0001
   4871  1.1  riastrad                                   ATOM_DEVICE_CRT2_SUPPORT                  0x0010
   4872  1.1  riastrad                                   ATOM_DEVICE_DFP1_SUPPORT                  0x0008
   4873  1.1  riastrad                                   ATOM_DEVICE_DFP6_SUPPORT                  0x0040
   4874  1.1  riastrad                                   ATOM_DEVICE_DFP2_SUPPORT                  0x0080
   4875  1.1  riastrad                                   ATOM_DEVICE_DFP3_SUPPORT                  0x0200
   4876  1.1  riastrad                                   ATOM_DEVICE_DFP4_SUPPORT                  0x0400
   4877  1.1  riastrad                                   ATOM_DEVICE_DFP5_SUPPORT                  0x0800
   4878  1.1  riastrad                                   ATOM_DEVICE_LCD1_SUPPORT                  0x0002
   4879  1.1  riastrad ulOtherDisplayMisc:      	        Other display related flags, not defined yet.
   4880  1.1  riastrad ulGPUCapInfo:                     bit[0]=0: TMDS/HDMI Coherent Mode use cascade PLL mode.
   4881  1.1  riastrad                                         =1: TMDS/HDMI Coherent Mode use signel PLL mode.
   4882  1.1  riastrad                                   bit[3]=0: Enable HW AUX mode detection logic
   4883  1.1  riastrad                                         =1: Disable HW AUX mode dettion logic
   4884  1.1  riastrad ulSB_MMIO_Base_Addr:              Physical Base address to SB MMIO space. Driver needs to initialize it for SMU usage.
   4885  1.1  riastrad 
   4886  1.1  riastrad usRequestedPWMFreqInHz:           When it's set to 0x0 by SBIOS: the LCD BackLight is not controlled by GPU(SW).
   4887  1.1  riastrad                                   Any attempt to change BL using VBIOS function or enable VariBri from PP table is not effective since ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU==0;
   4888  1.1  riastrad 
   4889  1.1  riastrad                                   When it's set to a non-zero frequency, the BackLight is controlled by GPU (SW) in one of two ways below:
   4890  1.1  riastrad                                   1. SW uses the GPU BL PWM output to control the BL, in chis case, this non-zero frequency determines what freq GPU should use;
   4891  1.1  riastrad                                   VBIOS will set up proper PWM frequency and ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU==1,as the result,
   4892  1.1  riastrad                                   Changing BL using VBIOS function is functional in both driver and non-driver present environment;
   4893  1.1  riastrad                                   and enabling VariBri under the driver environment from PP table is optional.
   4894  1.1  riastrad 
   4895  1.1  riastrad                                   2. SW uses other means to control BL (like DPCD),this non-zero frequency serves as a flag only indicating
   4896  1.1  riastrad                                   that BL control from GPU is expected.
   4897  1.1  riastrad                                   VBIOS will NOT set up PWM frequency but make ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU==1
   4898  1.1  riastrad                                   Changing BL using VBIOS function could be functional in both driver and non-driver present environment,but
   4899  1.1  riastrad                                   it's per platform
   4900  1.1  riastrad                                   and enabling VariBri under the driver environment from PP table is optional.
   4901  1.1  riastrad 
   4902  1.1  riastrad ucHtcTmpLmt:                      Refer to D18F3x64 bit[22:16], HtcTmpLmt.
   4903  1.1  riastrad                                   Threshold on value to enter HTC_active state.
   4904  1.1  riastrad ucHtcHystLmt:                     Refer to D18F3x64 bit[27:24], HtcHystLmt.
   4905  1.1  riastrad                                   To calculate threshold off value to exit HTC_active state, which is Threshold on vlaue minus ucHtcHystLmt.
   4906  1.1  riastrad ulMinEngineClock:                 Minimum SCLK allowed in 10kHz unit. This is calculated based on WRCK Fuse settings.
   4907  1.1  riastrad ulSystemConfig:                   Bit[0]=0: PCIE Power Gating Disabled
   4908  1.1  riastrad                                         =1: PCIE Power Gating Enabled
   4909  1.1  riastrad                                   Bit[1]=0: DDR-DLL shut-down feature disabled.
   4910  1.1  riastrad                                          1: DDR-DLL shut-down feature enabled.
   4911  1.1  riastrad                                   Bit[2]=0: DDR-PLL Power down feature disabled.
   4912  1.1  riastrad                                          1: DDR-PLL Power down feature enabled.
   4913  1.1  riastrad ulCPUCapInfo:                     TBD
   4914  1.1  riastrad usNBP0Voltage:                    VID for voltage on NB P0 State
   4915  1.1  riastrad usNBP1Voltage:                    VID for voltage on NB P1 State
   4916  1.1  riastrad usBootUpNBVoltage:                Voltage Index of GNB voltage configured by SBIOS, which is suffcient to support VBIOS DISPCLK requirement.
   4917  1.1  riastrad usExtDispConnInfoOffset:          Offset to sExtDispConnInfo inside the structure
   4918  1.1  riastrad usPanelRefreshRateRange:          Bit vector for LCD supported refresh rate range. If DRR is requestd by the platform, at least two bits need to be set
   4919  1.1  riastrad                                   to indicate a range.
   4920  1.1  riastrad                                   SUPPORTED_LCD_REFRESHRATE_30Hz          0x0004
   4921  1.1  riastrad                                   SUPPORTED_LCD_REFRESHRATE_40Hz          0x0008
   4922  1.1  riastrad                                   SUPPORTED_LCD_REFRESHRATE_50Hz          0x0010
   4923  1.1  riastrad                                   SUPPORTED_LCD_REFRESHRATE_60Hz          0x0020
   4924  1.1  riastrad ucMemoryType:                     [3:0]=1:DDR1;=2:DDR2;=3:DDR3.[7:4] is reserved.
   4925  1.1  riastrad ucUMAChannelNumber:      	        System memory channel numbers.
   4926  1.1  riastrad ulCSR_M3_ARB_CNTL_DEFAULT[10]:    Arrays with values for CSR M3 arbiter for default
   4927  1.1  riastrad ulCSR_M3_ARB_CNTL_UVD[10]:        Arrays with values for CSR M3 arbiter for UVD playback.
   4928  1.1  riastrad ulCSR_M3_ARB_CNTL_FS3D[10]:       Arrays with values for CSR M3 arbiter for Full Screen 3D applications.
   4929  1.1  riastrad sAvail_SCLK[5]:                   Arrays to provide availabe list of SLCK and corresponding voltage, order from low to high
   4930  1.1  riastrad ulGMCRestoreResetTime:            GMC power restore and GMC reset time to calculate data reconnection latency. Unit in ns.
   4931  1.1  riastrad ulMinimumNClk:                    Minimum NCLK speed among all NB-Pstates to calcualte data reconnection latency. Unit in 10kHz.
   4932  1.1  riastrad ulIdleNClk:                       NCLK speed while memory runs in self-refresh state. Unit in 10kHz.
   4933  1.1  riastrad ulDDR_DLL_PowerUpTime:            DDR PHY DLL power up time. Unit in ns.
   4934  1.1  riastrad ulDDR_PLL_PowerUpTime:            DDR PHY PLL power up time. Unit in ns.
   4935  1.1  riastrad usPCIEClkSSPercentage:            PCIE Clock Spred Spectrum Percentage in unit 0.01%; 100 mean 1%.
   4936  1.1  riastrad usPCIEClkSSType:                  PCIE Clock Spred Spectrum Type. 0 for Down spread(default); 1 for Center spread.
   4937  1.1  riastrad usLvdsSSPercentage:               LVDS panel ( not include eDP ) Spread Spectrum Percentage in unit of 0.01%, =0, use VBIOS default setting.
   4938  1.1  riastrad usLvdsSSpreadRateIn10Hz:          LVDS panel ( not include eDP ) Spread Spectrum frequency in unit of 10Hz, =0, use VBIOS default setting.
   4939  1.1  riastrad usHDMISSPercentage:               HDMI Spread Spectrum Percentage in unit 0.01%; 100 mean 1%,  =0, use VBIOS default setting.
   4940  1.1  riastrad usHDMISSpreadRateIn10Hz:          HDMI Spread Spectrum frequency in unit of 10Hz,  =0, use VBIOS default setting.
   4941  1.1  riastrad usDVISSPercentage:                DVI Spread Spectrum Percentage in unit 0.01%; 100 mean 1%,  =0, use VBIOS default setting.
   4942  1.1  riastrad usDVISSpreadRateIn10Hz:           DVI Spread Spectrum frequency in unit of 10Hz,  =0, use VBIOS default setting.
   4943  1.1  riastrad usMaxLVDSPclkFreqInSingleLink:    Max pixel clock LVDS panel single link, if=0 means VBIOS use default threhold, right now it is 85Mhz
   4944  1.1  riastrad ucLVDSMisc:                       [bit0] LVDS 888bit panel mode =0: LVDS 888 panel in LDI mode, =1: LVDS 888 panel in FPDI mode
   4945  1.1  riastrad                                   [bit1] LVDS panel lower and upper link mapping =0: lower link and upper link not swap, =1: lower link and upper link are swapped
   4946  1.1  riastrad                                   [bit2] LVDS 888bit per color mode  =0: 666 bit per color =1:888 bit per color
   4947  1.1  riastrad                                   [bit3] LVDS parameter override enable  =0: ucLvdsMisc parameter are not used =1: ucLvdsMisc parameter should be used
   4948  1.1  riastrad                                   [bit4] Polarity of signal sent to digital BLON output pin. =0: not inverted(active high) =1: inverted ( active low )
   4949  1.1  riastrad **********************************************************************************************************************/
   4950  1.1  riastrad 
   4951  1.1  riastrad // this Table is used for Liano/Ontario APU
   4952  1.1  riastrad typedef struct _ATOM_FUSION_SYSTEM_INFO_V1
   4953  1.1  riastrad {
   4954  1.1  riastrad   ATOM_INTEGRATED_SYSTEM_INFO_V6    sIntegratedSysInfo;
   4955  1.1  riastrad   ULONG  ulPowerplayTable[128];
   4956  1.1  riastrad }ATOM_FUSION_SYSTEM_INFO_V1;
   4957  1.1  riastrad 
   4958  1.1  riastrad 
   4959  1.1  riastrad typedef struct _ATOM_TDP_CONFIG_BITS
   4960  1.1  riastrad {
   4961  1.1  riastrad #if ATOM_BIG_ENDIAN
   4962  1.1  riastrad   ULONG   uReserved:2;
   4963  1.1  riastrad   ULONG   uTDP_Value:14;  // Original TDP value in tens of milli watts
   4964  1.1  riastrad   ULONG   uCTDP_Value:14; // Override value in tens of milli watts
   4965  1.1  riastrad   ULONG   uCTDP_Enable:2; // = (uCTDP_Value > uTDP_Value? 2: (uCTDP_Value < uTDP_Value))
   4966  1.1  riastrad #else
   4967  1.1  riastrad   ULONG   uCTDP_Enable:2; // = (uCTDP_Value > uTDP_Value? 2: (uCTDP_Value < uTDP_Value))
   4968  1.1  riastrad   ULONG   uCTDP_Value:14; // Override value in tens of milli watts
   4969  1.1  riastrad   ULONG   uTDP_Value:14;  // Original TDP value in tens of milli watts
   4970  1.1  riastrad   ULONG   uReserved:2;
   4971  1.1  riastrad #endif
   4972  1.1  riastrad }ATOM_TDP_CONFIG_BITS;
   4973  1.1  riastrad 
   4974  1.1  riastrad typedef union _ATOM_TDP_CONFIG
   4975  1.1  riastrad {
   4976  1.1  riastrad   ATOM_TDP_CONFIG_BITS TDP_config;
   4977  1.1  riastrad   ULONG            TDP_config_all;
   4978  1.1  riastrad }ATOM_TDP_CONFIG;
   4979  1.1  riastrad 
   4980  1.1  riastrad /**********************************************************************************************************************
   4981  1.1  riastrad   ATOM_FUSION_SYSTEM_INFO_V1 Description
   4982  1.1  riastrad sIntegratedSysInfo:               refer to ATOM_INTEGRATED_SYSTEM_INFO_V6 definition.
   4983  1.1  riastrad ulPowerplayTable[128]:            This 512 bytes memory is used to save ATOM_PPLIB_POWERPLAYTABLE3, starting form ulPowerplayTable[0]
   4984  1.1  riastrad **********************************************************************************************************************/
   4985  1.1  riastrad 
   4986  1.1  riastrad // this IntegrateSystemInfoTable is used for Trinity APU
   4987  1.1  riastrad typedef struct _ATOM_INTEGRATED_SYSTEM_INFO_V1_7
   4988  1.1  riastrad {
   4989  1.1  riastrad   ATOM_COMMON_TABLE_HEADER   sHeader;
   4990  1.1  riastrad   ULONG  ulBootUpEngineClock;
   4991  1.1  riastrad   ULONG  ulDentistVCOFreq;
   4992  1.1  riastrad   ULONG  ulBootUpUMAClock;
   4993  1.1  riastrad   ATOM_CLK_VOLT_CAPABILITY   sDISPCLK_Voltage[4];
   4994  1.1  riastrad   ULONG  ulBootUpReqDisplayVector;
   4995  1.1  riastrad   ULONG  ulOtherDisplayMisc;
   4996  1.1  riastrad   ULONG  ulGPUCapInfo;
   4997  1.1  riastrad   ULONG  ulSB_MMIO_Base_Addr;
   4998  1.1  riastrad   USHORT usRequestedPWMFreqInHz;
   4999  1.1  riastrad   UCHAR  ucHtcTmpLmt;
   5000  1.1  riastrad   UCHAR  ucHtcHystLmt;
   5001  1.1  riastrad   ULONG  ulMinEngineClock;
   5002  1.1  riastrad   ULONG  ulSystemConfig;
   5003  1.1  riastrad   ULONG  ulCPUCapInfo;
   5004  1.1  riastrad   USHORT usNBP0Voltage;
   5005  1.1  riastrad   USHORT usNBP1Voltage;
   5006  1.1  riastrad   USHORT usBootUpNBVoltage;
   5007  1.1  riastrad   USHORT usExtDispConnInfoOffset;
   5008  1.1  riastrad   USHORT usPanelRefreshRateRange;
   5009  1.1  riastrad   UCHAR  ucMemoryType;
   5010  1.1  riastrad   UCHAR  ucUMAChannelNumber;
   5011  1.1  riastrad   UCHAR  strVBIOSMsg[40];
   5012  1.1  riastrad   ATOM_TDP_CONFIG  asTdpConfig;
   5013  1.1  riastrad   ULONG  ulReserved[19];
   5014  1.1  riastrad   ATOM_AVAILABLE_SCLK_LIST   sAvail_SCLK[5];
   5015  1.1  riastrad   ULONG  ulGMCRestoreResetTime;
   5016  1.1  riastrad   ULONG  ulMinimumNClk;
   5017  1.1  riastrad   ULONG  ulIdleNClk;
   5018  1.1  riastrad   ULONG  ulDDR_DLL_PowerUpTime;
   5019  1.1  riastrad   ULONG  ulDDR_PLL_PowerUpTime;
   5020  1.1  riastrad   USHORT usPCIEClkSSPercentage;
   5021  1.1  riastrad   USHORT usPCIEClkSSType;
   5022  1.1  riastrad   USHORT usLvdsSSPercentage;
   5023  1.1  riastrad   USHORT usLvdsSSpreadRateIn10Hz;
   5024  1.1  riastrad   USHORT usHDMISSPercentage;
   5025  1.1  riastrad   USHORT usHDMISSpreadRateIn10Hz;
   5026  1.1  riastrad   USHORT usDVISSPercentage;
   5027  1.1  riastrad   USHORT usDVISSpreadRateIn10Hz;
   5028  1.1  riastrad   ULONG  SclkDpmBoostMargin;
   5029  1.1  riastrad   ULONG  SclkDpmThrottleMargin;
   5030  1.1  riastrad   USHORT SclkDpmTdpLimitPG;
   5031  1.1  riastrad   USHORT SclkDpmTdpLimitBoost;
   5032  1.1  riastrad   ULONG  ulBoostEngineCLock;
   5033  1.1  riastrad   UCHAR  ulBoostVid_2bit;
   5034  1.1  riastrad   UCHAR  EnableBoost;
   5035  1.1  riastrad   USHORT GnbTdpLimit;
   5036  1.1  riastrad   USHORT usMaxLVDSPclkFreqInSingleLink;
   5037  1.1  riastrad   UCHAR  ucLvdsMisc;
   5038  1.1  riastrad   UCHAR  ucTravisLVDSVolAdjust;
   5039  1.1  riastrad   UCHAR  ucLVDSPwrOnSeqDIGONtoDE_in4Ms;
   5040  1.1  riastrad   UCHAR  ucLVDSPwrOnSeqDEtoVARY_BL_in4Ms;
   5041  1.1  riastrad   UCHAR  ucLVDSPwrOffSeqVARY_BLtoDE_in4Ms;
   5042  1.1  riastrad   UCHAR  ucLVDSPwrOffSeqDEtoDIGON_in4Ms;
   5043  1.1  riastrad   UCHAR  ucLVDSOffToOnDelay_in4Ms;
   5044  1.1  riastrad   UCHAR  ucLVDSPwrOnSeqVARY_BLtoBLON_in4Ms;
   5045  1.1  riastrad   UCHAR  ucLVDSPwrOffSeqBLONtoVARY_BL_in4Ms;
   5046  1.1  riastrad   UCHAR  ucMinAllowedBL_Level;
   5047  1.1  riastrad   ULONG  ulLCDBitDepthControlVal;
   5048  1.1  riastrad   ULONG  ulNbpStateMemclkFreq[4];
   5049  1.1  riastrad   USHORT usNBP2Voltage;
   5050  1.1  riastrad   USHORT usNBP3Voltage;
   5051  1.1  riastrad   ULONG  ulNbpStateNClkFreq[4];
   5052  1.1  riastrad   UCHAR  ucNBDPMEnable;
   5053  1.1  riastrad   UCHAR  ucReserved[3];
   5054  1.1  riastrad   UCHAR  ucDPMState0VclkFid;
   5055  1.1  riastrad   UCHAR  ucDPMState0DclkFid;
   5056  1.1  riastrad   UCHAR  ucDPMState1VclkFid;
   5057  1.1  riastrad   UCHAR  ucDPMState1DclkFid;
   5058  1.1  riastrad   UCHAR  ucDPMState2VclkFid;
   5059  1.1  riastrad   UCHAR  ucDPMState2DclkFid;
   5060  1.1  riastrad   UCHAR  ucDPMState3VclkFid;
   5061  1.1  riastrad   UCHAR  ucDPMState3DclkFid;
   5062  1.1  riastrad   ATOM_EXTERNAL_DISPLAY_CONNECTION_INFO sExtDispConnInfo;
   5063  1.1  riastrad }ATOM_INTEGRATED_SYSTEM_INFO_V1_7;
   5064  1.1  riastrad 
   5065  1.1  riastrad // ulOtherDisplayMisc
   5066  1.1  riastrad #define INTEGRATED_SYSTEM_INFO__GET_EDID_CALLBACK_FUNC_SUPPORT            0x01
   5067  1.1  riastrad #define INTEGRATED_SYSTEM_INFO__GET_BOOTUP_DISPLAY_CALLBACK_FUNC_SUPPORT  0x02
   5068  1.1  riastrad #define INTEGRATED_SYSTEM_INFO__GET_EXPANSION_CALLBACK_FUNC_SUPPORT       0x04
   5069  1.1  riastrad #define INTEGRATED_SYSTEM_INFO__FAST_BOOT_SUPPORT                         0x08
   5070  1.1  riastrad 
   5071  1.1  riastrad // ulGPUCapInfo
   5072  1.1  riastrad #define SYS_INFO_GPUCAPS__TMDSHDMI_COHERENT_SINGLEPLL_MODE                0x01
   5073  1.1  riastrad #define SYS_INFO_GPUCAPS__DP_SINGLEPLL_MODE                               0x02
   5074  1.1  riastrad #define SYS_INFO_GPUCAPS__DISABLE_AUX_MODE_DETECT                         0x08
   5075  1.1  riastrad #define SYS_INFO_GPUCAPS__ENABEL_DFS_BYPASS                               0x10
   5076  1.1  riastrad 
   5077  1.1  riastrad /**********************************************************************************************************************
   5078  1.1  riastrad   ATOM_INTEGRATED_SYSTEM_INFO_V1_7 Description
   5079  1.1  riastrad ulBootUpEngineClock:              VBIOS bootup Engine clock frequency, in 10kHz unit. if it is equal 0, then VBIOS use pre-defined bootup engine clock
   5080  1.1  riastrad ulDentistVCOFreq:                 Dentist VCO clock in 10kHz unit.
   5081  1.1  riastrad ulBootUpUMAClock:                 System memory boot up clock frequency in 10Khz unit.
   5082  1.1  riastrad sDISPCLK_Voltage:                 Report Display clock voltage requirement.
   5083  1.1  riastrad 
   5084  1.1  riastrad ulBootUpReqDisplayVector:         VBIOS boot up display IDs, following are supported devices in Trinity projects:
   5085  1.1  riastrad                                   ATOM_DEVICE_CRT1_SUPPORT                  0x0001
   5086  1.1  riastrad                                   ATOM_DEVICE_DFP1_SUPPORT                  0x0008
   5087  1.1  riastrad                                   ATOM_DEVICE_DFP6_SUPPORT                  0x0040
   5088  1.1  riastrad                                   ATOM_DEVICE_DFP2_SUPPORT                  0x0080
   5089  1.1  riastrad                                   ATOM_DEVICE_DFP3_SUPPORT                  0x0200
   5090  1.1  riastrad                                   ATOM_DEVICE_DFP4_SUPPORT                  0x0400
   5091  1.1  riastrad                                   ATOM_DEVICE_DFP5_SUPPORT                  0x0800
   5092  1.1  riastrad                                   ATOM_DEVICE_LCD1_SUPPORT                  0x0002
   5093  1.1  riastrad ulOtherDisplayMisc:      	        bit[0]=0: INT15 callback function Get LCD EDID ( ax=4e08, bl=1b ) is not supported by SBIOS.
   5094  1.1  riastrad                                         =1: INT15 callback function Get LCD EDID ( ax=4e08, bl=1b ) is supported by SBIOS.
   5095  1.1  riastrad                                   bit[1]=0: INT15 callback function Get boot display( ax=4e08, bl=01h) is not supported by SBIOS
   5096  1.1  riastrad                                         =1: INT15 callback function Get boot display( ax=4e08, bl=01h) is supported by SBIOS
   5097  1.1  riastrad                                   bit[2]=0: INT15 callback function Get panel Expansion ( ax=4e08, bl=02h) is not supported by SBIOS
   5098  1.1  riastrad                                         =1: INT15 callback function Get panel Expansion ( ax=4e08, bl=02h) is supported by SBIOS
   5099  1.1  riastrad                                   bit[3]=0: VBIOS fast boot is disable
   5100  1.1  riastrad                                         =1: VBIOS fast boot is enable. ( VBIOS skip display device detection in every set mode if LCD panel is connect and LID is open)
   5101  1.1  riastrad ulGPUCapInfo:                     bit[0]=0: TMDS/HDMI Coherent Mode use cascade PLL mode.
   5102  1.1  riastrad                                         =1: TMDS/HDMI Coherent Mode use signel PLL mode.
   5103  1.1  riastrad                                   bit[1]=0: DP mode use cascade PLL mode ( New for Trinity )
   5104  1.1  riastrad                                         =1: DP mode use single PLL mode
   5105  1.1  riastrad                                   bit[3]=0: Enable AUX HW mode detection logic
   5106  1.1  riastrad                                         =1: Disable AUX HW mode detection logic
   5107  1.1  riastrad 
   5108  1.1  riastrad ulSB_MMIO_Base_Addr:              Physical Base address to SB MMIO space. Driver needs to initialize it for SMU usage.
   5109  1.1  riastrad 
   5110  1.1  riastrad usRequestedPWMFreqInHz:           When it's set to 0x0 by SBIOS: the LCD BackLight is not controlled by GPU(SW).
   5111  1.1  riastrad                                   Any attempt to change BL using VBIOS function or enable VariBri from PP table is not effective since ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU==0;
   5112  1.1  riastrad 
   5113  1.1  riastrad                                   When it's set to a non-zero frequency, the BackLight is controlled by GPU (SW) in one of two ways below:
   5114  1.1  riastrad                                   1. SW uses the GPU BL PWM output to control the BL, in chis case, this non-zero frequency determines what freq GPU should use;
   5115  1.1  riastrad                                   VBIOS will set up proper PWM frequency and ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU==1,as the result,
   5116  1.1  riastrad                                   Changing BL using VBIOS function is functional in both driver and non-driver present environment;
   5117  1.1  riastrad                                   and enabling VariBri under the driver environment from PP table is optional.
   5118  1.1  riastrad 
   5119  1.1  riastrad                                   2. SW uses other means to control BL (like DPCD),this non-zero frequency serves as a flag only indicating
   5120  1.1  riastrad                                   that BL control from GPU is expected.
   5121  1.1  riastrad                                   VBIOS will NOT set up PWM frequency but make ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU==1
   5122  1.1  riastrad                                   Changing BL using VBIOS function could be functional in both driver and non-driver present environment,but
   5123  1.1  riastrad                                   it's per platform
   5124  1.1  riastrad                                   and enabling VariBri under the driver environment from PP table is optional.
   5125  1.1  riastrad 
   5126  1.1  riastrad ucHtcTmpLmt:                      Refer to D18F3x64 bit[22:16], HtcTmpLmt.
   5127  1.1  riastrad                                   Threshold on value to enter HTC_active state.
   5128  1.1  riastrad ucHtcHystLmt:                     Refer to D18F3x64 bit[27:24], HtcHystLmt.
   5129  1.1  riastrad                                   To calculate threshold off value to exit HTC_active state, which is Threshold on vlaue minus ucHtcHystLmt.
   5130  1.1  riastrad ulMinEngineClock:                 Minimum SCLK allowed in 10kHz unit. This is calculated based on WRCK Fuse settings.
   5131  1.1  riastrad ulSystemConfig:                   Bit[0]=0: PCIE Power Gating Disabled
   5132  1.1  riastrad                                         =1: PCIE Power Gating Enabled
   5133  1.1  riastrad                                   Bit[1]=0: DDR-DLL shut-down feature disabled.
   5134  1.1  riastrad                                          1: DDR-DLL shut-down feature enabled.
   5135  1.1  riastrad                                   Bit[2]=0: DDR-PLL Power down feature disabled.
   5136  1.1  riastrad                                          1: DDR-PLL Power down feature enabled.
   5137  1.1  riastrad ulCPUCapInfo:                     TBD
   5138  1.1  riastrad usNBP0Voltage:                    VID for voltage on NB P0 State
   5139  1.1  riastrad usNBP1Voltage:                    VID for voltage on NB P1 State
   5140  1.1  riastrad usNBP2Voltage:                    VID for voltage on NB P2 State
   5141  1.1  riastrad usNBP3Voltage:                    VID for voltage on NB P3 State
   5142  1.1  riastrad usBootUpNBVoltage:                Voltage Index of GNB voltage configured by SBIOS, which is suffcient to support VBIOS DISPCLK requirement.
   5143  1.1  riastrad usExtDispConnInfoOffset:          Offset to sExtDispConnInfo inside the structure
   5144  1.1  riastrad usPanelRefreshRateRange:          Bit vector for LCD supported refresh rate range. If DRR is requestd by the platform, at least two bits need to be set
   5145  1.1  riastrad                                   to indicate a range.
   5146  1.1  riastrad                                   SUPPORTED_LCD_REFRESHRATE_30Hz          0x0004
   5147  1.1  riastrad                                   SUPPORTED_LCD_REFRESHRATE_40Hz          0x0008
   5148  1.1  riastrad                                   SUPPORTED_LCD_REFRESHRATE_50Hz          0x0010
   5149  1.1  riastrad                                   SUPPORTED_LCD_REFRESHRATE_60Hz          0x0020
   5150  1.1  riastrad ucMemoryType:                     [3:0]=1:DDR1;=2:DDR2;=3:DDR3.[7:4] is reserved.
   5151  1.1  riastrad ucUMAChannelNumber:      	        System memory channel numbers.
   5152  1.1  riastrad ulCSR_M3_ARB_CNTL_DEFAULT[10]:    Arrays with values for CSR M3 arbiter for default
   5153  1.1  riastrad ulCSR_M3_ARB_CNTL_UVD[10]:        Arrays with values for CSR M3 arbiter for UVD playback.
   5154  1.1  riastrad ulCSR_M3_ARB_CNTL_FS3D[10]:       Arrays with values for CSR M3 arbiter for Full Screen 3D applications.
   5155  1.1  riastrad sAvail_SCLK[5]:                   Arrays to provide availabe list of SLCK and corresponding voltage, order from low to high
   5156  1.1  riastrad ulGMCRestoreResetTime:            GMC power restore and GMC reset time to calculate data reconnection latency. Unit in ns.
   5157  1.1  riastrad ulMinimumNClk:                    Minimum NCLK speed among all NB-Pstates to calcualte data reconnection latency. Unit in 10kHz.
   5158  1.1  riastrad ulIdleNClk:                       NCLK speed while memory runs in self-refresh state. Unit in 10kHz.
   5159  1.1  riastrad ulDDR_DLL_PowerUpTime:            DDR PHY DLL power up time. Unit in ns.
   5160  1.1  riastrad ulDDR_PLL_PowerUpTime:            DDR PHY PLL power up time. Unit in ns.
   5161  1.1  riastrad usPCIEClkSSPercentage:            PCIE Clock Spread Spectrum Percentage in unit 0.01%; 100 mean 1%.
   5162  1.1  riastrad usPCIEClkSSType:                  PCIE Clock Spread Spectrum Type. 0 for Down spread(default); 1 for Center spread.
   5163  1.1  riastrad usLvdsSSPercentage:               LVDS panel ( not include eDP ) Spread Spectrum Percentage in unit of 0.01%, =0, use VBIOS default setting.
   5164  1.1  riastrad usLvdsSSpreadRateIn10Hz:          LVDS panel ( not include eDP ) Spread Spectrum frequency in unit of 10Hz, =0, use VBIOS default setting.
   5165  1.1  riastrad usHDMISSPercentage:               HDMI Spread Spectrum Percentage in unit 0.01%; 100 mean 1%,  =0, use VBIOS default setting.
   5166  1.1  riastrad usHDMISSpreadRateIn10Hz:          HDMI Spread Spectrum frequency in unit of 10Hz,  =0, use VBIOS default setting.
   5167  1.1  riastrad usDVISSPercentage:                DVI Spread Spectrum Percentage in unit 0.01%; 100 mean 1%,  =0, use VBIOS default setting.
   5168  1.1  riastrad usDVISSpreadRateIn10Hz:           DVI Spread Spectrum frequency in unit of 10Hz,  =0, use VBIOS default setting.
   5169  1.1  riastrad usMaxLVDSPclkFreqInSingleLink:    Max pixel clock LVDS panel single link, if=0 means VBIOS use default threhold, right now it is 85Mhz
   5170  1.1  riastrad ucLVDSMisc:                       [bit0] LVDS 888bit panel mode =0: LVDS 888 panel in LDI mode, =1: LVDS 888 panel in FPDI mode
   5171  1.1  riastrad                                   [bit1] LVDS panel lower and upper link mapping =0: lower link and upper link not swap, =1: lower link and upper link are swapped
   5172  1.1  riastrad                                   [bit2] LVDS 888bit per color mode  =0: 666 bit per color =1:888 bit per color
   5173  1.1  riastrad                                   [bit3] LVDS parameter override enable  =0: ucLvdsMisc parameter are not used =1: ucLvdsMisc parameter should be used
   5174  1.1  riastrad                                   [bit4] Polarity of signal sent to digital BLON output pin. =0: not inverted(active high) =1: inverted ( active low )
   5175  1.1  riastrad                                   [bit5] Travid LVDS output voltage override enable, when =1, use ucTravisLVDSVolAdjust value to overwrite Traivs register LVDS_CTRL_4
   5176  1.1  riastrad ucTravisLVDSVolAdjust             When ucLVDSMisc[5]=1,it means platform SBIOS want to overwrite TravisLVDSVoltage. Then VBIOS will use ucTravisLVDSVolAdjust
   5177  1.1  riastrad                                   value to program Travis register LVDS_CTRL_4
   5178  1.1  riastrad ucLVDSPwrOnSeqDIGONtoDE_in4Ms:    LVDS power up sequence time in unit of 4ms, time delay from DIGON signal active to data enable signal active( DE ).
   5179  1.1  riastrad                                   =0 mean use VBIOS default which is 8 ( 32ms ). The LVDS power up sequence is as following: DIGON->DE->VARY_BL->BLON.
   5180  1.1  riastrad                                   This parameter is used by VBIOS only. VBIOS will patch LVDS_InfoTable.
   5181  1.1  riastrad ucLVDSPwrOnDEtoVARY_BL_in4Ms:     LVDS power up sequence time in unit of 4ms., time delay from DE( data enable ) active to Vary Brightness enable signal active( VARY_BL ).
   5182  1.1  riastrad                                   =0 mean use VBIOS default which is 90 ( 360ms ). The LVDS power up sequence is as following: DIGON->DE->VARY_BL->BLON.
   5183  1.1  riastrad                                   This parameter is used by VBIOS only. VBIOS will patch LVDS_InfoTable.
   5184  1.1  riastrad 
   5185  1.1  riastrad ucLVDSPwrOffVARY_BLtoDE_in4Ms:    LVDS power down sequence time in unit of 4ms, time delay from data enable ( DE ) signal off to LCDVCC (DIGON) off.
   5186  1.1  riastrad                                   =0 mean use VBIOS default delay which is 8 ( 32ms ). The LVDS power down sequence is as following: BLON->VARY_BL->DE->DIGON
   5187  1.1  riastrad                                   This parameter is used by VBIOS only. VBIOS will patch LVDS_InfoTable.
   5188  1.1  riastrad 
   5189  1.1  riastrad ucLVDSPwrOffDEtoDIGON_in4Ms:      LVDS power down sequence time in unit of 4ms, time delay from vary brightness enable signal( VARY_BL) off to data enable ( DE ) signal off.
   5190  1.1  riastrad                                   =0 mean use VBIOS default which is 90 ( 360ms ). The LVDS power down sequence is as following: BLON->VARY_BL->DE->DIGON
   5191  1.1  riastrad                                   This parameter is used by VBIOS only. VBIOS will patch LVDS_InfoTable.
   5192  1.1  riastrad 
   5193  1.1  riastrad ucLVDSOffToOnDelay_in4Ms:         LVDS power down sequence time in unit of 4ms. Time delay from DIGON signal off to DIGON signal active.
   5194  1.1  riastrad                                   =0 means to use VBIOS default delay which is 125 ( 500ms ).
   5195  1.1  riastrad                                   This parameter is used by VBIOS only. VBIOS will patch LVDS_InfoTable.
   5196  1.1  riastrad 
   5197  1.1  riastrad ucLVDSPwrOnSeqVARY_BLtoBLON_in4Ms:
   5198  1.1  riastrad                                   LVDS power up sequence time in unit of 4ms. Time delay from VARY_BL signal on to DLON signal active.
   5199  1.1  riastrad                                   =0 means to use VBIOS default delay which is 0 ( 0ms ).
   5200  1.1  riastrad                                   This parameter is used by VBIOS only. VBIOS will patch LVDS_InfoTable.
   5201  1.1  riastrad 
   5202  1.1  riastrad ucLVDSPwrOffSeqBLONtoVARY_BL_in4Ms:
   5203  1.1  riastrad                                   LVDS power down sequence time in unit of 4ms. Time delay from BLON signal off to VARY_BL signal off.
   5204  1.1  riastrad                                   =0 means to use VBIOS default delay which is 0 ( 0ms ).
   5205  1.1  riastrad                                   This parameter is used by VBIOS only. VBIOS will patch LVDS_InfoTable.
   5206  1.1  riastrad 
   5207  1.1  riastrad ucMinAllowedBL_Level:             Lowest LCD backlight PWM level. This is customer platform specific parameters. By default it is 0.
   5208  1.1  riastrad 
   5209  1.1  riastrad ulNbpStateMemclkFreq[4]:          system memory clock frequncey in unit of 10Khz in different NB pstate.
   5210  1.1  riastrad 
   5211  1.1  riastrad **********************************************************************************************************************/
   5212  1.1  riastrad 
   5213  1.1  riastrad // this IntegrateSystemInfoTable is used for Kaveri & Kabini APU
   5214  1.1  riastrad typedef struct _ATOM_INTEGRATED_SYSTEM_INFO_V1_8
   5215  1.1  riastrad {
   5216  1.1  riastrad   ATOM_COMMON_TABLE_HEADER   sHeader;
   5217  1.1  riastrad   ULONG  ulBootUpEngineClock;
   5218  1.1  riastrad   ULONG  ulDentistVCOFreq;
   5219  1.1  riastrad   ULONG  ulBootUpUMAClock;
   5220  1.1  riastrad   ATOM_CLK_VOLT_CAPABILITY   sDISPCLK_Voltage[4];
   5221  1.1  riastrad   ULONG  ulBootUpReqDisplayVector;
   5222  1.1  riastrad   ULONG  ulVBIOSMisc;
   5223  1.1  riastrad   ULONG  ulGPUCapInfo;
   5224  1.1  riastrad   ULONG  ulDISP_CLK2Freq;
   5225  1.1  riastrad   USHORT usRequestedPWMFreqInHz;
   5226  1.1  riastrad   UCHAR  ucHtcTmpLmt;
   5227  1.1  riastrad   UCHAR  ucHtcHystLmt;
   5228  1.1  riastrad   ULONG  ulReserved2;
   5229  1.1  riastrad   ULONG  ulSystemConfig;
   5230  1.1  riastrad   ULONG  ulCPUCapInfo;
   5231  1.1  riastrad   ULONG  ulReserved3;
   5232  1.1  riastrad   USHORT usGPUReservedSysMemSize;
   5233  1.1  riastrad   USHORT usExtDispConnInfoOffset;
   5234  1.1  riastrad   USHORT usPanelRefreshRateRange;
   5235  1.1  riastrad   UCHAR  ucMemoryType;
   5236  1.1  riastrad   UCHAR  ucUMAChannelNumber;
   5237  1.1  riastrad   UCHAR  strVBIOSMsg[40];
   5238  1.1  riastrad   ATOM_TDP_CONFIG  asTdpConfig;
   5239  1.1  riastrad   ULONG  ulReserved[19];
   5240  1.1  riastrad   ATOM_AVAILABLE_SCLK_LIST   sAvail_SCLK[5];
   5241  1.1  riastrad   ULONG  ulGMCRestoreResetTime;
   5242  1.1  riastrad   ULONG  ulReserved4;
   5243  1.1  riastrad   ULONG  ulIdleNClk;
   5244  1.1  riastrad   ULONG  ulDDR_DLL_PowerUpTime;
   5245  1.1  riastrad   ULONG  ulDDR_PLL_PowerUpTime;
   5246  1.1  riastrad   USHORT usPCIEClkSSPercentage;
   5247  1.1  riastrad   USHORT usPCIEClkSSType;
   5248  1.1  riastrad   USHORT usLvdsSSPercentage;
   5249  1.1  riastrad   USHORT usLvdsSSpreadRateIn10Hz;
   5250  1.1  riastrad   USHORT usHDMISSPercentage;
   5251  1.1  riastrad   USHORT usHDMISSpreadRateIn10Hz;
   5252  1.1  riastrad   USHORT usDVISSPercentage;
   5253  1.1  riastrad   USHORT usDVISSpreadRateIn10Hz;
   5254  1.1  riastrad   ULONG  ulGPUReservedSysMemBaseAddrLo;
   5255  1.1  riastrad   ULONG  ulGPUReservedSysMemBaseAddrHi;
   5256  1.1  riastrad   ULONG  ulReserved5[3];
   5257  1.1  riastrad   USHORT usMaxLVDSPclkFreqInSingleLink;
   5258  1.1  riastrad   UCHAR  ucLvdsMisc;
   5259  1.1  riastrad   UCHAR  ucTravisLVDSVolAdjust;
   5260  1.1  riastrad   UCHAR  ucLVDSPwrOnSeqDIGONtoDE_in4Ms;
   5261  1.1  riastrad   UCHAR  ucLVDSPwrOnSeqDEtoVARY_BL_in4Ms;
   5262  1.1  riastrad   UCHAR  ucLVDSPwrOffSeqVARY_BLtoDE_in4Ms;
   5263  1.1  riastrad   UCHAR  ucLVDSPwrOffSeqDEtoDIGON_in4Ms;
   5264  1.1  riastrad   UCHAR  ucLVDSOffToOnDelay_in4Ms;
   5265  1.1  riastrad   UCHAR  ucLVDSPwrOnSeqVARY_BLtoBLON_in4Ms;
   5266  1.1  riastrad   UCHAR  ucLVDSPwrOffSeqBLONtoVARY_BL_in4Ms;
   5267  1.1  riastrad   UCHAR  ucMinAllowedBL_Level;
   5268  1.1  riastrad   ULONG  ulLCDBitDepthControlVal;
   5269  1.1  riastrad   ULONG  ulNbpStateMemclkFreq[4];
   5270  1.1  riastrad   ULONG  ulReserved6;
   5271  1.1  riastrad   ULONG  ulNbpStateNClkFreq[4];
   5272  1.1  riastrad   USHORT usNBPStateVoltage[4];
   5273  1.1  riastrad   USHORT usBootUpNBVoltage;
   5274  1.1  riastrad   USHORT usReserved2;
   5275  1.1  riastrad   ATOM_EXTERNAL_DISPLAY_CONNECTION_INFO sExtDispConnInfo;
   5276  1.1  riastrad }ATOM_INTEGRATED_SYSTEM_INFO_V1_8;
   5277  1.1  riastrad 
   5278  1.1  riastrad /**********************************************************************************************************************
   5279  1.1  riastrad   ATOM_INTEGRATED_SYSTEM_INFO_V1_8 Description
   5280  1.1  riastrad ulBootUpEngineClock:              VBIOS bootup Engine clock frequency, in 10kHz unit. if it is equal 0, then VBIOS use pre-defined bootup engine clock
   5281  1.1  riastrad ulDentistVCOFreq:                 Dentist VCO clock in 10kHz unit.
   5282  1.1  riastrad ulBootUpUMAClock:                 System memory boot up clock frequency in 10Khz unit.
   5283  1.1  riastrad sDISPCLK_Voltage:                 Report Display clock frequency requirement on GNB voltage(up to 4 voltage levels).
   5284  1.1  riastrad 
   5285  1.1  riastrad ulBootUpReqDisplayVector:         VBIOS boot up display IDs, following are supported devices in Trinity projects:
   5286  1.1  riastrad                                   ATOM_DEVICE_CRT1_SUPPORT                  0x0001
   5287  1.1  riastrad                                   ATOM_DEVICE_DFP1_SUPPORT                  0x0008
   5288  1.1  riastrad                                   ATOM_DEVICE_DFP6_SUPPORT                  0x0040
   5289  1.1  riastrad                                   ATOM_DEVICE_DFP2_SUPPORT                  0x0080
   5290  1.1  riastrad                                   ATOM_DEVICE_DFP3_SUPPORT                  0x0200
   5291  1.1  riastrad                                   ATOM_DEVICE_DFP4_SUPPORT                  0x0400
   5292  1.1  riastrad                                   ATOM_DEVICE_DFP5_SUPPORT                  0x0800
   5293  1.1  riastrad                                   ATOM_DEVICE_LCD1_SUPPORT                  0x0002
   5294  1.1  riastrad 
   5295  1.1  riastrad ulVBIOSMisc:      	              Miscellenous flags for VBIOS requirement and interface
   5296  1.1  riastrad                                   bit[0]=0: INT15 callback function Get LCD EDID ( ax=4e08, bl=1b ) is not supported by SBIOS.
   5297  1.1  riastrad                                         =1: INT15 callback function Get LCD EDID ( ax=4e08, bl=1b ) is supported by SBIOS.
   5298  1.1  riastrad                                   bit[1]=0: INT15 callback function Get boot display( ax=4e08, bl=01h) is not supported by SBIOS
   5299  1.1  riastrad                                         =1: INT15 callback function Get boot display( ax=4e08, bl=01h) is supported by SBIOS
   5300  1.1  riastrad                                   bit[2]=0: INT15 callback function Get panel Expansion ( ax=4e08, bl=02h) is not supported by SBIOS
   5301  1.1  riastrad                                         =1: INT15 callback function Get panel Expansion ( ax=4e08, bl=02h) is supported by SBIOS
   5302  1.1  riastrad                                   bit[3]=0: VBIOS fast boot is disable
   5303  1.1  riastrad                                         =1: VBIOS fast boot is enable. ( VBIOS skip display device detection in every set mode if LCD panel is connect and LID is open)
   5304  1.1  riastrad 
   5305  1.1  riastrad ulGPUCapInfo:                     bit[0~2]= Reserved
   5306  1.1  riastrad                                   bit[3]=0: Enable AUX HW mode detection logic
   5307  1.1  riastrad                                         =1: Disable AUX HW mode detection logic
   5308  1.1  riastrad                                   bit[4]=0: Disable DFS bypass feature
   5309  1.1  riastrad                                         =1: Enable DFS bypass feature
   5310  1.1  riastrad 
   5311  1.1  riastrad usRequestedPWMFreqInHz:           When it's set to 0x0 by SBIOS: the LCD BackLight is not controlled by GPU(SW).
   5312  1.1  riastrad                                   Any attempt to change BL using VBIOS function or enable VariBri from PP table is not effective since ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU==0;
   5313  1.1  riastrad 
   5314  1.1  riastrad                                   When it's set to a non-zero frequency, the BackLight is controlled by GPU (SW) in one of two ways below:
   5315  1.1  riastrad                                   1. SW uses the GPU BL PWM output to control the BL, in chis case, this non-zero frequency determines what freq GPU should use;
   5316  1.1  riastrad                                   VBIOS will set up proper PWM frequency and ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU==1,as the result,
   5317  1.1  riastrad                                   Changing BL using VBIOS function is functional in both driver and non-driver present environment;
   5318  1.1  riastrad                                   and enabling VariBri under the driver environment from PP table is optional.
   5319  1.1  riastrad 
   5320  1.1  riastrad                                   2. SW uses other means to control BL (like DPCD),this non-zero frequency serves as a flag only indicating
   5321  1.1  riastrad                                   that BL control from GPU is expected.
   5322  1.1  riastrad                                   VBIOS will NOT set up PWM frequency but make ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU==1
   5323  1.1  riastrad                                   Changing BL using VBIOS function could be functional in both driver and non-driver present environment,but
   5324  1.1  riastrad                                   it's per platform
   5325  1.1  riastrad                                   and enabling VariBri under the driver environment from PP table is optional.
   5326  1.1  riastrad 
   5327  1.1  riastrad ucHtcTmpLmt:                      Refer to D18F3x64 bit[22:16], HtcTmpLmt. Threshold on value to enter HTC_active state.
   5328  1.1  riastrad ucHtcHystLmt:                     Refer to D18F3x64 bit[27:24], HtcHystLmt.
   5329  1.1  riastrad                                   To calculate threshold off value to exit HTC_active state, which is Threshold on vlaue minus ucHtcHystLmt.
   5330  1.1  riastrad 
   5331  1.1  riastrad ulSystemConfig:                   Bit[0]=0: PCIE Power Gating Disabled
   5332  1.1  riastrad                                         =1: PCIE Power Gating Enabled
   5333  1.1  riastrad                                   Bit[1]=0: DDR-DLL shut-down feature disabled.
   5334  1.1  riastrad                                          1: DDR-DLL shut-down feature enabled.
   5335  1.1  riastrad                                   Bit[2]=0: DDR-PLL Power down feature disabled.
   5336  1.1  riastrad                                          1: DDR-PLL Power down feature enabled.
   5337  1.1  riastrad                                   Bit[3]=0: GNB DPM is disabled
   5338  1.1  riastrad                                         =1: GNB DPM is enabled
   5339  1.1  riastrad ulCPUCapInfo:                     TBD
   5340  1.1  riastrad 
   5341  1.1  riastrad usExtDispConnInfoOffset:          Offset to sExtDispConnInfo inside the structure
   5342  1.1  riastrad usPanelRefreshRateRange:          Bit vector for LCD supported refresh rate range. If DRR is requestd by the platform, at least two bits need to be set
   5343  1.1  riastrad                                   to indicate a range.
   5344  1.1  riastrad                                   SUPPORTED_LCD_REFRESHRATE_30Hz          0x0004
   5345  1.1  riastrad                                   SUPPORTED_LCD_REFRESHRATE_40Hz          0x0008
   5346  1.1  riastrad                                   SUPPORTED_LCD_REFRESHRATE_50Hz          0x0010
   5347  1.1  riastrad                                   SUPPORTED_LCD_REFRESHRATE_60Hz          0x0020
   5348  1.1  riastrad 
   5349  1.1  riastrad ucMemoryType:                     [3:0]=1:DDR1;=2:DDR2;=3:DDR3;=5:GDDR5; [7:4] is reserved.
   5350  1.1  riastrad ucUMAChannelNumber:      	        System memory channel numbers.
   5351  1.1  riastrad 
   5352  1.1  riastrad strVBIOSMsg[40]:                  VBIOS boot up customized message string
   5353  1.1  riastrad 
   5354  1.1  riastrad sAvail_SCLK[5]:                   Arrays to provide availabe list of SLCK and corresponding voltage, order from low to high
   5355  1.1  riastrad 
   5356  1.1  riastrad ulGMCRestoreResetTime:            GMC power restore and GMC reset time to calculate data reconnection latency. Unit in ns.
   5357  1.1  riastrad ulIdleNClk:                       NCLK speed while memory runs in self-refresh state, used to calculate self-refresh latency. Unit in 10kHz.
   5358  1.1  riastrad ulDDR_DLL_PowerUpTime:            DDR PHY DLL power up time. Unit in ns.
   5359  1.1  riastrad ulDDR_PLL_PowerUpTime:            DDR PHY PLL power up time. Unit in ns.
   5360  1.1  riastrad 
   5361  1.1  riastrad usPCIEClkSSPercentage:            PCIE Clock Spread Spectrum Percentage in unit 0.01%; 100 mean 1%.
   5362  1.1  riastrad usPCIEClkSSType:                  PCIE Clock Spread Spectrum Type. 0 for Down spread(default); 1 for Center spread.
   5363  1.1  riastrad usLvdsSSPercentage:               LVDS panel ( not include eDP ) Spread Spectrum Percentage in unit of 0.01%, =0, use VBIOS default setting.
   5364  1.1  riastrad usLvdsSSpreadRateIn10Hz:          LVDS panel ( not include eDP ) Spread Spectrum frequency in unit of 10Hz, =0, use VBIOS default setting.
   5365  1.1  riastrad usHDMISSPercentage:               HDMI Spread Spectrum Percentage in unit 0.01%; 100 mean 1%,  =0, use VBIOS default setting.
   5366  1.1  riastrad usHDMISSpreadRateIn10Hz:          HDMI Spread Spectrum frequency in unit of 10Hz,  =0, use VBIOS default setting.
   5367  1.1  riastrad usDVISSPercentage:                DVI Spread Spectrum Percentage in unit 0.01%; 100 mean 1%,  =0, use VBIOS default setting.
   5368  1.1  riastrad usDVISSpreadRateIn10Hz:           DVI Spread Spectrum frequency in unit of 10Hz,  =0, use VBIOS default setting.
   5369  1.1  riastrad 
   5370  1.1  riastrad usGPUReservedSysMemSize:          Reserved system memory size for ACP engine in APU GNB, units in MB. 0/2/4MB based on CMOS options, current default could be 0MB. KV only, not on KB.
   5371  1.1  riastrad ulGPUReservedSysMemBaseAddrLo:    Low 32 bits base address to the reserved system memory.
   5372  1.1  riastrad ulGPUReservedSysMemBaseAddrHi:    High 32 bits base address to the reserved system memory.
   5373  1.1  riastrad 
   5374  1.1  riastrad usMaxLVDSPclkFreqInSingleLink:    Max pixel clock LVDS panel single link, if=0 means VBIOS use default threhold, right now it is 85Mhz
   5375  1.1  riastrad ucLVDSMisc:                       [bit0] LVDS 888bit panel mode =0: LVDS 888 panel in LDI mode, =1: LVDS 888 panel in FPDI mode
   5376  1.1  riastrad                                   [bit1] LVDS panel lower and upper link mapping =0: lower link and upper link not swap, =1: lower link and upper link are swapped
   5377  1.1  riastrad                                   [bit2] LVDS 888bit per color mode  =0: 666 bit per color =1:888 bit per color
   5378  1.1  riastrad                                   [bit3] LVDS parameter override enable  =0: ucLvdsMisc parameter are not used =1: ucLvdsMisc parameter should be used
   5379  1.1  riastrad                                   [bit4] Polarity of signal sent to digital BLON output pin. =0: not inverted(active high) =1: inverted ( active low )
   5380  1.1  riastrad                                   [bit5] Travid LVDS output voltage override enable, when =1, use ucTravisLVDSVolAdjust value to overwrite Traivs register LVDS_CTRL_4
   5381  1.1  riastrad ucTravisLVDSVolAdjust             When ucLVDSMisc[5]=1,it means platform SBIOS want to overwrite TravisLVDSVoltage. Then VBIOS will use ucTravisLVDSVolAdjust
   5382  1.1  riastrad                                   value to program Travis register LVDS_CTRL_4
   5383  1.1  riastrad ucLVDSPwrOnSeqDIGONtoDE_in4Ms:
   5384  1.1  riastrad                                   LVDS power up sequence time in unit of 4ms, time delay from DIGON signal active to data enable signal active( DE ).
   5385  1.1  riastrad                                   =0 mean use VBIOS default which is 8 ( 32ms ). The LVDS power up sequence is as following: DIGON->DE->VARY_BL->BLON.
   5386  1.1  riastrad                                   This parameter is used by VBIOS only. VBIOS will patch LVDS_InfoTable.
   5387  1.1  riastrad ucLVDSPwrOnDEtoVARY_BL_in4Ms:
   5388  1.1  riastrad                                   LVDS power up sequence time in unit of 4ms., time delay from DE( data enable ) active to Vary Brightness enable signal active( VARY_BL ).
   5389  1.1  riastrad                                   =0 mean use VBIOS default which is 90 ( 360ms ). The LVDS power up sequence is as following: DIGON->DE->VARY_BL->BLON.
   5390  1.1  riastrad                                   This parameter is used by VBIOS only. VBIOS will patch LVDS_InfoTable.
   5391  1.1  riastrad ucLVDSPwrOffVARY_BLtoDE_in4Ms:
   5392  1.1  riastrad                                   LVDS power down sequence time in unit of 4ms, time delay from data enable ( DE ) signal off to LCDVCC (DIGON) off.
   5393  1.1  riastrad                                   =0 mean use VBIOS default delay which is 8 ( 32ms ). The LVDS power down sequence is as following: BLON->VARY_BL->DE->DIGON
   5394  1.1  riastrad                                   This parameter is used by VBIOS only. VBIOS will patch LVDS_InfoTable.
   5395  1.1  riastrad ucLVDSPwrOffDEtoDIGON_in4Ms:
   5396  1.1  riastrad                                    LVDS power down sequence time in unit of 4ms, time delay from vary brightness enable signal( VARY_BL) off to data enable ( DE ) signal off.
   5397  1.1  riastrad                                   =0 mean use VBIOS default which is 90 ( 360ms ). The LVDS power down sequence is as following: BLON->VARY_BL->DE->DIGON
   5398  1.1  riastrad                                   This parameter is used by VBIOS only. VBIOS will patch LVDS_InfoTable.
   5399  1.1  riastrad ucLVDSOffToOnDelay_in4Ms:
   5400  1.1  riastrad                                   LVDS power down sequence time in unit of 4ms. Time delay from DIGON signal off to DIGON signal active.
   5401  1.1  riastrad                                   =0 means to use VBIOS default delay which is 125 ( 500ms ).
   5402  1.1  riastrad                                   This parameter is used by VBIOS only. VBIOS will patch LVDS_InfoTable.
   5403  1.1  riastrad ucLVDSPwrOnSeqVARY_BLtoBLON_in4Ms:
   5404  1.1  riastrad                                   LVDS power up sequence time in unit of 4ms. Time delay from VARY_BL signal on to DLON signal active.
   5405  1.1  riastrad                                   =0 means to use VBIOS default delay which is 0 ( 0ms ).
   5406  1.1  riastrad                                   This parameter is used by VBIOS only. VBIOS will patch LVDS_InfoTable.
   5407  1.1  riastrad 
   5408  1.1  riastrad ucLVDSPwrOffSeqBLONtoVARY_BL_in4Ms:
   5409  1.1  riastrad                                   LVDS power down sequence time in unit of 4ms. Time delay from BLON signal off to VARY_BL signal off.
   5410  1.1  riastrad                                   =0 means to use VBIOS default delay which is 0 ( 0ms ).
   5411  1.1  riastrad                                   This parameter is used by VBIOS only. VBIOS will patch LVDS_InfoTable.
   5412  1.1  riastrad ucMinAllowedBL_Level:             Lowest LCD backlight PWM level. This is customer platform specific parameters. By default it is 0.
   5413  1.1  riastrad 
   5414  1.1  riastrad ulLCDBitDepthControlVal:          GPU display control encoder bit dither control setting, used to program register mmFMT_BIT_DEPTH_CONTROL
   5415  1.1  riastrad 
   5416  1.1  riastrad ulNbpStateMemclkFreq[4]:          system memory clock frequncey in unit of 10Khz in different NB P-State(P0, P1, P2 & P3).
   5417  1.1  riastrad ulNbpStateNClkFreq[4]:            NB P-State NClk frequency in different NB P-State
   5418  1.1  riastrad usNBPStateVoltage[4]:             NB P-State (P0/P1 & P2/P3) voltage; NBP3 refers to lowes voltage
   5419  1.1  riastrad usBootUpNBVoltage:                NB P-State voltage during boot up before driver loaded
   5420  1.1  riastrad sExtDispConnInfo:                 Display connector information table provided to VBIOS
   5421  1.1  riastrad 
   5422  1.1  riastrad **********************************************************************************************************************/
   5423  1.1  riastrad 
   5424  1.1  riastrad // this Table is used for Kaveri/Kabini APU
   5425  1.1  riastrad typedef struct _ATOM_FUSION_SYSTEM_INFO_V2
   5426  1.1  riastrad {
   5427  1.1  riastrad   ATOM_INTEGRATED_SYSTEM_INFO_V1_8    sIntegratedSysInfo;       // refer to ATOM_INTEGRATED_SYSTEM_INFO_V1_8 definition
   5428  1.1  riastrad   ULONG                               ulPowerplayTable[128];    // Update comments here to link new powerplay table definition structure
   5429  1.1  riastrad }ATOM_FUSION_SYSTEM_INFO_V2;
   5430  1.1  riastrad 
   5431  1.1  riastrad 
   5432  1.1  riastrad /**************************************************************************/
   5433  1.1  riastrad // This portion is only used when ext thermal chip or engine/memory clock SS chip is populated on a design
   5434  1.1  riastrad //Memory SS Info Table
   5435  1.1  riastrad //Define Memory Clock SS chip ID
   5436  1.1  riastrad #define ICS91719  1
   5437  1.1  riastrad #define ICS91720  2
   5438  1.1  riastrad 
   5439  1.1  riastrad //Define one structure to inform SW a "block of data" writing to external SS chip via I2C protocol
   5440  1.1  riastrad typedef struct _ATOM_I2C_DATA_RECORD
   5441  1.1  riastrad {
   5442  1.1  riastrad   UCHAR         ucNunberOfBytes;                                              //Indicates how many bytes SW needs to write to the external ASIC for one block, besides to "Start" and "Stop"
   5443  1.1  riastrad   UCHAR         ucI2CData[1];                                                 //I2C data in bytes, should be less than 16 bytes usually
   5444  1.1  riastrad }ATOM_I2C_DATA_RECORD;
   5445  1.1  riastrad 
   5446  1.1  riastrad 
   5447  1.1  riastrad //Define one structure to inform SW how many blocks of data writing to external SS chip via I2C protocol, in addition to other information
   5448  1.1  riastrad typedef struct _ATOM_I2C_DEVICE_SETUP_INFO
   5449  1.1  riastrad {
   5450  1.1  riastrad   ATOM_I2C_ID_CONFIG_ACCESS       sucI2cId;               //I2C line and HW/SW assisted cap.
   5451  1.1  riastrad   UCHAR		                        ucSSChipID;             //SS chip being used
   5452  1.1  riastrad   UCHAR		                        ucSSChipSlaveAddr;      //Slave Address to set up this SS chip
   5453  1.1  riastrad   UCHAR                           ucNumOfI2CDataRecords;  //number of data block
   5454  1.1  riastrad   ATOM_I2C_DATA_RECORD            asI2CData[1];
   5455  1.1  riastrad }ATOM_I2C_DEVICE_SETUP_INFO;
   5456  1.1  riastrad 
   5457  1.1  riastrad //==========================================================================================
   5458  1.1  riastrad typedef struct  _ATOM_ASIC_MVDD_INFO
   5459  1.1  riastrad {
   5460  1.1  riastrad   ATOM_COMMON_TABLE_HEADER	      sHeader;
   5461  1.1  riastrad   ATOM_I2C_DEVICE_SETUP_INFO      asI2CSetup[1];
   5462  1.1  riastrad }ATOM_ASIC_MVDD_INFO;
   5463  1.1  riastrad 
   5464  1.1  riastrad //==========================================================================================
   5465  1.1  riastrad #define ATOM_MCLK_SS_INFO         ATOM_ASIC_MVDD_INFO
   5466  1.1  riastrad 
   5467  1.1  riastrad //==========================================================================================
   5468  1.1  riastrad /**************************************************************************/
   5469  1.1  riastrad 
   5470  1.1  riastrad typedef struct _ATOM_ASIC_SS_ASSIGNMENT
   5471  1.1  riastrad {
   5472  1.1  riastrad 	ULONG								ulTargetClockRange;						//Clock Out frequence (VCO ), in unit of 10Khz
   5473  1.1  riastrad   USHORT              usSpreadSpectrumPercentage;		//in unit of 0.01%
   5474  1.1  riastrad 	USHORT							usSpreadRateInKhz;						//in unit of kHz, modulation freq
   5475  1.1  riastrad   UCHAR               ucClockIndication;					  //Indicate which clock source needs SS
   5476  1.1  riastrad 	UCHAR								ucSpreadSpectrumMode;					//Bit1=0 Down Spread,=1 Center Spread.
   5477  1.1  riastrad 	UCHAR								ucReserved[2];
   5478  1.1  riastrad }ATOM_ASIC_SS_ASSIGNMENT;
   5479  1.1  riastrad 
   5480  1.1  riastrad //Define ucClockIndication, SW uses the IDs below to search if the SS is required/enabled on a clock branch/signal type.
   5481  1.1  riastrad //SS is not required or enabled if a match is not found.
   5482  1.1  riastrad #define ASIC_INTERNAL_MEMORY_SS	         1
   5483  1.1  riastrad #define ASIC_INTERNAL_ENGINE_SS	         2
   5484  1.1  riastrad #define ASIC_INTERNAL_UVD_SS             3
   5485  1.1  riastrad #define ASIC_INTERNAL_SS_ON_TMDS         4
   5486  1.1  riastrad #define ASIC_INTERNAL_SS_ON_HDMI         5
   5487  1.1  riastrad #define ASIC_INTERNAL_SS_ON_LVDS         6
   5488  1.1  riastrad #define ASIC_INTERNAL_SS_ON_DP           7
   5489  1.1  riastrad #define ASIC_INTERNAL_SS_ON_DCPLL        8
   5490  1.1  riastrad #define ASIC_EXTERNAL_SS_ON_DP_CLOCK     9
   5491  1.1  riastrad #define ASIC_INTERNAL_VCE_SS             10
   5492  1.1  riastrad #define ASIC_INTERNAL_GPUPLL_SS          11
   5493  1.1  riastrad 
   5494  1.1  riastrad 
   5495  1.1  riastrad typedef struct _ATOM_ASIC_SS_ASSIGNMENT_V2
   5496  1.1  riastrad {
   5497  1.1  riastrad 	ULONG								ulTargetClockRange;						//For mem/engine/uvd, Clock Out frequence (VCO ), in unit of 10Khz
   5498  1.1  riastrad                                                     //For TMDS/HDMI/LVDS, it is pixel clock , for DP, it is link clock ( 27000 or 16200 )
   5499  1.1  riastrad   USHORT              usSpreadSpectrumPercentage;		//in unit of 0.01% or 0.001%, decided by ucSpreadSpectrumMode bit4
   5500  1.1  riastrad 	USHORT							usSpreadRateIn10Hz;						//in unit of 10Hz, modulation freq
   5501  1.1  riastrad   UCHAR               ucClockIndication;					  //Indicate which clock source needs SS
   5502  1.1  riastrad 	UCHAR								ucSpreadSpectrumMode;					//Bit0=0 Down Spread,=1 Center Spread, bit1=0: internal SS bit1=1: external SS
   5503  1.1  riastrad 	UCHAR								ucReserved[2];
   5504  1.1  riastrad }ATOM_ASIC_SS_ASSIGNMENT_V2;
   5505  1.1  riastrad 
   5506  1.1  riastrad //ucSpreadSpectrumMode
   5507  1.1  riastrad //#define ATOM_SS_DOWN_SPREAD_MODE_MASK          0x00000000
   5508  1.1  riastrad //#define ATOM_SS_DOWN_SPREAD_MODE               0x00000000
   5509  1.1  riastrad //#define ATOM_SS_CENTRE_SPREAD_MODE_MASK        0x00000001
   5510  1.1  riastrad //#define ATOM_SS_CENTRE_SPREAD_MODE             0x00000001
   5511  1.1  riastrad //#define ATOM_INTERNAL_SS_MASK                  0x00000000
   5512  1.1  riastrad //#define ATOM_EXTERNAL_SS_MASK                  0x00000002
   5513  1.1  riastrad 
   5514  1.1  riastrad typedef struct _ATOM_ASIC_INTERNAL_SS_INFO
   5515  1.1  riastrad {
   5516  1.1  riastrad   ATOM_COMMON_TABLE_HEADER	      sHeader;
   5517  1.1  riastrad   ATOM_ASIC_SS_ASSIGNMENT		      asSpreadSpectrum[4];
   5518  1.1  riastrad }ATOM_ASIC_INTERNAL_SS_INFO;
   5519  1.1  riastrad 
   5520  1.1  riastrad typedef struct _ATOM_ASIC_INTERNAL_SS_INFO_V2
   5521  1.1  riastrad {
   5522  1.1  riastrad   ATOM_COMMON_TABLE_HEADER	      sHeader;
   5523  1.1  riastrad   ATOM_ASIC_SS_ASSIGNMENT_V2		  asSpreadSpectrum[1];      //this is point only.
   5524  1.1  riastrad }ATOM_ASIC_INTERNAL_SS_INFO_V2;
   5525  1.1  riastrad 
   5526  1.1  riastrad typedef struct _ATOM_ASIC_SS_ASSIGNMENT_V3
   5527  1.1  riastrad {
   5528  1.1  riastrad 	ULONG								ulTargetClockRange;						//For mem/engine/uvd, Clock Out frequence (VCO ), in unit of 10Khz
   5529  1.1  riastrad                                                     //For TMDS/HDMI/LVDS, it is pixel clock , for DP, it is link clock ( 27000 or 16200 )
   5530  1.1  riastrad   USHORT              usSpreadSpectrumPercentage;		//in unit of 0.01%
   5531  1.1  riastrad 	USHORT							usSpreadRateIn10Hz;						//in unit of 10Hz, modulation freq
   5532  1.1  riastrad   UCHAR               ucClockIndication;					  //Indicate which clock source needs SS
   5533  1.1  riastrad 	UCHAR								ucSpreadSpectrumMode;					//Bit0=0 Down Spread,=1 Center Spread, bit1=0: internal SS bit1=1: external SS
   5534  1.1  riastrad 	UCHAR								ucReserved[2];
   5535  1.1  riastrad }ATOM_ASIC_SS_ASSIGNMENT_V3;
   5536  1.1  riastrad 
   5537  1.1  riastrad //ATOM_ASIC_SS_ASSIGNMENT_V3.ucSpreadSpectrumMode
   5538  1.1  riastrad #define SS_MODE_V3_CENTRE_SPREAD_MASK             0x01
   5539  1.1  riastrad #define SS_MODE_V3_EXTERNAL_SS_MASK               0x02
   5540  1.1  riastrad #define SS_MODE_V3_PERCENTAGE_DIV_BY_1000_MASK    0x10
   5541  1.1  riastrad 
   5542  1.1  riastrad typedef struct _ATOM_ASIC_INTERNAL_SS_INFO_V3
   5543  1.1  riastrad {
   5544  1.1  riastrad   ATOM_COMMON_TABLE_HEADER	      sHeader;
   5545  1.1  riastrad   ATOM_ASIC_SS_ASSIGNMENT_V3		  asSpreadSpectrum[1];      //this is pointer only.
   5546  1.1  riastrad }ATOM_ASIC_INTERNAL_SS_INFO_V3;
   5547  1.1  riastrad 
   5548  1.1  riastrad 
   5549  1.1  riastrad //==============================Scratch Pad Definition Portion===============================
   5550  1.1  riastrad #define ATOM_DEVICE_CONNECT_INFO_DEF  0
   5551  1.1  riastrad #define ATOM_ROM_LOCATION_DEF         1
   5552  1.1  riastrad #define ATOM_TV_STANDARD_DEF          2
   5553  1.1  riastrad #define ATOM_ACTIVE_INFO_DEF          3
   5554  1.1  riastrad #define ATOM_LCD_INFO_DEF             4
   5555  1.1  riastrad #define ATOM_DOS_REQ_INFO_DEF         5
   5556  1.1  riastrad #define ATOM_ACC_CHANGE_INFO_DEF      6
   5557  1.1  riastrad #define ATOM_DOS_MODE_INFO_DEF        7
   5558  1.1  riastrad #define ATOM_I2C_CHANNEL_STATUS_DEF   8
   5559  1.1  riastrad #define ATOM_I2C_CHANNEL_STATUS1_DEF  9
   5560  1.1  riastrad #define ATOM_INTERNAL_TIMER_DEF       10
   5561  1.1  riastrad 
   5562  1.1  riastrad // BIOS_0_SCRATCH Definition
   5563  1.1  riastrad #define ATOM_S0_CRT1_MONO               0x00000001L
   5564  1.1  riastrad #define ATOM_S0_CRT1_COLOR              0x00000002L
   5565  1.1  riastrad #define ATOM_S0_CRT1_MASK               (ATOM_S0_CRT1_MONO+ATOM_S0_CRT1_COLOR)
   5566  1.1  riastrad 
   5567  1.1  riastrad #define ATOM_S0_TV1_COMPOSITE_A         0x00000004L
   5568  1.1  riastrad #define ATOM_S0_TV1_SVIDEO_A            0x00000008L
   5569  1.1  riastrad #define ATOM_S0_TV1_MASK_A              (ATOM_S0_TV1_COMPOSITE_A+ATOM_S0_TV1_SVIDEO_A)
   5570  1.1  riastrad 
   5571  1.1  riastrad #define ATOM_S0_CV_A                    0x00000010L
   5572  1.1  riastrad #define ATOM_S0_CV_DIN_A                0x00000020L
   5573  1.1  riastrad #define ATOM_S0_CV_MASK_A               (ATOM_S0_CV_A+ATOM_S0_CV_DIN_A)
   5574  1.1  riastrad 
   5575  1.1  riastrad 
   5576  1.1  riastrad #define ATOM_S0_CRT2_MONO               0x00000100L
   5577  1.1  riastrad #define ATOM_S0_CRT2_COLOR              0x00000200L
   5578  1.1  riastrad #define ATOM_S0_CRT2_MASK               (ATOM_S0_CRT2_MONO+ATOM_S0_CRT2_COLOR)
   5579  1.1  riastrad 
   5580  1.1  riastrad #define ATOM_S0_TV1_COMPOSITE           0x00000400L
   5581  1.1  riastrad #define ATOM_S0_TV1_SVIDEO              0x00000800L
   5582  1.1  riastrad #define ATOM_S0_TV1_SCART               0x00004000L
   5583  1.1  riastrad #define ATOM_S0_TV1_MASK                (ATOM_S0_TV1_COMPOSITE+ATOM_S0_TV1_SVIDEO+ATOM_S0_TV1_SCART)
   5584  1.1  riastrad 
   5585  1.1  riastrad #define ATOM_S0_CV                      0x00001000L
   5586  1.1  riastrad #define ATOM_S0_CV_DIN                  0x00002000L
   5587  1.1  riastrad #define ATOM_S0_CV_MASK                 (ATOM_S0_CV+ATOM_S0_CV_DIN)
   5588  1.1  riastrad 
   5589  1.1  riastrad #define ATOM_S0_DFP1                    0x00010000L
   5590  1.1  riastrad #define ATOM_S0_DFP2                    0x00020000L
   5591  1.1  riastrad #define ATOM_S0_LCD1                    0x00040000L
   5592  1.1  riastrad #define ATOM_S0_LCD2                    0x00080000L
   5593  1.1  riastrad #define ATOM_S0_DFP6                    0x00100000L
   5594  1.1  riastrad #define ATOM_S0_DFP3                    0x00200000L
   5595  1.1  riastrad #define ATOM_S0_DFP4                    0x00400000L
   5596  1.1  riastrad #define ATOM_S0_DFP5                    0x00800000L
   5597  1.1  riastrad 
   5598  1.1  riastrad #define ATOM_S0_DFP_MASK                ATOM_S0_DFP1 | ATOM_S0_DFP2 | ATOM_S0_DFP3 | ATOM_S0_DFP4 | ATOM_S0_DFP5 | ATOM_S0_DFP6
   5599  1.1  riastrad 
   5600  1.1  riastrad #define ATOM_S0_FAD_REGISTER_BUG        0x02000000L // If set, indicates we are running a PCIE asic with
   5601  1.1  riastrad                                                     // the FAD/HDP reg access bug.  Bit is read by DAL, this is obsolete from RV5xx
   5602  1.1  riastrad 
   5603  1.1  riastrad #define ATOM_S0_THERMAL_STATE_MASK      0x1C000000L
   5604  1.1  riastrad #define ATOM_S0_THERMAL_STATE_SHIFT     26
   5605  1.1  riastrad 
   5606  1.1  riastrad #define ATOM_S0_SYSTEM_POWER_STATE_MASK 0xE0000000L
   5607  1.1  riastrad #define ATOM_S0_SYSTEM_POWER_STATE_SHIFT 29
   5608  1.1  riastrad 
   5609  1.1  riastrad #define ATOM_S0_SYSTEM_POWER_STATE_VALUE_AC     1
   5610  1.1  riastrad #define ATOM_S0_SYSTEM_POWER_STATE_VALUE_DC     2
   5611  1.1  riastrad #define ATOM_S0_SYSTEM_POWER_STATE_VALUE_LITEAC 3
   5612  1.1  riastrad #define ATOM_S0_SYSTEM_POWER_STATE_VALUE_LIT2AC 4
   5613  1.1  riastrad 
   5614  1.1  riastrad //Byte aligned definition for BIOS usage
   5615  1.1  riastrad #define ATOM_S0_CRT1_MONOb0             0x01
   5616  1.1  riastrad #define ATOM_S0_CRT1_COLORb0            0x02
   5617  1.1  riastrad #define ATOM_S0_CRT1_MASKb0             (ATOM_S0_CRT1_MONOb0+ATOM_S0_CRT1_COLORb0)
   5618  1.1  riastrad 
   5619  1.1  riastrad #define ATOM_S0_TV1_COMPOSITEb0         0x04
   5620  1.1  riastrad #define ATOM_S0_TV1_SVIDEOb0            0x08
   5621  1.1  riastrad #define ATOM_S0_TV1_MASKb0              (ATOM_S0_TV1_COMPOSITEb0+ATOM_S0_TV1_SVIDEOb0)
   5622  1.1  riastrad 
   5623  1.1  riastrad #define ATOM_S0_CVb0                    0x10
   5624  1.1  riastrad #define ATOM_S0_CV_DINb0                0x20
   5625  1.1  riastrad #define ATOM_S0_CV_MASKb0               (ATOM_S0_CVb0+ATOM_S0_CV_DINb0)
   5626  1.1  riastrad 
   5627  1.1  riastrad #define ATOM_S0_CRT2_MONOb1             0x01
   5628  1.1  riastrad #define ATOM_S0_CRT2_COLORb1            0x02
   5629  1.1  riastrad #define ATOM_S0_CRT2_MASKb1             (ATOM_S0_CRT2_MONOb1+ATOM_S0_CRT2_COLORb1)
   5630  1.1  riastrad 
   5631  1.1  riastrad #define ATOM_S0_TV1_COMPOSITEb1         0x04
   5632  1.1  riastrad #define ATOM_S0_TV1_SVIDEOb1            0x08
   5633  1.1  riastrad #define ATOM_S0_TV1_SCARTb1             0x40
   5634  1.1  riastrad #define ATOM_S0_TV1_MASKb1              (ATOM_S0_TV1_COMPOSITEb1+ATOM_S0_TV1_SVIDEOb1+ATOM_S0_TV1_SCARTb1)
   5635  1.1  riastrad 
   5636  1.1  riastrad #define ATOM_S0_CVb1                    0x10
   5637  1.1  riastrad #define ATOM_S0_CV_DINb1                0x20
   5638  1.1  riastrad #define ATOM_S0_CV_MASKb1               (ATOM_S0_CVb1+ATOM_S0_CV_DINb1)
   5639  1.1  riastrad 
   5640  1.1  riastrad #define ATOM_S0_DFP1b2                  0x01
   5641  1.1  riastrad #define ATOM_S0_DFP2b2                  0x02
   5642  1.1  riastrad #define ATOM_S0_LCD1b2                  0x04
   5643  1.1  riastrad #define ATOM_S0_LCD2b2                  0x08
   5644  1.1  riastrad #define ATOM_S0_DFP6b2                  0x10
   5645  1.1  riastrad #define ATOM_S0_DFP3b2                  0x20
   5646  1.1  riastrad #define ATOM_S0_DFP4b2                  0x40
   5647  1.1  riastrad #define ATOM_S0_DFP5b2                  0x80
   5648  1.1  riastrad 
   5649  1.1  riastrad 
   5650  1.1  riastrad #define ATOM_S0_THERMAL_STATE_MASKb3    0x1C
   5651  1.1  riastrad #define ATOM_S0_THERMAL_STATE_SHIFTb3   2
   5652  1.1  riastrad 
   5653  1.1  riastrad #define ATOM_S0_SYSTEM_POWER_STATE_MASKb3 0xE0
   5654  1.1  riastrad #define ATOM_S0_LCD1_SHIFT              18
   5655  1.1  riastrad 
   5656  1.1  riastrad // BIOS_1_SCRATCH Definition
   5657  1.1  riastrad #define ATOM_S1_ROM_LOCATION_MASK       0x0000FFFFL
   5658  1.1  riastrad #define ATOM_S1_PCI_BUS_DEV_MASK        0xFFFF0000L
   5659  1.1  riastrad 
   5660  1.1  riastrad //	BIOS_2_SCRATCH Definition
   5661  1.1  riastrad #define ATOM_S2_TV1_STANDARD_MASK       0x0000000FL
   5662  1.1  riastrad #define ATOM_S2_CURRENT_BL_LEVEL_MASK   0x0000FF00L
   5663  1.1  riastrad #define ATOM_S2_CURRENT_BL_LEVEL_SHIFT  8
   5664  1.1  riastrad 
   5665  1.1  riastrad #define ATOM_S2_FORCEDLOWPWRMODE_STATE_MASK       0x0C000000L
   5666  1.1  riastrad #define ATOM_S2_FORCEDLOWPWRMODE_STATE_MASK_SHIFT 26
   5667  1.1  riastrad #define ATOM_S2_FORCEDLOWPWRMODE_STATE_CHANGE     0x10000000L
   5668  1.1  riastrad 
   5669  1.1  riastrad #define ATOM_S2_DEVICE_DPMS_STATE       0x00010000L
   5670  1.1  riastrad #define ATOM_S2_VRI_BRIGHT_ENABLE       0x20000000L
   5671  1.1  riastrad 
   5672  1.1  riastrad #define ATOM_S2_DISPLAY_ROTATION_0_DEGREE     0x0
   5673  1.1  riastrad #define ATOM_S2_DISPLAY_ROTATION_90_DEGREE    0x1
   5674  1.1  riastrad #define ATOM_S2_DISPLAY_ROTATION_180_DEGREE   0x2
   5675  1.1  riastrad #define ATOM_S2_DISPLAY_ROTATION_270_DEGREE   0x3
   5676  1.1  riastrad #define ATOM_S2_DISPLAY_ROTATION_DEGREE_SHIFT 30
   5677  1.1  riastrad #define ATOM_S2_DISPLAY_ROTATION_ANGLE_MASK   0xC0000000L
   5678  1.1  riastrad 
   5679  1.1  riastrad 
   5680  1.1  riastrad //Byte aligned definition for BIOS usage
   5681  1.1  riastrad #define ATOM_S2_TV1_STANDARD_MASKb0     0x0F
   5682  1.1  riastrad #define ATOM_S2_CURRENT_BL_LEVEL_MASKb1 0xFF
   5683  1.1  riastrad #define ATOM_S2_DEVICE_DPMS_STATEb2     0x01
   5684  1.1  riastrad 
   5685  1.1  riastrad #define ATOM_S2_DEVICE_DPMS_MASKw1      0x3FF
   5686  1.1  riastrad #define ATOM_S2_FORCEDLOWPWRMODE_STATE_MASKb3     0x0C
   5687  1.1  riastrad #define ATOM_S2_FORCEDLOWPWRMODE_STATE_CHANGEb3   0x10
   5688  1.1  riastrad #define ATOM_S2_TMDS_COHERENT_MODEb3    0x10          // used by VBIOS code only, use coherent mode for TMDS/HDMI mode
   5689  1.1  riastrad #define ATOM_S2_VRI_BRIGHT_ENABLEb3     0x20
   5690  1.1  riastrad #define ATOM_S2_ROTATION_STATE_MASKb3   0xC0
   5691  1.1  riastrad 
   5692  1.1  riastrad 
   5693  1.1  riastrad // BIOS_3_SCRATCH Definition
   5694  1.1  riastrad #define ATOM_S3_CRT1_ACTIVE             0x00000001L
   5695  1.1  riastrad #define ATOM_S3_LCD1_ACTIVE             0x00000002L
   5696  1.1  riastrad #define ATOM_S3_TV1_ACTIVE              0x00000004L
   5697  1.1  riastrad #define ATOM_S3_DFP1_ACTIVE             0x00000008L
   5698  1.1  riastrad #define ATOM_S3_CRT2_ACTIVE             0x00000010L
   5699  1.1  riastrad #define ATOM_S3_LCD2_ACTIVE             0x00000020L
   5700  1.1  riastrad #define ATOM_S3_DFP6_ACTIVE             0x00000040L
   5701  1.1  riastrad #define ATOM_S3_DFP2_ACTIVE             0x00000080L
   5702  1.1  riastrad #define ATOM_S3_CV_ACTIVE               0x00000100L
   5703  1.1  riastrad #define ATOM_S3_DFP3_ACTIVE							0x00000200L
   5704  1.1  riastrad #define ATOM_S3_DFP4_ACTIVE							0x00000400L
   5705  1.1  riastrad #define ATOM_S3_DFP5_ACTIVE							0x00000800L
   5706  1.1  riastrad 
   5707  1.1  riastrad #define ATOM_S3_DEVICE_ACTIVE_MASK      0x00000FFFL
   5708  1.1  riastrad 
   5709  1.1  riastrad #define ATOM_S3_LCD_FULLEXPANSION_ACTIVE         0x00001000L
   5710  1.1  riastrad #define ATOM_S3_LCD_EXPANSION_ASPEC_RATIO_ACTIVE 0x00002000L
   5711  1.1  riastrad 
   5712  1.1  riastrad #define ATOM_S3_CRT1_CRTC_ACTIVE        0x00010000L
   5713  1.1  riastrad #define ATOM_S3_LCD1_CRTC_ACTIVE        0x00020000L
   5714  1.1  riastrad #define ATOM_S3_TV1_CRTC_ACTIVE         0x00040000L
   5715  1.1  riastrad #define ATOM_S3_DFP1_CRTC_ACTIVE        0x00080000L
   5716  1.1  riastrad #define ATOM_S3_CRT2_CRTC_ACTIVE        0x00100000L
   5717  1.1  riastrad #define ATOM_S3_LCD2_CRTC_ACTIVE        0x00200000L
   5718  1.1  riastrad #define ATOM_S3_DFP6_CRTC_ACTIVE        0x00400000L
   5719  1.1  riastrad #define ATOM_S3_DFP2_CRTC_ACTIVE        0x00800000L
   5720  1.1  riastrad #define ATOM_S3_CV_CRTC_ACTIVE          0x01000000L
   5721  1.1  riastrad #define ATOM_S3_DFP3_CRTC_ACTIVE				0x02000000L
   5722  1.1  riastrad #define ATOM_S3_DFP4_CRTC_ACTIVE				0x04000000L
   5723  1.1  riastrad #define ATOM_S3_DFP5_CRTC_ACTIVE				0x08000000L
   5724  1.1  riastrad 
   5725  1.1  riastrad #define ATOM_S3_DEVICE_CRTC_ACTIVE_MASK 0x0FFF0000L
   5726  1.1  riastrad #define ATOM_S3_ASIC_GUI_ENGINE_HUNG    0x20000000L
   5727  1.1  riastrad //Below two definitions are not supported in pplib, but in the old powerplay in DAL
   5728  1.1  riastrad #define ATOM_S3_ALLOW_FAST_PWR_SWITCH   0x40000000L
   5729  1.1  riastrad #define ATOM_S3_RQST_GPU_USE_MIN_PWR    0x80000000L
   5730  1.1  riastrad 
   5731  1.1  riastrad //Byte aligned definition for BIOS usage
   5732  1.1  riastrad #define ATOM_S3_CRT1_ACTIVEb0           0x01
   5733  1.1  riastrad #define ATOM_S3_LCD1_ACTIVEb0           0x02
   5734  1.1  riastrad #define ATOM_S3_TV1_ACTIVEb0            0x04
   5735  1.1  riastrad #define ATOM_S3_DFP1_ACTIVEb0           0x08
   5736  1.1  riastrad #define ATOM_S3_CRT2_ACTIVEb0           0x10
   5737  1.1  riastrad #define ATOM_S3_LCD2_ACTIVEb0           0x20
   5738  1.1  riastrad #define ATOM_S3_DFP6_ACTIVEb0           0x40
   5739  1.1  riastrad #define ATOM_S3_DFP2_ACTIVEb0           0x80
   5740  1.1  riastrad #define ATOM_S3_CV_ACTIVEb1             0x01
   5741  1.1  riastrad #define ATOM_S3_DFP3_ACTIVEb1						0x02
   5742  1.1  riastrad #define ATOM_S3_DFP4_ACTIVEb1						0x04
   5743  1.1  riastrad #define ATOM_S3_DFP5_ACTIVEb1						0x08
   5744  1.1  riastrad 
   5745  1.1  riastrad #define ATOM_S3_ACTIVE_CRTC1w0          0xFFF
   5746  1.1  riastrad 
   5747  1.1  riastrad #define ATOM_S3_CRT1_CRTC_ACTIVEb2      0x01
   5748  1.1  riastrad #define ATOM_S3_LCD1_CRTC_ACTIVEb2      0x02
   5749  1.1  riastrad #define ATOM_S3_TV1_CRTC_ACTIVEb2       0x04
   5750  1.1  riastrad #define ATOM_S3_DFP1_CRTC_ACTIVEb2      0x08
   5751  1.1  riastrad #define ATOM_S3_CRT2_CRTC_ACTIVEb2      0x10
   5752  1.1  riastrad #define ATOM_S3_LCD2_CRTC_ACTIVEb2      0x20
   5753  1.1  riastrad #define ATOM_S3_DFP6_CRTC_ACTIVEb2      0x40
   5754  1.1  riastrad #define ATOM_S3_DFP2_CRTC_ACTIVEb2      0x80
   5755  1.1  riastrad #define ATOM_S3_CV_CRTC_ACTIVEb3        0x01
   5756  1.1  riastrad #define ATOM_S3_DFP3_CRTC_ACTIVEb3			0x02
   5757  1.1  riastrad #define ATOM_S3_DFP4_CRTC_ACTIVEb3			0x04
   5758  1.1  riastrad #define ATOM_S3_DFP5_CRTC_ACTIVEb3			0x08
   5759  1.1  riastrad 
   5760  1.1  riastrad #define ATOM_S3_ACTIVE_CRTC2w1          0xFFF
   5761  1.1  riastrad 
   5762  1.1  riastrad // BIOS_4_SCRATCH Definition
   5763  1.1  riastrad #define ATOM_S4_LCD1_PANEL_ID_MASK      0x000000FFL
   5764  1.1  riastrad #define ATOM_S4_LCD1_REFRESH_MASK       0x0000FF00L
   5765  1.1  riastrad #define ATOM_S4_LCD1_REFRESH_SHIFT      8
   5766  1.1  riastrad 
   5767  1.1  riastrad //Byte aligned definition for BIOS usage
   5768  1.1  riastrad #define ATOM_S4_LCD1_PANEL_ID_MASKb0	  0x0FF
   5769  1.1  riastrad #define ATOM_S4_LCD1_REFRESH_MASKb1		  ATOM_S4_LCD1_PANEL_ID_MASKb0
   5770  1.1  riastrad #define ATOM_S4_VRAM_INFO_MASKb2        ATOM_S4_LCD1_PANEL_ID_MASKb0
   5771  1.1  riastrad 
   5772  1.1  riastrad // BIOS_5_SCRATCH Definition, BIOS_5_SCRATCH is used by Firmware only !!!!
   5773  1.1  riastrad #define ATOM_S5_DOS_REQ_CRT1b0          0x01
   5774  1.1  riastrad #define ATOM_S5_DOS_REQ_LCD1b0          0x02
   5775  1.1  riastrad #define ATOM_S5_DOS_REQ_TV1b0           0x04
   5776  1.1  riastrad #define ATOM_S5_DOS_REQ_DFP1b0          0x08
   5777  1.1  riastrad #define ATOM_S5_DOS_REQ_CRT2b0          0x10
   5778  1.1  riastrad #define ATOM_S5_DOS_REQ_LCD2b0          0x20
   5779  1.1  riastrad #define ATOM_S5_DOS_REQ_DFP6b0          0x40
   5780  1.1  riastrad #define ATOM_S5_DOS_REQ_DFP2b0          0x80
   5781  1.1  riastrad #define ATOM_S5_DOS_REQ_CVb1            0x01
   5782  1.1  riastrad #define ATOM_S5_DOS_REQ_DFP3b1					0x02
   5783  1.1  riastrad #define ATOM_S5_DOS_REQ_DFP4b1					0x04
   5784  1.1  riastrad #define ATOM_S5_DOS_REQ_DFP5b1					0x08
   5785  1.1  riastrad 
   5786  1.1  riastrad #define ATOM_S5_DOS_REQ_DEVICEw0        0x0FFF
   5787  1.1  riastrad 
   5788  1.1  riastrad #define ATOM_S5_DOS_REQ_CRT1            0x0001
   5789  1.1  riastrad #define ATOM_S5_DOS_REQ_LCD1            0x0002
   5790  1.1  riastrad #define ATOM_S5_DOS_REQ_TV1             0x0004
   5791  1.1  riastrad #define ATOM_S5_DOS_REQ_DFP1            0x0008
   5792  1.1  riastrad #define ATOM_S5_DOS_REQ_CRT2            0x0010
   5793  1.1  riastrad #define ATOM_S5_DOS_REQ_LCD2            0x0020
   5794  1.1  riastrad #define ATOM_S5_DOS_REQ_DFP6            0x0040
   5795  1.1  riastrad #define ATOM_S5_DOS_REQ_DFP2            0x0080
   5796  1.1  riastrad #define ATOM_S5_DOS_REQ_CV              0x0100
   5797  1.1  riastrad #define ATOM_S5_DOS_REQ_DFP3            0x0200
   5798  1.1  riastrad #define ATOM_S5_DOS_REQ_DFP4            0x0400
   5799  1.1  riastrad #define ATOM_S5_DOS_REQ_DFP5            0x0800
   5800  1.1  riastrad 
   5801  1.1  riastrad #define ATOM_S5_DOS_FORCE_CRT1b2        ATOM_S5_DOS_REQ_CRT1b0
   5802  1.1  riastrad #define ATOM_S5_DOS_FORCE_TV1b2         ATOM_S5_DOS_REQ_TV1b0
   5803  1.1  riastrad #define ATOM_S5_DOS_FORCE_CRT2b2        ATOM_S5_DOS_REQ_CRT2b0
   5804  1.1  riastrad #define ATOM_S5_DOS_FORCE_CVb3          ATOM_S5_DOS_REQ_CVb1
   5805  1.1  riastrad #define ATOM_S5_DOS_FORCE_DEVICEw1      (ATOM_S5_DOS_FORCE_CRT1b2+ATOM_S5_DOS_FORCE_TV1b2+ATOM_S5_DOS_FORCE_CRT2b2+\
   5806  1.1  riastrad                                         (ATOM_S5_DOS_FORCE_CVb3<<8))
   5807  1.1  riastrad 
   5808  1.1  riastrad // BIOS_6_SCRATCH Definition
   5809  1.1  riastrad #define ATOM_S6_DEVICE_CHANGE           0x00000001L
   5810  1.1  riastrad #define ATOM_S6_SCALER_CHANGE           0x00000002L
   5811  1.1  riastrad #define ATOM_S6_LID_CHANGE              0x00000004L
   5812  1.1  riastrad #define ATOM_S6_DOCKING_CHANGE          0x00000008L
   5813  1.1  riastrad #define ATOM_S6_ACC_MODE                0x00000010L
   5814  1.1  riastrad #define ATOM_S6_EXT_DESKTOP_MODE        0x00000020L
   5815  1.1  riastrad #define ATOM_S6_LID_STATE               0x00000040L
   5816  1.1  riastrad #define ATOM_S6_DOCK_STATE              0x00000080L
   5817  1.1  riastrad #define ATOM_S6_CRITICAL_STATE          0x00000100L
   5818  1.1  riastrad #define ATOM_S6_HW_I2C_BUSY_STATE       0x00000200L
   5819  1.1  riastrad #define ATOM_S6_THERMAL_STATE_CHANGE    0x00000400L
   5820  1.1  riastrad #define ATOM_S6_INTERRUPT_SET_BY_BIOS   0x00000800L
   5821  1.1  riastrad #define ATOM_S6_REQ_LCD_EXPANSION_FULL         0x00001000L //Normal expansion Request bit for LCD
   5822  1.1  riastrad #define ATOM_S6_REQ_LCD_EXPANSION_ASPEC_RATIO  0x00002000L //Aspect ratio expansion Request bit for LCD
   5823  1.1  riastrad 
   5824  1.1  riastrad #define ATOM_S6_DISPLAY_STATE_CHANGE    0x00004000L        //This bit is recycled when ATOM_BIOS_INFO_BIOS_SCRATCH6_SCL2_REDEFINE is set,previously it's SCL2_H_expansion
   5825  1.1  riastrad #define ATOM_S6_I2C_STATE_CHANGE        0x00008000L        //This bit is recycled,when ATOM_BIOS_INFO_BIOS_SCRATCH6_SCL2_REDEFINE is set,previously it's SCL2_V_expansion
   5826  1.1  riastrad 
   5827  1.1  riastrad #define ATOM_S6_ACC_REQ_CRT1            0x00010000L
   5828  1.1  riastrad #define ATOM_S6_ACC_REQ_LCD1            0x00020000L
   5829  1.1  riastrad #define ATOM_S6_ACC_REQ_TV1             0x00040000L
   5830  1.1  riastrad #define ATOM_S6_ACC_REQ_DFP1            0x00080000L
   5831  1.1  riastrad #define ATOM_S6_ACC_REQ_CRT2            0x00100000L
   5832  1.1  riastrad #define ATOM_S6_ACC_REQ_LCD2            0x00200000L
   5833  1.1  riastrad #define ATOM_S6_ACC_REQ_DFP6            0x00400000L
   5834  1.1  riastrad #define ATOM_S6_ACC_REQ_DFP2            0x00800000L
   5835  1.1  riastrad #define ATOM_S6_ACC_REQ_CV              0x01000000L
   5836  1.1  riastrad #define ATOM_S6_ACC_REQ_DFP3						0x02000000L
   5837  1.1  riastrad #define ATOM_S6_ACC_REQ_DFP4						0x04000000L
   5838  1.1  riastrad #define ATOM_S6_ACC_REQ_DFP5						0x08000000L
   5839  1.1  riastrad 
   5840  1.1  riastrad #define ATOM_S6_ACC_REQ_MASK                0x0FFF0000L
   5841  1.1  riastrad #define ATOM_S6_SYSTEM_POWER_MODE_CHANGE    0x10000000L
   5842  1.1  riastrad #define ATOM_S6_ACC_BLOCK_DISPLAY_SWITCH    0x20000000L
   5843  1.1  riastrad #define ATOM_S6_VRI_BRIGHTNESS_CHANGE       0x40000000L
   5844  1.1  riastrad #define ATOM_S6_CONFIG_DISPLAY_CHANGE_MASK  0x80000000L
   5845  1.1  riastrad 
   5846  1.1  riastrad //Byte aligned definition for BIOS usage
   5847  1.1  riastrad #define ATOM_S6_DEVICE_CHANGEb0         0x01
   5848  1.1  riastrad #define ATOM_S6_SCALER_CHANGEb0         0x02
   5849  1.1  riastrad #define ATOM_S6_LID_CHANGEb0            0x04
   5850  1.1  riastrad #define ATOM_S6_DOCKING_CHANGEb0        0x08
   5851  1.1  riastrad #define ATOM_S6_ACC_MODEb0              0x10
   5852  1.1  riastrad #define ATOM_S6_EXT_DESKTOP_MODEb0      0x20
   5853  1.1  riastrad #define ATOM_S6_LID_STATEb0             0x40
   5854  1.1  riastrad #define ATOM_S6_DOCK_STATEb0            0x80
   5855  1.1  riastrad #define ATOM_S6_CRITICAL_STATEb1        0x01
   5856  1.1  riastrad #define ATOM_S6_HW_I2C_BUSY_STATEb1     0x02
   5857  1.1  riastrad #define ATOM_S6_THERMAL_STATE_CHANGEb1  0x04
   5858  1.1  riastrad #define ATOM_S6_INTERRUPT_SET_BY_BIOSb1 0x08
   5859  1.1  riastrad #define ATOM_S6_REQ_LCD_EXPANSION_FULLb1        0x10
   5860  1.1  riastrad #define ATOM_S6_REQ_LCD_EXPANSION_ASPEC_RATIOb1 0x20
   5861  1.1  riastrad 
   5862  1.1  riastrad #define ATOM_S6_ACC_REQ_CRT1b2          0x01
   5863  1.1  riastrad #define ATOM_S6_ACC_REQ_LCD1b2          0x02
   5864  1.1  riastrad #define ATOM_S6_ACC_REQ_TV1b2           0x04
   5865  1.1  riastrad #define ATOM_S6_ACC_REQ_DFP1b2          0x08
   5866  1.1  riastrad #define ATOM_S6_ACC_REQ_CRT2b2          0x10
   5867  1.1  riastrad #define ATOM_S6_ACC_REQ_LCD2b2          0x20
   5868  1.1  riastrad #define ATOM_S6_ACC_REQ_DFP6b2          0x40
   5869  1.1  riastrad #define ATOM_S6_ACC_REQ_DFP2b2          0x80
   5870  1.1  riastrad #define ATOM_S6_ACC_REQ_CVb3            0x01
   5871  1.1  riastrad #define ATOM_S6_ACC_REQ_DFP3b3          0x02
   5872  1.1  riastrad #define ATOM_S6_ACC_REQ_DFP4b3          0x04
   5873  1.1  riastrad #define ATOM_S6_ACC_REQ_DFP5b3          0x08
   5874  1.1  riastrad 
   5875  1.1  riastrad #define ATOM_S6_ACC_REQ_DEVICEw1        ATOM_S5_DOS_REQ_DEVICEw0
   5876  1.1  riastrad #define ATOM_S6_SYSTEM_POWER_MODE_CHANGEb3 0x10
   5877  1.1  riastrad #define ATOM_S6_ACC_BLOCK_DISPLAY_SWITCHb3 0x20
   5878  1.1  riastrad #define ATOM_S6_VRI_BRIGHTNESS_CHANGEb3    0x40
   5879  1.1  riastrad #define ATOM_S6_CONFIG_DISPLAY_CHANGEb3    0x80
   5880  1.1  riastrad 
   5881  1.1  riastrad #define ATOM_S6_DEVICE_CHANGE_SHIFT             0
   5882  1.1  riastrad #define ATOM_S6_SCALER_CHANGE_SHIFT             1
   5883  1.1  riastrad #define ATOM_S6_LID_CHANGE_SHIFT                2
   5884  1.1  riastrad #define ATOM_S6_DOCKING_CHANGE_SHIFT            3
   5885  1.1  riastrad #define ATOM_S6_ACC_MODE_SHIFT                  4
   5886  1.1  riastrad #define ATOM_S6_EXT_DESKTOP_MODE_SHIFT          5
   5887  1.1  riastrad #define ATOM_S6_LID_STATE_SHIFT                 6
   5888  1.1  riastrad #define ATOM_S6_DOCK_STATE_SHIFT                7
   5889  1.1  riastrad #define ATOM_S6_CRITICAL_STATE_SHIFT            8
   5890  1.1  riastrad #define ATOM_S6_HW_I2C_BUSY_STATE_SHIFT         9
   5891  1.1  riastrad #define ATOM_S6_THERMAL_STATE_CHANGE_SHIFT      10
   5892  1.1  riastrad #define ATOM_S6_INTERRUPT_SET_BY_BIOS_SHIFT     11
   5893  1.1  riastrad #define ATOM_S6_REQ_SCALER_SHIFT                12
   5894  1.1  riastrad #define ATOM_S6_REQ_SCALER_ARATIO_SHIFT         13
   5895  1.1  riastrad #define ATOM_S6_DISPLAY_STATE_CHANGE_SHIFT      14
   5896  1.1  riastrad #define ATOM_S6_I2C_STATE_CHANGE_SHIFT          15
   5897  1.1  riastrad #define ATOM_S6_SYSTEM_POWER_MODE_CHANGE_SHIFT  28
   5898  1.1  riastrad #define ATOM_S6_ACC_BLOCK_DISPLAY_SWITCH_SHIFT  29
   5899  1.1  riastrad #define ATOM_S6_VRI_BRIGHTNESS_CHANGE_SHIFT     30
   5900  1.1  riastrad #define ATOM_S6_CONFIG_DISPLAY_CHANGE_SHIFT     31
   5901  1.1  riastrad 
   5902  1.1  riastrad // BIOS_7_SCRATCH Definition, BIOS_7_SCRATCH is used by Firmware only !!!!
   5903  1.1  riastrad #define ATOM_S7_DOS_MODE_TYPEb0             0x03
   5904  1.1  riastrad #define ATOM_S7_DOS_MODE_VGAb0              0x00
   5905  1.1  riastrad #define ATOM_S7_DOS_MODE_VESAb0             0x01
   5906  1.1  riastrad #define ATOM_S7_DOS_MODE_EXTb0              0x02
   5907  1.1  riastrad #define ATOM_S7_DOS_MODE_PIXEL_DEPTHb0      0x0C
   5908  1.1  riastrad #define ATOM_S7_DOS_MODE_PIXEL_FORMATb0     0xF0
   5909  1.1  riastrad #define ATOM_S7_DOS_8BIT_DAC_ENb1           0x01
   5910  1.1  riastrad #define ATOM_S7_ASIC_INIT_COMPLETEb1        0x02
   5911  1.1  riastrad #define ATOM_S7_ASIC_INIT_COMPLETE_MASK     0x00000200
   5912  1.1  riastrad #define ATOM_S7_DOS_MODE_NUMBERw1           0x0FFFF
   5913  1.1  riastrad 
   5914  1.1  riastrad #define ATOM_S7_DOS_8BIT_DAC_EN_SHIFT       8
   5915  1.1  riastrad 
   5916  1.1  riastrad // BIOS_8_SCRATCH Definition
   5917  1.1  riastrad #define ATOM_S8_I2C_CHANNEL_BUSY_MASK       0x00000FFFF
   5918  1.1  riastrad #define ATOM_S8_I2C_HW_ENGINE_BUSY_MASK     0x0FFFF0000
   5919  1.1  riastrad 
   5920  1.1  riastrad #define ATOM_S8_I2C_CHANNEL_BUSY_SHIFT      0
   5921  1.1  riastrad #define ATOM_S8_I2C_ENGINE_BUSY_SHIFT       16
   5922  1.1  riastrad 
   5923  1.1  riastrad // BIOS_9_SCRATCH Definition
   5924  1.1  riastrad #ifndef ATOM_S9_I2C_CHANNEL_COMPLETED_MASK
   5925  1.1  riastrad #define ATOM_S9_I2C_CHANNEL_COMPLETED_MASK  0x0000FFFF
   5926  1.1  riastrad #endif
   5927  1.1  riastrad #ifndef ATOM_S9_I2C_CHANNEL_ABORTED_MASK
   5928  1.1  riastrad #define ATOM_S9_I2C_CHANNEL_ABORTED_MASK    0xFFFF0000
   5929  1.1  riastrad #endif
   5930  1.1  riastrad #ifndef ATOM_S9_I2C_CHANNEL_COMPLETED_SHIFT
   5931  1.1  riastrad #define ATOM_S9_I2C_CHANNEL_COMPLETED_SHIFT 0
   5932  1.1  riastrad #endif
   5933  1.1  riastrad #ifndef ATOM_S9_I2C_CHANNEL_ABORTED_SHIFT
   5934  1.1  riastrad #define ATOM_S9_I2C_CHANNEL_ABORTED_SHIFT   16
   5935  1.1  riastrad #endif
   5936  1.1  riastrad 
   5937  1.1  riastrad 
   5938  1.1  riastrad #define ATOM_FLAG_SET                         0x20
   5939  1.1  riastrad #define ATOM_FLAG_CLEAR                       0
   5940  1.1  riastrad #define CLEAR_ATOM_S6_ACC_MODE                ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_ACC_MODE_SHIFT | ATOM_FLAG_CLEAR)
   5941  1.1  riastrad #define SET_ATOM_S6_DEVICE_CHANGE             ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_DEVICE_CHANGE_SHIFT | ATOM_FLAG_SET)
   5942  1.1  riastrad #define SET_ATOM_S6_VRI_BRIGHTNESS_CHANGE     ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_VRI_BRIGHTNESS_CHANGE_SHIFT | ATOM_FLAG_SET)
   5943  1.1  riastrad #define SET_ATOM_S6_SCALER_CHANGE             ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_SCALER_CHANGE_SHIFT | ATOM_FLAG_SET)
   5944  1.1  riastrad #define SET_ATOM_S6_LID_CHANGE                ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_LID_CHANGE_SHIFT | ATOM_FLAG_SET)
   5945  1.1  riastrad 
   5946  1.1  riastrad #define SET_ATOM_S6_LID_STATE                 ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_LID_STATE_SHIFT | ATOM_FLAG_SET)
   5947  1.1  riastrad #define CLEAR_ATOM_S6_LID_STATE               ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_LID_STATE_SHIFT | ATOM_FLAG_CLEAR)
   5948  1.1  riastrad 
   5949  1.1  riastrad #define SET_ATOM_S6_DOCK_CHANGE			          ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_DOCKING_CHANGE_SHIFT | ATOM_FLAG_SET)
   5950  1.1  riastrad #define SET_ATOM_S6_DOCK_STATE                ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_DOCK_STATE_SHIFT | ATOM_FLAG_SET)
   5951  1.1  riastrad #define CLEAR_ATOM_S6_DOCK_STATE              ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_DOCK_STATE_SHIFT | ATOM_FLAG_CLEAR)
   5952  1.1  riastrad 
   5953  1.1  riastrad #define SET_ATOM_S6_THERMAL_STATE_CHANGE      ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_THERMAL_STATE_CHANGE_SHIFT | ATOM_FLAG_SET)
   5954  1.1  riastrad #define SET_ATOM_S6_SYSTEM_POWER_MODE_CHANGE  ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_SYSTEM_POWER_MODE_CHANGE_SHIFT | ATOM_FLAG_SET)
   5955  1.1  riastrad #define SET_ATOM_S6_INTERRUPT_SET_BY_BIOS     ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_INTERRUPT_SET_BY_BIOS_SHIFT | ATOM_FLAG_SET)
   5956  1.1  riastrad 
   5957  1.1  riastrad #define SET_ATOM_S6_CRITICAL_STATE            ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_CRITICAL_STATE_SHIFT | ATOM_FLAG_SET)
   5958  1.1  riastrad #define CLEAR_ATOM_S6_CRITICAL_STATE          ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_CRITICAL_STATE_SHIFT | ATOM_FLAG_CLEAR)
   5959  1.1  riastrad 
   5960  1.1  riastrad #define SET_ATOM_S6_REQ_SCALER                ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_REQ_SCALER_SHIFT | ATOM_FLAG_SET)
   5961  1.1  riastrad #define CLEAR_ATOM_S6_REQ_SCALER              ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_REQ_SCALER_SHIFT | ATOM_FLAG_CLEAR )
   5962  1.1  riastrad 
   5963  1.1  riastrad #define SET_ATOM_S6_REQ_SCALER_ARATIO         ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_REQ_SCALER_ARATIO_SHIFT | ATOM_FLAG_SET )
   5964  1.1  riastrad #define CLEAR_ATOM_S6_REQ_SCALER_ARATIO       ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_REQ_SCALER_ARATIO_SHIFT | ATOM_FLAG_CLEAR )
   5965  1.1  riastrad 
   5966  1.1  riastrad #define SET_ATOM_S6_I2C_STATE_CHANGE          ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_I2C_STATE_CHANGE_SHIFT | ATOM_FLAG_SET )
   5967  1.1  riastrad 
   5968  1.1  riastrad #define SET_ATOM_S6_DISPLAY_STATE_CHANGE      ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_DISPLAY_STATE_CHANGE_SHIFT | ATOM_FLAG_SET )
   5969  1.1  riastrad 
   5970  1.1  riastrad #define SET_ATOM_S6_DEVICE_RECONFIG           ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_CONFIG_DISPLAY_CHANGE_SHIFT | ATOM_FLAG_SET)
   5971  1.1  riastrad #define CLEAR_ATOM_S0_LCD1                    ((ATOM_DEVICE_CONNECT_INFO_DEF << 8 )|  ATOM_S0_LCD1_SHIFT | ATOM_FLAG_CLEAR )
   5972  1.1  riastrad #define SET_ATOM_S7_DOS_8BIT_DAC_EN           ((ATOM_DOS_MODE_INFO_DEF << 8 )|ATOM_S7_DOS_8BIT_DAC_EN_SHIFT | ATOM_FLAG_SET )
   5973  1.1  riastrad #define CLEAR_ATOM_S7_DOS_8BIT_DAC_EN         ((ATOM_DOS_MODE_INFO_DEF << 8 )|ATOM_S7_DOS_8BIT_DAC_EN_SHIFT | ATOM_FLAG_CLEAR )
   5974  1.1  riastrad 
   5975  1.1  riastrad /****************************************************************************/
   5976  1.1  riastrad //Portion II: Definitinos only used in Driver
   5977  1.1  riastrad /****************************************************************************/
   5978  1.1  riastrad 
   5979  1.1  riastrad // Macros used by driver
   5980  1.1  riastrad #ifdef __cplusplus
   5981  1.1  riastrad #define GetIndexIntoMasterTable(MasterOrData, FieldName) ((reinterpret_cast<char*>(&(static_cast<ATOM_MASTER_LIST_OF_##MasterOrData##_TABLES*>(0))->FieldName)-static_cast<char*>(0))/sizeof(USHORT))
   5982  1.1  riastrad 
   5983  1.1  riastrad #define GET_COMMAND_TABLE_COMMANDSET_REVISION(TABLE_HEADER_OFFSET) (((static_cast<ATOM_COMMON_TABLE_HEADER*>(TABLE_HEADER_OFFSET))->ucTableFormatRevision )&0x3F)
   5984  1.1  riastrad #define GET_COMMAND_TABLE_PARAMETER_REVISION(TABLE_HEADER_OFFSET)  (((static_cast<ATOM_COMMON_TABLE_HEADER*>(TABLE_HEADER_OFFSET))->ucTableContentRevision)&0x3F)
   5985  1.1  riastrad #else // not __cplusplus
   5986  1.1  riastrad #define	GetIndexIntoMasterTable(MasterOrData, FieldName) (((char*)(&((ATOM_MASTER_LIST_OF_##MasterOrData##_TABLES*)0)->FieldName)-(char*)0)/sizeof(USHORT))
   5987  1.1  riastrad 
   5988  1.1  riastrad #define GET_COMMAND_TABLE_COMMANDSET_REVISION(TABLE_HEADER_OFFSET) ((((ATOM_COMMON_TABLE_HEADER*)TABLE_HEADER_OFFSET)->ucTableFormatRevision)&0x3F)
   5989  1.1  riastrad #define GET_COMMAND_TABLE_PARAMETER_REVISION(TABLE_HEADER_OFFSET)  ((((ATOM_COMMON_TABLE_HEADER*)TABLE_HEADER_OFFSET)->ucTableContentRevision)&0x3F)
   5990  1.1  riastrad #endif // __cplusplus
   5991  1.1  riastrad 
   5992  1.1  riastrad #define GET_DATA_TABLE_MAJOR_REVISION GET_COMMAND_TABLE_COMMANDSET_REVISION
   5993  1.1  riastrad #define GET_DATA_TABLE_MINOR_REVISION GET_COMMAND_TABLE_PARAMETER_REVISION
   5994  1.1  riastrad 
   5995  1.1  riastrad /****************************************************************************/
   5996  1.1  riastrad //Portion III: Definitinos only used in VBIOS
   5997  1.1  riastrad /****************************************************************************/
   5998  1.1  riastrad #define ATOM_DAC_SRC					0x80
   5999  1.1  riastrad #define ATOM_SRC_DAC1					0
   6000  1.1  riastrad #define ATOM_SRC_DAC2					0x80
   6001  1.1  riastrad 
   6002  1.1  riastrad typedef struct _MEMORY_PLLINIT_PARAMETERS
   6003  1.1  riastrad {
   6004  1.1  riastrad   ULONG ulTargetMemoryClock; //In 10Khz unit
   6005  1.1  riastrad   UCHAR   ucAction;					 //not define yet
   6006  1.1  riastrad   UCHAR   ucFbDiv_Hi;				 //Fbdiv Hi byte
   6007  1.1  riastrad   UCHAR   ucFbDiv;					 //FB value
   6008  1.1  riastrad   UCHAR   ucPostDiv;				 //Post div
   6009  1.1  riastrad }MEMORY_PLLINIT_PARAMETERS;
   6010  1.1  riastrad 
   6011  1.1  riastrad #define MEMORY_PLLINIT_PS_ALLOCATION  MEMORY_PLLINIT_PARAMETERS
   6012  1.1  riastrad 
   6013  1.1  riastrad 
   6014  1.1  riastrad #define	GPIO_PIN_WRITE													0x01
   6015  1.1  riastrad #define	GPIO_PIN_READ														0x00
   6016  1.1  riastrad 
   6017  1.1  riastrad typedef struct  _GPIO_PIN_CONTROL_PARAMETERS
   6018  1.1  riastrad {
   6019  1.1  riastrad   UCHAR ucGPIO_ID;           //return value, read from GPIO pins
   6020  1.1  riastrad   UCHAR ucGPIOBitShift;	     //define which bit in uGPIOBitVal need to be update
   6021  1.1  riastrad 	UCHAR ucGPIOBitVal;		     //Set/Reset corresponding bit defined in ucGPIOBitMask
   6022  1.1  riastrad   UCHAR ucAction;				     //=GPIO_PIN_WRITE: Read; =GPIO_PIN_READ: Write
   6023  1.1  riastrad }GPIO_PIN_CONTROL_PARAMETERS;
   6024  1.1  riastrad 
   6025  1.1  riastrad typedef struct _ENABLE_SCALER_PARAMETERS
   6026  1.1  riastrad {
   6027  1.1  riastrad   UCHAR ucScaler;            // ATOM_SCALER1, ATOM_SCALER2
   6028  1.1  riastrad   UCHAR ucEnable;            // ATOM_SCALER_DISABLE or ATOM_SCALER_CENTER or ATOM_SCALER_EXPANSION
   6029  1.1  riastrad   UCHAR ucTVStandard;        //
   6030  1.1  riastrad   UCHAR ucPadding[1];
   6031  1.1  riastrad }ENABLE_SCALER_PARAMETERS;
   6032  1.1  riastrad #define ENABLE_SCALER_PS_ALLOCATION ENABLE_SCALER_PARAMETERS
   6033  1.1  riastrad 
   6034  1.1  riastrad //ucEnable:
   6035  1.1  riastrad #define SCALER_BYPASS_AUTO_CENTER_NO_REPLICATION    0
   6036  1.1  riastrad #define SCALER_BYPASS_AUTO_CENTER_AUTO_REPLICATION  1
   6037  1.1  riastrad #define SCALER_ENABLE_2TAP_ALPHA_MODE               2
   6038  1.1  riastrad #define SCALER_ENABLE_MULTITAP_MODE                 3
   6039  1.1  riastrad 
   6040  1.1  riastrad typedef struct _ENABLE_HARDWARE_ICON_CURSOR_PARAMETERS
   6041  1.1  riastrad {
   6042  1.1  riastrad   ULONG  usHWIconHorzVertPosn;        // Hardware Icon Vertical position
   6043  1.1  riastrad   UCHAR  ucHWIconVertOffset;          // Hardware Icon Vertical offset
   6044  1.1  riastrad   UCHAR  ucHWIconHorzOffset;          // Hardware Icon Horizontal offset
   6045  1.1  riastrad   UCHAR  ucSelection;                 // ATOM_CURSOR1 or ATOM_ICON1 or ATOM_CURSOR2 or ATOM_ICON2
   6046  1.1  riastrad   UCHAR  ucEnable;                    // ATOM_ENABLE or ATOM_DISABLE
   6047  1.1  riastrad }ENABLE_HARDWARE_ICON_CURSOR_PARAMETERS;
   6048  1.1  riastrad 
   6049  1.1  riastrad typedef struct _ENABLE_HARDWARE_ICON_CURSOR_PS_ALLOCATION
   6050  1.1  riastrad {
   6051  1.1  riastrad   ENABLE_HARDWARE_ICON_CURSOR_PARAMETERS  sEnableIcon;
   6052  1.1  riastrad   ENABLE_CRTC_PARAMETERS                  sReserved;
   6053  1.1  riastrad }ENABLE_HARDWARE_ICON_CURSOR_PS_ALLOCATION;
   6054  1.1  riastrad 
   6055  1.1  riastrad typedef struct _ENABLE_GRAPH_SURFACE_PARAMETERS
   6056  1.1  riastrad {
   6057  1.1  riastrad   USHORT usHight;                     // Image Hight
   6058  1.1  riastrad   USHORT usWidth;                     // Image Width
   6059  1.1  riastrad   UCHAR  ucSurface;                   // Surface 1 or 2
   6060  1.1  riastrad   UCHAR  ucPadding[3];
   6061  1.1  riastrad }ENABLE_GRAPH_SURFACE_PARAMETERS;
   6062  1.1  riastrad 
   6063  1.1  riastrad typedef struct _ENABLE_GRAPH_SURFACE_PARAMETERS_V1_2
   6064  1.1  riastrad {
   6065  1.1  riastrad   USHORT usHight;                     // Image Hight
   6066  1.1  riastrad   USHORT usWidth;                     // Image Width
   6067  1.1  riastrad   UCHAR  ucSurface;                   // Surface 1 or 2
   6068  1.1  riastrad   UCHAR  ucEnable;                    // ATOM_ENABLE or ATOM_DISABLE
   6069  1.1  riastrad   UCHAR  ucPadding[2];
   6070  1.1  riastrad }ENABLE_GRAPH_SURFACE_PARAMETERS_V1_2;
   6071  1.1  riastrad 
   6072  1.1  riastrad typedef struct _ENABLE_GRAPH_SURFACE_PARAMETERS_V1_3
   6073  1.1  riastrad {
   6074  1.1  riastrad   USHORT usHight;                     // Image Hight
   6075  1.1  riastrad   USHORT usWidth;                     // Image Width
   6076  1.1  riastrad   UCHAR  ucSurface;                   // Surface 1 or 2
   6077  1.1  riastrad   UCHAR  ucEnable;                    // ATOM_ENABLE or ATOM_DISABLE
   6078  1.1  riastrad   USHORT usDeviceId;                  // Active Device Id for this surface. If no device, set to 0.
   6079  1.1  riastrad }ENABLE_GRAPH_SURFACE_PARAMETERS_V1_3;
   6080  1.1  riastrad 
   6081  1.1  riastrad typedef struct _ENABLE_GRAPH_SURFACE_PARAMETERS_V1_4
   6082  1.1  riastrad {
   6083  1.1  riastrad   USHORT usHight;                     // Image Hight
   6084  1.1  riastrad   USHORT usWidth;                     // Image Width
   6085  1.1  riastrad   USHORT usGraphPitch;
   6086  1.1  riastrad   UCHAR  ucColorDepth;
   6087  1.1  riastrad   UCHAR  ucPixelFormat;
   6088  1.1  riastrad   UCHAR  ucSurface;                   // Surface 1 or 2
   6089  1.1  riastrad   UCHAR  ucEnable;                    // ATOM_ENABLE or ATOM_DISABLE
   6090  1.1  riastrad   UCHAR  ucModeType;
   6091  1.1  riastrad   UCHAR  ucReserved;
   6092  1.1  riastrad }ENABLE_GRAPH_SURFACE_PARAMETERS_V1_4;
   6093  1.1  riastrad 
   6094  1.1  riastrad // ucEnable
   6095  1.1  riastrad #define ATOM_GRAPH_CONTROL_SET_PITCH             0x0f
   6096  1.1  riastrad #define ATOM_GRAPH_CONTROL_SET_DISP_START        0x10
   6097  1.1  riastrad 
   6098  1.1  riastrad typedef struct _ENABLE_GRAPH_SURFACE_PS_ALLOCATION
   6099  1.1  riastrad {
   6100  1.1  riastrad   ENABLE_GRAPH_SURFACE_PARAMETERS sSetSurface;
   6101  1.1  riastrad   ENABLE_YUV_PS_ALLOCATION        sReserved; // Don't set this one
   6102  1.1  riastrad }ENABLE_GRAPH_SURFACE_PS_ALLOCATION;
   6103  1.1  riastrad 
   6104  1.1  riastrad typedef struct _MEMORY_CLEAN_UP_PARAMETERS
   6105  1.1  riastrad {
   6106  1.1  riastrad   USHORT  usMemoryStart;                //in 8Kb boundary, offset from memory base address
   6107  1.1  riastrad   USHORT  usMemorySize;                 //8Kb blocks aligned
   6108  1.1  riastrad }MEMORY_CLEAN_UP_PARAMETERS;
   6109  1.1  riastrad #define MEMORY_CLEAN_UP_PS_ALLOCATION MEMORY_CLEAN_UP_PARAMETERS
   6110  1.1  riastrad 
   6111  1.1  riastrad typedef struct  _GET_DISPLAY_SURFACE_SIZE_PARAMETERS
   6112  1.1  riastrad {
   6113  1.1  riastrad   USHORT  usX_Size;                     //When use as input parameter, usX_Size indicates which CRTC
   6114  1.1  riastrad   USHORT  usY_Size;
   6115  1.1  riastrad }GET_DISPLAY_SURFACE_SIZE_PARAMETERS;
   6116  1.1  riastrad 
   6117  1.1  riastrad typedef struct  _GET_DISPLAY_SURFACE_SIZE_PARAMETERS_V2
   6118  1.1  riastrad {
   6119  1.1  riastrad   union{
   6120  1.1  riastrad     USHORT  usX_Size;                     //When use as input parameter, usX_Size indicates which CRTC
   6121  1.1  riastrad     USHORT  usSurface;
   6122  1.1  riastrad   };
   6123  1.1  riastrad   USHORT usY_Size;
   6124  1.1  riastrad   USHORT usDispXStart;
   6125  1.1  riastrad   USHORT usDispYStart;
   6126  1.1  riastrad }GET_DISPLAY_SURFACE_SIZE_PARAMETERS_V2;
   6127  1.1  riastrad 
   6128  1.1  riastrad 
   6129  1.1  riastrad typedef struct _PALETTE_DATA_CONTROL_PARAMETERS_V3
   6130  1.1  riastrad {
   6131  1.1  riastrad   UCHAR  ucLutId;
   6132  1.1  riastrad   UCHAR  ucAction;
   6133  1.1  riastrad   USHORT usLutStartIndex;
   6134  1.1  riastrad   USHORT usLutLength;
   6135  1.1  riastrad   USHORT usLutOffsetInVram;
   6136  1.1  riastrad }PALETTE_DATA_CONTROL_PARAMETERS_V3;
   6137  1.1  riastrad 
   6138  1.1  riastrad // ucAction:
   6139  1.1  riastrad #define PALETTE_DATA_AUTO_FILL            1
   6140  1.1  riastrad #define PALETTE_DATA_READ                 2
   6141  1.1  riastrad #define PALETTE_DATA_WRITE                3
   6142  1.1  riastrad 
   6143  1.1  riastrad 
   6144  1.1  riastrad typedef struct _INTERRUPT_SERVICE_PARAMETERS_V2
   6145  1.1  riastrad {
   6146  1.1  riastrad   UCHAR  ucInterruptId;
   6147  1.1  riastrad   UCHAR  ucServiceId;
   6148  1.1  riastrad   UCHAR  ucStatus;
   6149  1.1  riastrad   UCHAR  ucReserved;
   6150  1.1  riastrad }INTERRUPT_SERVICE_PARAMETER_V2;
   6151  1.1  riastrad 
   6152  1.1  riastrad // ucInterruptId
   6153  1.1  riastrad #define HDP1_INTERRUPT_ID                 1
   6154  1.1  riastrad #define HDP2_INTERRUPT_ID                 2
   6155  1.1  riastrad #define HDP3_INTERRUPT_ID                 3
   6156  1.1  riastrad #define HDP4_INTERRUPT_ID                 4
   6157  1.1  riastrad #define HDP5_INTERRUPT_ID                 5
   6158  1.1  riastrad #define HDP6_INTERRUPT_ID                 6
   6159  1.1  riastrad #define SW_INTERRUPT_ID                   11
   6160  1.1  riastrad 
   6161  1.1  riastrad // ucAction
   6162  1.1  riastrad #define INTERRUPT_SERVICE_GEN_SW_INT      1
   6163  1.1  riastrad #define INTERRUPT_SERVICE_GET_STATUS      2
   6164  1.1  riastrad 
   6165  1.1  riastrad  // ucStatus
   6166  1.1  riastrad #define INTERRUPT_STATUS__INT_TRIGGER     1
   6167  1.1  riastrad #define INTERRUPT_STATUS__HPD_HIGH        2
   6168  1.1  riastrad 
   6169  1.1  riastrad typedef struct _INDIRECT_IO_ACCESS
   6170  1.1  riastrad {
   6171  1.1  riastrad   ATOM_COMMON_TABLE_HEADER sHeader;
   6172  1.1  riastrad   UCHAR                    IOAccessSequence[256];
   6173  1.1  riastrad } INDIRECT_IO_ACCESS;
   6174  1.1  riastrad 
   6175  1.1  riastrad #define INDIRECT_READ              0x00
   6176  1.1  riastrad #define INDIRECT_WRITE             0x80
   6177  1.1  riastrad 
   6178  1.1  riastrad #define INDIRECT_IO_MM             0
   6179  1.1  riastrad #define INDIRECT_IO_PLL            1
   6180  1.1  riastrad #define INDIRECT_IO_MC             2
   6181  1.1  riastrad #define INDIRECT_IO_PCIE           3
   6182  1.1  riastrad #define INDIRECT_IO_PCIEP          4
   6183  1.1  riastrad #define INDIRECT_IO_NBMISC         5
   6184  1.1  riastrad #define INDIRECT_IO_SMU            5
   6185  1.1  riastrad 
   6186  1.1  riastrad #define INDIRECT_IO_PLL_READ       INDIRECT_IO_PLL   | INDIRECT_READ
   6187  1.1  riastrad #define INDIRECT_IO_PLL_WRITE      INDIRECT_IO_PLL   | INDIRECT_WRITE
   6188  1.1  riastrad #define INDIRECT_IO_MC_READ        INDIRECT_IO_MC    | INDIRECT_READ
   6189  1.1  riastrad #define INDIRECT_IO_MC_WRITE       INDIRECT_IO_MC    | INDIRECT_WRITE
   6190  1.1  riastrad #define INDIRECT_IO_PCIE_READ      INDIRECT_IO_PCIE  | INDIRECT_READ
   6191  1.1  riastrad #define INDIRECT_IO_PCIE_WRITE     INDIRECT_IO_PCIE  | INDIRECT_WRITE
   6192  1.1  riastrad #define INDIRECT_IO_PCIEP_READ     INDIRECT_IO_PCIEP | INDIRECT_READ
   6193  1.1  riastrad #define INDIRECT_IO_PCIEP_WRITE    INDIRECT_IO_PCIEP | INDIRECT_WRITE
   6194  1.1  riastrad #define INDIRECT_IO_NBMISC_READ    INDIRECT_IO_NBMISC | INDIRECT_READ
   6195  1.1  riastrad #define INDIRECT_IO_NBMISC_WRITE   INDIRECT_IO_NBMISC | INDIRECT_WRITE
   6196  1.1  riastrad #define INDIRECT_IO_SMU_READ       INDIRECT_IO_SMU | INDIRECT_READ
   6197  1.1  riastrad #define INDIRECT_IO_SMU_WRITE      INDIRECT_IO_SMU | INDIRECT_WRITE
   6198  1.1  riastrad 
   6199  1.1  riastrad typedef struct _ATOM_OEM_INFO
   6200  1.1  riastrad {
   6201  1.1  riastrad   ATOM_COMMON_TABLE_HEADER	sHeader;
   6202  1.1  riastrad   ATOM_I2C_ID_CONFIG_ACCESS sucI2cId;
   6203  1.1  riastrad }ATOM_OEM_INFO;
   6204  1.1  riastrad 
   6205  1.1  riastrad typedef struct _ATOM_TV_MODE
   6206  1.1  riastrad {
   6207  1.1  riastrad    UCHAR	ucVMode_Num;			  //Video mode number
   6208  1.1  riastrad    UCHAR	ucTV_Mode_Num;			//Internal TV mode number
   6209  1.1  riastrad }ATOM_TV_MODE;
   6210  1.1  riastrad 
   6211  1.1  riastrad typedef struct _ATOM_BIOS_INT_TVSTD_MODE
   6212  1.1  riastrad {
   6213  1.1  riastrad   ATOM_COMMON_TABLE_HEADER sHeader;
   6214  1.1  riastrad    USHORT	usTV_Mode_LUT_Offset;	// Pointer to standard to internal number conversion table
   6215  1.1  riastrad    USHORT	usTV_FIFO_Offset;		  // Pointer to FIFO entry table
   6216  1.1  riastrad    USHORT	usNTSC_Tbl_Offset;		// Pointer to SDTV_Mode_NTSC table
   6217  1.1  riastrad    USHORT	usPAL_Tbl_Offset;		  // Pointer to SDTV_Mode_PAL table
   6218  1.1  riastrad    USHORT	usCV_Tbl_Offset;		  // Pointer to SDTV_Mode_PAL table
   6219  1.1  riastrad }ATOM_BIOS_INT_TVSTD_MODE;
   6220  1.1  riastrad 
   6221  1.1  riastrad 
   6222  1.1  riastrad typedef struct _ATOM_TV_MODE_SCALER_PTR
   6223  1.1  riastrad {
   6224  1.1  riastrad    USHORT	ucFilter0_Offset;		//Pointer to filter format 0 coefficients
   6225  1.1  riastrad    USHORT	usFilter1_Offset;		//Pointer to filter format 0 coefficients
   6226  1.1  riastrad    UCHAR	ucTV_Mode_Num;
   6227  1.1  riastrad }ATOM_TV_MODE_SCALER_PTR;
   6228  1.1  riastrad 
   6229  1.1  riastrad typedef struct _ATOM_STANDARD_VESA_TIMING
   6230  1.1  riastrad {
   6231  1.1  riastrad   ATOM_COMMON_TABLE_HEADER sHeader;
   6232  1.1  riastrad   ATOM_DTD_FORMAT 				 aModeTimings[16];      // 16 is not the real array number, just for initial allocation
   6233  1.1  riastrad }ATOM_STANDARD_VESA_TIMING;
   6234  1.1  riastrad 
   6235  1.1  riastrad 
   6236  1.1  riastrad typedef struct _ATOM_STD_FORMAT
   6237  1.1  riastrad {
   6238  1.1  riastrad   USHORT    usSTD_HDisp;
   6239  1.1  riastrad   USHORT    usSTD_VDisp;
   6240  1.1  riastrad   USHORT    usSTD_RefreshRate;
   6241  1.1  riastrad   USHORT    usReserved;
   6242  1.1  riastrad }ATOM_STD_FORMAT;
   6243  1.1  riastrad 
   6244  1.1  riastrad typedef struct _ATOM_VESA_TO_EXTENDED_MODE
   6245  1.1  riastrad {
   6246  1.1  riastrad   USHORT  usVESA_ModeNumber;
   6247  1.1  riastrad   USHORT  usExtendedModeNumber;
   6248  1.1  riastrad }ATOM_VESA_TO_EXTENDED_MODE;
   6249  1.1  riastrad 
   6250  1.1  riastrad typedef struct _ATOM_VESA_TO_INTENAL_MODE_LUT
   6251  1.1  riastrad {
   6252  1.1  riastrad   ATOM_COMMON_TABLE_HEADER   sHeader;
   6253  1.1  riastrad   ATOM_VESA_TO_EXTENDED_MODE asVESA_ToExtendedModeInfo[76];
   6254  1.1  riastrad }ATOM_VESA_TO_INTENAL_MODE_LUT;
   6255  1.1  riastrad 
   6256  1.1  riastrad /*************** ATOM Memory Related Data Structure ***********************/
   6257  1.1  riastrad typedef struct _ATOM_MEMORY_VENDOR_BLOCK{
   6258  1.1  riastrad 	UCHAR												ucMemoryType;
   6259  1.1  riastrad 	UCHAR												ucMemoryVendor;
   6260  1.1  riastrad 	UCHAR												ucAdjMCId;
   6261  1.1  riastrad 	UCHAR												ucDynClkId;
   6262  1.1  riastrad 	ULONG												ulDllResetClkRange;
   6263  1.1  riastrad }ATOM_MEMORY_VENDOR_BLOCK;
   6264  1.1  riastrad 
   6265  1.1  riastrad 
   6266  1.1  riastrad typedef struct _ATOM_MEMORY_SETTING_ID_CONFIG{
   6267  1.1  riastrad #if ATOM_BIG_ENDIAN
   6268  1.1  riastrad 	ULONG												ucMemBlkId:8;
   6269  1.1  riastrad 	ULONG												ulMemClockRange:24;
   6270  1.1  riastrad #else
   6271  1.1  riastrad 	ULONG												ulMemClockRange:24;
   6272  1.1  riastrad 	ULONG												ucMemBlkId:8;
   6273  1.1  riastrad #endif
   6274  1.1  riastrad }ATOM_MEMORY_SETTING_ID_CONFIG;
   6275  1.1  riastrad 
   6276  1.1  riastrad typedef union _ATOM_MEMORY_SETTING_ID_CONFIG_ACCESS
   6277  1.1  riastrad {
   6278  1.1  riastrad   ATOM_MEMORY_SETTING_ID_CONFIG slAccess;
   6279  1.1  riastrad   ULONG                         ulAccess;
   6280  1.1  riastrad }ATOM_MEMORY_SETTING_ID_CONFIG_ACCESS;
   6281  1.1  riastrad 
   6282  1.1  riastrad 
   6283  1.1  riastrad typedef struct _ATOM_MEMORY_SETTING_DATA_BLOCK{
   6284  1.1  riastrad 	ATOM_MEMORY_SETTING_ID_CONFIG_ACCESS			ulMemoryID;
   6285  1.1  riastrad 	ULONG															        aulMemData[1];
   6286  1.1  riastrad }ATOM_MEMORY_SETTING_DATA_BLOCK;
   6287  1.1  riastrad 
   6288  1.1  riastrad 
   6289  1.1  riastrad typedef struct _ATOM_INIT_REG_INDEX_FORMAT{
   6290  1.1  riastrad 	 USHORT											usRegIndex;                                     // MC register index
   6291  1.1  riastrad 	 UCHAR											ucPreRegDataLength;                             // offset in ATOM_INIT_REG_DATA_BLOCK.saRegDataBuf
   6292  1.1  riastrad }ATOM_INIT_REG_INDEX_FORMAT;
   6293  1.1  riastrad 
   6294  1.1  riastrad 
   6295  1.1  riastrad typedef struct _ATOM_INIT_REG_BLOCK{
   6296  1.1  riastrad 	USHORT													usRegIndexTblSize;													//size of asRegIndexBuf
   6297  1.1  riastrad 	USHORT													usRegDataBlkSize;														//size of ATOM_MEMORY_SETTING_DATA_BLOCK
   6298  1.1  riastrad 	ATOM_INIT_REG_INDEX_FORMAT			asRegIndexBuf[1];
   6299  1.1  riastrad 	ATOM_MEMORY_SETTING_DATA_BLOCK	asRegDataBuf[1];
   6300  1.1  riastrad }ATOM_INIT_REG_BLOCK;
   6301  1.1  riastrad 
   6302  1.1  riastrad #define END_OF_REG_INDEX_BLOCK  0x0ffff
   6303  1.1  riastrad #define END_OF_REG_DATA_BLOCK   0x00000000
   6304  1.1  riastrad #define ATOM_INIT_REG_MASK_FLAG 0x80               //Not used in BIOS
   6305  1.1  riastrad #define	CLOCK_RANGE_HIGHEST			0x00ffffff
   6306  1.1  riastrad 
   6307  1.1  riastrad #define VALUE_DWORD             SIZEOF ULONG
   6308  1.1  riastrad #define VALUE_SAME_AS_ABOVE     0
   6309  1.1  riastrad #define VALUE_MASK_DWORD        0x84
   6310  1.1  riastrad 
   6311  1.1  riastrad #define INDEX_ACCESS_RANGE_BEGIN	    (VALUE_DWORD + 1)
   6312  1.1  riastrad #define INDEX_ACCESS_RANGE_END		    (INDEX_ACCESS_RANGE_BEGIN + 1)
   6313  1.1  riastrad #define VALUE_INDEX_ACCESS_SINGLE	    (INDEX_ACCESS_RANGE_END + 1)
   6314  1.1  riastrad //#define ACCESS_MCIODEBUGIND            0x40       //defined in BIOS code
   6315  1.1  riastrad #define ACCESS_PLACEHOLDER             0x80
   6316  1.1  riastrad 
   6317  1.1  riastrad typedef struct _ATOM_MC_INIT_PARAM_TABLE
   6318  1.1  riastrad {
   6319  1.1  riastrad   ATOM_COMMON_TABLE_HEADER		sHeader;
   6320  1.1  riastrad   USHORT											usAdjustARB_SEQDataOffset;
   6321  1.1  riastrad   USHORT											usMCInitMemTypeTblOffset;
   6322  1.1  riastrad   USHORT											usMCInitCommonTblOffset;
   6323  1.1  riastrad   USHORT											usMCInitPowerDownTblOffset;
   6324  1.1  riastrad 	ULONG												ulARB_SEQDataBuf[32];
   6325  1.1  riastrad 	ATOM_INIT_REG_BLOCK					asMCInitMemType;
   6326  1.1  riastrad 	ATOM_INIT_REG_BLOCK					asMCInitCommon;
   6327  1.1  riastrad }ATOM_MC_INIT_PARAM_TABLE;
   6328  1.1  riastrad 
   6329  1.1  riastrad 
   6330  1.1  riastrad #define _4Mx16              0x2
   6331  1.1  riastrad #define _4Mx32              0x3
   6332  1.1  riastrad #define _8Mx16              0x12
   6333  1.1  riastrad #define _8Mx32              0x13
   6334  1.1  riastrad #define _16Mx16             0x22
   6335  1.1  riastrad #define _16Mx32             0x23
   6336  1.1  riastrad #define _32Mx16             0x32
   6337  1.1  riastrad #define _32Mx32             0x33
   6338  1.1  riastrad #define _64Mx8              0x41
   6339  1.1  riastrad #define _64Mx16             0x42
   6340  1.1  riastrad #define _64Mx32             0x43
   6341  1.1  riastrad #define _128Mx8             0x51
   6342  1.1  riastrad #define _128Mx16            0x52
   6343  1.1  riastrad #define _128Mx32            0x53
   6344  1.1  riastrad #define _256Mx8             0x61
   6345  1.1  riastrad #define _256Mx16            0x62
   6346  1.1  riastrad #define _512Mx8             0x71
   6347  1.1  riastrad 
   6348  1.1  riastrad #define SAMSUNG             0x1
   6349  1.1  riastrad #define INFINEON            0x2
   6350  1.1  riastrad #define ELPIDA              0x3
   6351  1.1  riastrad #define ETRON               0x4
   6352  1.1  riastrad #define NANYA               0x5
   6353  1.1  riastrad #define HYNIX               0x6
   6354  1.1  riastrad #define MOSEL               0x7
   6355  1.1  riastrad #define WINBOND             0x8
   6356  1.1  riastrad #define ESMT                0x9
   6357  1.1  riastrad #define MICRON              0xF
   6358  1.1  riastrad 
   6359  1.1  riastrad #define QIMONDA             INFINEON
   6360  1.1  riastrad #define PROMOS              MOSEL
   6361  1.1  riastrad #define KRETON              INFINEON
   6362  1.1  riastrad #define ELIXIR              NANYA
   6363  1.1  riastrad #define MEZZA               ELPIDA
   6364  1.1  riastrad 
   6365  1.1  riastrad 
   6366  1.1  riastrad /////////////Support for GDDR5 MC uCode to reside in upper 64K of ROM/////////////
   6367  1.1  riastrad 
   6368  1.1  riastrad #define UCODE_ROM_START_ADDRESS		0x1b800
   6369  1.1  riastrad #define	UCODE_SIGNATURE			0x4375434d // 'MCuC' - MC uCode
   6370  1.1  riastrad 
   6371  1.1  riastrad //uCode block header for reference
   6372  1.1  riastrad 
   6373  1.1  riastrad typedef struct _MCuCodeHeader
   6374  1.1  riastrad {
   6375  1.1  riastrad   ULONG  ulSignature;
   6376  1.1  riastrad   UCHAR  ucRevision;
   6377  1.1  riastrad   UCHAR  ucChecksum;
   6378  1.1  riastrad   UCHAR  ucReserved1;
   6379  1.1  riastrad   UCHAR  ucReserved2;
   6380  1.1  riastrad   USHORT usParametersLength;
   6381  1.1  riastrad   USHORT usUCodeLength;
   6382  1.1  riastrad   USHORT usReserved1;
   6383  1.1  riastrad   USHORT usReserved2;
   6384  1.1  riastrad } MCuCodeHeader;
   6385  1.1  riastrad 
   6386  1.1  riastrad //////////////////////////////////////////////////////////////////////////////////
   6387  1.1  riastrad 
   6388  1.1  riastrad #define ATOM_MAX_NUMBER_OF_VRAM_MODULE	16
   6389  1.1  riastrad 
   6390  1.1  riastrad #define ATOM_VRAM_MODULE_MEMORY_VENDOR_ID_MASK	0xF
   6391  1.1  riastrad typedef struct _ATOM_VRAM_MODULE_V1
   6392  1.1  riastrad {
   6393  1.1  riastrad   ULONG                      ulReserved;
   6394  1.1  riastrad   USHORT                     usEMRSValue;
   6395  1.1  riastrad   USHORT                     usMRSValue;
   6396  1.1  riastrad   USHORT                     usReserved;
   6397  1.1  riastrad   UCHAR                      ucExtMemoryID;     // An external indicator (by hardcode, callback or pin) to tell what is the current memory module
   6398  1.1  riastrad   UCHAR                      ucMemoryType;      // [7:4]=0x1:DDR1;=0x2:DDR2;=0x3:DDR3;=0x4:DDR4;[3:0] reserved;
   6399  1.1  riastrad   UCHAR                      ucMemoryVenderID;  // Predefined,never change across designs or memory type/vender
   6400  1.1  riastrad   UCHAR                      ucMemoryDeviceCfg; // [7:4]=0x0:4M;=0x1:8M;=0x2:16M;0x3:32M....[3:0]=0x0:x4;=0x1:x8;=0x2:x16;=0x3:x32...
   6401  1.1  riastrad   UCHAR                      ucRow;             // Number of Row,in power of 2;
   6402  1.1  riastrad   UCHAR                      ucColumn;          // Number of Column,in power of 2;
   6403  1.1  riastrad   UCHAR                      ucBank;            // Nunber of Bank;
   6404  1.1  riastrad   UCHAR                      ucRank;            // Number of Rank, in power of 2
   6405  1.1  riastrad   UCHAR                      ucChannelNum;      // Number of channel;
   6406  1.1  riastrad   UCHAR                      ucChannelConfig;   // [3:0]=Indication of what channel combination;[4:7]=Channel bit width, in number of 2
   6407  1.1  riastrad   UCHAR                      ucDefaultMVDDQ_ID; // Default MVDDQ setting for this memory block, ID linking to MVDDQ info table to find real set-up data;
   6408  1.1  riastrad   UCHAR                      ucDefaultMVDDC_ID; // Default MVDDC setting for this memory block, ID linking to MVDDC info table to find real set-up data;
   6409  1.1  riastrad   UCHAR                      ucReserved[2];
   6410  1.1  riastrad }ATOM_VRAM_MODULE_V1;
   6411  1.1  riastrad 
   6412  1.1  riastrad 
   6413  1.1  riastrad typedef struct _ATOM_VRAM_MODULE_V2
   6414  1.1  riastrad {
   6415  1.1  riastrad   ULONG                      ulReserved;
   6416  1.1  riastrad   ULONG                      ulFlags;     			// To enable/disable functionalities based on memory type
   6417  1.1  riastrad   ULONG                      ulEngineClock;     // Override of default engine clock for particular memory type
   6418  1.1  riastrad   ULONG                      ulMemoryClock;     // Override of default memory clock for particular memory type
   6419  1.1  riastrad   USHORT                     usEMRS2Value;      // EMRS2 Value is used for GDDR2 and GDDR4 memory type
   6420  1.1  riastrad   USHORT                     usEMRS3Value;      // EMRS3 Value is used for GDDR2 and GDDR4 memory type
   6421  1.1  riastrad   USHORT                     usEMRSValue;
   6422  1.1  riastrad   USHORT                     usMRSValue;
   6423  1.1  riastrad   USHORT                     usReserved;
   6424  1.1  riastrad   UCHAR                      ucExtMemoryID;     // An external indicator (by hardcode, callback or pin) to tell what is the current memory module
   6425  1.1  riastrad   UCHAR                      ucMemoryType;      // [7:4]=0x1:DDR1;=0x2:DDR2;=0x3:DDR3;=0x4:DDR4;[3:0] - must not be used for now;
   6426  1.1  riastrad   UCHAR                      ucMemoryVenderID;  // Predefined,never change across designs or memory type/vender. If not predefined, vendor detection table gets executed
   6427  1.1  riastrad   UCHAR                      ucMemoryDeviceCfg; // [7:4]=0x0:4M;=0x1:8M;=0x2:16M;0x3:32M....[3:0]=0x0:x4;=0x1:x8;=0x2:x16;=0x3:x32...
   6428  1.1  riastrad   UCHAR                      ucRow;             // Number of Row,in power of 2;
   6429  1.1  riastrad   UCHAR                      ucColumn;          // Number of Column,in power of 2;
   6430  1.1  riastrad   UCHAR                      ucBank;            // Nunber of Bank;
   6431  1.1  riastrad   UCHAR                      ucRank;            // Number of Rank, in power of 2
   6432  1.1  riastrad   UCHAR                      ucChannelNum;      // Number of channel;
   6433  1.1  riastrad   UCHAR                      ucChannelConfig;   // [3:0]=Indication of what channel combination;[4:7]=Channel bit width, in number of 2
   6434  1.1  riastrad   UCHAR                      ucDefaultMVDDQ_ID; // Default MVDDQ setting for this memory block, ID linking to MVDDQ info table to find real set-up data;
   6435  1.1  riastrad   UCHAR                      ucDefaultMVDDC_ID; // Default MVDDC setting for this memory block, ID linking to MVDDC info table to find real set-up data;
   6436  1.1  riastrad   UCHAR                      ucRefreshRateFactor;
   6437  1.1  riastrad   UCHAR                      ucReserved[3];
   6438  1.1  riastrad }ATOM_VRAM_MODULE_V2;
   6439  1.1  riastrad 
   6440  1.1  riastrad 
   6441  1.1  riastrad typedef	struct _ATOM_MEMORY_TIMING_FORMAT
   6442  1.1  riastrad {
   6443  1.1  riastrad 	ULONG											 ulClkRange;				// memory clock in 10kHz unit, when target memory clock is below this clock, use this memory timing
   6444  1.1  riastrad   union{
   6445  1.1  riastrad 	  USHORT										 usMRS;							// mode register
   6446  1.1  riastrad     USHORT                     usDDR3_MR0;
   6447  1.1  riastrad   };
   6448  1.1  riastrad   union{
   6449  1.1  riastrad 	  USHORT										 usEMRS;						// extended mode register
   6450  1.1  riastrad     USHORT                     usDDR3_MR1;
   6451  1.1  riastrad   };
   6452  1.1  riastrad 	UCHAR											 ucCL;							// CAS latency
   6453  1.1  riastrad 	UCHAR											 ucWL;							// WRITE Latency
   6454  1.1  riastrad 	UCHAR											 uctRAS;						// tRAS
   6455  1.1  riastrad 	UCHAR											 uctRC;							// tRC
   6456  1.1  riastrad 	UCHAR											 uctRFC;						// tRFC
   6457  1.1  riastrad 	UCHAR											 uctRCDR;						// tRCDR
   6458  1.1  riastrad 	UCHAR											 uctRCDW;						// tRCDW
   6459  1.1  riastrad 	UCHAR											 uctRP;							// tRP
   6460  1.1  riastrad 	UCHAR											 uctRRD;						// tRRD
   6461  1.1  riastrad 	UCHAR											 uctWR;							// tWR
   6462  1.1  riastrad 	UCHAR											 uctWTR;						// tWTR
   6463  1.1  riastrad 	UCHAR											 uctPDIX;						// tPDIX
   6464  1.1  riastrad 	UCHAR											 uctFAW;						// tFAW
   6465  1.1  riastrad 	UCHAR											 uctAOND;						// tAOND
   6466  1.1  riastrad   union
   6467  1.1  riastrad   {
   6468  1.1  riastrad     struct {
   6469  1.1  riastrad 	    UCHAR											 ucflag;						// flag to control memory timing calculation. bit0= control EMRS2 Infineon
   6470  1.1  riastrad 	    UCHAR											 ucReserved;
   6471  1.1  riastrad     };
   6472  1.1  riastrad     USHORT                   usDDR3_MR2;
   6473  1.1  riastrad   };
   6474  1.1  riastrad }ATOM_MEMORY_TIMING_FORMAT;
   6475  1.1  riastrad 
   6476  1.1  riastrad 
   6477  1.1  riastrad typedef	struct _ATOM_MEMORY_TIMING_FORMAT_V1
   6478  1.1  riastrad {
   6479  1.1  riastrad 	ULONG											 ulClkRange;				// memory clock in 10kHz unit, when target memory clock is below this clock, use this memory timing
   6480  1.1  riastrad 	USHORT										 usMRS;							// mode register
   6481  1.1  riastrad 	USHORT										 usEMRS;						// extended mode register
   6482  1.1  riastrad 	UCHAR											 ucCL;							// CAS latency
   6483  1.1  riastrad 	UCHAR											 ucWL;							// WRITE Latency
   6484  1.1  riastrad 	UCHAR											 uctRAS;						// tRAS
   6485  1.1  riastrad 	UCHAR											 uctRC;							// tRC
   6486  1.1  riastrad 	UCHAR											 uctRFC;						// tRFC
   6487  1.1  riastrad 	UCHAR											 uctRCDR;						// tRCDR
   6488  1.1  riastrad 	UCHAR											 uctRCDW;						// tRCDW
   6489  1.1  riastrad 	UCHAR											 uctRP;							// tRP
   6490  1.1  riastrad 	UCHAR											 uctRRD;						// tRRD
   6491  1.1  riastrad 	UCHAR											 uctWR;							// tWR
   6492  1.1  riastrad 	UCHAR											 uctWTR;						// tWTR
   6493  1.1  riastrad 	UCHAR											 uctPDIX;						// tPDIX
   6494  1.1  riastrad 	UCHAR											 uctFAW;						// tFAW
   6495  1.1  riastrad 	UCHAR											 uctAOND;						// tAOND
   6496  1.1  riastrad 	UCHAR											 ucflag;						// flag to control memory timing calculation. bit0= control EMRS2 Infineon
   6497  1.1  riastrad ////////////////////////////////////GDDR parameters///////////////////////////////////
   6498  1.1  riastrad 	UCHAR											 uctCCDL;						//
   6499  1.1  riastrad 	UCHAR											 uctCRCRL;						//
   6500  1.1  riastrad 	UCHAR											 uctCRCWL;						//
   6501  1.1  riastrad 	UCHAR											 uctCKE;						//
   6502  1.1  riastrad 	UCHAR											 uctCKRSE;						//
   6503  1.1  riastrad 	UCHAR											 uctCKRSX;						//
   6504  1.1  riastrad 	UCHAR											 uctFAW32;						//
   6505  1.1  riastrad 	UCHAR											 ucMR5lo;					//
   6506  1.1  riastrad 	UCHAR											 ucMR5hi;					//
   6507  1.1  riastrad 	UCHAR											 ucTerminator;
   6508  1.1  riastrad }ATOM_MEMORY_TIMING_FORMAT_V1;
   6509  1.1  riastrad 
   6510  1.1  riastrad typedef	struct _ATOM_MEMORY_TIMING_FORMAT_V2
   6511  1.1  riastrad {
   6512  1.1  riastrad 	ULONG											 ulClkRange;				// memory clock in 10kHz unit, when target memory clock is below this clock, use this memory timing
   6513  1.1  riastrad 	USHORT										 usMRS;							// mode register
   6514  1.1  riastrad 	USHORT										 usEMRS;						// extended mode register
   6515  1.1  riastrad 	UCHAR											 ucCL;							// CAS latency
   6516  1.1  riastrad 	UCHAR											 ucWL;							// WRITE Latency
   6517  1.1  riastrad 	UCHAR											 uctRAS;						// tRAS
   6518  1.1  riastrad 	UCHAR											 uctRC;							// tRC
   6519  1.1  riastrad 	UCHAR											 uctRFC;						// tRFC
   6520  1.1  riastrad 	UCHAR											 uctRCDR;						// tRCDR
   6521  1.1  riastrad 	UCHAR											 uctRCDW;						// tRCDW
   6522  1.1  riastrad 	UCHAR											 uctRP;							// tRP
   6523  1.1  riastrad 	UCHAR											 uctRRD;						// tRRD
   6524  1.1  riastrad 	UCHAR											 uctWR;							// tWR
   6525  1.1  riastrad 	UCHAR											 uctWTR;						// tWTR
   6526  1.1  riastrad 	UCHAR											 uctPDIX;						// tPDIX
   6527  1.1  riastrad 	UCHAR											 uctFAW;						// tFAW
   6528  1.1  riastrad 	UCHAR											 uctAOND;						// tAOND
   6529  1.1  riastrad 	UCHAR											 ucflag;						// flag to control memory timing calculation. bit0= control EMRS2 Infineon
   6530  1.1  riastrad ////////////////////////////////////GDDR parameters///////////////////////////////////
   6531  1.1  riastrad 	UCHAR											 uctCCDL;						//
   6532  1.1  riastrad 	UCHAR											 uctCRCRL;						//
   6533  1.1  riastrad 	UCHAR											 uctCRCWL;						//
   6534  1.1  riastrad 	UCHAR											 uctCKE;						//
   6535  1.1  riastrad 	UCHAR											 uctCKRSE;						//
   6536  1.1  riastrad 	UCHAR											 uctCKRSX;						//
   6537  1.1  riastrad 	UCHAR											 uctFAW32;						//
   6538  1.1  riastrad 	UCHAR											 ucMR4lo;					//
   6539  1.1  riastrad 	UCHAR											 ucMR4hi;					//
   6540  1.1  riastrad 	UCHAR											 ucMR5lo;					//
   6541  1.1  riastrad 	UCHAR											 ucMR5hi;					//
   6542  1.1  riastrad 	UCHAR											 ucTerminator;
   6543  1.1  riastrad 	UCHAR											 ucReserved;
   6544  1.1  riastrad }ATOM_MEMORY_TIMING_FORMAT_V2;
   6545  1.1  riastrad 
   6546  1.1  riastrad typedef	struct _ATOM_MEMORY_FORMAT
   6547  1.1  riastrad {
   6548  1.1  riastrad 	ULONG											 ulDllDisClock;			// memory DLL will be disable when target memory clock is below this clock
   6549  1.1  riastrad   union{
   6550  1.1  riastrad     USHORT                     usEMRS2Value;      // EMRS2 Value is used for GDDR2 and GDDR4 memory type
   6551  1.1  riastrad     USHORT                     usDDR3_Reserved;   // Not used for DDR3 memory
   6552  1.1  riastrad   };
   6553  1.1  riastrad   union{
   6554  1.1  riastrad     USHORT                     usEMRS3Value;      // EMRS3 Value is used for GDDR2 and GDDR4 memory type
   6555  1.1  riastrad     USHORT                     usDDR3_MR3;        // Used for DDR3 memory
   6556  1.1  riastrad   };
   6557  1.1  riastrad   UCHAR                      ucMemoryType;      // [7:4]=0x1:DDR1;=0x2:DDR2;=0x3:DDR3;=0x4:DDR4;[3:0] - must not be used for now;
   6558  1.1  riastrad   UCHAR                      ucMemoryVenderID;  // Predefined,never change across designs or memory type/vender. If not predefined, vendor detection table gets executed
   6559  1.1  riastrad   UCHAR                      ucRow;             // Number of Row,in power of 2;
   6560  1.1  riastrad   UCHAR                      ucColumn;          // Number of Column,in power of 2;
   6561  1.1  riastrad   UCHAR                      ucBank;            // Nunber of Bank;
   6562  1.1  riastrad   UCHAR                      ucRank;            // Number of Rank, in power of 2
   6563  1.1  riastrad 	UCHAR											 ucBurstSize;				// burst size, 0= burst size=4  1= burst size=8
   6564  1.1  riastrad   UCHAR                      ucDllDisBit;				// position of DLL Enable/Disable bit in EMRS ( Extended Mode Register )
   6565  1.1  riastrad   UCHAR                      ucRefreshRateFactor;	// memory refresh rate in unit of ms
   6566  1.1  riastrad 	UCHAR											 ucDensity;					// _8Mx32, _16Mx32, _16Mx16, _32Mx16
   6567  1.1  riastrad 	UCHAR											 ucPreamble;				//[7:4] Write Preamble, [3:0] Read Preamble
   6568  1.1  riastrad   UCHAR											 ucMemAttrib;				// Memory Device Addribute, like RDBI/WDBI etc
   6569  1.1  riastrad 	ATOM_MEMORY_TIMING_FORMAT	 asMemTiming[5];		//Memory Timing block sort from lower clock to higher clock
   6570  1.1  riastrad }ATOM_MEMORY_FORMAT;
   6571  1.1  riastrad 
   6572  1.1  riastrad 
   6573  1.1  riastrad typedef struct _ATOM_VRAM_MODULE_V3
   6574  1.1  riastrad {
   6575  1.1  riastrad 	ULONG											 ulChannelMapCfg;		// board dependent paramenter:Channel combination
   6576  1.1  riastrad 	USHORT										 usSize;						// size of ATOM_VRAM_MODULE_V3
   6577  1.1  riastrad   USHORT                     usDefaultMVDDQ;		// board dependent parameter:Default Memory Core Voltage
   6578  1.1  riastrad   USHORT                     usDefaultMVDDC;		// board dependent parameter:Default Memory IO Voltage
   6579  1.1  riastrad 	UCHAR                      ucExtMemoryID;     // An external indicator (by hardcode, callback or pin) to tell what is the current memory module
   6580  1.1  riastrad   UCHAR                      ucChannelNum;      // board dependent parameter:Number of channel;
   6581  1.1  riastrad 	UCHAR											 ucChannelSize;			// board dependent parameter:32bit or 64bit
   6582  1.1  riastrad 	UCHAR											 ucVREFI;						// board dependnt parameter: EXT or INT +160mv to -140mv
   6583  1.1  riastrad 	UCHAR											 ucNPL_RT;					// board dependent parameter:NPL round trip delay, used for calculate memory timing parameters
   6584  1.1  riastrad 	UCHAR											 ucFlag;						// To enable/disable functionalities based on memory type
   6585  1.1  riastrad 	ATOM_MEMORY_FORMAT				 asMemory;					// describ all of video memory parameters from memory spec
   6586  1.1  riastrad }ATOM_VRAM_MODULE_V3;
   6587  1.1  riastrad 
   6588  1.1  riastrad 
   6589  1.1  riastrad //ATOM_VRAM_MODULE_V3.ucNPL_RT
   6590  1.1  riastrad #define NPL_RT_MASK															0x0f
   6591  1.1  riastrad #define BATTERY_ODT_MASK												0xc0
   6592  1.1  riastrad 
   6593  1.1  riastrad #define ATOM_VRAM_MODULE		 ATOM_VRAM_MODULE_V3
   6594  1.1  riastrad 
   6595  1.1  riastrad typedef struct _ATOM_VRAM_MODULE_V4
   6596  1.1  riastrad {
   6597  1.1  riastrad   ULONG	  ulChannelMapCfg;	                // board dependent parameter: Channel combination
   6598  1.1  riastrad   USHORT  usModuleSize;                     // size of ATOM_VRAM_MODULE_V4, make it easy for VBIOS to look for next entry of VRAM_MODULE
   6599  1.1  riastrad   USHORT  usPrivateReserved;                // BIOS internal reserved space to optimize code size, updated by the compiler, shouldn't be modified manually!!
   6600  1.1  riastrad                                             // MC_ARB_RAMCFG (includes NOOFBANK,NOOFRANKS,NOOFROWS,NOOFCOLS)
   6601  1.1  riastrad   USHORT  usReserved;
   6602  1.1  riastrad   UCHAR   ucExtMemoryID;    		            // An external indicator (by hardcode, callback or pin) to tell what is the current memory module
   6603  1.1  riastrad   UCHAR   ucMemoryType;                     // [7:4]=0x1:DDR1;=0x2:DDR2;=0x3:DDR3;=0x4:DDR4; 0x5:DDR5 [3:0] - Must be 0x0 for now;
   6604  1.1  riastrad   UCHAR   ucChannelNum;                     // Number of channels present in this module config
   6605  1.1  riastrad   UCHAR   ucChannelWidth;                   // 0 - 32 bits; 1 - 64 bits
   6606  1.1  riastrad 	UCHAR   ucDensity;                        // _8Mx32, _16Mx32, _16Mx16, _32Mx16
   6607  1.1  riastrad 	UCHAR	  ucFlag;						                // To enable/disable functionalities based on memory type
   6608  1.1  riastrad 	UCHAR	  ucMisc;						                // bit0: 0 - single rank; 1 - dual rank;   bit2: 0 - burstlength 4, 1 - burstlength 8
   6609  1.1  riastrad   UCHAR		ucVREFI;                          // board dependent parameter
   6610  1.1  riastrad   UCHAR   ucNPL_RT;                         // board dependent parameter:NPL round trip delay, used for calculate memory timing parameters
   6611  1.1  riastrad   UCHAR		ucPreamble;                       // [7:4] Write Preamble, [3:0] Read Preamble
   6612  1.1  riastrad   UCHAR   ucMemorySize;                     // BIOS internal reserved space to optimize code size, updated by the compiler, shouldn't be modified manually!!
   6613  1.1  riastrad                                             // Total memory size in unit of 16MB for CONFIG_MEMSIZE - bit[23:0] zeros
   6614  1.1  riastrad   UCHAR   ucReserved[3];
   6615  1.1  riastrad 
   6616  1.1  riastrad //compare with V3, we flat the struct by merging ATOM_MEMORY_FORMAT (as is) into V4 as the same level
   6617  1.1  riastrad   union{
   6618  1.1  riastrad     USHORT	usEMRS2Value;                   // EMRS2 Value is used for GDDR2 and GDDR4 memory type
   6619  1.1  riastrad     USHORT  usDDR3_Reserved;
   6620  1.1  riastrad   };
   6621  1.1  riastrad   union{
   6622  1.1  riastrad     USHORT	usEMRS3Value;                   // EMRS3 Value is used for GDDR2 and GDDR4 memory type
   6623  1.1  riastrad     USHORT  usDDR3_MR3;                     // Used for DDR3 memory
   6624  1.1  riastrad   };
   6625  1.1  riastrad   UCHAR   ucMemoryVenderID;  		            // Predefined, If not predefined, vendor detection table gets executed
   6626  1.1  riastrad   UCHAR	  ucRefreshRateFactor;              // [1:0]=RefreshFactor (00=8ms, 01=16ms, 10=32ms,11=64ms)
   6627  1.1  riastrad   UCHAR   ucReserved2[2];
   6628  1.1  riastrad   ATOM_MEMORY_TIMING_FORMAT  asMemTiming[5];//Memory Timing block sort from lower clock to higher clock
   6629  1.1  riastrad }ATOM_VRAM_MODULE_V4;
   6630  1.1  riastrad 
   6631  1.1  riastrad #define VRAM_MODULE_V4_MISC_RANK_MASK       0x3
   6632  1.1  riastrad #define VRAM_MODULE_V4_MISC_DUAL_RANK       0x1
   6633  1.1  riastrad #define VRAM_MODULE_V4_MISC_BL_MASK         0x4
   6634  1.1  riastrad #define VRAM_MODULE_V4_MISC_BL8             0x4
   6635  1.1  riastrad #define VRAM_MODULE_V4_MISC_DUAL_CS         0x10
   6636  1.1  riastrad 
   6637  1.1  riastrad typedef struct _ATOM_VRAM_MODULE_V5
   6638  1.1  riastrad {
   6639  1.1  riastrad   ULONG	  ulChannelMapCfg;	                // board dependent parameter: Channel combination
   6640  1.1  riastrad   USHORT  usModuleSize;                     // size of ATOM_VRAM_MODULE_V4, make it easy for VBIOS to look for next entry of VRAM_MODULE
   6641  1.1  riastrad   USHORT  usPrivateReserved;                // BIOS internal reserved space to optimize code size, updated by the compiler, shouldn't be modified manually!!
   6642  1.1  riastrad                                             // MC_ARB_RAMCFG (includes NOOFBANK,NOOFRANKS,NOOFROWS,NOOFCOLS)
   6643  1.1  riastrad   USHORT  usReserved;
   6644  1.1  riastrad   UCHAR   ucExtMemoryID;    		            // An external indicator (by hardcode, callback or pin) to tell what is the current memory module
   6645  1.1  riastrad   UCHAR   ucMemoryType;                     // [7:4]=0x1:DDR1;=0x2:DDR2;=0x3:DDR3;=0x4:DDR4; 0x5:DDR5 [3:0] - Must be 0x0 for now;
   6646  1.1  riastrad   UCHAR   ucChannelNum;                     // Number of channels present in this module config
   6647  1.1  riastrad   UCHAR   ucChannelWidth;                   // 0 - 32 bits; 1 - 64 bits
   6648  1.1  riastrad 	UCHAR   ucDensity;                        // _8Mx32, _16Mx32, _16Mx16, _32Mx16
   6649  1.1  riastrad 	UCHAR	  ucFlag;						                // To enable/disable functionalities based on memory type
   6650  1.1  riastrad 	UCHAR	  ucMisc;						                // bit0: 0 - single rank; 1 - dual rank;   bit2: 0 - burstlength 4, 1 - burstlength 8
   6651  1.1  riastrad   UCHAR		ucVREFI;                          // board dependent parameter
   6652  1.1  riastrad   UCHAR   ucNPL_RT;                         // board dependent parameter:NPL round trip delay, used for calculate memory timing parameters
   6653  1.1  riastrad   UCHAR		ucPreamble;                       // [7:4] Write Preamble, [3:0] Read Preamble
   6654  1.1  riastrad   UCHAR   ucMemorySize;                     // BIOS internal reserved space to optimize code size, updated by the compiler, shouldn't be modified manually!!
   6655  1.1  riastrad                                             // Total memory size in unit of 16MB for CONFIG_MEMSIZE - bit[23:0] zeros
   6656  1.1  riastrad   UCHAR   ucReserved[3];
   6657  1.1  riastrad 
   6658  1.1  riastrad //compare with V3, we flat the struct by merging ATOM_MEMORY_FORMAT (as is) into V4 as the same level
   6659  1.1  riastrad   USHORT	usEMRS2Value;      		            // EMRS2 Value is used for GDDR2 and GDDR4 memory type
   6660  1.1  riastrad   USHORT	usEMRS3Value;      		            // EMRS3 Value is used for GDDR2 and GDDR4 memory type
   6661  1.1  riastrad   UCHAR   ucMemoryVenderID;  		            // Predefined, If not predefined, vendor detection table gets executed
   6662  1.1  riastrad   UCHAR	  ucRefreshRateFactor;              // [1:0]=RefreshFactor (00=8ms, 01=16ms, 10=32ms,11=64ms)
   6663  1.1  riastrad   UCHAR	  ucFIFODepth;			                // FIFO depth supposes to be detected during vendor detection, but if we dont do vendor detection we have to hardcode FIFO Depth
   6664  1.1  riastrad   UCHAR   ucCDR_Bandwidth;		   // [0:3]=Read CDR bandwidth, [4:7] - Write CDR Bandwidth
   6665  1.1  riastrad   ATOM_MEMORY_TIMING_FORMAT_V1  asMemTiming[5];//Memory Timing block sort from lower clock to higher clock
   6666  1.1  riastrad }ATOM_VRAM_MODULE_V5;
   6667  1.1  riastrad 
   6668  1.1  riastrad typedef struct _ATOM_VRAM_MODULE_V6
   6669  1.1  riastrad {
   6670  1.1  riastrad   ULONG	  ulChannelMapCfg;	                // board dependent parameter: Channel combination
   6671  1.1  riastrad   USHORT  usModuleSize;                     // size of ATOM_VRAM_MODULE_V4, make it easy for VBIOS to look for next entry of VRAM_MODULE
   6672  1.1  riastrad   USHORT  usPrivateReserved;                // BIOS internal reserved space to optimize code size, updated by the compiler, shouldn't be modified manually!!
   6673  1.1  riastrad                                             // MC_ARB_RAMCFG (includes NOOFBANK,NOOFRANKS,NOOFROWS,NOOFCOLS)
   6674  1.1  riastrad   USHORT  usReserved;
   6675  1.1  riastrad   UCHAR   ucExtMemoryID;    		            // An external indicator (by hardcode, callback or pin) to tell what is the current memory module
   6676  1.1  riastrad   UCHAR   ucMemoryType;                     // [7:4]=0x1:DDR1;=0x2:DDR2;=0x3:DDR3;=0x4:DDR4; 0x5:DDR5 [3:0] - Must be 0x0 for now;
   6677  1.1  riastrad   UCHAR   ucChannelNum;                     // Number of channels present in this module config
   6678  1.1  riastrad   UCHAR   ucChannelWidth;                   // 0 - 32 bits; 1 - 64 bits
   6679  1.1  riastrad 	UCHAR   ucDensity;                        // _8Mx32, _16Mx32, _16Mx16, _32Mx16
   6680  1.1  riastrad 	UCHAR	  ucFlag;						                // To enable/disable functionalities based on memory type
   6681  1.1  riastrad 	UCHAR	  ucMisc;						                // bit0: 0 - single rank; 1 - dual rank;   bit2: 0 - burstlength 4, 1 - burstlength 8
   6682  1.1  riastrad   UCHAR		ucVREFI;                          // board dependent parameter
   6683  1.1  riastrad   UCHAR   ucNPL_RT;                         // board dependent parameter:NPL round trip delay, used for calculate memory timing parameters
   6684  1.1  riastrad   UCHAR		ucPreamble;                       // [7:4] Write Preamble, [3:0] Read Preamble
   6685  1.1  riastrad   UCHAR   ucMemorySize;                     // BIOS internal reserved space to optimize code size, updated by the compiler, shouldn't be modified manually!!
   6686  1.1  riastrad                                             // Total memory size in unit of 16MB for CONFIG_MEMSIZE - bit[23:0] zeros
   6687  1.1  riastrad   UCHAR   ucReserved[3];
   6688  1.1  riastrad 
   6689  1.1  riastrad //compare with V3, we flat the struct by merging ATOM_MEMORY_FORMAT (as is) into V4 as the same level
   6690  1.1  riastrad   USHORT	usEMRS2Value;      		            // EMRS2 Value is used for GDDR2 and GDDR4 memory type
   6691  1.1  riastrad   USHORT	usEMRS3Value;      		            // EMRS3 Value is used for GDDR2 and GDDR4 memory type
   6692  1.1  riastrad   UCHAR   ucMemoryVenderID;  		            // Predefined, If not predefined, vendor detection table gets executed
   6693  1.1  riastrad   UCHAR	  ucRefreshRateFactor;              // [1:0]=RefreshFactor (00=8ms, 01=16ms, 10=32ms,11=64ms)
   6694  1.1  riastrad   UCHAR	  ucFIFODepth;			                // FIFO depth supposes to be detected during vendor detection, but if we dont do vendor detection we have to hardcode FIFO Depth
   6695  1.1  riastrad   UCHAR   ucCDR_Bandwidth;		   // [0:3]=Read CDR bandwidth, [4:7] - Write CDR Bandwidth
   6696  1.1  riastrad   ATOM_MEMORY_TIMING_FORMAT_V2  asMemTiming[5];//Memory Timing block sort from lower clock to higher clock
   6697  1.1  riastrad }ATOM_VRAM_MODULE_V6;
   6698  1.1  riastrad 
   6699  1.1  riastrad typedef struct _ATOM_VRAM_MODULE_V7
   6700  1.1  riastrad {
   6701  1.1  riastrad // Design Specific Values
   6702  1.1  riastrad   ULONG	  ulChannelMapCfg;	                // mmMC_SHARED_CHREMAP
   6703  1.1  riastrad   USHORT  usModuleSize;                     // Size of ATOM_VRAM_MODULE_V7
   6704  1.1  riastrad   USHORT  usPrivateReserved;                // MC_ARB_RAMCFG (includes NOOFBANK,NOOFRANKS,NOOFROWS,NOOFCOLS)
   6705  1.1  riastrad   USHORT  usEnableChannels;                 // bit vector which indicate which channels are enabled
   6706  1.1  riastrad   UCHAR   ucExtMemoryID;                    // Current memory module ID
   6707  1.1  riastrad   UCHAR   ucMemoryType;                     // MEM_TYPE_DDR2/DDR3/GDDR3/GDDR5
   6708  1.1  riastrad   UCHAR   ucChannelNum;                     // Number of mem. channels supported in this module
   6709  1.1  riastrad   UCHAR   ucChannelWidth;                   // CHANNEL_16BIT/CHANNEL_32BIT/CHANNEL_64BIT
   6710  1.1  riastrad   UCHAR   ucDensity;                        // _8Mx32, _16Mx32, _16Mx16, _32Mx16
   6711  1.1  riastrad   UCHAR	  ucReserve;                        // Former container for Mx_FLAGS like DBI_AC_MODE_ENABLE_ASIC for GDDR4. Not used now.
   6712  1.1  riastrad   UCHAR	  ucMisc;                           // RANK_OF_THISMEMORY etc.
   6713  1.1  riastrad   UCHAR	  ucVREFI;                          // Not used.
   6714  1.1  riastrad   UCHAR   ucNPL_RT;                         // Round trip delay (MC_SEQ_CAS_TIMING [28:24]:TCL=CL+NPL_RT-2). Always 2.
   6715  1.1  riastrad   UCHAR	  ucPreamble;                       // [7:4] Write Preamble, [3:0] Read Preamble
   6716  1.1  riastrad   UCHAR   ucMemorySize;                     // Total memory size in unit of 16MB for CONFIG_MEMSIZE - bit[23:0] zeros
   6717  1.1  riastrad   USHORT  usSEQSettingOffset;
   6718  1.1  riastrad   UCHAR   ucReserved;
   6719  1.1  riastrad // Memory Module specific values
   6720  1.1  riastrad   USHORT  usEMRS2Value;                     // EMRS2/MR2 Value.
   6721  1.1  riastrad   USHORT  usEMRS3Value;                     // EMRS3/MR3 Value.
   6722  1.1  riastrad   UCHAR   ucMemoryVenderID;                 // [7:4] Revision, [3:0] Vendor code
   6723  1.1  riastrad   UCHAR	  ucRefreshRateFactor;              // [1:0]=RefreshFactor (00=8ms, 01=16ms, 10=32ms,11=64ms)
   6724  1.1  riastrad   UCHAR	  ucFIFODepth;                      // FIFO depth can be detected during vendor detection, here is hardcoded per memory
   6725  1.1  riastrad   UCHAR   ucCDR_Bandwidth;                  // [0:3]=Read CDR bandwidth, [4:7] - Write CDR Bandwidth
   6726  1.1  riastrad   char    strMemPNString[20];               // part number end with '0'.
   6727  1.1  riastrad }ATOM_VRAM_MODULE_V7;
   6728  1.1  riastrad 
   6729  1.1  riastrad typedef struct _ATOM_VRAM_INFO_V2
   6730  1.1  riastrad {
   6731  1.1  riastrad   ATOM_COMMON_TABLE_HEADER   sHeader;
   6732  1.1  riastrad   UCHAR                      ucNumOfVRAMModule;
   6733  1.1  riastrad   ATOM_VRAM_MODULE           aVramInfo[ATOM_MAX_NUMBER_OF_VRAM_MODULE];      // just for allocation, real number of blocks is in ucNumOfVRAMModule;
   6734  1.1  riastrad }ATOM_VRAM_INFO_V2;
   6735  1.1  riastrad 
   6736  1.1  riastrad typedef struct _ATOM_VRAM_INFO_V3
   6737  1.1  riastrad {
   6738  1.1  riastrad   ATOM_COMMON_TABLE_HEADER   sHeader;
   6739  1.1  riastrad 	USHORT										 usMemAdjustTblOffset;													 // offset of ATOM_INIT_REG_BLOCK structure for memory vendor specific MC adjust setting
   6740  1.1  riastrad 	USHORT										 usMemClkPatchTblOffset;												 //	offset of ATOM_INIT_REG_BLOCK structure for memory clock specific MC setting
   6741  1.1  riastrad 	USHORT										 usRerseved;
   6742  1.1  riastrad 	UCHAR           	         aVID_PinsShift[9];															 // 8 bit strap maximum+terminator
   6743  1.1  riastrad   UCHAR                      ucNumOfVRAMModule;
   6744  1.1  riastrad   ATOM_VRAM_MODULE		       aVramInfo[ATOM_MAX_NUMBER_OF_VRAM_MODULE];      // just for allocation, real number of blocks is in ucNumOfVRAMModule;
   6745  1.1  riastrad 	ATOM_INIT_REG_BLOCK				 asMemPatch;																		 // for allocation
   6746  1.1  riastrad 																																						 //	ATOM_INIT_REG_BLOCK				 aMemAdjust;
   6747  1.1  riastrad }ATOM_VRAM_INFO_V3;
   6748  1.1  riastrad 
   6749  1.1  riastrad #define	ATOM_VRAM_INFO_LAST	     ATOM_VRAM_INFO_V3
   6750  1.1  riastrad 
   6751  1.1  riastrad typedef struct _ATOM_VRAM_INFO_V4
   6752  1.1  riastrad {
   6753  1.1  riastrad   ATOM_COMMON_TABLE_HEADER   sHeader;
   6754  1.1  riastrad   USHORT                     usMemAdjustTblOffset;													 // offset of ATOM_INIT_REG_BLOCK structure for memory vendor specific MC adjust setting
   6755  1.1  riastrad   USHORT                     usMemClkPatchTblOffset;												 //	offset of ATOM_INIT_REG_BLOCK structure for memory clock specific MC setting
   6756  1.1  riastrad   USHORT										 usRerseved;
   6757  1.1  riastrad   UCHAR           	         ucMemDQ7_0ByteRemap;													   // DQ line byte remap, =0: Memory Data line BYTE0, =1: BYTE1, =2: BYTE2, =3: BYTE3
   6758  1.1  riastrad   ULONG                      ulMemDQ7_0BitRemap;                             // each DQ line ( 7~0) use 3bits, like: DQ0=Bit[2:0], DQ1:[5:3], ... DQ7:[23:21]
   6759  1.1  riastrad   UCHAR                      ucReservde[4];
   6760  1.1  riastrad   UCHAR                      ucNumOfVRAMModule;
   6761  1.1  riastrad   ATOM_VRAM_MODULE_V4		     aVramInfo[ATOM_MAX_NUMBER_OF_VRAM_MODULE];      // just for allocation, real number of blocks is in ucNumOfVRAMModule;
   6762  1.1  riastrad 	ATOM_INIT_REG_BLOCK				 asMemPatch;																		 // for allocation
   6763  1.1  riastrad 																																						 //	ATOM_INIT_REG_BLOCK				 aMemAdjust;
   6764  1.1  riastrad }ATOM_VRAM_INFO_V4;
   6765  1.1  riastrad 
   6766  1.1  riastrad typedef struct _ATOM_VRAM_INFO_HEADER_V2_1
   6767  1.1  riastrad {
   6768  1.1  riastrad   ATOM_COMMON_TABLE_HEADER   sHeader;
   6769  1.1  riastrad   USHORT                     usMemAdjustTblOffset;													 // offset of ATOM_INIT_REG_BLOCK structure for memory vendor specific MC adjust setting
   6770  1.1  riastrad   USHORT                     usMemClkPatchTblOffset;												 //	offset of ATOM_INIT_REG_BLOCK structure for memory clock specific MC setting
   6771  1.1  riastrad   USHORT                     usPerBytePresetOffset;                          // offset of ATOM_INIT_REG_BLOCK structure for Per Byte Offset Preset Settings
   6772  1.1  riastrad   USHORT                     usReserved[3];
   6773  1.1  riastrad   UCHAR                      ucNumOfVRAMModule;                              // indicate number of VRAM module
   6774  1.1  riastrad   UCHAR                      ucMemoryClkPatchTblVer;                         // version of memory AC timing register list
   6775  1.1  riastrad   UCHAR                      ucVramModuleVer;                                // indicate ATOM_VRAM_MODUE version
   6776  1.1  riastrad   UCHAR                      ucReserved;
   6777  1.1  riastrad   ATOM_VRAM_MODULE_V7		     aVramInfo[ATOM_MAX_NUMBER_OF_VRAM_MODULE];      // just for allocation, real number of blocks is in ucNumOfVRAMModule;
   6778  1.1  riastrad }ATOM_VRAM_INFO_HEADER_V2_1;
   6779  1.1  riastrad 
   6780  1.1  riastrad 
   6781  1.1  riastrad typedef struct _ATOM_VRAM_GPIO_DETECTION_INFO
   6782  1.1  riastrad {
   6783  1.1  riastrad   ATOM_COMMON_TABLE_HEADER   sHeader;
   6784  1.1  riastrad   UCHAR           	         aVID_PinsShift[9];   //8 bit strap maximum+terminator
   6785  1.1  riastrad }ATOM_VRAM_GPIO_DETECTION_INFO;
   6786  1.1  riastrad 
   6787  1.1  riastrad 
   6788  1.1  riastrad typedef struct _ATOM_MEMORY_TRAINING_INFO
   6789  1.1  riastrad {
   6790  1.1  riastrad 	ATOM_COMMON_TABLE_HEADER   sHeader;
   6791  1.1  riastrad 	UCHAR											 ucTrainingLoop;
   6792  1.1  riastrad 	UCHAR											 ucReserved[3];
   6793  1.1  riastrad 	ATOM_INIT_REG_BLOCK				 asMemTrainingSetting;
   6794  1.1  riastrad }ATOM_MEMORY_TRAINING_INFO;
   6795  1.1  riastrad 
   6796  1.1  riastrad 
   6797  1.1  riastrad typedef struct SW_I2C_CNTL_DATA_PARAMETERS
   6798  1.1  riastrad {
   6799  1.1  riastrad   UCHAR    ucControl;
   6800  1.1  riastrad   UCHAR    ucData;
   6801  1.1  riastrad   UCHAR    ucSatus;
   6802  1.1  riastrad   UCHAR    ucTemp;
   6803  1.1  riastrad } SW_I2C_CNTL_DATA_PARAMETERS;
   6804  1.1  riastrad 
   6805  1.1  riastrad #define SW_I2C_CNTL_DATA_PS_ALLOCATION  SW_I2C_CNTL_DATA_PARAMETERS
   6806  1.1  riastrad 
   6807  1.1  riastrad typedef struct _SW_I2C_IO_DATA_PARAMETERS
   6808  1.1  riastrad {
   6809  1.1  riastrad   USHORT   GPIO_Info;
   6810  1.1  riastrad   UCHAR    ucAct;
   6811  1.1  riastrad   UCHAR    ucData;
   6812  1.1  riastrad  } SW_I2C_IO_DATA_PARAMETERS;
   6813  1.1  riastrad 
   6814  1.1  riastrad #define SW_I2C_IO_DATA_PS_ALLOCATION  SW_I2C_IO_DATA_PARAMETERS
   6815  1.1  riastrad 
   6816  1.1  riastrad /****************************SW I2C CNTL DEFINITIONS**********************/
   6817  1.1  riastrad #define SW_I2C_IO_RESET       0
   6818  1.1  riastrad #define SW_I2C_IO_GET         1
   6819  1.1  riastrad #define SW_I2C_IO_DRIVE       2
   6820  1.1  riastrad #define SW_I2C_IO_SET         3
   6821  1.1  riastrad #define SW_I2C_IO_START       4
   6822  1.1  riastrad 
   6823  1.1  riastrad #define SW_I2C_IO_CLOCK       0
   6824  1.1  riastrad #define SW_I2C_IO_DATA        0x80
   6825  1.1  riastrad 
   6826  1.1  riastrad #define SW_I2C_IO_ZERO        0
   6827  1.1  riastrad #define SW_I2C_IO_ONE         0x100
   6828  1.1  riastrad 
   6829  1.1  riastrad #define SW_I2C_CNTL_READ      0
   6830  1.1  riastrad #define SW_I2C_CNTL_WRITE     1
   6831  1.1  riastrad #define SW_I2C_CNTL_START     2
   6832  1.1  riastrad #define SW_I2C_CNTL_STOP      3
   6833  1.1  riastrad #define SW_I2C_CNTL_OPEN      4
   6834  1.1  riastrad #define SW_I2C_CNTL_CLOSE     5
   6835  1.1  riastrad #define SW_I2C_CNTL_WRITE1BIT 6
   6836  1.1  riastrad 
   6837  1.1  riastrad //==============================VESA definition Portion===============================
   6838  1.1  riastrad #define VESA_OEM_PRODUCT_REV			            "01.00"
   6839  1.1  riastrad #define VESA_MODE_ATTRIBUTE_MODE_SUPPORT	     0xBB	//refer to VBE spec p.32, no TTY support
   6840  1.1  riastrad #define VESA_MODE_WIN_ATTRIBUTE						     7
   6841  1.1  riastrad #define VESA_WIN_SIZE											     64
   6842  1.1  riastrad 
   6843  1.1  riastrad typedef struct _PTR_32_BIT_STRUCTURE
   6844  1.1  riastrad {
   6845  1.1  riastrad 	USHORT	Offset16;
   6846  1.1  riastrad 	USHORT	Segment16;
   6847  1.1  riastrad } PTR_32_BIT_STRUCTURE;
   6848  1.1  riastrad 
   6849  1.1  riastrad typedef union _PTR_32_BIT_UNION
   6850  1.1  riastrad {
   6851  1.1  riastrad 	PTR_32_BIT_STRUCTURE	SegmentOffset;
   6852  1.1  riastrad 	ULONG					        Ptr32_Bit;
   6853  1.1  riastrad } PTR_32_BIT_UNION;
   6854  1.1  riastrad 
   6855  1.1  riastrad typedef struct _VBE_1_2_INFO_BLOCK_UPDATABLE
   6856  1.1  riastrad {
   6857  1.1  riastrad 	UCHAR				      VbeSignature[4];
   6858  1.1  riastrad 	USHORT				    VbeVersion;
   6859  1.1  riastrad 	PTR_32_BIT_UNION	OemStringPtr;
   6860  1.1  riastrad 	UCHAR				      Capabilities[4];
   6861  1.1  riastrad 	PTR_32_BIT_UNION	VideoModePtr;
   6862  1.1  riastrad 	USHORT				    TotalMemory;
   6863  1.1  riastrad } VBE_1_2_INFO_BLOCK_UPDATABLE;
   6864  1.1  riastrad 
   6865  1.1  riastrad 
   6866  1.1  riastrad typedef struct _VBE_2_0_INFO_BLOCK_UPDATABLE
   6867  1.1  riastrad {
   6868  1.1  riastrad 	VBE_1_2_INFO_BLOCK_UPDATABLE	CommonBlock;
   6869  1.1  riastrad 	USHORT							    OemSoftRev;
   6870  1.1  riastrad 	PTR_32_BIT_UNION				OemVendorNamePtr;
   6871  1.1  riastrad 	PTR_32_BIT_UNION				OemProductNamePtr;
   6872  1.1  riastrad 	PTR_32_BIT_UNION				OemProductRevPtr;
   6873  1.1  riastrad } VBE_2_0_INFO_BLOCK_UPDATABLE;
   6874  1.1  riastrad 
   6875  1.1  riastrad typedef union _VBE_VERSION_UNION
   6876  1.1  riastrad {
   6877  1.1  riastrad 	VBE_2_0_INFO_BLOCK_UPDATABLE	VBE_2_0_InfoBlock;
   6878  1.1  riastrad 	VBE_1_2_INFO_BLOCK_UPDATABLE	VBE_1_2_InfoBlock;
   6879  1.1  riastrad } VBE_VERSION_UNION;
   6880  1.1  riastrad 
   6881  1.1  riastrad typedef struct _VBE_INFO_BLOCK
   6882  1.1  riastrad {
   6883  1.1  riastrad 	VBE_VERSION_UNION			UpdatableVBE_Info;
   6884  1.1  riastrad 	UCHAR						      Reserved[222];
   6885  1.1  riastrad 	UCHAR						      OemData[256];
   6886  1.1  riastrad } VBE_INFO_BLOCK;
   6887  1.1  riastrad 
   6888  1.1  riastrad typedef struct _VBE_FP_INFO
   6889  1.1  riastrad {
   6890  1.1  riastrad   USHORT	HSize;
   6891  1.1  riastrad 	USHORT	VSize;
   6892  1.1  riastrad 	USHORT	FPType;
   6893  1.1  riastrad 	UCHAR		RedBPP;
   6894  1.1  riastrad 	UCHAR		GreenBPP;
   6895  1.1  riastrad 	UCHAR		BlueBPP;
   6896  1.1  riastrad 	UCHAR		ReservedBPP;
   6897  1.1  riastrad 	ULONG		RsvdOffScrnMemSize;
   6898  1.1  riastrad 	ULONG		RsvdOffScrnMEmPtr;
   6899  1.1  riastrad 	UCHAR		Reserved[14];
   6900  1.1  riastrad } VBE_FP_INFO;
   6901  1.1  riastrad 
   6902  1.1  riastrad typedef struct _VESA_MODE_INFO_BLOCK
   6903  1.1  riastrad {
   6904  1.1  riastrad // Mandatory information for all VBE revisions
   6905  1.1  riastrad   USHORT    ModeAttributes;  //			dw	?	; mode attributes
   6906  1.1  riastrad 	UCHAR     WinAAttributes;  //			db	?	; window A attributes
   6907  1.1  riastrad 	UCHAR     WinBAttributes;  //			db	?	; window B attributes
   6908  1.1  riastrad 	USHORT    WinGranularity;  //			dw	?	; window granularity
   6909  1.1  riastrad 	USHORT    WinSize;         //			dw	?	; window size
   6910  1.1  riastrad 	USHORT    WinASegment;     //			dw	?	; window A start segment
   6911  1.1  riastrad 	USHORT    WinBSegment;     //			dw	?	; window B start segment
   6912  1.1  riastrad 	ULONG     WinFuncPtr;      //			dd	?	; real mode pointer to window function
   6913  1.1  riastrad 	USHORT    BytesPerScanLine;//			dw	?	; bytes per scan line
   6914  1.1  riastrad 
   6915  1.1  riastrad //; Mandatory information for VBE 1.2 and above
   6916  1.1  riastrad   USHORT    XResolution;      //			dw	?	; horizontal resolution in pixels or characters
   6917  1.1  riastrad 	USHORT    YResolution;      //			dw	?	; vertical resolution in pixels or characters
   6918  1.1  riastrad 	UCHAR     XCharSize;        //			db	?	; character cell width in pixels
   6919  1.1  riastrad 	UCHAR     YCharSize;        //			db	?	; character cell height in pixels
   6920  1.1  riastrad 	UCHAR     NumberOfPlanes;   //			db	?	; number of memory planes
   6921  1.1  riastrad 	UCHAR     BitsPerPixel;     //			db	?	; bits per pixel
   6922  1.1  riastrad 	UCHAR     NumberOfBanks;    //			db	?	; number of banks
   6923  1.1  riastrad 	UCHAR     MemoryModel;      //			db	?	; memory model type
   6924  1.1  riastrad 	UCHAR     BankSize;         //			db	?	; bank size in KB
   6925  1.1  riastrad 	UCHAR     NumberOfImagePages;//		  db	?	; number of images
   6926  1.1  riastrad 	UCHAR     ReservedForPageFunction;//db	1	; reserved for page function
   6927  1.1  riastrad 
   6928  1.1  riastrad //; Direct Color fields(required for direct/6 and YUV/7 memory models)
   6929  1.1  riastrad 	UCHAR			RedMaskSize;        //		db	?	; size of direct color red mask in bits
   6930  1.1  riastrad 	UCHAR			RedFieldPosition;   //		db	?	; bit position of lsb of red mask
   6931  1.1  riastrad 	UCHAR			GreenMaskSize;      //		db	?	; size of direct color green mask in bits
   6932  1.1  riastrad 	UCHAR			GreenFieldPosition; //		db	?	; bit position of lsb of green mask
   6933  1.1  riastrad 	UCHAR			BlueMaskSize;       //		db	?	; size of direct color blue mask in bits
   6934  1.1  riastrad 	UCHAR			BlueFieldPosition;  //		db	?	; bit position of lsb of blue mask
   6935  1.1  riastrad 	UCHAR			RsvdMaskSize;       //		db	?	; size of direct color reserved mask in bits
   6936  1.1  riastrad 	UCHAR			RsvdFieldPosition;  //		db	?	; bit position of lsb of reserved mask
   6937  1.1  riastrad 	UCHAR			DirectColorModeInfo;//		db	?	; direct color mode attributes
   6938  1.1  riastrad 
   6939  1.1  riastrad //; Mandatory information for VBE 2.0 and above
   6940  1.1  riastrad 	ULONG			PhysBasePtr;        //		dd	?	; physical address for flat memory frame buffer
   6941  1.1  riastrad 	ULONG			Reserved_1;         //		dd	0	; reserved - always set to 0
   6942  1.1  riastrad 	USHORT		Reserved_2;         //	  dw	0	; reserved - always set to 0
   6943  1.1  riastrad 
   6944  1.1  riastrad //; Mandatory information for VBE 3.0 and above
   6945  1.1  riastrad 	USHORT		LinBytesPerScanLine;  //	dw	?	; bytes per scan line for linear modes
   6946  1.1  riastrad 	UCHAR			BnkNumberOfImagePages;//	db	?	; number of images for banked modes
   6947  1.1  riastrad 	UCHAR			LinNumberOfImagPages; //	db	?	; number of images for linear modes
   6948  1.1  riastrad 	UCHAR			LinRedMaskSize;       //	db	?	; size of direct color red mask(linear modes)
   6949  1.1  riastrad 	UCHAR			LinRedFieldPosition;  //	db	?	; bit position of lsb of red mask(linear modes)
   6950  1.1  riastrad 	UCHAR			LinGreenMaskSize;     //	db	?	; size of direct color green mask(linear modes)
   6951  1.1  riastrad 	UCHAR			LinGreenFieldPosition;//	db	?	; bit position of lsb of green mask(linear modes)
   6952  1.1  riastrad 	UCHAR			LinBlueMaskSize;      //	db	?	; size of direct color blue mask(linear modes)
   6953  1.1  riastrad 	UCHAR			LinBlueFieldPosition; //	db	?	; bit position of lsb of blue mask(linear modes)
   6954  1.1  riastrad 	UCHAR			LinRsvdMaskSize;      //	db	?	; size of direct color reserved mask(linear modes)
   6955  1.1  riastrad 	UCHAR			LinRsvdFieldPosition; //	db	?	; bit position of lsb of reserved mask(linear modes)
   6956  1.1  riastrad 	ULONG			MaxPixelClock;        //	dd	?	; maximum pixel clock(in Hz) for graphics mode
   6957  1.1  riastrad 	UCHAR			Reserved;             //	db	190 dup (0)
   6958  1.1  riastrad } VESA_MODE_INFO_BLOCK;
   6959  1.1  riastrad 
   6960  1.1  riastrad // BIOS function CALLS
   6961  1.1  riastrad #define ATOM_BIOS_EXTENDED_FUNCTION_CODE        0xA0	        // ATI Extended Function code
   6962  1.1  riastrad #define ATOM_BIOS_FUNCTION_COP_MODE             0x00
   6963  1.1  riastrad #define ATOM_BIOS_FUNCTION_SHORT_QUERY1         0x04
   6964  1.1  riastrad #define ATOM_BIOS_FUNCTION_SHORT_QUERY2         0x05
   6965  1.1  riastrad #define ATOM_BIOS_FUNCTION_SHORT_QUERY3         0x06
   6966  1.1  riastrad #define ATOM_BIOS_FUNCTION_GET_DDC              0x0B
   6967  1.1  riastrad #define ATOM_BIOS_FUNCTION_ASIC_DSTATE          0x0E
   6968  1.1  riastrad #define ATOM_BIOS_FUNCTION_DEBUG_PLAY           0x0F
   6969  1.1  riastrad #define ATOM_BIOS_FUNCTION_STV_STD              0x16
   6970  1.1  riastrad #define ATOM_BIOS_FUNCTION_DEVICE_DET           0x17
   6971  1.1  riastrad #define ATOM_BIOS_FUNCTION_DEVICE_SWITCH        0x18
   6972  1.1  riastrad 
   6973  1.1  riastrad #define ATOM_BIOS_FUNCTION_PANEL_CONTROL        0x82
   6974  1.1  riastrad #define ATOM_BIOS_FUNCTION_OLD_DEVICE_DET       0x83
   6975  1.1  riastrad #define ATOM_BIOS_FUNCTION_OLD_DEVICE_SWITCH    0x84
   6976  1.1  riastrad #define ATOM_BIOS_FUNCTION_HW_ICON              0x8A
   6977  1.1  riastrad #define ATOM_BIOS_FUNCTION_SET_CMOS             0x8B
   6978  1.1  riastrad #define SUB_FUNCTION_UPDATE_DISPLAY_INFO        0x8000          // Sub function 80
   6979  1.1  riastrad #define SUB_FUNCTION_UPDATE_EXPANSION_INFO      0x8100          // Sub function 80
   6980  1.1  riastrad 
   6981  1.1  riastrad #define ATOM_BIOS_FUNCTION_DISPLAY_INFO         0x8D
   6982  1.1  riastrad #define ATOM_BIOS_FUNCTION_DEVICE_ON_OFF        0x8E
   6983  1.1  riastrad #define ATOM_BIOS_FUNCTION_VIDEO_STATE          0x8F
   6984  1.1  riastrad #define ATOM_SUB_FUNCTION_GET_CRITICAL_STATE    0x0300          // Sub function 03
   6985  1.1  riastrad #define ATOM_SUB_FUNCTION_GET_LIDSTATE          0x0700          // Sub function 7
   6986  1.1  riastrad #define ATOM_SUB_FUNCTION_THERMAL_STATE_NOTICE  0x1400          // Notify caller the current thermal state
   6987  1.1  riastrad #define ATOM_SUB_FUNCTION_CRITICAL_STATE_NOTICE 0x8300          // Notify caller the current critical state
   6988  1.1  riastrad #define ATOM_SUB_FUNCTION_SET_LIDSTATE          0x8500          // Sub function 85
   6989  1.1  riastrad #define ATOM_SUB_FUNCTION_GET_REQ_DISPLAY_FROM_SBIOS_MODE 0x8900// Sub function 89
   6990  1.1  riastrad #define ATOM_SUB_FUNCTION_INFORM_ADC_SUPPORT    0x9400          // Notify caller that ADC is supported
   6991  1.1  riastrad 
   6992  1.1  riastrad 
   6993  1.1  riastrad #define ATOM_BIOS_FUNCTION_VESA_DPMS            0x4F10          // Set DPMS
   6994  1.1  riastrad #define ATOM_SUB_FUNCTION_SET_DPMS              0x0001          // BL: Sub function 01
   6995  1.1  riastrad #define ATOM_SUB_FUNCTION_GET_DPMS              0x0002          // BL: Sub function 02
   6996  1.1  riastrad #define ATOM_PARAMETER_VESA_DPMS_ON             0x0000          // BH Parameter for DPMS ON.
   6997  1.1  riastrad #define ATOM_PARAMETER_VESA_DPMS_STANDBY        0x0100          // BH Parameter for DPMS STANDBY
   6998  1.1  riastrad #define ATOM_PARAMETER_VESA_DPMS_SUSPEND        0x0200          // BH Parameter for DPMS SUSPEND
   6999  1.1  riastrad #define ATOM_PARAMETER_VESA_DPMS_OFF            0x0400          // BH Parameter for DPMS OFF
   7000  1.1  riastrad #define ATOM_PARAMETER_VESA_DPMS_REDUCE_ON      0x0800          // BH Parameter for DPMS REDUCE ON (NOT SUPPORTED)
   7001  1.1  riastrad 
   7002  1.1  riastrad #define ATOM_BIOS_RETURN_CODE_MASK              0x0000FF00L
   7003  1.1  riastrad #define ATOM_BIOS_REG_HIGH_MASK                 0x0000FF00L
   7004  1.1  riastrad #define ATOM_BIOS_REG_LOW_MASK                  0x000000FFL
   7005  1.1  riastrad 
   7006  1.1  riastrad // structure used for VBIOS only
   7007  1.1  riastrad 
   7008  1.1  riastrad //DispOutInfoTable
   7009  1.1  riastrad typedef struct _ASIC_TRANSMITTER_INFO
   7010  1.1  riastrad {
   7011  1.1  riastrad 	USHORT usTransmitterObjId;
   7012  1.1  riastrad 	USHORT usSupportDevice;
   7013  1.1  riastrad   UCHAR  ucTransmitterCmdTblId;
   7014  1.1  riastrad 	UCHAR  ucConfig;
   7015  1.1  riastrad 	UCHAR  ucEncoderID;					 //available 1st encoder ( default )
   7016  1.1  riastrad 	UCHAR  ucOptionEncoderID;    //available 2nd encoder ( optional )
   7017  1.1  riastrad 	UCHAR  uc2ndEncoderID;
   7018  1.1  riastrad 	UCHAR  ucReserved;
   7019  1.1  riastrad }ASIC_TRANSMITTER_INFO;
   7020  1.1  riastrad 
   7021  1.1  riastrad #define ASIC_TRANSMITTER_INFO_CONFIG__DVO_SDR_MODE          0x01
   7022  1.1  riastrad #define ASIC_TRANSMITTER_INFO_CONFIG__COHERENT_MODE         0x02
   7023  1.1  riastrad #define ASIC_TRANSMITTER_INFO_CONFIG__ENCODEROBJ_ID_MASK    0xc4
   7024  1.1  riastrad #define ASIC_TRANSMITTER_INFO_CONFIG__ENCODER_A             0x00
   7025  1.1  riastrad #define ASIC_TRANSMITTER_INFO_CONFIG__ENCODER_B             0x04
   7026  1.1  riastrad #define ASIC_TRANSMITTER_INFO_CONFIG__ENCODER_C             0x40
   7027  1.1  riastrad #define ASIC_TRANSMITTER_INFO_CONFIG__ENCODER_D             0x44
   7028  1.1  riastrad #define ASIC_TRANSMITTER_INFO_CONFIG__ENCODER_E             0x80
   7029  1.1  riastrad #define ASIC_TRANSMITTER_INFO_CONFIG__ENCODER_F             0x84
   7030  1.1  riastrad 
   7031  1.1  riastrad typedef struct _ASIC_ENCODER_INFO
   7032  1.1  riastrad {
   7033  1.1  riastrad 	UCHAR ucEncoderID;
   7034  1.1  riastrad 	UCHAR ucEncoderConfig;
   7035  1.1  riastrad   USHORT usEncoderCmdTblId;
   7036  1.1  riastrad }ASIC_ENCODER_INFO;
   7037  1.1  riastrad 
   7038  1.1  riastrad typedef struct _ATOM_DISP_OUT_INFO
   7039  1.1  riastrad {
   7040  1.1  riastrad   ATOM_COMMON_TABLE_HEADER sHeader;
   7041  1.1  riastrad 	USHORT ptrTransmitterInfo;
   7042  1.1  riastrad 	USHORT ptrEncoderInfo;
   7043  1.1  riastrad 	ASIC_TRANSMITTER_INFO  asTransmitterInfo[1];
   7044  1.1  riastrad 	ASIC_ENCODER_INFO      asEncoderInfo[1];
   7045  1.1  riastrad }ATOM_DISP_OUT_INFO;
   7046  1.1  riastrad 
   7047  1.1  riastrad typedef struct _ATOM_DISP_OUT_INFO_V2
   7048  1.1  riastrad {
   7049  1.1  riastrad   ATOM_COMMON_TABLE_HEADER sHeader;
   7050  1.1  riastrad 	USHORT ptrTransmitterInfo;
   7051  1.1  riastrad 	USHORT ptrEncoderInfo;
   7052  1.1  riastrad   USHORT ptrMainCallParserFar;                  // direct address of main parser call in VBIOS binary.
   7053  1.1  riastrad 	ASIC_TRANSMITTER_INFO  asTransmitterInfo[1];
   7054  1.1  riastrad 	ASIC_ENCODER_INFO      asEncoderInfo[1];
   7055  1.1  riastrad }ATOM_DISP_OUT_INFO_V2;
   7056  1.1  riastrad 
   7057  1.1  riastrad 
   7058  1.1  riastrad typedef struct _ATOM_DISP_CLOCK_ID {
   7059  1.1  riastrad   UCHAR ucPpllId;
   7060  1.1  riastrad   UCHAR ucPpllAttribute;
   7061  1.1  riastrad }ATOM_DISP_CLOCK_ID;
   7062  1.1  riastrad 
   7063  1.1  riastrad // ucPpllAttribute
   7064  1.1  riastrad #define CLOCK_SOURCE_SHAREABLE            0x01
   7065  1.1  riastrad #define CLOCK_SOURCE_DP_MODE              0x02
   7066  1.1  riastrad #define CLOCK_SOURCE_NONE_DP_MODE         0x04
   7067  1.1  riastrad 
   7068  1.1  riastrad //DispOutInfoTable
   7069  1.1  riastrad typedef struct _ASIC_TRANSMITTER_INFO_V2
   7070  1.1  riastrad {
   7071  1.1  riastrad 	USHORT usTransmitterObjId;
   7072  1.1  riastrad 	USHORT usDispClkIdOffset;    // point to clock source id list supported by Encoder Object
   7073  1.1  riastrad   UCHAR  ucTransmitterCmdTblId;
   7074  1.1  riastrad 	UCHAR  ucConfig;
   7075  1.1  riastrad 	UCHAR  ucEncoderID;					 // available 1st encoder ( default )
   7076  1.1  riastrad 	UCHAR  ucOptionEncoderID;    // available 2nd encoder ( optional )
   7077  1.1  riastrad 	UCHAR  uc2ndEncoderID;
   7078  1.1  riastrad 	UCHAR  ucReserved;
   7079  1.1  riastrad }ASIC_TRANSMITTER_INFO_V2;
   7080  1.1  riastrad 
   7081  1.1  riastrad typedef struct _ATOM_DISP_OUT_INFO_V3
   7082  1.1  riastrad {
   7083  1.1  riastrad   ATOM_COMMON_TABLE_HEADER sHeader;
   7084  1.1  riastrad 	USHORT ptrTransmitterInfo;
   7085  1.1  riastrad 	USHORT ptrEncoderInfo;
   7086  1.1  riastrad   USHORT ptrMainCallParserFar;                  // direct address of main parser call in VBIOS binary.
   7087  1.1  riastrad   USHORT usReserved;
   7088  1.1  riastrad   UCHAR  ucDCERevision;
   7089  1.1  riastrad   UCHAR  ucMaxDispEngineNum;
   7090  1.1  riastrad   UCHAR  ucMaxActiveDispEngineNum;
   7091  1.1  riastrad   UCHAR  ucMaxPPLLNum;
   7092  1.1  riastrad   UCHAR  ucCoreRefClkSource;                    // value of CORE_REF_CLK_SOURCE
   7093  1.1  riastrad   UCHAR  ucDispCaps;
   7094  1.1  riastrad   UCHAR  ucReserved[2];
   7095  1.1  riastrad   ASIC_TRANSMITTER_INFO_V2  asTransmitterInfo[1];     // for alligment only
   7096  1.1  riastrad }ATOM_DISP_OUT_INFO_V3;
   7097  1.1  riastrad 
   7098  1.1  riastrad //ucDispCaps
   7099  1.1  riastrad #define DISPLAY_CAPS__DP_PCLK_FROM_PPLL        0x01
   7100  1.1  riastrad #define DISPLAY_CAPS__FORCE_DISPDEV_CONNECTED  0x02
   7101  1.1  riastrad 
   7102  1.1  riastrad typedef enum CORE_REF_CLK_SOURCE{
   7103  1.1  riastrad   CLOCK_SRC_XTALIN=0,
   7104  1.1  riastrad   CLOCK_SRC_XO_IN=1,
   7105  1.1  riastrad   CLOCK_SRC_XO_IN2=2,
   7106  1.1  riastrad }CORE_REF_CLK_SOURCE;
   7107  1.1  riastrad 
   7108  1.1  riastrad // DispDevicePriorityInfo
   7109  1.1  riastrad typedef struct _ATOM_DISPLAY_DEVICE_PRIORITY_INFO
   7110  1.1  riastrad {
   7111  1.1  riastrad   ATOM_COMMON_TABLE_HEADER sHeader;
   7112  1.1  riastrad 	USHORT asDevicePriority[16];
   7113  1.1  riastrad }ATOM_DISPLAY_DEVICE_PRIORITY_INFO;
   7114  1.1  riastrad 
   7115  1.1  riastrad //ProcessAuxChannelTransactionTable
   7116  1.1  riastrad typedef struct _PROCESS_AUX_CHANNEL_TRANSACTION_PARAMETERS
   7117  1.1  riastrad {
   7118  1.1  riastrad 	USHORT	lpAuxRequest;
   7119  1.1  riastrad 	USHORT  lpDataOut;
   7120  1.1  riastrad 	UCHAR		ucChannelID;
   7121  1.1  riastrad 	union
   7122  1.1  riastrad 	{
   7123  1.1  riastrad   UCHAR   ucReplyStatus;
   7124  1.1  riastrad 	UCHAR   ucDelay;
   7125  1.1  riastrad 	};
   7126  1.1  riastrad   UCHAR   ucDataOutLen;
   7127  1.1  riastrad 	UCHAR   ucReserved;
   7128  1.1  riastrad }PROCESS_AUX_CHANNEL_TRANSACTION_PARAMETERS;
   7129  1.1  riastrad 
   7130  1.1  riastrad //ProcessAuxChannelTransactionTable
   7131  1.1  riastrad typedef struct _PROCESS_AUX_CHANNEL_TRANSACTION_PARAMETERS_V2
   7132  1.1  riastrad {
   7133  1.1  riastrad 	USHORT	lpAuxRequest;
   7134  1.1  riastrad 	USHORT  lpDataOut;
   7135  1.1  riastrad 	UCHAR		ucChannelID;
   7136  1.1  riastrad 	union
   7137  1.1  riastrad 	{
   7138  1.1  riastrad   UCHAR   ucReplyStatus;
   7139  1.1  riastrad 	UCHAR   ucDelay;
   7140  1.1  riastrad 	};
   7141  1.1  riastrad   UCHAR   ucDataOutLen;
   7142  1.1  riastrad 	UCHAR   ucHPD_ID;                                       //=0: HPD1, =1: HPD2, =2: HPD3, =3: HPD4, =4: HPD5, =5: HPD6
   7143  1.1  riastrad }PROCESS_AUX_CHANNEL_TRANSACTION_PARAMETERS_V2;
   7144  1.1  riastrad 
   7145  1.1  riastrad #define PROCESS_AUX_CHANNEL_TRANSACTION_PS_ALLOCATION			PROCESS_AUX_CHANNEL_TRANSACTION_PARAMETERS
   7146  1.1  riastrad 
   7147  1.1  riastrad //GetSinkType
   7148  1.1  riastrad 
   7149  1.1  riastrad typedef struct _DP_ENCODER_SERVICE_PARAMETERS
   7150  1.1  riastrad {
   7151  1.1  riastrad 	USHORT ucLinkClock;
   7152  1.1  riastrad 	union
   7153  1.1  riastrad 	{
   7154  1.1  riastrad 	UCHAR ucConfig;				// for DP training command
   7155  1.1  riastrad 	UCHAR ucI2cId;				// use for GET_SINK_TYPE command
   7156  1.1  riastrad 	};
   7157  1.1  riastrad 	UCHAR ucAction;
   7158  1.1  riastrad 	UCHAR ucStatus;
   7159  1.1  riastrad 	UCHAR ucLaneNum;
   7160  1.1  riastrad 	UCHAR ucReserved[2];
   7161  1.1  riastrad }DP_ENCODER_SERVICE_PARAMETERS;
   7162  1.1  riastrad 
   7163  1.1  riastrad // ucAction
   7164  1.1  riastrad #define ATOM_DP_ACTION_GET_SINK_TYPE							0x01
   7165  1.1  riastrad /* obselete */
   7166  1.1  riastrad #define ATOM_DP_ACTION_TRAINING_START							0x02
   7167  1.1  riastrad #define ATOM_DP_ACTION_TRAINING_COMPLETE					0x03
   7168  1.1  riastrad #define ATOM_DP_ACTION_TRAINING_PATTERN_SEL				0x04
   7169  1.1  riastrad #define ATOM_DP_ACTION_SET_VSWING_PREEMP					0x05
   7170  1.1  riastrad #define ATOM_DP_ACTION_GET_VSWING_PREEMP					0x06
   7171  1.1  riastrad #define ATOM_DP_ACTION_BLANKING                   0x07
   7172  1.1  riastrad 
   7173  1.1  riastrad // ucConfig
   7174  1.1  riastrad #define ATOM_DP_CONFIG_ENCODER_SEL_MASK						0x03
   7175  1.1  riastrad #define ATOM_DP_CONFIG_DIG1_ENCODER								0x00
   7176  1.1  riastrad #define ATOM_DP_CONFIG_DIG2_ENCODER								0x01
   7177  1.1  riastrad #define ATOM_DP_CONFIG_EXTERNAL_ENCODER						0x02
   7178  1.1  riastrad #define ATOM_DP_CONFIG_LINK_SEL_MASK							0x04
   7179  1.1  riastrad #define ATOM_DP_CONFIG_LINK_A											0x00
   7180  1.1  riastrad #define ATOM_DP_CONFIG_LINK_B											0x04
   7181  1.1  riastrad /* /obselete */
   7182  1.1  riastrad #define DP_ENCODER_SERVICE_PS_ALLOCATION				WRITE_ONE_BYTE_HW_I2C_DATA_PARAMETERS
   7183  1.1  riastrad 
   7184  1.1  riastrad 
   7185  1.1  riastrad typedef struct _DP_ENCODER_SERVICE_PARAMETERS_V2
   7186  1.1  riastrad {
   7187  1.1  riastrad 	USHORT usExtEncoderObjId;   // External Encoder Object Id, output parameter only, use when ucAction = DP_SERVICE_V2_ACTION_DET_EXT_CONNECTION
   7188  1.1  riastrad   UCHAR  ucAuxId;
   7189  1.1  riastrad   UCHAR  ucAction;
   7190  1.1  riastrad   UCHAR  ucSinkType;          // Iput and Output parameters.
   7191  1.1  riastrad   UCHAR  ucHPDId;             // Input parameter, used when ucAction = DP_SERVICE_V2_ACTION_DET_EXT_CONNECTION
   7192  1.1  riastrad 	UCHAR  ucReserved[2];
   7193  1.1  riastrad }DP_ENCODER_SERVICE_PARAMETERS_V2;
   7194  1.1  riastrad 
   7195  1.1  riastrad typedef struct _DP_ENCODER_SERVICE_PS_ALLOCATION_V2
   7196  1.1  riastrad {
   7197  1.1  riastrad   DP_ENCODER_SERVICE_PARAMETERS_V2 asDPServiceParam;
   7198  1.1  riastrad   PROCESS_AUX_CHANNEL_TRANSACTION_PARAMETERS_V2 asAuxParam;
   7199  1.1  riastrad }DP_ENCODER_SERVICE_PS_ALLOCATION_V2;
   7200  1.1  riastrad 
   7201  1.1  riastrad // ucAction
   7202  1.1  riastrad #define DP_SERVICE_V2_ACTION_GET_SINK_TYPE							0x01
   7203  1.1  riastrad #define DP_SERVICE_V2_ACTION_DET_LCD_CONNECTION			    0x02
   7204  1.1  riastrad 
   7205  1.1  riastrad 
   7206  1.1  riastrad // DP_TRAINING_TABLE
   7207  1.1  riastrad #define DPCD_SET_LINKRATE_LANENUM_PATTERN1_TBL_ADDR				ATOM_DP_TRAINING_TBL_ADDR
   7208  1.1  riastrad #define DPCD_SET_SS_CNTL_TBL_ADDR													(ATOM_DP_TRAINING_TBL_ADDR + 8 )
   7209  1.1  riastrad #define DPCD_SET_LANE_VSWING_PREEMP_TBL_ADDR							(ATOM_DP_TRAINING_TBL_ADDR + 16 )
   7210  1.1  riastrad #define DPCD_SET_TRAINING_PATTERN0_TBL_ADDR								(ATOM_DP_TRAINING_TBL_ADDR + 24 )
   7211  1.1  riastrad #define DPCD_SET_TRAINING_PATTERN2_TBL_ADDR								(ATOM_DP_TRAINING_TBL_ADDR + 32)
   7212  1.1  riastrad #define DPCD_GET_LINKRATE_LANENUM_SS_TBL_ADDR							(ATOM_DP_TRAINING_TBL_ADDR + 40)
   7213  1.1  riastrad #define	DPCD_GET_LANE_STATUS_ADJUST_TBL_ADDR							(ATOM_DP_TRAINING_TBL_ADDR + 48)
   7214  1.1  riastrad #define DP_I2C_AUX_DDC_WRITE_START_TBL_ADDR								(ATOM_DP_TRAINING_TBL_ADDR + 60)
   7215  1.1  riastrad #define DP_I2C_AUX_DDC_WRITE_TBL_ADDR											(ATOM_DP_TRAINING_TBL_ADDR + 64)
   7216  1.1  riastrad #define DP_I2C_AUX_DDC_READ_START_TBL_ADDR								(ATOM_DP_TRAINING_TBL_ADDR + 72)
   7217  1.1  riastrad #define DP_I2C_AUX_DDC_READ_TBL_ADDR											(ATOM_DP_TRAINING_TBL_ADDR + 76)
   7218  1.1  riastrad #define DP_I2C_AUX_DDC_WRITE_END_TBL_ADDR                 (ATOM_DP_TRAINING_TBL_ADDR + 80)
   7219  1.1  riastrad #define DP_I2C_AUX_DDC_READ_END_TBL_ADDR									(ATOM_DP_TRAINING_TBL_ADDR + 84)
   7220  1.1  riastrad 
   7221  1.1  riastrad typedef struct _PROCESS_I2C_CHANNEL_TRANSACTION_PARAMETERS
   7222  1.1  riastrad {
   7223  1.1  riastrad 	UCHAR   ucI2CSpeed;
   7224  1.1  riastrad  	union
   7225  1.1  riastrad 	{
   7226  1.1  riastrad    UCHAR ucRegIndex;
   7227  1.1  riastrad    UCHAR ucStatus;
   7228  1.1  riastrad 	};
   7229  1.1  riastrad 	USHORT  lpI2CDataOut;
   7230  1.1  riastrad   UCHAR   ucFlag;
   7231  1.1  riastrad   UCHAR   ucTransBytes;
   7232  1.1  riastrad   UCHAR   ucSlaveAddr;
   7233  1.1  riastrad   UCHAR   ucLineNumber;
   7234  1.1  riastrad }PROCESS_I2C_CHANNEL_TRANSACTION_PARAMETERS;
   7235  1.1  riastrad 
   7236  1.1  riastrad #define PROCESS_I2C_CHANNEL_TRANSACTION_PS_ALLOCATION       PROCESS_I2C_CHANNEL_TRANSACTION_PARAMETERS
   7237  1.1  riastrad 
   7238  1.1  riastrad //ucFlag
   7239  1.1  riastrad #define HW_I2C_WRITE        1
   7240  1.1  riastrad #define HW_I2C_READ         0
   7241  1.1  riastrad #define I2C_2BYTE_ADDR      0x02
   7242  1.1  riastrad 
   7243  1.1  riastrad /****************************************************************************/
   7244  1.1  riastrad // Structures used by HW_Misc_OperationTable
   7245  1.1  riastrad /****************************************************************************/
   7246  1.1  riastrad typedef struct  _ATOM_HW_MISC_OPERATION_INPUT_PARAMETER_V1_1
   7247  1.1  riastrad {
   7248  1.1  riastrad   UCHAR  ucCmd;                //  Input: To tell which action to take
   7249  1.1  riastrad   UCHAR  ucReserved[3];
   7250  1.1  riastrad   ULONG  ulReserved;
   7251  1.1  riastrad }ATOM_HW_MISC_OPERATION_INPUT_PARAMETER_V1_1;
   7252  1.1  riastrad 
   7253  1.1  riastrad typedef struct  _ATOM_HW_MISC_OPERATION_OUTPUT_PARAMETER_V1_1
   7254  1.1  riastrad {
   7255  1.1  riastrad   UCHAR  ucReturnCode;        // Output: Return value base on action was taken
   7256  1.1  riastrad   UCHAR  ucReserved[3];
   7257  1.1  riastrad   ULONG  ulReserved;
   7258  1.1  riastrad }ATOM_HW_MISC_OPERATION_OUTPUT_PARAMETER_V1_1;
   7259  1.1  riastrad 
   7260  1.1  riastrad // Actions code
   7261  1.1  riastrad #define  ATOM_GET_SDI_SUPPORT              0xF0
   7262  1.1  riastrad 
   7263  1.1  riastrad // Return code
   7264  1.1  riastrad #define  ATOM_UNKNOWN_CMD                   0
   7265  1.1  riastrad #define  ATOM_FEATURE_NOT_SUPPORTED         1
   7266  1.1  riastrad #define  ATOM_FEATURE_SUPPORTED             2
   7267  1.1  riastrad 
   7268  1.1  riastrad typedef struct _ATOM_HW_MISC_OPERATION_PS_ALLOCATION
   7269  1.1  riastrad {
   7270  1.1  riastrad 	ATOM_HW_MISC_OPERATION_INPUT_PARAMETER_V1_1        sInput_Output;
   7271  1.1  riastrad 	PROCESS_I2C_CHANNEL_TRANSACTION_PARAMETERS         sReserved;
   7272  1.1  riastrad }ATOM_HW_MISC_OPERATION_PS_ALLOCATION;
   7273  1.1  riastrad 
   7274  1.1  riastrad /****************************************************************************/
   7275  1.1  riastrad 
   7276  1.1  riastrad typedef struct _SET_HWBLOCK_INSTANCE_PARAMETER_V2
   7277  1.1  riastrad {
   7278  1.1  riastrad    UCHAR ucHWBlkInst;                // HW block instance, 0, 1, 2, ...
   7279  1.1  riastrad    UCHAR ucReserved[3];
   7280  1.1  riastrad }SET_HWBLOCK_INSTANCE_PARAMETER_V2;
   7281  1.1  riastrad 
   7282  1.1  riastrad #define HWBLKINST_INSTANCE_MASK       0x07
   7283  1.1  riastrad #define HWBLKINST_HWBLK_MASK          0xF0
   7284  1.1  riastrad #define HWBLKINST_HWBLK_SHIFT         0x04
   7285  1.1  riastrad 
   7286  1.1  riastrad //ucHWBlock
   7287  1.1  riastrad #define SELECT_DISP_ENGINE            0
   7288  1.1  riastrad #define SELECT_DISP_PLL               1
   7289  1.1  riastrad #define SELECT_DCIO_UNIPHY_LINK0      2
   7290  1.1  riastrad #define SELECT_DCIO_UNIPHY_LINK1      3
   7291  1.1  riastrad #define SELECT_DCIO_IMPCAL            4
   7292  1.1  riastrad #define SELECT_DCIO_DIG               6
   7293  1.1  riastrad #define SELECT_CRTC_PIXEL_RATE        7
   7294  1.1  riastrad #define SELECT_VGA_BLK                8
   7295  1.1  riastrad 
   7296  1.1  riastrad // DIGTransmitterInfoTable structure used to program UNIPHY settings
   7297  1.1  riastrad typedef struct _DIG_TRANSMITTER_INFO_HEADER_V3_1{
   7298  1.1  riastrad   ATOM_COMMON_TABLE_HEADER sHeader;
   7299  1.1  riastrad   USHORT usDPVsPreEmphSettingOffset;     // offset of PHY_ANALOG_SETTING_INFO * with DP Voltage Swing and Pre-Emphasis for each Link clock
   7300  1.1  riastrad   USHORT usPhyAnalogRegListOffset;       // offset of CLOCK_CONDITION_REGESTER_INFO* with None-DP mode Analog Setting's register Info
   7301  1.1  riastrad   USHORT usPhyAnalogSettingOffset;       // offset of CLOCK_CONDITION_SETTING_ENTRY* with None-DP mode Analog Setting for each link clock range
   7302  1.1  riastrad   USHORT usPhyPllRegListOffset;          // offset of CLOCK_CONDITION_REGESTER_INFO* with Phy Pll register Info
   7303  1.1  riastrad   USHORT usPhyPllSettingOffset;          // offset of CLOCK_CONDITION_SETTING_ENTRY* with Phy Pll Settings
   7304  1.1  riastrad }DIG_TRANSMITTER_INFO_HEADER_V3_1;
   7305  1.1  riastrad 
   7306  1.1  riastrad typedef struct _DIG_TRANSMITTER_INFO_HEADER_V3_2{
   7307  1.1  riastrad   ATOM_COMMON_TABLE_HEADER sHeader;
   7308  1.1  riastrad   USHORT usDPVsPreEmphSettingOffset;     // offset of PHY_ANALOG_SETTING_INFO * with DP Voltage Swing and Pre-Emphasis for each Link clock
   7309  1.1  riastrad   USHORT usPhyAnalogRegListOffset;       // offset of CLOCK_CONDITION_REGESTER_INFO* with None-DP mode Analog Setting's register Info
   7310  1.1  riastrad   USHORT usPhyAnalogSettingOffset;       // offset of CLOCK_CONDITION_SETTING_ENTRY* with None-DP mode Analog Setting for each link clock range
   7311  1.1  riastrad   USHORT usPhyPllRegListOffset;          // offset of CLOCK_CONDITION_REGESTER_INFO* with Phy Pll register Info
   7312  1.1  riastrad   USHORT usPhyPllSettingOffset;          // offset of CLOCK_CONDITION_SETTING_ENTRY* with Phy Pll Settings
   7313  1.1  riastrad   USHORT usDPSSRegListOffset;            // offset of CLOCK_CONDITION_REGESTER_INFO* with Phy SS Pll register Info
   7314  1.1  riastrad   USHORT usDPSSSettingOffset;            // offset of CLOCK_CONDITION_SETTING_ENTRY* with Phy SS Pll Settings
   7315  1.1  riastrad }DIG_TRANSMITTER_INFO_HEADER_V3_2;
   7316  1.1  riastrad 
   7317  1.1  riastrad typedef struct _CLOCK_CONDITION_REGESTER_INFO{
   7318  1.1  riastrad   USHORT usRegisterIndex;
   7319  1.1  riastrad   UCHAR  ucStartBit;
   7320  1.1  riastrad   UCHAR  ucEndBit;
   7321  1.1  riastrad }CLOCK_CONDITION_REGESTER_INFO;
   7322  1.1  riastrad 
   7323  1.1  riastrad typedef struct _CLOCK_CONDITION_SETTING_ENTRY{
   7324  1.1  riastrad   USHORT usMaxClockFreq;
   7325  1.1  riastrad   UCHAR  ucEncodeMode;
   7326  1.1  riastrad   UCHAR  ucPhySel;
   7327  1.1  riastrad   ULONG  ulAnalogSetting[1];
   7328  1.1  riastrad }CLOCK_CONDITION_SETTING_ENTRY;
   7329  1.1  riastrad 
   7330  1.1  riastrad typedef struct _CLOCK_CONDITION_SETTING_INFO{
   7331  1.1  riastrad   USHORT usEntrySize;
   7332  1.1  riastrad   CLOCK_CONDITION_SETTING_ENTRY asClkCondSettingEntry[1];
   7333  1.1  riastrad }CLOCK_CONDITION_SETTING_INFO;
   7334  1.1  riastrad 
   7335  1.1  riastrad typedef struct _PHY_CONDITION_REG_VAL{
   7336  1.1  riastrad   ULONG  ulCondition;
   7337  1.1  riastrad   ULONG  ulRegVal;
   7338  1.1  riastrad }PHY_CONDITION_REG_VAL;
   7339  1.1  riastrad 
   7340  1.1  riastrad typedef struct _PHY_CONDITION_REG_VAL_V2{
   7341  1.1  riastrad   ULONG  ulCondition;
   7342  1.1  riastrad   UCHAR  ucCondition2;
   7343  1.1  riastrad   ULONG  ulRegVal;
   7344  1.1  riastrad }PHY_CONDITION_REG_VAL_V2;
   7345  1.1  riastrad 
   7346  1.1  riastrad typedef struct _PHY_CONDITION_REG_INFO{
   7347  1.1  riastrad   USHORT usRegIndex;
   7348  1.1  riastrad   USHORT usSize;
   7349  1.1  riastrad   PHY_CONDITION_REG_VAL asRegVal[1];
   7350  1.1  riastrad }PHY_CONDITION_REG_INFO;
   7351  1.1  riastrad 
   7352  1.1  riastrad typedef struct _PHY_CONDITION_REG_INFO_V2{
   7353  1.1  riastrad   USHORT usRegIndex;
   7354  1.1  riastrad   USHORT usSize;
   7355  1.1  riastrad   PHY_CONDITION_REG_VAL_V2 asRegVal[1];
   7356  1.1  riastrad }PHY_CONDITION_REG_INFO_V2;
   7357  1.1  riastrad 
   7358  1.1  riastrad typedef struct _PHY_ANALOG_SETTING_INFO{
   7359  1.1  riastrad   UCHAR  ucEncodeMode;
   7360  1.1  riastrad   UCHAR  ucPhySel;
   7361  1.1  riastrad   USHORT usSize;
   7362  1.1  riastrad   PHY_CONDITION_REG_INFO  asAnalogSetting[1];
   7363  1.1  riastrad }PHY_ANALOG_SETTING_INFO;
   7364  1.1  riastrad 
   7365  1.1  riastrad typedef struct _PHY_ANALOG_SETTING_INFO_V2{
   7366  1.1  riastrad   UCHAR  ucEncodeMode;
   7367  1.1  riastrad   UCHAR  ucPhySel;
   7368  1.1  riastrad   USHORT usSize;
   7369  1.1  riastrad   PHY_CONDITION_REG_INFO_V2  asAnalogSetting[1];
   7370  1.1  riastrad }PHY_ANALOG_SETTING_INFO_V2;
   7371  1.1  riastrad 
   7372  1.1  riastrad typedef struct _GFX_HAVESTING_PARAMETERS {
   7373  1.1  riastrad   UCHAR ucGfxBlkId;                        //GFX blk id to be harvested, like CU, RB or PRIM
   7374  1.1  riastrad   UCHAR ucReserved;                        //reserved
   7375  1.1  riastrad   UCHAR ucActiveUnitNumPerSH;              //requested active CU/RB/PRIM number per shader array
   7376  1.1  riastrad   UCHAR ucMaxUnitNumPerSH;                 //max CU/RB/PRIM number per shader array
   7377  1.1  riastrad } GFX_HAVESTING_PARAMETERS;
   7378  1.1  riastrad 
   7379  1.1  riastrad //ucGfxBlkId
   7380  1.1  riastrad #define GFX_HARVESTING_CU_ID               0
   7381  1.1  riastrad #define GFX_HARVESTING_RB_ID               1
   7382  1.1  riastrad #define GFX_HARVESTING_PRIM_ID             2
   7383  1.1  riastrad 
   7384  1.1  riastrad /****************************************************************************/
   7385  1.1  riastrad //Portion VI: Definitinos for vbios MC scratch registers that driver used
   7386  1.1  riastrad /****************************************************************************/
   7387  1.1  riastrad 
   7388  1.1  riastrad #define MC_MISC0__MEMORY_TYPE_MASK    0xF0000000
   7389  1.1  riastrad #define MC_MISC0__MEMORY_TYPE__GDDR1  0x10000000
   7390  1.1  riastrad #define MC_MISC0__MEMORY_TYPE__DDR2   0x20000000
   7391  1.1  riastrad #define MC_MISC0__MEMORY_TYPE__GDDR3  0x30000000
   7392  1.1  riastrad #define MC_MISC0__MEMORY_TYPE__GDDR4  0x40000000
   7393  1.1  riastrad #define MC_MISC0__MEMORY_TYPE__GDDR5  0x50000000
   7394  1.1  riastrad #define MC_MISC0__MEMORY_TYPE__HBM    0x60000000
   7395  1.1  riastrad #define MC_MISC0__MEMORY_TYPE__DDR3   0xB0000000
   7396  1.1  riastrad 
   7397  1.1  riastrad #define ATOM_MEM_TYPE_DDR_STRING      "DDR"
   7398  1.1  riastrad #define ATOM_MEM_TYPE_DDR2_STRING     "DDR2"
   7399  1.1  riastrad #define ATOM_MEM_TYPE_GDDR3_STRING    "GDDR3"
   7400  1.1  riastrad #define ATOM_MEM_TYPE_GDDR4_STRING    "GDDR4"
   7401  1.1  riastrad #define ATOM_MEM_TYPE_GDDR5_STRING    "GDDR5"
   7402  1.1  riastrad #define ATOM_MEM_TYPE_HBM_STRING      "HBM"
   7403  1.1  riastrad #define ATOM_MEM_TYPE_DDR3_STRING     "DDR3"
   7404  1.1  riastrad 
   7405  1.1  riastrad /****************************************************************************/
   7406  1.1  riastrad //Portion VI: Definitinos being oboselete
   7407  1.1  riastrad /****************************************************************************/
   7408  1.1  riastrad 
   7409  1.1  riastrad //==========================================================================================
   7410  1.1  riastrad //Remove the definitions below when driver is ready!
   7411  1.1  riastrad typedef struct _ATOM_DAC_INFO
   7412  1.1  riastrad {
   7413  1.1  riastrad   ATOM_COMMON_TABLE_HEADER sHeader;
   7414  1.1  riastrad   USHORT                   usMaxFrequency;      // in 10kHz unit
   7415  1.1  riastrad   USHORT                   usReserved;
   7416  1.1  riastrad }ATOM_DAC_INFO;
   7417  1.1  riastrad 
   7418  1.1  riastrad 
   7419  1.1  riastrad typedef struct  _COMPASSIONATE_DATA
   7420  1.1  riastrad {
   7421  1.1  riastrad   ATOM_COMMON_TABLE_HEADER sHeader;
   7422  1.1  riastrad 
   7423  1.1  riastrad   //==============================  DAC1 portion
   7424  1.1  riastrad   UCHAR   ucDAC1_BG_Adjustment;
   7425  1.1  riastrad   UCHAR   ucDAC1_DAC_Adjustment;
   7426  1.1  riastrad   USHORT  usDAC1_FORCE_Data;
   7427  1.1  riastrad   //==============================  DAC2 portion
   7428  1.1  riastrad   UCHAR   ucDAC2_CRT2_BG_Adjustment;
   7429  1.1  riastrad   UCHAR   ucDAC2_CRT2_DAC_Adjustment;
   7430  1.1  riastrad   USHORT  usDAC2_CRT2_FORCE_Data;
   7431  1.1  riastrad   USHORT  usDAC2_CRT2_MUX_RegisterIndex;
   7432  1.1  riastrad   UCHAR   ucDAC2_CRT2_MUX_RegisterInfo;     //Bit[4:0]=Bit position,Bit[7]=1:Active High;=0 Active Low
   7433  1.1  riastrad   UCHAR   ucDAC2_NTSC_BG_Adjustment;
   7434  1.1  riastrad   UCHAR   ucDAC2_NTSC_DAC_Adjustment;
   7435  1.1  riastrad   USHORT  usDAC2_TV1_FORCE_Data;
   7436  1.1  riastrad   USHORT  usDAC2_TV1_MUX_RegisterIndex;
   7437  1.1  riastrad   UCHAR   ucDAC2_TV1_MUX_RegisterInfo;      //Bit[4:0]=Bit position,Bit[7]=1:Active High;=0 Active Low
   7438  1.1  riastrad   UCHAR   ucDAC2_CV_BG_Adjustment;
   7439  1.1  riastrad   UCHAR   ucDAC2_CV_DAC_Adjustment;
   7440  1.1  riastrad   USHORT  usDAC2_CV_FORCE_Data;
   7441  1.1  riastrad   USHORT  usDAC2_CV_MUX_RegisterIndex;
   7442  1.1  riastrad   UCHAR   ucDAC2_CV_MUX_RegisterInfo;       //Bit[4:0]=Bit position,Bit[7]=1:Active High;=0 Active Low
   7443  1.1  riastrad   UCHAR   ucDAC2_PAL_BG_Adjustment;
   7444  1.1  riastrad   UCHAR   ucDAC2_PAL_DAC_Adjustment;
   7445  1.1  riastrad   USHORT  usDAC2_TV2_FORCE_Data;
   7446  1.1  riastrad }COMPASSIONATE_DATA;
   7447  1.1  riastrad 
   7448  1.1  riastrad /****************************Supported Device Info Table Definitions**********************/
   7449  1.1  riastrad //  ucConnectInfo:
   7450  1.1  riastrad //    [7:4] - connector type
   7451  1.1  riastrad //      = 1   - VGA connector
   7452  1.1  riastrad //      = 2   - DVI-I
   7453  1.1  riastrad //      = 3   - DVI-D
   7454  1.1  riastrad //      = 4   - DVI-A
   7455  1.1  riastrad //      = 5   - SVIDEO
   7456  1.1  riastrad //      = 6   - COMPOSITE
   7457  1.1  riastrad //      = 7   - LVDS
   7458  1.1  riastrad //      = 8   - DIGITAL LINK
   7459  1.1  riastrad //      = 9   - SCART
   7460  1.1  riastrad //      = 0xA - HDMI_type A
   7461  1.1  riastrad //      = 0xB - HDMI_type B
   7462  1.1  riastrad //      = 0xE - Special case1 (DVI+DIN)
   7463  1.1  riastrad //      Others=TBD
   7464  1.1  riastrad //    [3:0] - DAC Associated
   7465  1.1  riastrad //      = 0   - no DAC
   7466  1.1  riastrad //      = 1   - DACA
   7467  1.1  riastrad //      = 2   - DACB
   7468  1.1  riastrad //      = 3   - External DAC
   7469  1.1  riastrad //      Others=TBD
   7470  1.1  riastrad //
   7471  1.1  riastrad 
   7472  1.1  riastrad typedef struct _ATOM_CONNECTOR_INFO
   7473  1.1  riastrad {
   7474  1.1  riastrad #if ATOM_BIG_ENDIAN
   7475  1.1  riastrad   UCHAR   bfConnectorType:4;
   7476  1.1  riastrad   UCHAR   bfAssociatedDAC:4;
   7477  1.1  riastrad #else
   7478  1.1  riastrad   UCHAR   bfAssociatedDAC:4;
   7479  1.1  riastrad   UCHAR   bfConnectorType:4;
   7480  1.1  riastrad #endif
   7481  1.1  riastrad }ATOM_CONNECTOR_INFO;
   7482  1.1  riastrad 
   7483  1.1  riastrad typedef union _ATOM_CONNECTOR_INFO_ACCESS
   7484  1.1  riastrad {
   7485  1.1  riastrad   ATOM_CONNECTOR_INFO sbfAccess;
   7486  1.1  riastrad   UCHAR               ucAccess;
   7487  1.1  riastrad }ATOM_CONNECTOR_INFO_ACCESS;
   7488  1.1  riastrad 
   7489  1.1  riastrad typedef struct _ATOM_CONNECTOR_INFO_I2C
   7490  1.1  riastrad {
   7491  1.1  riastrad   ATOM_CONNECTOR_INFO_ACCESS sucConnectorInfo;
   7492  1.1  riastrad   ATOM_I2C_ID_CONFIG_ACCESS  sucI2cId;
   7493  1.1  riastrad }ATOM_CONNECTOR_INFO_I2C;
   7494  1.1  riastrad 
   7495  1.1  riastrad 
   7496  1.1  riastrad typedef struct _ATOM_SUPPORTED_DEVICES_INFO
   7497  1.1  riastrad {
   7498  1.1  riastrad   ATOM_COMMON_TABLE_HEADER	sHeader;
   7499  1.1  riastrad   USHORT                    usDeviceSupport;
   7500  1.1  riastrad   ATOM_CONNECTOR_INFO_I2C   asConnInfo[ATOM_MAX_SUPPORTED_DEVICE_INFO];
   7501  1.1  riastrad }ATOM_SUPPORTED_DEVICES_INFO;
   7502  1.1  riastrad 
   7503  1.1  riastrad #define NO_INT_SRC_MAPPED       0xFF
   7504  1.1  riastrad 
   7505  1.1  riastrad typedef struct _ATOM_CONNECTOR_INC_SRC_BITMAP
   7506  1.1  riastrad {
   7507  1.1  riastrad   UCHAR   ucIntSrcBitmap;
   7508  1.1  riastrad }ATOM_CONNECTOR_INC_SRC_BITMAP;
   7509  1.1  riastrad 
   7510  1.1  riastrad typedef struct _ATOM_SUPPORTED_DEVICES_INFO_2
   7511  1.1  riastrad {
   7512  1.1  riastrad   ATOM_COMMON_TABLE_HEADER      sHeader;
   7513  1.1  riastrad   USHORT                        usDeviceSupport;
   7514  1.1  riastrad   ATOM_CONNECTOR_INFO_I2C       asConnInfo[ATOM_MAX_SUPPORTED_DEVICE_INFO_2];
   7515  1.1  riastrad   ATOM_CONNECTOR_INC_SRC_BITMAP asIntSrcInfo[ATOM_MAX_SUPPORTED_DEVICE_INFO_2];
   7516  1.1  riastrad }ATOM_SUPPORTED_DEVICES_INFO_2;
   7517  1.1  riastrad 
   7518  1.1  riastrad typedef struct _ATOM_SUPPORTED_DEVICES_INFO_2d1
   7519  1.1  riastrad {
   7520  1.1  riastrad   ATOM_COMMON_TABLE_HEADER      sHeader;
   7521  1.1  riastrad   USHORT                        usDeviceSupport;
   7522  1.1  riastrad   ATOM_CONNECTOR_INFO_I2C       asConnInfo[ATOM_MAX_SUPPORTED_DEVICE];
   7523  1.1  riastrad   ATOM_CONNECTOR_INC_SRC_BITMAP asIntSrcInfo[ATOM_MAX_SUPPORTED_DEVICE];
   7524  1.1  riastrad }ATOM_SUPPORTED_DEVICES_INFO_2d1;
   7525  1.1  riastrad 
   7526  1.1  riastrad #define ATOM_SUPPORTED_DEVICES_INFO_LAST ATOM_SUPPORTED_DEVICES_INFO_2d1
   7527  1.1  riastrad 
   7528  1.1  riastrad 
   7529  1.1  riastrad 
   7530  1.1  riastrad typedef struct _ATOM_MISC_CONTROL_INFO
   7531  1.1  riastrad {
   7532  1.1  riastrad    USHORT usFrequency;
   7533  1.1  riastrad    UCHAR  ucPLL_ChargePump;				                // PLL charge-pump gain control
   7534  1.1  riastrad    UCHAR  ucPLL_DutyCycle;				                // PLL duty cycle control
   7535  1.1  riastrad    UCHAR  ucPLL_VCO_Gain;				                  // PLL VCO gain control
   7536  1.1  riastrad    UCHAR  ucPLL_VoltageSwing;			                // PLL driver voltage swing control
   7537  1.1  riastrad }ATOM_MISC_CONTROL_INFO;
   7538  1.1  riastrad 
   7539  1.1  riastrad 
   7540  1.1  riastrad #define ATOM_MAX_MISC_INFO       4
   7541  1.1  riastrad 
   7542  1.1  riastrad typedef struct _ATOM_TMDS_INFO
   7543  1.1  riastrad {
   7544  1.1  riastrad   ATOM_COMMON_TABLE_HEADER sHeader;
   7545  1.1  riastrad   USHORT							usMaxFrequency;             // in 10Khz
   7546  1.1  riastrad   ATOM_MISC_CONTROL_INFO				asMiscInfo[ATOM_MAX_MISC_INFO];
   7547  1.1  riastrad }ATOM_TMDS_INFO;
   7548  1.1  riastrad 
   7549  1.1  riastrad 
   7550  1.1  riastrad typedef struct _ATOM_ENCODER_ANALOG_ATTRIBUTE
   7551  1.1  riastrad {
   7552  1.1  riastrad   UCHAR ucTVStandard;     //Same as TV standards defined above,
   7553  1.1  riastrad   UCHAR ucPadding[1];
   7554  1.1  riastrad }ATOM_ENCODER_ANALOG_ATTRIBUTE;
   7555  1.1  riastrad 
   7556  1.1  riastrad typedef struct _ATOM_ENCODER_DIGITAL_ATTRIBUTE
   7557  1.1  riastrad {
   7558  1.1  riastrad   UCHAR ucAttribute;      //Same as other digital encoder attributes defined above
   7559  1.1  riastrad   UCHAR ucPadding[1];
   7560  1.1  riastrad }ATOM_ENCODER_DIGITAL_ATTRIBUTE;
   7561  1.1  riastrad 
   7562  1.1  riastrad typedef union _ATOM_ENCODER_ATTRIBUTE
   7563  1.1  riastrad {
   7564  1.1  riastrad   ATOM_ENCODER_ANALOG_ATTRIBUTE sAlgAttrib;
   7565  1.1  riastrad   ATOM_ENCODER_DIGITAL_ATTRIBUTE sDigAttrib;
   7566  1.1  riastrad }ATOM_ENCODER_ATTRIBUTE;
   7567  1.1  riastrad 
   7568  1.1  riastrad 
   7569  1.1  riastrad typedef struct _DVO_ENCODER_CONTROL_PARAMETERS
   7570  1.1  riastrad {
   7571  1.1  riastrad   USHORT usPixelClock;
   7572  1.1  riastrad   USHORT usEncoderID;
   7573  1.1  riastrad   UCHAR  ucDeviceType;												//Use ATOM_DEVICE_xxx1_Index to indicate device type only.
   7574  1.1  riastrad   UCHAR  ucAction;														//ATOM_ENABLE/ATOM_DISABLE/ATOM_HPD_INIT
   7575  1.1  riastrad   ATOM_ENCODER_ATTRIBUTE usDevAttr;
   7576  1.1  riastrad }DVO_ENCODER_CONTROL_PARAMETERS;
   7577  1.1  riastrad 
   7578  1.1  riastrad typedef struct _DVO_ENCODER_CONTROL_PS_ALLOCATION
   7579  1.1  riastrad {
   7580  1.1  riastrad   DVO_ENCODER_CONTROL_PARAMETERS    sDVOEncoder;
   7581  1.1  riastrad   WRITE_ONE_BYTE_HW_I2C_DATA_PS_ALLOCATION      sReserved;     //Caller doesn't need to init this portion
   7582  1.1  riastrad }DVO_ENCODER_CONTROL_PS_ALLOCATION;
   7583  1.1  riastrad 
   7584  1.1  riastrad 
   7585  1.1  riastrad #define ATOM_XTMDS_ASIC_SI164_ID        1
   7586  1.1  riastrad #define ATOM_XTMDS_ASIC_SI178_ID        2
   7587  1.1  riastrad #define ATOM_XTMDS_ASIC_TFP513_ID       3
   7588  1.1  riastrad #define ATOM_XTMDS_SUPPORTED_SINGLELINK 0x00000001
   7589  1.1  riastrad #define ATOM_XTMDS_SUPPORTED_DUALLINK   0x00000002
   7590  1.1  riastrad #define ATOM_XTMDS_MVPU_FPGA            0x00000004
   7591  1.1  riastrad 
   7592  1.1  riastrad 
   7593  1.1  riastrad typedef struct _ATOM_XTMDS_INFO
   7594  1.1  riastrad {
   7595  1.1  riastrad   ATOM_COMMON_TABLE_HEADER   sHeader;
   7596  1.1  riastrad   USHORT                     usSingleLinkMaxFrequency;
   7597  1.1  riastrad   ATOM_I2C_ID_CONFIG_ACCESS  sucI2cId;           //Point the ID on which I2C is used to control external chip
   7598  1.1  riastrad   UCHAR                      ucXtransimitterID;
   7599  1.1  riastrad   UCHAR                      ucSupportedLink;    // Bit field, bit0=1, single link supported;bit1=1,dual link supported
   7600  1.1  riastrad   UCHAR                      ucSequnceAlterID;   // Even with the same external TMDS asic, it's possible that the program seqence alters
   7601  1.1  riastrad                                                  // due to design. This ID is used to alert driver that the sequence is not "standard"!
   7602  1.1  riastrad   UCHAR                      ucMasterAddress;    // Address to control Master xTMDS Chip
   7603  1.1  riastrad   UCHAR                      ucSlaveAddress;     // Address to control Slave xTMDS Chip
   7604  1.1  riastrad }ATOM_XTMDS_INFO;
   7605  1.1  riastrad 
   7606  1.1  riastrad typedef struct _DFP_DPMS_STATUS_CHANGE_PARAMETERS
   7607  1.1  riastrad {
   7608  1.1  riastrad   UCHAR ucEnable;                     // ATOM_ENABLE=On or ATOM_DISABLE=Off
   7609  1.1  riastrad   UCHAR ucDevice;                     // ATOM_DEVICE_DFP1_INDEX....
   7610  1.1  riastrad   UCHAR ucPadding[2];
   7611  1.1  riastrad }DFP_DPMS_STATUS_CHANGE_PARAMETERS;
   7612  1.1  riastrad 
   7613  1.1  riastrad /****************************Legacy Power Play Table Definitions **********************/
   7614  1.1  riastrad 
   7615  1.1  riastrad //Definitions for ulPowerPlayMiscInfo
   7616  1.1  riastrad #define ATOM_PM_MISCINFO_SPLIT_CLOCK                     0x00000000L
   7617  1.1  riastrad #define ATOM_PM_MISCINFO_USING_MCLK_SRC                  0x00000001L
   7618  1.1  riastrad #define ATOM_PM_MISCINFO_USING_SCLK_SRC                  0x00000002L
   7619  1.1  riastrad 
   7620  1.1  riastrad #define ATOM_PM_MISCINFO_VOLTAGE_DROP_SUPPORT            0x00000004L
   7621  1.1  riastrad #define ATOM_PM_MISCINFO_VOLTAGE_DROP_ACTIVE_HIGH        0x00000008L
   7622  1.1  riastrad 
   7623  1.1  riastrad #define ATOM_PM_MISCINFO_LOAD_PERFORMANCE_EN             0x00000010L
   7624  1.1  riastrad 
   7625  1.1  riastrad #define ATOM_PM_MISCINFO_ENGINE_CLOCK_CONTRL_EN          0x00000020L
   7626  1.1  riastrad #define ATOM_PM_MISCINFO_MEMORY_CLOCK_CONTRL_EN          0x00000040L
   7627  1.1  riastrad #define ATOM_PM_MISCINFO_PROGRAM_VOLTAGE                 0x00000080L  //When this bit set, ucVoltageDropIndex is not an index for GPIO pin, but a voltage ID that SW needs program
   7628  1.1  riastrad 
   7629  1.1  riastrad #define ATOM_PM_MISCINFO_ASIC_REDUCED_SPEED_SCLK_EN      0x00000100L
   7630  1.1  riastrad #define ATOM_PM_MISCINFO_ASIC_DYNAMIC_VOLTAGE_EN         0x00000200L
   7631  1.1  riastrad #define ATOM_PM_MISCINFO_ASIC_SLEEP_MODE_EN              0x00000400L
   7632  1.1  riastrad #define ATOM_PM_MISCINFO_LOAD_BALANCE_EN                 0x00000800L
   7633  1.1  riastrad #define ATOM_PM_MISCINFO_DEFAULT_DC_STATE_ENTRY_TRUE     0x00001000L
   7634  1.1  riastrad #define ATOM_PM_MISCINFO_DEFAULT_LOW_DC_STATE_ENTRY_TRUE 0x00002000L
   7635  1.1  riastrad #define ATOM_PM_MISCINFO_LOW_LCD_REFRESH_RATE            0x00004000L
   7636  1.1  riastrad 
   7637  1.1  riastrad #define ATOM_PM_MISCINFO_DRIVER_DEFAULT_MODE             0x00008000L
   7638  1.1  riastrad #define ATOM_PM_MISCINFO_OVER_CLOCK_MODE                 0x00010000L
   7639  1.1  riastrad #define ATOM_PM_MISCINFO_OVER_DRIVE_MODE                 0x00020000L
   7640  1.1  riastrad #define ATOM_PM_MISCINFO_POWER_SAVING_MODE               0x00040000L
   7641  1.1  riastrad #define ATOM_PM_MISCINFO_THERMAL_DIODE_MODE              0x00080000L
   7642  1.1  riastrad 
   7643  1.1  riastrad #define ATOM_PM_MISCINFO_FRAME_MODULATION_MASK           0x00300000L  //0-FM Disable, 1-2 level FM, 2-4 level FM, 3-Reserved
   7644  1.1  riastrad #define ATOM_PM_MISCINFO_FRAME_MODULATION_SHIFT          20
   7645  1.1  riastrad 
   7646  1.1  riastrad #define ATOM_PM_MISCINFO_DYN_CLK_3D_IDLE                 0x00400000L
   7647  1.1  riastrad #define ATOM_PM_MISCINFO_DYNAMIC_CLOCK_DIVIDER_BY_2      0x00800000L
   7648  1.1  riastrad #define ATOM_PM_MISCINFO_DYNAMIC_CLOCK_DIVIDER_BY_4      0x01000000L
   7649  1.1  riastrad #define ATOM_PM_MISCINFO_DYNAMIC_HDP_BLOCK_EN            0x02000000L  //When set, Dynamic
   7650  1.1  riastrad #define ATOM_PM_MISCINFO_DYNAMIC_MC_HOST_BLOCK_EN        0x04000000L  //When set, Dynamic
   7651  1.1  riastrad #define ATOM_PM_MISCINFO_3D_ACCELERATION_EN              0x08000000L  //When set, This mode is for acceleated 3D mode
   7652  1.1  riastrad 
   7653  1.1  riastrad #define ATOM_PM_MISCINFO_POWERPLAY_SETTINGS_GROUP_MASK   0x70000000L  //1-Optimal Battery Life Group, 2-High Battery, 3-Balanced, 4-High Performance, 5- Optimal Performance (Default state with Default clocks)
   7654  1.1  riastrad #define ATOM_PM_MISCINFO_POWERPLAY_SETTINGS_GROUP_SHIFT  28
   7655  1.1  riastrad #define ATOM_PM_MISCINFO_ENABLE_BACK_BIAS                0x80000000L
   7656  1.1  riastrad 
   7657  1.1  riastrad #define ATOM_PM_MISCINFO2_SYSTEM_AC_LITE_MODE            0x00000001L
   7658  1.1  riastrad #define ATOM_PM_MISCINFO2_MULTI_DISPLAY_SUPPORT          0x00000002L
   7659  1.1  riastrad #define ATOM_PM_MISCINFO2_DYNAMIC_BACK_BIAS_EN           0x00000004L
   7660  1.1  riastrad #define ATOM_PM_MISCINFO2_FS3D_OVERDRIVE_INFO            0x00000008L
   7661  1.1  riastrad #define ATOM_PM_MISCINFO2_FORCEDLOWPWR_MODE              0x00000010L
   7662  1.1  riastrad #define ATOM_PM_MISCINFO2_VDDCI_DYNAMIC_VOLTAGE_EN       0x00000020L
   7663  1.1  riastrad #define ATOM_PM_MISCINFO2_VIDEO_PLAYBACK_CAPABLE         0x00000040L  //If this bit is set in multi-pp mode, then driver will pack up one with the minior power consumption.
   7664  1.1  riastrad                                                                       //If it's not set in any pp mode, driver will use its default logic to pick a pp mode in video playback
   7665  1.1  riastrad #define ATOM_PM_MISCINFO2_NOT_VALID_ON_DC                0x00000080L
   7666  1.1  riastrad #define ATOM_PM_MISCINFO2_STUTTER_MODE_EN                0x00000100L
   7667  1.1  riastrad #define ATOM_PM_MISCINFO2_UVD_SUPPORT_MODE               0x00000200L
   7668  1.1  riastrad 
   7669  1.1  riastrad //ucTableFormatRevision=1
   7670  1.1  riastrad //ucTableContentRevision=1
   7671  1.1  riastrad typedef struct  _ATOM_POWERMODE_INFO
   7672  1.1  riastrad {
   7673  1.1  riastrad   ULONG     ulMiscInfo;                 //The power level should be arranged in ascending order
   7674  1.1  riastrad   ULONG     ulReserved1;                // must set to 0
   7675  1.1  riastrad   ULONG     ulReserved2;                // must set to 0
   7676  1.1  riastrad   USHORT    usEngineClock;
   7677  1.1  riastrad   USHORT    usMemoryClock;
   7678  1.1  riastrad   UCHAR     ucVoltageDropIndex;         // index to GPIO table
   7679  1.1  riastrad   UCHAR     ucSelectedPanel_RefreshRate;// panel refresh rate
   7680  1.1  riastrad   UCHAR     ucMinTemperature;
   7681  1.1  riastrad   UCHAR     ucMaxTemperature;
   7682  1.1  riastrad   UCHAR     ucNumPciELanes;             // number of PCIE lanes
   7683  1.1  riastrad }ATOM_POWERMODE_INFO;
   7684  1.1  riastrad 
   7685  1.1  riastrad //ucTableFormatRevision=2
   7686  1.1  riastrad //ucTableContentRevision=1
   7687  1.1  riastrad typedef struct  _ATOM_POWERMODE_INFO_V2
   7688  1.1  riastrad {
   7689  1.1  riastrad   ULONG     ulMiscInfo;                 //The power level should be arranged in ascending order
   7690  1.1  riastrad   ULONG     ulMiscInfo2;
   7691  1.1  riastrad   ULONG     ulEngineClock;
   7692  1.1  riastrad   ULONG     ulMemoryClock;
   7693  1.1  riastrad   UCHAR     ucVoltageDropIndex;         // index to GPIO table
   7694  1.1  riastrad   UCHAR     ucSelectedPanel_RefreshRate;// panel refresh rate
   7695  1.1  riastrad   UCHAR     ucMinTemperature;
   7696  1.1  riastrad   UCHAR     ucMaxTemperature;
   7697  1.1  riastrad   UCHAR     ucNumPciELanes;             // number of PCIE lanes
   7698  1.1  riastrad }ATOM_POWERMODE_INFO_V2;
   7699  1.1  riastrad 
   7700  1.1  riastrad //ucTableFormatRevision=2
   7701  1.1  riastrad //ucTableContentRevision=2
   7702  1.1  riastrad typedef struct  _ATOM_POWERMODE_INFO_V3
   7703  1.1  riastrad {
   7704  1.1  riastrad   ULONG     ulMiscInfo;                 //The power level should be arranged in ascending order
   7705  1.1  riastrad   ULONG     ulMiscInfo2;
   7706  1.1  riastrad   ULONG     ulEngineClock;
   7707  1.1  riastrad   ULONG     ulMemoryClock;
   7708  1.1  riastrad   UCHAR     ucVoltageDropIndex;         // index to Core (VDDC) votage table
   7709  1.1  riastrad   UCHAR     ucSelectedPanel_RefreshRate;// panel refresh rate
   7710  1.1  riastrad   UCHAR     ucMinTemperature;
   7711  1.1  riastrad   UCHAR     ucMaxTemperature;
   7712  1.1  riastrad   UCHAR     ucNumPciELanes;             // number of PCIE lanes
   7713  1.1  riastrad   UCHAR     ucVDDCI_VoltageDropIndex;   // index to VDDCI votage table
   7714  1.1  riastrad }ATOM_POWERMODE_INFO_V3;
   7715  1.1  riastrad 
   7716  1.1  riastrad 
   7717  1.1  riastrad #define ATOM_MAX_NUMBEROF_POWER_BLOCK  8
   7718  1.1  riastrad 
   7719  1.1  riastrad #define ATOM_PP_OVERDRIVE_INTBITMAP_AUXWIN            0x01
   7720  1.1  riastrad #define ATOM_PP_OVERDRIVE_INTBITMAP_OVERDRIVE         0x02
   7721  1.1  riastrad 
   7722  1.1  riastrad #define ATOM_PP_OVERDRIVE_THERMALCONTROLLER_LM63      0x01
   7723  1.1  riastrad #define ATOM_PP_OVERDRIVE_THERMALCONTROLLER_ADM1032   0x02
   7724  1.1  riastrad #define ATOM_PP_OVERDRIVE_THERMALCONTROLLER_ADM1030   0x03
   7725  1.1  riastrad #define ATOM_PP_OVERDRIVE_THERMALCONTROLLER_MUA6649   0x04
   7726  1.1  riastrad #define ATOM_PP_OVERDRIVE_THERMALCONTROLLER_LM64      0x05
   7727  1.1  riastrad #define ATOM_PP_OVERDRIVE_THERMALCONTROLLER_F75375    0x06
   7728  1.1  riastrad #define ATOM_PP_OVERDRIVE_THERMALCONTROLLER_ASC7512   0x07	// Andigilog
   7729  1.1  riastrad 
   7730  1.1  riastrad 
   7731  1.1  riastrad typedef struct  _ATOM_POWERPLAY_INFO
   7732  1.1  riastrad {
   7733  1.1  riastrad   ATOM_COMMON_TABLE_HEADER	sHeader;
   7734  1.1  riastrad   UCHAR    ucOverdriveThermalController;
   7735  1.1  riastrad   UCHAR    ucOverdriveI2cLine;
   7736  1.1  riastrad   UCHAR    ucOverdriveIntBitmap;
   7737  1.1  riastrad   UCHAR    ucOverdriveControllerAddress;
   7738  1.1  riastrad   UCHAR    ucSizeOfPowerModeEntry;
   7739  1.1  riastrad   UCHAR    ucNumOfPowerModeEntries;
   7740  1.1  riastrad   ATOM_POWERMODE_INFO asPowerPlayInfo[ATOM_MAX_NUMBEROF_POWER_BLOCK];
   7741  1.1  riastrad }ATOM_POWERPLAY_INFO;
   7742  1.1  riastrad 
   7743  1.1  riastrad typedef struct  _ATOM_POWERPLAY_INFO_V2
   7744  1.1  riastrad {
   7745  1.1  riastrad   ATOM_COMMON_TABLE_HEADER	sHeader;
   7746  1.1  riastrad   UCHAR    ucOverdriveThermalController;
   7747  1.1  riastrad   UCHAR    ucOverdriveI2cLine;
   7748  1.1  riastrad   UCHAR    ucOverdriveIntBitmap;
   7749  1.1  riastrad   UCHAR    ucOverdriveControllerAddress;
   7750  1.1  riastrad   UCHAR    ucSizeOfPowerModeEntry;
   7751  1.1  riastrad   UCHAR    ucNumOfPowerModeEntries;
   7752  1.1  riastrad   ATOM_POWERMODE_INFO_V2 asPowerPlayInfo[ATOM_MAX_NUMBEROF_POWER_BLOCK];
   7753  1.1  riastrad }ATOM_POWERPLAY_INFO_V2;
   7754  1.1  riastrad 
   7755  1.1  riastrad typedef struct  _ATOM_POWERPLAY_INFO_V3
   7756  1.1  riastrad {
   7757  1.1  riastrad   ATOM_COMMON_TABLE_HEADER	sHeader;
   7758  1.1  riastrad   UCHAR    ucOverdriveThermalController;
   7759  1.1  riastrad   UCHAR    ucOverdriveI2cLine;
   7760  1.1  riastrad   UCHAR    ucOverdriveIntBitmap;
   7761  1.1  riastrad   UCHAR    ucOverdriveControllerAddress;
   7762  1.1  riastrad   UCHAR    ucSizeOfPowerModeEntry;
   7763  1.1  riastrad   UCHAR    ucNumOfPowerModeEntries;
   7764  1.1  riastrad   ATOM_POWERMODE_INFO_V3 asPowerPlayInfo[ATOM_MAX_NUMBEROF_POWER_BLOCK];
   7765  1.1  riastrad }ATOM_POWERPLAY_INFO_V3;
   7766  1.1  riastrad 
   7767  1.1  riastrad 
   7768  1.1  riastrad // Following definitions are for compatibility issue in different SW components.
   7769  1.1  riastrad #define ATOM_MASTER_DATA_TABLE_REVISION   0x01
   7770  1.1  riastrad #define Object_Info												Object_Header
   7771  1.1  riastrad #define	AdjustARB_SEQ											MC_InitParameter
   7772  1.1  riastrad #define	VRAM_GPIO_DetectionInfo						VoltageObjectInfo
   7773  1.1  riastrad #define	ASIC_VDDCI_Info                   ASIC_ProfilingInfo
   7774  1.1  riastrad #define ASIC_MVDDQ_Info										MemoryTrainingInfo
   7775  1.1  riastrad #define SS_Info                           PPLL_SS_Info
   7776  1.1  riastrad #define ASIC_MVDDC_Info                   ASIC_InternalSS_Info
   7777  1.1  riastrad #define DispDevicePriorityInfo						SaveRestoreInfo
   7778  1.1  riastrad #define DispOutInfo												TV_VideoMode
   7779  1.1  riastrad 
   7780  1.1  riastrad 
   7781  1.1  riastrad #define ATOM_ENCODER_OBJECT_TABLE         ATOM_OBJECT_TABLE
   7782  1.1  riastrad #define ATOM_CONNECTOR_OBJECT_TABLE       ATOM_OBJECT_TABLE
   7783  1.1  riastrad 
   7784  1.1  riastrad //New device naming, remove them when both DAL/VBIOS is ready
   7785  1.1  riastrad #define DFP2I_OUTPUT_CONTROL_PARAMETERS    CRT1_OUTPUT_CONTROL_PARAMETERS
   7786  1.1  riastrad #define DFP2I_OUTPUT_CONTROL_PS_ALLOCATION DFP2I_OUTPUT_CONTROL_PARAMETERS
   7787  1.1  riastrad 
   7788  1.1  riastrad #define DFP1X_OUTPUT_CONTROL_PARAMETERS    CRT1_OUTPUT_CONTROL_PARAMETERS
   7789  1.1  riastrad #define DFP1X_OUTPUT_CONTROL_PS_ALLOCATION DFP1X_OUTPUT_CONTROL_PARAMETERS
   7790  1.1  riastrad 
   7791  1.1  riastrad #define DFP1I_OUTPUT_CONTROL_PARAMETERS    DFP1_OUTPUT_CONTROL_PARAMETERS
   7792  1.1  riastrad #define DFP1I_OUTPUT_CONTROL_PS_ALLOCATION DFP1_OUTPUT_CONTROL_PS_ALLOCATION
   7793  1.1  riastrad 
   7794  1.1  riastrad #define ATOM_DEVICE_DFP1I_SUPPORT          ATOM_DEVICE_DFP1_SUPPORT
   7795  1.1  riastrad #define ATOM_DEVICE_DFP1X_SUPPORT          ATOM_DEVICE_DFP2_SUPPORT
   7796  1.1  riastrad 
   7797  1.1  riastrad #define ATOM_DEVICE_DFP1I_INDEX            ATOM_DEVICE_DFP1_INDEX
   7798  1.1  riastrad #define ATOM_DEVICE_DFP1X_INDEX            ATOM_DEVICE_DFP2_INDEX
   7799  1.1  riastrad 
   7800  1.1  riastrad #define ATOM_DEVICE_DFP2I_INDEX            0x00000009
   7801  1.1  riastrad #define ATOM_DEVICE_DFP2I_SUPPORT          (0x1L << ATOM_DEVICE_DFP2I_INDEX)
   7802  1.1  riastrad 
   7803  1.1  riastrad #define ATOM_S0_DFP1I                      ATOM_S0_DFP1
   7804  1.1  riastrad #define ATOM_S0_DFP1X                      ATOM_S0_DFP2
   7805  1.1  riastrad 
   7806  1.1  riastrad #define ATOM_S0_DFP2I                      0x00200000L
   7807  1.1  riastrad #define ATOM_S0_DFP2Ib2                    0x20
   7808  1.1  riastrad 
   7809  1.1  riastrad #define ATOM_S2_DFP1I_DPMS_STATE           ATOM_S2_DFP1_DPMS_STATE
   7810  1.1  riastrad #define ATOM_S2_DFP1X_DPMS_STATE           ATOM_S2_DFP2_DPMS_STATE
   7811  1.1  riastrad 
   7812  1.1  riastrad #define ATOM_S2_DFP2I_DPMS_STATE           0x02000000L
   7813  1.1  riastrad #define ATOM_S2_DFP2I_DPMS_STATEb3         0x02
   7814  1.1  riastrad 
   7815  1.1  riastrad #define ATOM_S3_DFP2I_ACTIVEb1             0x02
   7816  1.1  riastrad 
   7817  1.1  riastrad #define ATOM_S3_DFP1I_ACTIVE               ATOM_S3_DFP1_ACTIVE
   7818  1.1  riastrad #define ATOM_S3_DFP1X_ACTIVE               ATOM_S3_DFP2_ACTIVE
   7819  1.1  riastrad 
   7820  1.1  riastrad #define ATOM_S3_DFP2I_ACTIVE               0x00000200L
   7821  1.1  riastrad 
   7822  1.1  riastrad #define ATOM_S3_DFP1I_CRTC_ACTIVE          ATOM_S3_DFP1_CRTC_ACTIVE
   7823  1.1  riastrad #define ATOM_S3_DFP1X_CRTC_ACTIVE          ATOM_S3_DFP2_CRTC_ACTIVE
   7824  1.1  riastrad #define ATOM_S3_DFP2I_CRTC_ACTIVE          0x02000000L
   7825  1.1  riastrad 
   7826  1.1  riastrad #define ATOM_S3_DFP2I_CRTC_ACTIVEb3        0x02
   7827  1.1  riastrad #define ATOM_S5_DOS_REQ_DFP2Ib1            0x02
   7828  1.1  riastrad 
   7829  1.1  riastrad #define ATOM_S5_DOS_REQ_DFP2I              0x0200
   7830  1.1  riastrad #define ATOM_S6_ACC_REQ_DFP1I              ATOM_S6_ACC_REQ_DFP1
   7831  1.1  riastrad #define ATOM_S6_ACC_REQ_DFP1X              ATOM_S6_ACC_REQ_DFP2
   7832  1.1  riastrad 
   7833  1.1  riastrad #define ATOM_S6_ACC_REQ_DFP2Ib3            0x02
   7834  1.1  riastrad #define ATOM_S6_ACC_REQ_DFP2I              0x02000000L
   7835  1.1  riastrad 
   7836  1.1  riastrad #define TMDS1XEncoderControl               DVOEncoderControl
   7837  1.1  riastrad #define DFP1XOutputControl                 DVOOutputControl
   7838  1.1  riastrad 
   7839  1.1  riastrad #define ExternalDFPOutputControl           DFP1XOutputControl
   7840  1.1  riastrad #define EnableExternalTMDS_Encoder         TMDS1XEncoderControl
   7841  1.1  riastrad 
   7842  1.1  riastrad #define DFP1IOutputControl                 TMDSAOutputControl
   7843  1.1  riastrad #define DFP2IOutputControl                 LVTMAOutputControl
   7844  1.1  riastrad 
   7845  1.1  riastrad #define DAC1_ENCODER_CONTROL_PARAMETERS    DAC_ENCODER_CONTROL_PARAMETERS
   7846  1.1  riastrad #define DAC1_ENCODER_CONTROL_PS_ALLOCATION DAC_ENCODER_CONTROL_PS_ALLOCATION
   7847  1.1  riastrad 
   7848  1.1  riastrad #define DAC2_ENCODER_CONTROL_PARAMETERS    DAC_ENCODER_CONTROL_PARAMETERS
   7849  1.1  riastrad #define DAC2_ENCODER_CONTROL_PS_ALLOCATION DAC_ENCODER_CONTROL_PS_ALLOCATION
   7850  1.1  riastrad 
   7851  1.1  riastrad #define ucDac1Standard  ucDacStandard
   7852  1.1  riastrad #define ucDac2Standard  ucDacStandard
   7853  1.1  riastrad 
   7854  1.1  riastrad #define TMDS1EncoderControl TMDSAEncoderControl
   7855  1.1  riastrad #define TMDS2EncoderControl LVTMAEncoderControl
   7856  1.1  riastrad 
   7857  1.1  riastrad #define DFP1OutputControl   TMDSAOutputControl
   7858  1.1  riastrad #define DFP2OutputControl   LVTMAOutputControl
   7859  1.1  riastrad #define CRT1OutputControl   DAC1OutputControl
   7860  1.1  riastrad #define CRT2OutputControl   DAC2OutputControl
   7861  1.1  riastrad 
   7862  1.1  riastrad //These two lines will be removed for sure in a few days, will follow up with Michael V.
   7863  1.1  riastrad #define EnableLVDS_SS   EnableSpreadSpectrumOnPPLL
   7864  1.1  riastrad #define ENABLE_LVDS_SS_PARAMETERS_V3  ENABLE_SPREAD_SPECTRUM_ON_PPLL
   7865  1.1  riastrad 
   7866  1.1  riastrad //#define ATOM_S2_CRT1_DPMS_STATE         0x00010000L
   7867  1.1  riastrad //#define ATOM_S2_LCD1_DPMS_STATE	        ATOM_S2_CRT1_DPMS_STATE
   7868  1.1  riastrad //#define ATOM_S2_TV1_DPMS_STATE          ATOM_S2_CRT1_DPMS_STATE
   7869  1.1  riastrad //#define ATOM_S2_DFP1_DPMS_STATE         ATOM_S2_CRT1_DPMS_STATE
   7870  1.1  riastrad //#define ATOM_S2_CRT2_DPMS_STATE         ATOM_S2_CRT1_DPMS_STATE
   7871  1.1  riastrad 
   7872  1.1  riastrad #define ATOM_S6_ACC_REQ_TV2             0x00400000L
   7873  1.1  riastrad #define ATOM_DEVICE_TV2_INDEX           0x00000006
   7874  1.1  riastrad #define ATOM_DEVICE_TV2_SUPPORT         (0x1L << ATOM_DEVICE_TV2_INDEX)
   7875  1.1  riastrad #define ATOM_S0_TV2                     0x00100000L
   7876  1.1  riastrad #define ATOM_S3_TV2_ACTIVE              ATOM_S3_DFP6_ACTIVE
   7877  1.1  riastrad #define ATOM_S3_TV2_CRTC_ACTIVE         ATOM_S3_DFP6_CRTC_ACTIVE
   7878  1.1  riastrad 
   7879  1.1  riastrad //
   7880  1.1  riastrad #define ATOM_S2_CRT1_DPMS_STATE         0x00010000L
   7881  1.1  riastrad #define ATOM_S2_LCD1_DPMS_STATE	        0x00020000L
   7882  1.1  riastrad #define ATOM_S2_TV1_DPMS_STATE          0x00040000L
   7883  1.1  riastrad #define ATOM_S2_DFP1_DPMS_STATE         0x00080000L
   7884  1.1  riastrad #define ATOM_S2_CRT2_DPMS_STATE         0x00100000L
   7885  1.1  riastrad #define ATOM_S2_LCD2_DPMS_STATE         0x00200000L
   7886  1.1  riastrad #define ATOM_S2_TV2_DPMS_STATE          0x00400000L
   7887  1.1  riastrad #define ATOM_S2_DFP2_DPMS_STATE         0x00800000L
   7888  1.1  riastrad #define ATOM_S2_CV_DPMS_STATE           0x01000000L
   7889  1.1  riastrad #define ATOM_S2_DFP3_DPMS_STATE					0x02000000L
   7890  1.1  riastrad #define ATOM_S2_DFP4_DPMS_STATE					0x04000000L
   7891  1.1  riastrad #define ATOM_S2_DFP5_DPMS_STATE					0x08000000L
   7892  1.1  riastrad 
   7893  1.1  riastrad #define ATOM_S2_CRT1_DPMS_STATEb2       0x01
   7894  1.1  riastrad #define ATOM_S2_LCD1_DPMS_STATEb2       0x02
   7895  1.1  riastrad #define ATOM_S2_TV1_DPMS_STATEb2        0x04
   7896  1.1  riastrad #define ATOM_S2_DFP1_DPMS_STATEb2       0x08
   7897  1.1  riastrad #define ATOM_S2_CRT2_DPMS_STATEb2       0x10
   7898  1.1  riastrad #define ATOM_S2_LCD2_DPMS_STATEb2       0x20
   7899  1.1  riastrad #define ATOM_S2_TV2_DPMS_STATEb2        0x40
   7900  1.1  riastrad #define ATOM_S2_DFP2_DPMS_STATEb2       0x80
   7901  1.1  riastrad #define ATOM_S2_CV_DPMS_STATEb3         0x01
   7902  1.1  riastrad #define ATOM_S2_DFP3_DPMS_STATEb3				0x02
   7903  1.1  riastrad #define ATOM_S2_DFP4_DPMS_STATEb3				0x04
   7904  1.1  riastrad #define ATOM_S2_DFP5_DPMS_STATEb3				0x08
   7905  1.1  riastrad 
   7906  1.1  riastrad #define ATOM_S3_ASIC_GUI_ENGINE_HUNGb3	0x20
   7907  1.1  riastrad #define ATOM_S3_ALLOW_FAST_PWR_SWITCHb3 0x40
   7908  1.1  riastrad #define ATOM_S3_RQST_GPU_USE_MIN_PWRb3  0x80
   7909  1.1  riastrad 
   7910  1.1  riastrad /*********************************************************************************/
   7911  1.1  riastrad 
   7912  1.1  riastrad #pragma pack() // BIOS data must use byte aligment
   7913  1.1  riastrad 
   7914  1.1  riastrad //
   7915  1.1  riastrad // AMD ACPI Table
   7916  1.1  riastrad //
   7917  1.1  riastrad #pragma pack(1)
   7918  1.1  riastrad 
   7919  1.1  riastrad typedef struct {
   7920  1.1  riastrad   ULONG Signature;
   7921  1.1  riastrad   ULONG TableLength;      //Length
   7922  1.1  riastrad   UCHAR Revision;
   7923  1.1  riastrad   UCHAR Checksum;
   7924  1.1  riastrad   UCHAR OemId[6];
   7925  1.1  riastrad   UCHAR OemTableId[8];    //UINT64  OemTableId;
   7926  1.1  riastrad   ULONG OemRevision;
   7927  1.1  riastrad   ULONG CreatorId;
   7928  1.1  riastrad   ULONG CreatorRevision;
   7929  1.1  riastrad } AMD_ACPI_DESCRIPTION_HEADER;
   7930  1.1  riastrad /*
   7931  1.1  riastrad //EFI_ACPI_DESCRIPTION_HEADER from AcpiCommon.h
   7932  1.1  riastrad typedef struct {
   7933  1.1  riastrad   UINT32  Signature;       //0x0
   7934  1.1  riastrad   UINT32  Length;          //0x4
   7935  1.1  riastrad   UINT8   Revision;        //0x8
   7936  1.1  riastrad   UINT8   Checksum;        //0x9
   7937  1.1  riastrad   UINT8   OemId[6];        //0xA
   7938  1.1  riastrad   UINT64  OemTableId;      //0x10
   7939  1.1  riastrad   UINT32  OemRevision;     //0x18
   7940  1.1  riastrad   UINT32  CreatorId;       //0x1C
   7941  1.1  riastrad   UINT32  CreatorRevision; //0x20
   7942  1.1  riastrad }EFI_ACPI_DESCRIPTION_HEADER;
   7943  1.1  riastrad */
   7944  1.1  riastrad typedef struct {
   7945  1.1  riastrad   AMD_ACPI_DESCRIPTION_HEADER SHeader;
   7946  1.1  riastrad   UCHAR TableUUID[16];    //0x24
   7947  1.1  riastrad   ULONG VBIOSImageOffset; //0x34. Offset to the first GOP_VBIOS_CONTENT block from the beginning of the stucture.
   7948  1.1  riastrad   ULONG Lib1ImageOffset;  //0x38. Offset to the first GOP_LIB1_CONTENT block from the beginning of the stucture.
   7949  1.1  riastrad   ULONG Reserved[4];      //0x3C
   7950  1.1  riastrad }UEFI_ACPI_VFCT;
   7951  1.1  riastrad 
   7952  1.1  riastrad typedef struct {
   7953  1.1  riastrad   ULONG  PCIBus;          //0x4C
   7954  1.1  riastrad   ULONG  PCIDevice;       //0x50
   7955  1.1  riastrad   ULONG  PCIFunction;     //0x54
   7956  1.1  riastrad   USHORT VendorID;        //0x58
   7957  1.1  riastrad   USHORT DeviceID;        //0x5A
   7958  1.1  riastrad   USHORT SSVID;           //0x5C
   7959  1.1  riastrad   USHORT SSID;            //0x5E
   7960  1.1  riastrad   ULONG  Revision;        //0x60
   7961  1.1  riastrad   ULONG  ImageLength;     //0x64
   7962  1.1  riastrad }VFCT_IMAGE_HEADER;
   7963  1.1  riastrad 
   7964  1.1  riastrad 
   7965  1.1  riastrad typedef struct {
   7966  1.1  riastrad   VFCT_IMAGE_HEADER	VbiosHeader;
   7967  1.1  riastrad   UCHAR	VbiosContent[1];
   7968  1.1  riastrad }GOP_VBIOS_CONTENT;
   7969  1.1  riastrad 
   7970  1.1  riastrad typedef struct {
   7971  1.1  riastrad   VFCT_IMAGE_HEADER	Lib1Header;
   7972  1.1  riastrad   UCHAR	Lib1Content[1];
   7973  1.1  riastrad }GOP_LIB1_CONTENT;
   7974  1.1  riastrad 
   7975  1.1  riastrad #pragma pack()
   7976  1.1  riastrad 
   7977  1.1  riastrad 
   7978  1.1  riastrad #endif /* _ATOMBIOS_H */
   7979  1.1  riastrad 
   7980  1.1  riastrad #include "pptable.h"
   7981  1.1  riastrad 
   7982