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