4642 lines · 171.9 KB · C
RawDownload
/****************************************************************************\* *  File Name      atomfirmware.h*  Project        This is an interface header file between atombios and OS GPU drivers for SoC15 products**  Description    header file of general definitions for OS and pre-OS video drivers**  Copyright 2014 Advanced Micro Devices, Inc.** Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction,* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,* subject to the following conditions:** The above copyright notice and this permission notice shall be included in all copies or substantial* portions of the Software.** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR* OTHER DEALINGS IN THE SOFTWARE.*\****************************************************************************/ /*IMPORTANT NOTES* If a change in VBIOS/Driver/Tool's interface is only needed for SoC15 and forward products, then the change is only needed in this atomfirmware.h header file.* If a change in VBIOS/Driver/Tool's interface is only needed for pre-SoC15 products, then the change is only needed in atombios.h header file.* If a change is needed for both pre and post SoC15 products, then the change has to be made separately and might be differently in both atomfirmware.h and atombios.h.*/ #ifndef _ATOMFIRMWARE_H_#define _ATOMFIRMWARE_H_ enum  atom_bios_header_version_def{  ATOM_MAJOR_VERSION        =0x0003,  ATOM_MINOR_VERSION        =0x0003,}; #ifdef _H2INC  #ifndef uint32_t    typedef unsigned long uint32_t;  #endif   #ifndef uint16_t    typedef unsigned short uint16_t;  #endif   #ifndef uint8_t     typedef unsigned char uint8_t;  #endif#endif enum atom_crtc_def{  ATOM_CRTC1      =0,  ATOM_CRTC2      =1,  ATOM_CRTC3      =2,  ATOM_CRTC4      =3,  ATOM_CRTC5      =4,  ATOM_CRTC6      =5,  ATOM_CRTC_INVALID  =0xff,}; enum atom_ppll_def{  ATOM_PPLL0          =2,  ATOM_GCK_DFS        =8,  ATOM_FCH_CLK        =9,  ATOM_DP_DTO         =11,  ATOM_COMBOPHY_PLL0  =20,  ATOM_COMBOPHY_PLL1  =21,  ATOM_COMBOPHY_PLL2  =22,  ATOM_COMBOPHY_PLL3  =23,  ATOM_COMBOPHY_PLL4  =24,  ATOM_COMBOPHY_PLL5  =25,  ATOM_PPLL_INVALID   =0xff,}; // define ASIC internal encoder id ( bit vector ), used for CRTC_SourceSelenum atom_dig_def{  ASIC_INT_DIG1_ENCODER_ID  =0x03,  ASIC_INT_DIG2_ENCODER_ID  =0x09,  ASIC_INT_DIG3_ENCODER_ID  =0x0a,  ASIC_INT_DIG4_ENCODER_ID  =0x0b,  ASIC_INT_DIG5_ENCODER_ID  =0x0c,  ASIC_INT_DIG6_ENCODER_ID  =0x0d,  ASIC_INT_DIG7_ENCODER_ID  =0x0e,}; //ucEncoderModeenum atom_encode_mode_def{  ATOM_ENCODER_MODE_DP          =0,  ATOM_ENCODER_MODE_DP_SST      =0,  ATOM_ENCODER_MODE_LVDS        =1,  ATOM_ENCODER_MODE_DVI         =2,  ATOM_ENCODER_MODE_HDMI        =3,  ATOM_ENCODER_MODE_DP_AUDIO    =5,  ATOM_ENCODER_MODE_DP_MST      =5,  ATOM_ENCODER_MODE_CRT         =15,  ATOM_ENCODER_MODE_DVO         =16,}; enum atom_encoder_refclk_src_def{  ENCODER_REFCLK_SRC_P1PLL      =0,  ENCODER_REFCLK_SRC_P2PLL      =1,  ENCODER_REFCLK_SRC_P3PLL      =2,  ENCODER_REFCLK_SRC_EXTCLK     =3,  ENCODER_REFCLK_SRC_INVALID    =0xff,}; enum atom_scaler_def{  ATOM_SCALER_DISABLE          =0,  /*scaler bypass mode, auto-center & no replication*/  ATOM_SCALER_CENTER           =1,  //For Fudo, it's bypass and auto-center & auto replication  ATOM_SCALER_EXPANSION        =2,  /*scaler expansion by 2 tap alpha blending mode*/}; enum atom_operation_def{  ATOM_DISABLE             = 0,  ATOM_ENABLE              = 1,  ATOM_INIT                = 7,  ATOM_GET_STATUS          = 8,}; enum atom_embedded_display_op_def{  ATOM_LCD_BL_OFF                = 2,  ATOM_LCD_BL_OM                 = 3,  ATOM_LCD_BL_BRIGHTNESS_CONTROL = 4,  ATOM_LCD_SELFTEST_START        = 5,  ATOM_LCD_SELFTEST_STOP         = 6,}; enum atom_spread_spectrum_mode{  ATOM_SS_CENTER_OR_DOWN_MODE_MASK  = 0x01,  ATOM_SS_DOWN_SPREAD_MODE          = 0x00,  ATOM_SS_CENTRE_SPREAD_MODE        = 0x01,  ATOM_INT_OR_EXT_SS_MASK           = 0x02,  ATOM_INTERNAL_SS_MASK             = 0x00,  ATOM_EXTERNAL_SS_MASK             = 0x02,}; /* define panel bit per color  */enum atom_panel_bit_per_color{  PANEL_BPC_UNDEFINE     =0x00,  PANEL_6BIT_PER_COLOR   =0x01,  PANEL_8BIT_PER_COLOR   =0x02,  PANEL_10BIT_PER_COLOR  =0x03,  PANEL_12BIT_PER_COLOR  =0x04,  PANEL_16BIT_PER_COLOR  =0x05,}; //ucVoltageTypeenum atom_voltage_type{  VOLTAGE_TYPE_VDDC = 1,  VOLTAGE_TYPE_MVDDC = 2,  VOLTAGE_TYPE_MVDDQ = 3,  VOLTAGE_TYPE_VDDCI = 4,  VOLTAGE_TYPE_VDDGFX = 5,  VOLTAGE_TYPE_PCC = 6,  VOLTAGE_TYPE_MVPP = 7,  VOLTAGE_TYPE_LEDDPM = 8,  VOLTAGE_TYPE_PCC_MVDD = 9,  VOLTAGE_TYPE_PCIE_VDDC = 10,  VOLTAGE_TYPE_PCIE_VDDR = 11,  VOLTAGE_TYPE_GENERIC_I2C_1 = 0x11,  VOLTAGE_TYPE_GENERIC_I2C_2 = 0x12,  VOLTAGE_TYPE_GENERIC_I2C_3 = 0x13,  VOLTAGE_TYPE_GENERIC_I2C_4 = 0x14,  VOLTAGE_TYPE_GENERIC_I2C_5 = 0x15,  VOLTAGE_TYPE_GENERIC_I2C_6 = 0x16,  VOLTAGE_TYPE_GENERIC_I2C_7 = 0x17,  VOLTAGE_TYPE_GENERIC_I2C_8 = 0x18,  VOLTAGE_TYPE_GENERIC_I2C_9 = 0x19,  VOLTAGE_TYPE_GENERIC_I2C_10 = 0x1A,}; enum atom_dgpu_vram_type {  ATOM_DGPU_VRAM_TYPE_GDDR5 = 0x50,  ATOM_DGPU_VRAM_TYPE_HBM2  = 0x60,  ATOM_DGPU_VRAM_TYPE_HBM2E = 0x61,  ATOM_DGPU_VRAM_TYPE_GDDR6 = 0x70,  ATOM_DGPU_VRAM_TYPE_HBM3 = 0x80,	ATOM_DGPU_VRAM_TYPE_HBM3E = 0x81,}; enum atom_dp_vs_preemph_def{  DP_VS_LEVEL0_PREEMPH_LEVEL0 = 0x00,  DP_VS_LEVEL1_PREEMPH_LEVEL0 = 0x01,  DP_VS_LEVEL2_PREEMPH_LEVEL0 = 0x02,  DP_VS_LEVEL3_PREEMPH_LEVEL0 = 0x03,  DP_VS_LEVEL0_PREEMPH_LEVEL1 = 0x08,  DP_VS_LEVEL1_PREEMPH_LEVEL1 = 0x09,  DP_VS_LEVEL2_PREEMPH_LEVEL1 = 0x0a,  DP_VS_LEVEL0_PREEMPH_LEVEL2 = 0x10,  DP_VS_LEVEL1_PREEMPH_LEVEL2 = 0x11,  DP_VS_LEVEL0_PREEMPH_LEVEL3 = 0x18,}; #define BIOS_ATOM_PREFIX   "ATOMBIOS"#define BIOS_VERSION_PREFIX  "ATOMBIOSBK-AMD"#define BIOS_STRING_LENGTH 43 /*enum atom_string_def{asic_bus_type_pcie_string = "PCI_EXPRESS", atom_fire_gl_string       = "FGL",atom_bios_string          = "ATOM"};*/ #pragma pack(1)                          /* BIOS data must use byte alignment*/ enum atombios_image_offset{  OFFSET_TO_ATOM_ROM_HEADER_POINTER          = 0x00000048,  OFFSET_TO_ATOM_ROM_IMAGE_SIZE              = 0x00000002,  OFFSET_TO_ATOMBIOS_ASIC_BUS_MEM_TYPE       = 0x94,  MAXSIZE_OF_ATOMBIOS_ASIC_BUS_MEM_TYPE      = 20,  /*including the terminator 0x0!*/  OFFSET_TO_GET_ATOMBIOS_NUMBER_OF_STRINGS   = 0x2f,  OFFSET_TO_GET_ATOMBIOS_STRING_START        = 0x6e,  OFFSET_TO_VBIOS_PART_NUMBER                = 0x80,  OFFSET_TO_VBIOS_DATE                       = 0x50,}; /****************************************************************************   * Common header for all tables (Data table, Command function).* Every table pointed in _ATOM_MASTER_DATA_TABLE has this common header. * And the pointer actually points to this header.****************************************************************************/    struct atom_common_table_header{  uint16_t structuresize;  uint8_t  format_revision;   //mainly used for a hw function, when the parser is not backward compatible   uint8_t  content_revision;  //change it when a data table has a structure change, or a hw function has a input/output parameter change                                }; /****************************************************************************  * Structure stores the ROM header.****************************************************************************/   struct atom_rom_header_v2_2{  struct atom_common_table_header table_header;  uint8_t  atom_bios_string[4];        //enum atom_string_def atom_bios_string;     //Signature to distinguish between Atombios and non-atombios,   uint16_t bios_segment_address;  uint16_t protectedmodeoffset;  uint16_t configfilenameoffset;  uint16_t crc_block_offset;  uint16_t vbios_bootupmessageoffset;  uint16_t int10_offset;  uint16_t pcibusdevinitcode;  uint16_t iobaseaddress;  uint16_t subsystem_vendor_id;  uint16_t subsystem_id;  uint16_t pci_info_offset;  uint16_t masterhwfunction_offset;      //Offset for SW to get all command function offsets, Don't change the position  uint16_t masterdatatable_offset;       //Offset for SW to get all data table offsets, Don't change the position  uint16_t reserved;  uint32_t pspdirtableoffset;}; /*==============================hw function portion======================================================================*/  /****************************************************************************   * Structures used in Command.mtb, each function name is not given here since those function could change from time to time* The real functionality of each function is associated with the parameter structure version when defined* For all internal cmd function definitions, please reference to atomstruct.h****************************************************************************/   struct atom_master_list_of_command_functions_v2_1{  uint16_t asic_init;                   //Function  uint16_t cmd_function1;               //used as an internal one  uint16_t cmd_function2;               //used as an internal one  uint16_t cmd_function3;               //used as an internal one  uint16_t digxencodercontrol;          //Function     uint16_t cmd_function5;               //used as an internal one  uint16_t cmd_function6;               //used as an internal one   uint16_t cmd_function7;               //used as an internal one  uint16_t cmd_function8;               //used as an internal one  uint16_t cmd_function9;               //used as an internal one  uint16_t setengineclock;              //Function  uint16_t setmemoryclock;              //Function  uint16_t setpixelclock;               //Function  uint16_t enabledisppowergating;       //Function              uint16_t cmd_function14;              //used as an internal one               uint16_t cmd_function15;              //used as an internal one  uint16_t cmd_function16;              //used as an internal one  uint16_t cmd_function17;              //used as an internal one  uint16_t cmd_function18;              //used as an internal one  uint16_t cmd_function19;              //used as an internal one   uint16_t cmd_function20;              //used as an internal one                 uint16_t cmd_function21;              //used as an internal one  uint16_t cmd_function22;              //used as an internal one  uint16_t cmd_function23;              //used as an internal one  uint16_t cmd_function24;              //used as an internal one  uint16_t cmd_function25;              //used as an internal one  uint16_t cmd_function26;              //used as an internal one  uint16_t cmd_function27;              //used as an internal one  uint16_t cmd_function28;              //used as an internal one  uint16_t cmd_function29;              //used as an internal one  uint16_t cmd_function30;              //used as an internal one  uint16_t cmd_function31;              //used as an internal one  uint16_t cmd_function32;              //used as an internal one  uint16_t cmd_function33;              //used as an internal one  uint16_t blankcrtc;                   //Function  uint16_t enablecrtc;                  //Function  uint16_t cmd_function36;              //used as an internal one  uint16_t cmd_function37;              //used as an internal one  uint16_t cmd_function38;              //used as an internal one  uint16_t cmd_function39;              //used as an internal one  uint16_t cmd_function40;              //used as an internal one  uint16_t getsmuclockinfo;             //Function  uint16_t selectcrtc_source;           //Function  uint16_t cmd_function43;              //used as an internal one  uint16_t cmd_function44;              //used as an internal one  uint16_t cmd_function45;              //used as an internal one  uint16_t setdceclock;                 //Function  uint16_t getmemoryclock;              //Function             uint16_t getengineclock;              //Function             uint16_t setcrtc_usingdtdtiming;      //Function  uint16_t externalencodercontrol;      //Function   uint16_t cmd_function51;              //used as an internal one  uint16_t cmd_function52;              //used as an internal one  uint16_t cmd_function53;              //used as an internal one  uint16_t processi2cchanneltransaction;//Function             uint16_t cmd_function55;              //used as an internal one  uint16_t cmd_function56;              //used as an internal one  uint16_t cmd_function57;              //used as an internal one  uint16_t cmd_function58;              //used as an internal one  uint16_t cmd_function59;              //used as an internal one  uint16_t computegpuclockparam;        //Function           uint16_t cmd_function61;              //used as an internal one  uint16_t cmd_function62;              //used as an internal one  uint16_t dynamicmemorysettings;       //Function function  uint16_t memorytraining;              //Function function  uint16_t cmd_function65;              //used as an internal one  uint16_t cmd_function66;              //used as an internal one  uint16_t setvoltage;                  //Function  uint16_t cmd_function68;              //used as an internal one  uint16_t readefusevalue;              //Function  uint16_t cmd_function70;              //used as an internal one   uint16_t cmd_function71;              //used as an internal one  uint16_t cmd_function72;              //used as an internal one  uint16_t cmd_function73;              //used as an internal one  uint16_t cmd_function74;              //used as an internal one  uint16_t cmd_function75;              //used as an internal one  uint16_t dig1transmittercontrol;      //Function  uint16_t cmd_function77;              //used as an internal one  uint16_t processauxchanneltransaction;//Function  uint16_t cmd_function79;              //used as an internal one  uint16_t getvoltageinfo;              //Function}; struct atom_master_command_function_v2_1{  struct atom_common_table_header  table_header;  struct atom_master_list_of_command_functions_v2_1 listofcmdfunctions;}; /**************************************************************************** * Structures used in every command function****************************************************************************/   struct atom_function_attribute{  uint16_t  ws_in_bytes:8;            //[7:0]=Size of workspace in Bytes (in multiple of a dword),   uint16_t  ps_in_bytes:7;            //[14:8]=Size of parameter space in Bytes (multiple of a dword),   uint16_t  updated_by_util:1;        //[15]=flag to indicate the function is updated by util};  /**************************************************************************** * Common header for all hw functions.* Every function pointed by _master_list_of_hw_function has this common header. * And the pointer actually points to this header.****************************************************************************/   struct atom_rom_hw_function_header{  struct atom_common_table_header func_header;  struct atom_function_attribute func_attrib;  };  /*==============================sw data table portion======================================================================*//***************************************************************************** Structures used in data.mtb, each data table name is not given here since those data table could change from time to time* The real name of each table is given when its data structure version is defined****************************************************************************/struct atom_master_list_of_data_tables_v2_1{  uint16_t utilitypipeline;               /* Offest for the utility to get parser info,Don't change this position!*/  uint16_t multimedia_info;                 uint16_t smc_dpm_info;  uint16_t sw_datatable3;                   uint16_t firmwareinfo;                  /* Shared by various SW components */  uint16_t sw_datatable5;  uint16_t lcd_info;                      /* Shared by various SW components */  uint16_t sw_datatable7;  uint16_t smu_info;                   uint16_t sw_datatable9;  uint16_t sw_datatable10;   uint16_t vram_usagebyfirmware;          /* Shared by various SW components */  uint16_t gpio_pin_lut;                  /* Shared by various SW components */  uint16_t sw_datatable13;   uint16_t gfx_info;  uint16_t powerplayinfo;                 /* Shared by various SW components */  uint16_t sw_datatable16;                  uint16_t sw_datatable17;  uint16_t sw_datatable18;  uint16_t sw_datatable19;                  uint16_t sw_datatable20;  uint16_t sw_datatable21;  uint16_t displayobjectinfo;             /* Shared by various SW components */  uint16_t indirectioaccess;			  /* used as an internal one */  uint16_t umc_info;                      /* Shared by various SW components */  uint16_t sw_datatable25;  uint16_t sw_datatable26;  uint16_t dce_info;                      /* Shared by various SW components */  uint16_t vram_info;                     /* Shared by various SW components */  uint16_t sw_datatable29;  uint16_t integratedsysteminfo;          /* Shared by various SW components */  uint16_t asic_profiling_info;           /* Shared by various SW components */  uint16_t voltageobject_info;            /* shared by various SW components */  uint16_t sw_datatable33;  uint16_t sw_datatable34;};  struct atom_master_data_table_v2_1{   struct atom_common_table_header table_header;  struct atom_master_list_of_data_tables_v2_1 listOfdatatables;};  struct atom_dtd_format{  uint16_t  pixclk;  uint16_t  h_active;  uint16_t  h_blanking_time;  uint16_t  v_active;  uint16_t  v_blanking_time;  uint16_t  h_sync_offset;  uint16_t  h_sync_width;  uint16_t  v_sync_offset;  uint16_t  v_syncwidth;  uint16_t  reserved;  uint16_t  reserved0;  uint8_t   h_border;  uint8_t   v_border;  uint16_t  miscinfo;  uint8_t   atom_mode_id;  uint8_t   refreshrate;}; /* atom_dtd_format.modemiscinfo definition */enum atom_dtd_format_modemiscinfo{  ATOM_HSYNC_POLARITY    = 0x0002,  ATOM_VSYNC_POLARITY    = 0x0004,  ATOM_H_REPLICATIONBY2  = 0x0010,  ATOM_V_REPLICATIONBY2  = 0x0020,  ATOM_INTERLACE         = 0x0080,  ATOM_COMPOSITESYNC     = 0x0040,};  /* utilitypipeline * when format_revision==1 && content_revision==1, then this an info table for atomworks to use during debug session, no structure is associated with it. * the location of it can't change*/  /*   ***************************************************************************    Data Table firmwareinfo  structure  ****************************************************************************/ struct atom_firmware_info_v3_1{  struct atom_common_table_header table_header;  uint32_t firmware_revision;  uint32_t bootup_sclk_in10khz;  uint32_t bootup_mclk_in10khz;  uint32_t firmware_capability;             // enum atombios_firmware_capability  uint32_t main_call_parser_entry;          /* direct address of main parser call in VBIOS binary. */  uint32_t bios_scratch_reg_startaddr;      // 1st bios scratch register dword address   uint16_t bootup_vddc_mv;  uint16_t bootup_vddci_mv;   uint16_t bootup_mvddc_mv;  uint16_t bootup_vddgfx_mv;  uint8_t  mem_module_id;         uint8_t  coolingsolution_id;              /*0: Air cooling; 1: Liquid cooling ... */  uint8_t  reserved1[2];  uint32_t mc_baseaddr_high;  uint32_t mc_baseaddr_low;  uint32_t reserved2[6];}; /* Total 32bit cap indication */

Lines 1–500 of 4642.