[PATCH 3/3] drm/amd: Read IMU FW version from scratch register during hw_init

Deucher, Alexander Alexander.Deucher at amd.com
Fri Oct 13 19:41:40 UTC 2023


[AMD Official Use Only - General]

Series is:
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
________________________________
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> on behalf of Mario Limonciello <mario.limonciello at amd.com>
Sent: Friday, October 13, 2023 3:26 PM
To: amd-gfx at lists.freedesktop.org <amd-gfx at lists.freedesktop.org>
Cc: Limonciello, Mario <Mario.Limonciello at amd.com>
Subject: [PATCH 3/3] 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.

Signed-off-by: Mario Limonciello <mario.limonciello at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
index f0957d060750..154b20492123 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;
 }

--
2.34.1

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20231013/77ff5a18/attachment.htm>


More information about the amd-gfx mailing list