Path: blob/master/drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomfwctrl.h
26552 views
/*1* Copyright 2016 Advanced Micro Devices, Inc.2*3* Permission is hereby granted, free of charge, to any person obtaining a4* copy of this software and associated documentation files (the "Software"),5* to deal in the Software without restriction, including without limitation6* the rights to use, copy, modify, merge, publish, distribute, sublicense,7* and/or sell copies of the Software, and to permit persons to whom the8* Software is furnished to do so, subject to the following conditions:9*10* The above copyright notice and this permission notice shall be included in11* all copies or substantial portions of the Software.12*13* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR14* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,15* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL16* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR17* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,18* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR19* OTHER DEALINGS IN THE SOFTWARE.20*21*/2223#ifndef PP_ATOMFWCTRL_H24#define PP_ATOMFWCTRL_H2526#include "hwmgr.h"2728typedef enum atom_smu9_syspll0_clock_id BIOS_CLKID;2930#define GetIndexIntoMasterCmdTable(FieldName) \31(offsetof(struct atom_master_list_of_command_functions_v2_1, FieldName) / sizeof(uint16_t))32#define GetIndexIntoMasterDataTable(FieldName) \33(offsetof(struct atom_master_list_of_data_tables_v2_1, FieldName) / sizeof(uint16_t))3435#define PP_ATOMFWCTRL_MAX_VOLTAGE_ENTRIES 323637struct pp_atomfwctrl_voltage_table_entry {38uint16_t value;39uint32_t smio_low;40};4142struct pp_atomfwctrl_voltage_table {43uint32_t count;44uint32_t mask_low;45uint32_t phase_delay;46uint8_t psi0_enable;47uint8_t psi1_enable;48uint8_t max_vid_step;49uint8_t telemetry_offset;50uint8_t telemetry_slope;51struct pp_atomfwctrl_voltage_table_entry entries[PP_ATOMFWCTRL_MAX_VOLTAGE_ENTRIES];52};5354struct pp_atomfwctrl_gpio_pin_assignment {55uint16_t us_gpio_pin_aindex;56uint8_t uc_gpio_pin_bit_shift;57};5859struct pp_atomfwctrl_clock_dividers_soc15 {60uint32_t ulClock; /* the actual clock */61uint32_t ulDid; /* DFS divider */62uint32_t ulPll_fb_mult; /* Feedback Multiplier: bit 8:0 int, bit 15:12 post_div, bit 31:16 frac */63uint32_t ulPll_ss_fbsmult; /* Spread FB Multiplier: bit 8:0 int, bit 31:16 frac */64uint16_t usPll_ss_slew_frac;65uint8_t ucPll_ss_enable;66uint8_t ucReserve;67uint32_t ulReserve[2];68};6970struct pp_atomfwctrl_avfs_parameters {71uint32_t ulMaxVddc;72uint32_t ulMinVddc;7374uint32_t ulMeanNsigmaAcontant0;75uint32_t ulMeanNsigmaAcontant1;76uint32_t ulMeanNsigmaAcontant2;77uint16_t usMeanNsigmaDcTolSigma;78uint16_t usMeanNsigmaPlatformMean;79uint16_t usMeanNsigmaPlatformSigma;80uint32_t ulGbVdroopTableCksoffA0;81uint32_t ulGbVdroopTableCksoffA1;82uint32_t ulGbVdroopTableCksoffA2;83uint32_t ulGbVdroopTableCksonA0;84uint32_t ulGbVdroopTableCksonA1;85uint32_t ulGbVdroopTableCksonA2;8687uint32_t ulGbFuseTableCksoffM1;88uint32_t ulGbFuseTableCksoffM2;89uint32_t ulGbFuseTableCksoffB;9091uint32_t ulGbFuseTableCksonM1;92uint32_t ulGbFuseTableCksonM2;93uint32_t ulGbFuseTableCksonB;9495uint8_t ucEnableGbVdroopTableCkson;96uint8_t ucEnableGbFuseTableCkson;97uint16_t usPsmAgeComfactor;9899uint32_t ulDispclk2GfxclkM1;100uint32_t ulDispclk2GfxclkM2;101uint32_t ulDispclk2GfxclkB;102uint32_t ulDcefclk2GfxclkM1;103uint32_t ulDcefclk2GfxclkM2;104uint32_t ulDcefclk2GfxclkB;105uint32_t ulPixelclk2GfxclkM1;106uint32_t ulPixelclk2GfxclkM2;107uint32_t ulPixelclk2GfxclkB;108uint32_t ulPhyclk2GfxclkM1;109uint32_t ulPhyclk2GfxclkM2;110uint32_t ulPhyclk2GfxclkB;111uint32_t ulAcgGbVdroopTableA0;112uint32_t ulAcgGbVdroopTableA1;113uint32_t ulAcgGbVdroopTableA2;114uint32_t ulAcgGbFuseTableM1;115uint32_t ulAcgGbFuseTableM2;116uint32_t ulAcgGbFuseTableB;117uint32_t ucAcgEnableGbVdroopTable;118uint32_t ucAcgEnableGbFuseTable;119};120121struct pp_atomfwctrl_gpio_parameters {122uint8_t ucAcDcGpio;123uint8_t ucAcDcPolarity;124uint8_t ucVR0HotGpio;125uint8_t ucVR0HotPolarity;126uint8_t ucVR1HotGpio;127uint8_t ucVR1HotPolarity;128uint8_t ucFwCtfGpio;129uint8_t ucFwCtfPolarity;130};131132struct pp_atomfwctrl_bios_boot_up_values {133uint32_t ulRevision;134uint32_t ulGfxClk;135uint32_t ulUClk;136uint32_t ulSocClk;137uint32_t ulDCEFClk;138uint32_t ulEClk;139uint32_t ulVClk;140uint32_t ulDClk;141uint32_t ulFClk;142uint16_t usVddc;143uint16_t usVddci;144uint16_t usMvddc;145uint16_t usVddGfx;146uint8_t ucCoolingID;147};148149struct pp_atomfwctrl_smc_dpm_parameters {150uint8_t liquid1_i2c_address;151uint8_t liquid2_i2c_address;152uint8_t vr_i2c_address;153uint8_t plx_i2c_address;154uint8_t liquid_i2c_linescl;155uint8_t liquid_i2c_linesda;156uint8_t vr_i2c_linescl;157uint8_t vr_i2c_linesda;158uint8_t plx_i2c_linescl;159uint8_t plx_i2c_linesda;160uint8_t vrsensorpresent;161uint8_t liquidsensorpresent;162uint16_t maxvoltagestepgfx;163uint16_t maxvoltagestepsoc;164uint8_t vddgfxvrmapping;165uint8_t vddsocvrmapping;166uint8_t vddmem0vrmapping;167uint8_t vddmem1vrmapping;168uint8_t gfxulvphasesheddingmask;169uint8_t soculvphasesheddingmask;170171uint16_t gfxmaxcurrent;172uint8_t gfxoffset;173uint8_t padding_telemetrygfx;174uint16_t socmaxcurrent;175uint8_t socoffset;176uint8_t padding_telemetrysoc;177uint16_t mem0maxcurrent;178uint8_t mem0offset;179uint8_t padding_telemetrymem0;180uint16_t mem1maxcurrent;181uint8_t mem1offset;182uint8_t padding_telemetrymem1;183184uint8_t acdcgpio;185uint8_t acdcpolarity;186uint8_t vr0hotgpio;187uint8_t vr0hotpolarity;188uint8_t vr1hotgpio;189uint8_t vr1hotpolarity;190uint8_t padding1;191uint8_t padding2;192193uint8_t ledpin0;194uint8_t ledpin1;195uint8_t ledpin2;196197uint8_t pllgfxclkspreadenabled;198uint8_t pllgfxclkspreadpercent;199uint16_t pllgfxclkspreadfreq;200201uint8_t uclkspreadenabled;202uint8_t uclkspreadpercent;203uint16_t uclkspreadfreq;204205uint8_t socclkspreadenabled;206uint8_t socclkspreadpercent;207uint16_t socclkspreadfreq;208209uint8_t acggfxclkspreadenabled;210uint8_t acggfxclkspreadpercent;211uint16_t acggfxclkspreadfreq;212213uint8_t Vr2_I2C_address;214};215216int pp_atomfwctrl_get_gpu_pll_dividers_vega10(struct pp_hwmgr *hwmgr,217uint32_t clock_type, uint32_t clock_value,218struct pp_atomfwctrl_clock_dividers_soc15 *dividers);219220int pp_atomfwctrl_get_voltage_table_v4(struct pp_hwmgr *hwmgr, uint8_t voltage_type,221uint8_t voltage_mode, struct pp_atomfwctrl_voltage_table *voltage_table);222bool pp_atomfwctrl_is_voltage_controlled_by_gpio_v4(struct pp_hwmgr *hwmgr,223uint8_t voltage_type, uint8_t voltage_mode);224225int pp_atomfwctrl_get_avfs_information(struct pp_hwmgr *hwmgr,226struct pp_atomfwctrl_avfs_parameters *param);227int pp_atomfwctrl_get_gpio_information(struct pp_hwmgr *hwmgr,228struct pp_atomfwctrl_gpio_parameters *param);229230int pp_atomfwctrl_get_vbios_bootup_values(struct pp_hwmgr *hwmgr,231struct pp_atomfwctrl_bios_boot_up_values *boot_values);232int pp_atomfwctrl_get_smc_dpm_information(struct pp_hwmgr *hwmgr,233struct pp_atomfwctrl_smc_dpm_parameters *param);234int pp_atomfwctrl_get_clk_information_by_clkid(struct pp_hwmgr *hwmgr,235uint8_t clk_id, uint8_t syspll_id,236uint32_t *frequency);237238#endif239240241242