<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;" align="Left">
[AMD Official Use Only]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Series is:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
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 Kent Russell <kent.russell@amd.com><br>
<b>Sent:</b> Friday, December 17, 2021 10:31 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Russell, Kent <Kent.Russell@amd.com><br>
<b>Subject:</b> [PATCH 4/4] drm/amdgpu: Access the FRU on Aldebaran</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">This is supported, although the offset is different from VG20, so fix<br>
that with a variable and enable getting the product name and serial<br>
number from the FRU. Do this for all SKUs since all SKUs have the FRU<br>
<br>
Signed-off-by: Kent Russell <kent.russell@amd.com><br>
---<br>
drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c | 13 ++++++++++---<br>
1 file changed, 10 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c<br>
index 5ed24701f9cf..80f43e69e659 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c<br>
@@ -56,6 +56,9 @@ static bool is_fru_eeprom_supported(struct amdgpu_device *adev)<br>
return true;<br>
else<br>
return false;<br>
+ case CHIP_ALDEBARAN:<br>
+ /* All Aldebaran SKUs have the FRU */<br>
+ return true;<br>
default:<br>
return false;<br>
}<br>
@@ -91,6 +94,10 @@ int amdgpu_fru_get_product_info(struct amdgpu_device *adev)<br>
unsigned char buff[PRODUCT_NAME_LEN+2];<br>
u32 addrptr;<br>
int size, len;<br>
+ int offset = 2;<br>
+<br>
+ if (adev->asic_type == CHIP_ALDEBARAN)<br>
+ offset = 0;<br>
<br>
if (!is_fru_eeprom_supported(adev))<br>
return 0;<br>
@@ -137,7 +144,7 @@ int amdgpu_fru_get_product_info(struct amdgpu_device *adev)<br>
len = PRODUCT_NAME_LEN - 1;<br>
}<br>
/* Start at 2 due to buff using fields 0 and 1 for the address */<br>
- memcpy(adev->product_name, &buff[2], len);<br>
+ memcpy(adev->product_name, &buff[offset], len);<br>
adev->product_name[len] = '\0';<br>
<br>
addrptr += size + 1;<br>
@@ -155,7 +162,7 @@ int amdgpu_fru_get_product_info(struct amdgpu_device *adev)<br>
DRM_WARN("FRU Product Number is larger than 16 characters. This is likely a mistake");<br>
len = sizeof(adev->product_number) - 1;<br>
}<br>
- memcpy(adev->product_number, &buff[2], len);<br>
+ memcpy(adev->product_number, &buff[offset], len);<br>
adev->product_number[len] = '\0';<br>
<br>
addrptr += size + 1;<br>
@@ -182,7 +189,7 @@ int amdgpu_fru_get_product_info(struct amdgpu_device *adev)<br>
DRM_WARN("FRU Serial Number is larger than 16 characters. This is likely a mistake");<br>
len = sizeof(adev->serial) - 1;<br>
}<br>
- memcpy(adev->serial, &buff[2], len);<br>
+ memcpy(adev->serial, &buff[offset], len);<br>
adev->serial[len] = '\0';<br>
<br>
return 0;<br>
-- <br>
2.25.1<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>