<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:10pt;color:#0000FF;margin:5pt;font-style:normal;font-weight:normal;text-decoration:none;" align="Left">
[AMD Official Use Only - General]<br>
</p>
<br>
<div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Series is:</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Reviewed-by: Alex Deucher <alexander.deucher@amd.com><br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Mario Limonciello <mario.limonciello@amd.com><br>
<b>Sent:</b> Friday, October 13, 2023 3:26 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Limonciello, Mario <Mario.Limonciello@amd.com><br>
<b>Subject:</b> [PATCH 3/3] drm/amd: Read IMU FW version from scratch register during hw_init</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">If the IMU version wasn't discovered from the header, such as when<br>
the firmware was directly loaded by PSP then there is no firmware<br>
version to show to userspace from sysfs or IOCTL.<br>
<br>
The IMU F/W stores the version in the first scratch register though,<br>
so fetch it in these cases to let the driver export.<br>
<br>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com><br>
---<br>
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 4 ++++<br>
1 file changed, 4 insertions(+)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c<br>
index f0957d060750..154b20492123 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c<br>
@@ -4373,6 +4373,10 @@ static int gfx_v11_0_hw_init(void *handle)<br>
if (r)<br>
return r;<br>
<br>
+ /* get IMU version from HW if it's not set */<br>
+ if (!adev->gfx.imu_fw_version)<br>
+ adev->gfx.imu_fw_version = RREG32_SOC15(GC, 0, regGFX_IMU_SCRATCH_0);<br>
+<br>
return r;<br>
}<br>
<br>
-- <br>
2.34.1<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>