summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
diff options
context:
space:
mode:
authorMario Limonciello <mario.limonciello@amd.com>2023-10-13 22:26:04 +0300
committerAlex Deucher <alexander.deucher@amd.com>2023-10-20 01:26:51 +0300
commite56690bb37eb202cfc31deb6b794dc8fca9b9a89 (patch)
tree9cad8b3d67e0026341a965dcfa7a7b31508ba550 /drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
parent4916615fe96fb530517b0d46702c750c20a5601c (diff)
downloadlinux-e56690bb37eb202cfc31deb6b794dc8fca9b9a89.tar.xz
drm/amd: Read IMU FW version from scratch register during hw_init
If the IMU version wasn't discovered from the header, such as when the firmware was directly loaded by PSP then there is no firmware version to show to userspace from sysfs or IOCTL. The IMU F/W stores the version in the first scratch register though, so fetch it in these cases to let the driver export. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
index f994508a36ea..fd22943685f7 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
@@ -4373,6 +4373,10 @@ static int gfx_v11_0_hw_init(void *handle)
if (r)
return r;
+ /* get IMU version from HW if it's not set */
+ if (!adev->gfx.imu_fw_version)
+ adev->gfx.imu_fw_version = RREG32_SOC15(GC, 0, regGFX_IMU_SCRATCH_0);
+
return r;
}