Commit 34ec3ced authored by Li Ma's avatar Li Ma Committed by Alex Deucher

drm/amd/swsmu: update smu v14_0_0 driver if and metrics table

Update driver if headers and metrics table in smu v14_0_0 after smu fw promotion.
Drop the legacy metrics table and add warning of checking pmfw version.
Signed-off-by: default avatarLi Ma <li.ma@amd.com>
Reviewed-by: default avatarYifan Zhang <yifan1.zhang@amd.com>
Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 38a64e3a
...@@ -1080,33 +1080,35 @@ struct gpu_metrics_v3_0 { ...@@ -1080,33 +1080,35 @@ struct gpu_metrics_v3_0 {
uint16_t average_ipu_activity[8]; uint16_t average_ipu_activity[8];
/* time filtered per-core C0 residency % [0-100]*/ /* time filtered per-core C0 residency % [0-100]*/
uint16_t average_core_c0_activity[16]; uint16_t average_core_c0_activity[16];
/* time filtered DRAM read bandwidth [GB/sec] */ /* time filtered DRAM read bandwidth [MB/sec] */
uint16_t average_dram_reads; uint16_t average_dram_reads;
/* time filtered DRAM write bandwidth [GB/sec] */ /* time filtered DRAM write bandwidth [MB/sec] */
uint16_t average_dram_writes; uint16_t average_dram_writes;
/* Driver attached timestamp (in ns) */ /* Driver attached timestamp (in ns) */
uint64_t system_clock_counter; uint64_t system_clock_counter;
/* Power/Energy */ /* Power/Energy */
/* average dGPU + APU power on A + A platform */ /* time filtered power used for PPT/STAPM [APU+dGPU] [mW] */
uint32_t average_socket_power; uint32_t average_socket_power;
/* average IPU power [W] */ /* time filtered IPU power [mW] */
uint16_t average_ipu_power; uint16_t average_ipu_power;
/* average APU power [W] */ /* time filtered APU power [mW] */
uint32_t average_apu_power; uint32_t average_apu_power;
/* average dGPU power [W] */ /* time filtered GFX power [mW] */
uint32_t average_gfx_power;
/* time filtered dGPU power [mW] */
uint32_t average_dgpu_power; uint32_t average_dgpu_power;
/* sum of core power across all cores in the socket [W] */ /* time filtered sum of core power across all cores in the socket [mW] */
uint32_t average_core_power; uint32_t average_all_core_power;
/* calculated core power [W] */ /* calculated core power [mW] */
uint16_t core_power[16]; uint16_t average_core_power[16];
/* maximum IRM defined STAPM power limit [W] */ /* maximum IRM defined STAPM power limit [mW] */
uint16_t stapm_power_limit; uint16_t stapm_power_limit;
/* time filtered STAPM power limit [W] */ /* time filtered STAPM power limit [mW] */
uint16_t current_stapm_power_limit; uint16_t current_stapm_power_limit;
/* Average clocks */ /* time filtered clocks [MHz] */
uint16_t average_gfxclk_frequency; uint16_t average_gfxclk_frequency;
uint16_t average_socclk_frequency; uint16_t average_socclk_frequency;
uint16_t average_vpeclk_frequency; uint16_t average_vpeclk_frequency;
...@@ -1115,7 +1117,7 @@ struct gpu_metrics_v3_0 { ...@@ -1115,7 +1117,7 @@ struct gpu_metrics_v3_0 {
uint16_t average_vclk_frequency; uint16_t average_vclk_frequency;
/* Current clocks */ /* Current clocks */
/* target core frequency */ /* target core frequency [MHz] */
uint16_t current_coreclk[16]; uint16_t current_coreclk[16];
/* CCLK frequency limit enforced on classic cores [MHz] */ /* CCLK frequency limit enforced on classic cores [MHz] */
uint16_t current_core_maxfreq; uint16_t current_core_maxfreq;
......
...@@ -150,97 +150,39 @@ typedef struct { ...@@ -150,97 +150,39 @@ typedef struct {
} DpmClocks_t; } DpmClocks_t;
typedef struct { typedef struct {
uint16_t CoreFrequency[16]; //Target core frequency [MHz] uint16_t CoreFrequency[16]; //Target core frequency [MHz]
uint16_t CorePower[16]; //CAC calculated core power [W] [Q8.8] uint16_t CorePower[16]; //CAC calculated core power [mW]
uint16_t CoreTemperature[16]; //TSEN measured core temperature [C] [Q8.8] uint16_t CoreTemperature[16]; //TSEN measured core temperature [centi-C]
uint16_t GfxTemperature; //TSEN measured GFX temperature [C] [Q8.8] uint16_t GfxTemperature; //TSEN measured GFX temperature [centi-C]
uint16_t SocTemperature; //TSEN measured SOC temperature [C] [Q8.8] uint16_t SocTemperature; //TSEN measured SOC temperature [centi-C]
uint16_t StapmOpnLimit; //Maximum IRM defined STAPM power limit [W] [Q8.8] uint16_t StapmOpnLimit; //Maximum IRM defined STAPM power limit [mW]
uint16_t StapmCurrentLimit; //Time filtered STAPM power limit [W] [Q8.8] uint16_t StapmCurrentLimit; //Time filtered STAPM power limit [mW]
uint16_t InfrastructureCpuMaxFreq; //CCLK frequency limit enforced on classic cores [MHz] uint16_t InfrastructureCpuMaxFreq; //CCLK frequency limit enforced on classic cores [MHz]
uint16_t InfrastructureGfxMaxFreq; //GFXCLK frequency limit enforced on GFX [MHz] uint16_t InfrastructureGfxMaxFreq; //GFXCLK frequency limit enforced on GFX [MHz]
uint16_t SkinTemp; //Maximum skin temperature reported by APU and HS2 chassis sensors [C] [Q8.8] uint16_t SkinTemp; //Maximum skin temperature reported by APU and HS2 chassis sensors [centi-C]
uint16_t AverageGfxclkFrequency; //Time filtered target GFXCLK frequency [MHz] uint16_t GfxclkFrequency; //Time filtered target GFXCLK frequency [MHz]
uint16_t AverageFclkFrequency; //Time filtered target FCLK frequency [MHz] uint16_t FclkFrequency; //Time filtered target FCLK frequency [MHz]
uint16_t AverageGfxActivity; //Time filtered GFX busy % [0-100] [Q8.8] uint16_t GfxActivity; //Time filtered GFX busy % [0-100]
uint16_t AverageSocclkFrequency; //Time filtered target SOCCLK frequency [MHz] uint16_t SocclkFrequency; //Time filtered target SOCCLK frequency [MHz]
uint16_t AverageVclkFrequency; //Time filtered target VCLK frequency [MHz] uint16_t VclkFrequency; //Time filtered target VCLK frequency [MHz]
uint16_t AverageVcnActivity; //Time filtered VCN busy % [0-100] [Q8.8] uint16_t VcnActivity; //Time filtered VCN busy % [0-100]
uint16_t AverageVpeclkFrequency; //Time filtered target VPECLK frequency [MHz] uint16_t VpeclkFrequency; //Time filtered target VPECLK frequency [MHz]
uint16_t AverageIpuclkFrequency; //Time filtered target IPUCLK frequency [MHz] uint16_t IpuclkFrequency; //Time filtered target IPUCLK frequency [MHz]
uint16_t AverageIpuBusy[8]; //Time filtered IPU per-column busy % [0-100] [Q8.8] uint16_t IpuBusy[8]; //Time filtered IPU per-column busy % [0-100]
uint16_t AverageDRAMReads; //Time filtered DRAM read bandwidth [GB/sec] [Q8.8] uint16_t DRAMReads; //Time filtered DRAM read bandwidth [MB/sec]
uint16_t AverageDRAMWrites; //Time filtered DRAM write bandwidth [GB/sec] [Q8.8] uint16_t DRAMWrites; //Time filtered DRAM write bandwidth [MB/sec]
uint16_t AverageCoreC0Residency[16]; //Time filtered per-core C0 residency % [0-100] [Q8.8] uint16_t CoreC0Residency[16]; //Time filtered per-core C0 residency % [0-100]
uint16_t IpuPower; //Time filtered IPU power [W] [Q8.8] uint16_t IpuPower; //Time filtered IPU power [mW]
uint32_t ApuPower; //Time filtered APU power [W] [Q24.8] uint32_t ApuPower; //Time filtered APU power [mW]
uint32_t dGpuPower; //Time filtered dGPU power [W] [Q24.8] uint32_t GfxPower; //Time filtered GFX power [mW]
uint32_t AverageSocketPower; //Time filtered power used for PPT/STAPM [APU+dGPU] [W] [Q24.8] uint32_t dGpuPower; //Time filtered dGPU power [mW]
uint32_t AverageCorePower; //Time filtered sum of core power across all cores in the socket [W] [Q24.8] uint32_t SocketPower; //Time filtered power used for PPT/STAPM [APU+dGPU] [mW]
uint32_t FilterAlphaValue; //Metrics table alpha filter time constant [us] uint32_t AllCorePower; //Time filtered sum of core power across all cores in the socket [mW]
uint32_t MetricsCounter; //Counter that is incremented on every metrics table update [PM_TIMER cycles] uint32_t FilterAlphaValue; //Metrics table alpha filter time constant [us]
uint32_t MetricsCounter; //Counter that is incremented on every metrics table update [PM_TIMER cycles]
uint32_t spare[16];
} SmuMetrics_t; } SmuMetrics_t;
typedef struct {
uint16_t GfxclkFrequency; //[MHz]
uint16_t SocclkFrequency; //[MHz]
uint16_t VclkFrequency; //[MHz]
uint16_t DclkFrequency; //[MHz]
uint16_t MemclkFrequency; //[MHz]
uint16_t spare;
uint16_t UvdActivity; //[centi]
uint16_t GfxActivity; //[centi]
uint16_t Voltage[2]; //[mV] indices: VDDCR_VDD, VDDCR_SOC
uint16_t Current[2]; //[mA] indices: VDDCR_VDD, VDDCR_SOC
uint16_t Power[2]; //[mW] indices: VDDCR_VDD, VDDCR_SOC
uint16_t CoreFrequency[8]; //[MHz]
uint16_t CorePower[8]; //[mW]
uint16_t CoreTemperature[8]; //[centi-Celsius]
uint16_t L3Frequency[2]; //[MHz]
uint16_t L3Temperature[2]; //[centi-Celsius]
uint16_t spare2[24];
uint16_t GfxTemperature; //[centi-Celsius]
uint16_t SocTemperature; //[centi-Celsius]
uint16_t ThrottlerStatus;
uint16_t CurrentSocketPower; //[mW]
uint16_t StapmOpnLimit; //[W]
uint16_t StapmCurrentLimit; //[W]
uint32_t ApuPower; //[mW]
uint32_t dGpuPower; //[mW]
uint16_t VddTdcValue; //[mA]
uint16_t SocTdcValue; //[mA]
uint16_t VddEdcValue; //[mA]
uint16_t SocEdcValue; //[mA]
uint16_t InfrastructureCpuMaxFreq; //[MHz]
uint16_t InfrastructureGfxMaxFreq; //[MHz]
uint16_t SkinTemp;
uint16_t DeviceState;
uint16_t CurTemp; //[centi-Celsius]
uint16_t FilterAlphaValue; //[m]
uint16_t AverageGfxclkFrequency;
uint16_t AverageFclkFrequency;
uint16_t AverageGfxActivity;
uint16_t AverageSocclkFrequency;
uint16_t AverageVclkFrequency;
uint16_t AverageVcnActivity;
uint16_t AverageDRAMReads; //Filtered DF Bandwidth::DRAM Reads
uint16_t AverageDRAMWrites; //Filtered DF Bandwidth::DRAM Writes
uint16_t AverageSocketPower; //Filtered value of CurrentSocketPower
uint16_t AverageCorePower[2]; //Filtered of [sum of CorePower[8] per ccx])
uint16_t AverageCoreC0Residency[16]; //Filtered of [average C0 residency % per core]
uint16_t spare1;
uint32_t MetricsCounter; //Counts the # of metrics table parameter reads per update to the metrics table, i.e. if the metrics table update happens every 1 second, this value could be up to 1000 if the smu collected metrics data every cycle, or as low as 0 if the smu was asleep the whole time. Reset to 0 after writing.
} SmuMetrics_legacy_t;
//ISP tile definitions //ISP tile definitions
typedef enum { typedef enum {
TILE_XTILE = 0, //ONO0 TILE_XTILE = 0, //ONO0
......
...@@ -229,6 +229,8 @@ int smu_v14_0_check_fw_version(struct smu_context *smu) ...@@ -229,6 +229,8 @@ int smu_v14_0_check_fw_version(struct smu_context *smu)
smu->smc_driver_if_version = SMU14_DRIVER_IF_VERSION_SMU_V14_0_2; smu->smc_driver_if_version = SMU14_DRIVER_IF_VERSION_SMU_V14_0_2;
break; break;
case IP_VERSION(14, 0, 0): case IP_VERSION(14, 0, 0):
if ((smu->smc_fw_version < 0x5d3a00))
dev_warn(smu->adev->dev, "The PMFW version(%x) is behind in this BIOS!\n", smu->smc_fw_version);
smu->smc_driver_if_version = SMU14_DRIVER_IF_VERSION_SMU_V14_0_0; smu->smc_driver_if_version = SMU14_DRIVER_IF_VERSION_SMU_V14_0_0;
break; break;
default: default:
......
...@@ -1004,6 +1004,9 @@ void smu_cmn_init_soft_gpu_metrics(void *table, uint8_t frev, uint8_t crev) ...@@ -1004,6 +1004,9 @@ void smu_cmn_init_soft_gpu_metrics(void *table, uint8_t frev, uint8_t crev)
case METRICS_VERSION(2, 4): case METRICS_VERSION(2, 4):
structure_size = sizeof(struct gpu_metrics_v2_4); structure_size = sizeof(struct gpu_metrics_v2_4);
break; break;
case METRICS_VERSION(3, 0):
structure_size = sizeof(struct gpu_metrics_v3_0);
break;
default: default:
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment