[PATCH 1/4] drm/amdgpu: enable FRU device for SMU v13.0.6

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Yang Wang <kevinyang.wang@xxxxxxx>

v1:
enable GFX v9.4.3 FRU device to query board information.

v2:
use MP1 version to identify different asic

Signed-off-by: Yang Wang <kevinyang.wang@xxxxxxx>
Reviewed-by: Lijo Lazar <lijo.lazar@xxxxxxx>
Acked-by: Alex Deucher <alexander.deucher@xxxxxxx>
---
 .../gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c    | 48 +++++++++++--------
 1 file changed, 29 insertions(+), 19 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c
index 7cd0dfaeee20..d0ae9cada110 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c
@@ -57,27 +57,26 @@ static bool is_fru_eeprom_supported(struct amdgpu_device *adev, u32 *fru_addr)
 	 * 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_pn, "D161",
-			    sizeof(atom_ctx->vbios_pn)) ||
-		    strnstr(atom_ctx->vbios_pn, "D163",
-			    sizeof(atom_ctx->vbios_pn))) {
-			if (fru_addr)
-				*fru_addr = FRU_EEPROM_MADDR_6;
-			return true;
-		} else {
+	switch (amdgpu_ip_version(adev, MP1_HWIP, 0)) {
+	case IP_VERSION(11, 0, 2):
+		switch (adev->asic_type) {
+		case CHIP_VEGA20:
+			/* D161 and D163 are the VG20 server SKUs */
+			if (strnstr(atom_ctx->vbios_pn, "D161",
+				    sizeof(atom_ctx->vbios_pn)) ||
+			    strnstr(atom_ctx->vbios_pn, "D163",
+				    sizeof(atom_ctx->vbios_pn))) {
+				if (fru_addr)
+					*fru_addr = FRU_EEPROM_MADDR_6;
+				return true;
+			} else {
+				return false;
+			}
+		case CHIP_ARCTURUS:
+		default:
 			return false;
 		}
-	case CHIP_ALDEBARAN:
-		/* All Aldebaran SKUs have an FRU */
-		if (!strnstr(atom_ctx->vbios_pn, "D673",
-			     sizeof(atom_ctx->vbios_pn)))
-			if (fru_addr)
-				*fru_addr = FRU_EEPROM_MADDR_6;
-		return true;
-	case CHIP_SIENNA_CICHLID:
+	case IP_VERSION(11, 0, 7):
 		if (strnstr(atom_ctx->vbios_pn, "D603",
 			    sizeof(atom_ctx->vbios_pn))) {
 			if (strnstr(atom_ctx->vbios_pn, "D603GLXE",
@@ -92,6 +91,17 @@ static bool is_fru_eeprom_supported(struct amdgpu_device *adev, u32 *fru_addr)
 		} else {
 			return false;
 		}
+	case IP_VERSION(13, 0, 2):
+		/* All Aldebaran SKUs have an FRU */
+		if (!strnstr(atom_ctx->vbios_pn, "D673",
+			     sizeof(atom_ctx->vbios_pn)))
+			if (fru_addr)
+				*fru_addr = FRU_EEPROM_MADDR_6;
+		return true;
+	case IP_VERSION(13, 0, 6):
+			if (fru_addr)
+				*fru_addr = FRU_EEPROM_MADDR_8;
+			return true;
 	default:
 		return false;
 	}
-- 
2.25.1




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux