Skip to contentSkip to conversation

drm/amdgpu: Add pldm version reporting

PATCH In review Asad Kamal 2 participants 4 messages May 13, 2025

Subsystems (3)
lore
Share & tools
lore

Asad Kamal

author
#0 lore raw

PATCH 1/3 drm/amdgpu: Add pldm version reporting

Add pldm version reporting through sysfs node

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 3 ++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +2 -1
index 3d9e9fdc10b4..4a72c2bbd49e 100644
@@ -767,6 +767,7 @@ FW_VERSION_ATTR(vcn_fw_version, 0444, vcn.fw_version);
 FW_VERSION_ATTR(dmcu_fw_version, 0444, dm.dmcu_fw_version);
 FW_VERSION_ATTR(mes_fw_version, 0444, mes.sched_version & AMDGPU_MES_VERSION_MASK);
 FW_VERSION_ATTR(mes_kiq_fw_version, 0444, mes.kiq_version & AMDGPU_MES_VERSION_MASK);
+FW_VERSION_ATTR(pldm_fw_version, 0444, firmware.pldm_version);
 
 static struct attribute *fw_attrs[] = {
 	&dev_attr_vce_fw_version.attr, &dev_attr_uvd_fw_version.attr,
@@ -781,7 +782,7 @@ static struct attribute *fw_attrs[] = {
 	&dev_attr_sdma2_fw_version.attr, &dev_attr_vcn_fw_version.attr,
 	&dev_attr_dmcu_fw_version.attr, &dev_attr_imu_fw_version.attr,
 	&dev_attr_mes_fw_version.attr, &dev_attr_mes_kiq_fw_version.attr,
-	NULL
+	&dev_attr_pldm_fw_version.attr, NULL
 };
 
 #define to_dev_attr(x) container_of(x, struct device_attribute, attr)
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h +1 -0
index 06fe21e15ed6..9e89c3487be5 100644
@@ -602,6 +602,7 @@ struct amdgpu_firmware {
 
 	void *fw_buf_ptr;
 	uint64_t fw_buf_mc;
+	uint32_t pldm_version;
 };
 
 void amdgpu_ucode_print_mc_hdr(const struct common_firmware_header *hdr);
Signature · 1 line
2.46.0
author
#1 lore raw

PATCH 2/3 drm/amd/pm: Update pmfw headers for smu_v_13_0_6

Update pmfw headers for smu_v_13_0_6 to include pldm version as part of statics metrics table

---
 drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_6_pmfw.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_6_pmfw.h +3 -1
index 3d9e5e967c94..01790a927930 100644
@@ -127,7 +127,7 @@ typedef enum {
   VOLTAGE_GUARDBAND_COUNT
 } GFX_GUARDBAND_e;
 
-#define SMU_METRICS_TABLE_VERSION 0x10
+#define SMU_METRICS_TABLE_VERSION 0x11
 
 // Unified metrics table for smu_v13_0_6
 typedef struct __attribute__((packed, aligned(4))) {
@@ -463,6 +463,8 @@ typedef struct __attribute__((packed, aligned(4))) {
 typedef struct {
   // Telemetry
   uint32_t InputTelemetryVoltageInmV;
+  // General info
+  uint32_t pldmVersion[2];
 } StaticMetricsTable_t;
 #pragma pack(pop)
 
Signature · 1 line
2.46.0
author
#2 lore raw

PATCH 3/3 drm/amd/pm: Fill pldm version for SMU v13.0.6 SOCs

In reply to Asad Kamal

Fetch pldm version from static metrics table for SMU v13.0.6 SOCs

---
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 7 +++++++
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.h | 1 +
 2 files changed, 8 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +7 -0
index 7d4ff09be7e8..cd9ed3b5e9fa 100644
@@ -396,6 +396,8 @@ static void smu_v13_0_6_init_caps(struct smu_context *smu)
 			smu_v13_0_6_cap_set(smu, SMU_CAP(STATIC_METRICS));
 			smu_v13_0_6_cap_set(smu, SMU_CAP(BOARD_VOLTAGE));
 		}
+		if (fw_ver >= 0x00558000)
+			smu_v13_0_6_cap_set(smu, SMU_CAP(PLDM_VERSION));
 	}
 	if (((pgm == 7) && (fw_ver >= 0x7550700)) ||
 	    ((pgm == 0) && (fw_ver >= 0x00557900)) ||
@@ -752,6 +754,11 @@ static void smu_v13_0_6_fill_static_metrics_table(struct smu_context *smu,
 	}
 
 	dpm_context->board_volt = static_metrics->InputTelemetryVoltageInmV;
+
+	if (smu_v13_0_6_cap_supported(smu, SMU_CAP(PLDM_VERSION)) &&
+	    static_metrics->pldmVersion[0] != 0xFFFFFFFF)
+		smu->adev->firmware.pldm_version =
+			static_metrics->pldmVersion[0];
 }
 
 int smu_v13_0_6_get_static_metrics_table(struct smu_context *smu)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.h +1 -0
index 5313206ae4bb..6e7293d3f264 100644
@@ -67,6 +67,7 @@ enum smu_v13_0_6_caps {
 	SMU_CAP(STATIC_METRICS),
 	SMU_CAP(HST_LIMIT_METRICS),
 	SMU_CAP(BOARD_VOLTAGE),
+	SMU_CAP(PLDM_VERSION),
 	SMU_CAP(ALL),
 };
 
Signature · 1 line
2.46.0
Reviewed-by on v1 3/3
#3 lore raw

RE: [PATCH 3/3] drm/amd/pm: Fill pldm version for SMU v13.0.6 SOCs

[AMD Official Use Only - AMD Internal Distribution Only]

Series is

Regards,
Hawking
-----Original Message-----
From: Kamal, Asad <[email protected]>
Sent: Tuesday, May 13, 2025 19:22
To: [email protected]; Lazar, Lijo <[email protected]>
Cc: Zhang, Hawking <[email protected]>; Ma, Le <[email protected]>; Zhang, Morris <[email protected]>; Kamal, Asad <[email protected]>; Deucher, Alexander <[email protected]>
Subject: [PATCH 3/3] drm/amd/pm: Fill pldm version for SMU v13.0.6 SOCs

Fetch pldm version from static metrics table for SMU v13.0.6 SOCs

---
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 7 +++++++  drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.h | 1 +
 2 files changed, 8 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +2 -0
index 7d4ff09be7e8..cd9ed3b5e9fa 100644
@@ -396,6 +396,8 @@ static void smu_v13_0_6_init_caps(struct smu_context *smu)
                        smu_v13_0_6_cap_set(smu, SMU_CAP(STATIC_METRICS));
                        smu_v13_0_6_cap_set(smu, SMU_CAP(BOARD_VOLTAGE));
                }
+               if (fw_ver >= 0x00558000)
+                       smu_v13_0_6_cap_set(smu, SMU_CAP(PLDM_VERSION));
        }
        if (((pgm == 7) && (fw_ver >= 0x7550700)) ||
            ((pgm == 0) && (fw_ver >= 0x00557900)) || @@ -752,6 +754,11 @@ static void smu_v13_0_6_fill_static_metrics_table(struct smu_context *smu,
        }

        dpm_context->board_volt = static_metrics->InputTelemetryVoltageInmV;

+
+ if (smu_v13_0_6_cap_supported(smu, SMU_CAP(PLDM_VERSION)) &&
+ static_metrics->pldmVersion[0] != 0xFFFFFFFF)
+ smu->adev->firmware.pldm_version =
+ static_metrics->pldmVersion[0];
}

int smu_v13_0_6_get_static_metrics_table(struct smu_context *smu) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.h b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.h
index 5313206ae4bb..6e7293d3f264 100644

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.h +1 -0
@@ -67,6 +67,7 @@ enum smu_v13_0_6_caps {
        SMU_CAP(STATIC_METRICS),
        SMU_CAP(HST_LIMIT_METRICS),
        SMU_CAP(BOARD_VOLTAGE),
+       SMU_CAP(PLDM_VERSION),
        SMU_CAP(ALL),
 };
 

--
2.46.0