mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
drm/amd/pm: Fetch fru product info for smu_v13_0_12
Fetch fru product info for smu_v13_0_12 from static metrics table v2: Field by field copy for fru info(Lijo) Signed-off-by: Asad Kamal <asad.kamal@amd.com> Reviewed-by: Lijo Lazar <lijo.lazar@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
|
||||
#define FRU_EEPROM_MADDR_6 0x60000
|
||||
#define FRU_EEPROM_MADDR_8 0x80000
|
||||
#define FRU_EEPROM_MADDR_INV 0xFFFFF
|
||||
|
||||
static bool is_fru_eeprom_supported(struct amdgpu_device *adev, u32 *fru_addr)
|
||||
{
|
||||
@@ -104,6 +105,10 @@ static bool is_fru_eeprom_supported(struct amdgpu_device *adev, u32 *fru_addr)
|
||||
if (fru_addr)
|
||||
*fru_addr = FRU_EEPROM_MADDR_8;
|
||||
return true;
|
||||
case IP_VERSION(13, 0, 12):
|
||||
if (fru_addr)
|
||||
*fru_addr = FRU_EEPROM_MADDR_INV;
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -120,6 +125,10 @@ int amdgpu_fru_get_product_info(struct amdgpu_device *adev)
|
||||
if (!is_fru_eeprom_supported(adev, &fru_addr))
|
||||
return 0;
|
||||
|
||||
/* FRU data avaialble, but no direct EEPROM access */
|
||||
if (fru_addr == FRU_EEPROM_MADDR_INV)
|
||||
return 0;
|
||||
|
||||
if (!adev->fru_info) {
|
||||
adev->fru_info = kzalloc(sizeof(*adev->fru_info), GFP_KERNEL);
|
||||
if (!adev->fru_info)
|
||||
|
||||
Reference in New Issue
Block a user