drm/amdgpu: Use SKU instead of DID for FRU check v2
Subsystems (2)
PATCH 1/1 drm/amdgpu: Use SKU instead of DID for FRU check v2
The VG20 DIDs 66a0, 66a1 and 66a4 are used for various SKUs that may or may not have the FRU EEPROM on it. Parse the VBIOS to check for server SKU variants (D131 or D134) until a more general solution can be determined.
v2: Remove string-based logic, correct the VBIOS string comment
--- .../gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c | 34 +++++++++++++------ 1 file changed, 23 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c +23 -11
@@ -34,18 +34,30 @@static bool is_fru_eeprom_supported (struct amdgpu_device *adev) { -/* TODO: Gaming SKUs don't have the FRU EEPROM. -* Use this hack to address hangs on modprobe on gaming SKUs -* until a proper solution can be implemented by only supporting -* the explicit chip IDs for VG20 Server cards -* -* TODO: Add list of supported Arcturus DIDs once confirmed +/* TODO: See if we can figure this out dynamically instead of +* having to parse VBIOS versions. */ -if ((adev->asic_type ==CHIP_VEGA20 && adev->pdev->device ==0x66a0 ) || - (adev->asic_type ==CHIP_VEGA20 && adev->pdev->device ==0x66a1 ) || - (adev->asic_type ==CHIP_VEGA20 && adev->pdev->device ==0x66a4 )) -return true; -return false; +struct atom_context *atom_ctx = adev->mode_info.atom_context; + +/* VBIOS is of the format ###-DXXXYY-##. For SKU identification, +* we can use just the "DXXX" portion. If there were more models, we +* could convert the 3 characters to a hex integer and use a switch +* for ease/speed/readability. For now, 2 string comparisons are +* reasonable and not too expensive +*/ +switch (adev->asic_type) { +case CHIP_VEGA20 : +/* D161 and D163 are the VG20 server SKUs */ +if (strnstr (atom_ctx->vbios_version,"D161" , +sizeof (atom_ctx->vbios_version)) || +strnstr (atom_ctx->vbios_version,"D163" , +sizeof (atom_ctx->vbios_version))) +return true; +else +return false; +default : +return false; + } } static int amdgpu_fru_read_eeprom(struct amdgpu_device *adev, uint32_t addrptr,
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Am 2020-09-29 um 11:08 a.m. schrieb Kent Russell:
Quoted 7 lines
The VG20 DIDs 66a0, 66a1 and 66a4 are used for various SKUs that may or may not have the FRU EEPROM on it. Parse the VBIOS to check for server SKU variants (D131 or D134) until a more general solution can be determined.
v2: Remove string-based logic, correct the VBIOS string comment
Signed-off-by Kent Russell <[email protected]>
Quoted 40 lines
--- .../gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c | 34 +++++++++++++------ 1 file changed, 23 insertions(+), 11 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c +16
-11@@ -34,18 +34,30 @@ static bool is_fru_eeprom_supported(struct amdgpu_device *adev) { -/* TODO: Gaming SKUs don't have the FRU EEPROM. -* Use this hack to address hangs on modprobe on gaming SKUs -* until a proper solution can be implemented by only supporting -* the explicit chip IDs for VG20 Server cards -* -* TODO: Add list of supported Arcturus DIDs once confirmed + /* TODO: See if we can figure this out dynamically instead of + * having to parse VBIOS versions. */ -if ((adev->asic_type ==CHIP_VEGA20 && adev->pdev->device ==0x66a0 ) || - (adev->asic_type ==CHIP_VEGA20 && adev->pdev->device ==0x66a1 ) || - (adev->asic_type ==CHIP_VEGA20 && adev->pdev->device ==0x66a4 )) -return true; -return false; + struct atom_context *atom_ctx = adev->mode_info.atom_context; + + /* VBIOS is of the format ###-DXXXYY-##. For SKU identification, + * we can use just the "DXXX" portion. If there were more models, we + * could convert the 3 characters to a hex integer and use a switch + * for ease/speed/readability. For now, 2 string comparisons are + * reasonable and not too expensive + */ + switch (adev->asic_type) { + case CHIP_VEGA20: + /* D161 and D163 are the VG20 server SKUs */ + if (strnstr(atom_ctx->vbios_version, "D161", + sizeof(atom_ctx->vbios_version)) || + strnstr(atom_ctx->vbios_version, "D163",
drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c line 63
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c +7
-0+ sizeof(atom_ctx->vbios_version))) +return true; + else + return false; +default : +return false; + } } static int amdgpu_fru_read_eeprom(struct amdgpu_device *adev, uint32_t addrptr,
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx