From a8a5a20793c6072128f2c417b50c8297fcad9666 Mon Sep 17 00:00:00 2001
From: John Clements <john.clements@amd.com>
Date: Mon, 23 Mar 2020 17:22:01 +0800
Subject: drm/amdgpu: disabled fru eeprom access
Git-commit: fabe01d7bbda15ae608fe8fa221b596fe498b037
Patch-mainline: v5.8-rc1
References: jsc#SLE-12680, jsc#SLE-12880, jsc#SLE-12882, jsc#SLE-12883, jsc#SLE-13496, jsc#SLE-15322
added asic support checking function to be filled in by supported asic types
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: John Clements <john.clements@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Patrik Jakobsson <pjakobsson@suse.de>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c
index 990dee6e22d5..6f5e98fda181 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c
@@ -29,6 +29,13 @@
#define I2C_PRODUCT_INFO_ADDR_SIZE 0x2
#define I2C_PRODUCT_INFO_OFFSET 0xC0
+bool is_fru_eeprom_supported(struct amdgpu_device *adev)
+{
+ /* TODO: Resolve supported ASIC type */
+
+ return false;
+}
+
int amdgpu_fru_read_eeprom(struct amdgpu_device *adev, uint32_t addrptr,
unsigned char *buff)
{
@@ -71,6 +78,9 @@ int amdgpu_fru_get_product_info(struct amdgpu_device *adev)
unsigned char buff[32];
int addrptr = 0, size = 0;
+ if (!is_fru_eeprom_supported(adev))
+ return 0;
+
/* If algo exists, it means that the i2c_adapter's initialized */
if (!adev->pm.smu_i2c.algo) {
DRM_WARN("Cannot access FRU, EEPROM accessor not initialized");
--
2.28.0