Skip to contentSkip to conversation

drm/amdgpu: Fetch TOS version in PSP v15.0.8

PATCH Superseded Lijo Lazar 1 participant 1 message Nov 6

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Lijo Lazar

author
#0 lore raw

PATCH 1/1 drm/amdgpu: Fetch TOS version in PSP v15.0.8

For PSP v15.0.8, PSP is initialized along with VBIOS. Query and keep the version during early init.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c  |  3 +--
 drivers/gpu/drm/amd/amdgpu/psp_v15_0_8.c | 10 ++++++++++
 2 files changed, 11 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +1 -2
index c0ed3e24b684..548e017311d4 100644
@@ -191,6 +191,7 @@ static int psp_early_init(struct amdgpu_ip_block *ip_block)
 
 	psp->autoload_supported = true;
 	psp->boot_time_tmr = true;
+	psp->adev = adev;
 
 	switch (amdgpu_ip_version(adev, MP0_HWIP, 0)) {
 	case IP_VERSION(9, 0, 0):
@@ -298,8 +299,6 @@ static int psp_early_init(struct amdgpu_ip_block *ip_block)
 		return -EINVAL;
 	}
 
-	psp->adev = adev;
-
 	adev->psp_timeout = 20000;
 
 	psp_check_pmfw_centralized_cstate_management(psp);
drivers/gpu/drm/amd/amdgpu/psp_v15_0_8.c +10 -0
index dcfc9be269b0..803414e0be62 100644
@@ -36,6 +36,13 @@ MODULE_FIRMWARE("amdgpu/psp_15_0_8_toc_1.bin");
 MODULE_FIRMWARE("amdgpu/psp_15_0_8_rl.bin");
 MODULE_FIRMWARE("amdgpu/psp_15_0_8_ta.bin");
 
+static void psp_v15_0_8_init_sos_version(struct psp_context *psp)
+{
+	struct amdgpu_device *adev = psp->adev;
+
+	psp->sos.fw_version = RREG32_SOC15(MP0, 0, regMPASP_SMN_C2PMSG_58);
+}
+
 static int psp_v15_0_8_init_microcode(struct psp_context *psp)
 {
 	struct amdgpu_device *adev = psp->adev;
@@ -507,4 +514,7 @@ static const struct psp_funcs psp_v15_0_8_funcs = {
 void psp_v15_0_8_set_psp_funcs(struct psp_context *psp)
 {
 	psp->funcs = &psp_v15_0_8_funcs;
+
+	/* Initialize SOS version as well */
+	psp_v15_0_8_init_sos_version(psp);
 }
Signature · 1 line
2.49.0