aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/psp_v13_0.c
diff options
context:
space:
mode:
authorGravatar Lijo Lazar <lijo.lazar@amd.com> 2023-10-10 12:49:25 +0530
committerGravatar Alex Deucher <alexander.deucher@amd.com> 2023-10-13 11:02:43 -0400
commitd4a02673b3f06502ed6fa61bb6d9afeb31b668a2 (patch)
tree003c8623dd4b9edd8d61dbbeec177fdbc574dddc /drivers/gpu/drm/amd/amdgpu/psp_v13_0.c
parentdrm/amd/display: add missing NULL check for DML2 (diff)
downloadlinux-d4a02673b3f06502ed6fa61bb6d9afeb31b668a2.tar.gz
linux-d4a02673b3f06502ed6fa61bb6d9afeb31b668a2.tar.bz2
linux-d4a02673b3f06502ed6fa61bb6d9afeb31b668a2.zip
drm/amdgpu: Read PSPv13 OS version from register
PSP OS updates the version information in register. On APUs with PSPv13, PSP OS will already be loaded with SBIOS. Hence use the version register instead of using information in driver binary header. Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Reviewed-by: Yang Wang <kevinyang.wang@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/psp_v13_0.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/psp_v13_0.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v13_0.c b/drivers/gpu/drm/amd/amdgpu/psp_v13_0.c
index b7bc00d4c696..573046702861 100644
--- a/drivers/gpu/drm/amd/amdgpu/psp_v13_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/psp_v13_0.c
@@ -263,6 +263,12 @@ static int psp_v13_0_bootloader_load_ras_drv(struct psp_context *psp)
return psp_v13_0_bootloader_load_component(psp, &psp->ras_drv, PSP_BL__LOAD_RASDRV);
}
+static inline void psp_v13_0_init_sos_version(struct psp_context *psp)
+{
+ struct amdgpu_device *adev = psp->adev;
+
+ psp->sos.fw_version = RREG32_SOC15(MP0, 0, regMP0_SMN_C2PMSG_58);
+}
static int psp_v13_0_bootloader_load_sos(struct psp_context *psp)
{
@@ -273,8 +279,10 @@ static int psp_v13_0_bootloader_load_sos(struct psp_context *psp)
/* Check sOS sign of life register to confirm sys driver and sOS
* are already been loaded.
*/
- if (psp_v13_0_is_sos_alive(psp))
+ if (psp_v13_0_is_sos_alive(psp)) {
+ psp_v13_0_init_sos_version(psp);
return 0;
+ }
ret = psp_v13_0_wait_for_bootloader(psp);
if (ret)
@@ -298,6 +306,9 @@ static int psp_v13_0_bootloader_load_sos(struct psp_context *psp)
RREG32_SOC15(MP0, 0, regMP0_SMN_C2PMSG_81),
0, true);
+ if (!ret)
+ psp_v13_0_init_sos_version(psp);
+
return ret;
}