Skip to contentSkip to conversation

drm/amdgpu: update ecc query support for arcturus

PATCH In review Hawking Zhang 2 participants 2 messages Mar 12, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: update ecc query support for arcturus

arcturus and sienna_cichlid share the same version of umc_info interface (umc_info v33). arcturus uses umc_config to indicate ECC capability, while sienna_cichlid uses umc_config1 to indicate ECC capability. driver needs to check either umc_config or umc_config1 to decide ECC capability for ASICs that use umc_info v33 interface.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c +10 -6
index 2b5c823995f9..60716b35444b 100644
@@ -361,6 +361,8 @@ bool amdgpu_atomfirmware_mem_ecc_supported(struct amdgpu_device *adev)
 	union umc_info *umc_info;
 	u8 frev, crev;
 	bool ecc_default_enabled = false;
+	u8 umc_config;
+	u32 umc_config1;
 
 	index = get_index_into_master_table(atom_master_list_of_data_tables_v2_1,
 			umc_info);
@@ -372,19 +374,21 @@ bool amdgpu_atomfirmware_mem_ecc_supported(struct amdgpu_device *adev)
 				(mode_info->atom_context->bios + data_offset);
 			switch (crev) {
 			case 1:
+				umc_config = le32_to_cpu(umc_info->v31.umc_config);
 				ecc_default_enabled =
-					(le32_to_cpu(umc_info->v31.umc_config) &
-					 UMC_CONFIG__DEFAULT_MEM_ECC_ENABLE) ? true : false;
+					(umc_config & UMC_CONFIG__DEFAULT_MEM_ECC_ENABLE) ? true : false;
 				break;
 			case 2:
+				umc_config = le32_to_cpu(umc_info->v32.umc_config);
 				ecc_default_enabled =
-					(le32_to_cpu(umc_info->v32.umc_config) &
-					 UMC_CONFIG__DEFAULT_MEM_ECC_ENABLE) ? true : false;
+					(umc_config & UMC_CONFIG__DEFAULT_MEM_ECC_ENABLE) ? true : false;
 				break;
 			case 3:
+				umc_config = le32_to_cpu(umc_info->v33.umc_config);
+				umc_config1 = le32_to_cpu(umc_info->v33.umc_config1);
 				ecc_default_enabled =
-					(le32_to_cpu(umc_info->v33.umc_config1) &
-					 UMC_CONFIG1__ENABLE_ECC_CAPABLE) ? true : false;
+					((umc_config & UMC_CONFIG__DEFAULT_MEM_ECC_ENABLE) ||
+					 (umc_config1 & UMC_CONFIG1__ENABLE_ECC_CAPABLE)) ? true : false;
 				break;
 			default:
 				/* unsupported crev */
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by on v1 1/1
#1 lore raw

[AMD Official Use Only - Internal Distribution Only]

This patch looks good to me

-----Original Message-----
From: Hawking Zhang <[email protected]>
Sent: Friday, March 12, 2021 10:36 PM
To: [email protected]; Min, Frank <[email protected]>; Deucher, Alexander <[email protected]>
Cc: Zhang, Hawking <[email protected]>
Subject: [PATCH] drm/amdgpu: update ecc query support for arcturus

arcturus and sienna_cichlid share the same version of umc_info interface (umc_info v33). arcturus uses umc_config to indicate ECC capability, while sienna_cichlid uses umc_config1 to indicate ECC capability. driver needs to check either umc_config or umc_config1 to decide ECC capability for ASICs that use umc_info v33 interface.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c +10 -6
index 2b5c823995f9..60716b35444b 100644
@@ -361,6 +361,8 @@ bool amdgpu_atomfirmware_mem_ecc_supported(struct amdgpu_device *adev)
 union umc_info *umc_info;
 u8 frev, crev;
 bool ecc_default_enabled = false;
+u8 umc_config;
+u32 umc_config1;
 
 index = get_index_into_master_table(atom_master_list_of_data_tables_v2_1,
 umc_info);
@@ -372,19 +374,21 @@ bool amdgpu_atomfirmware_mem_ecc_supported(struct amdgpu_device *adev)
 (mode_info->atom_context->bios + data_offset);
 switch (crev) {
 case 1:
+umc_config = le32_to_cpu(umc_info->v31.umc_config);
 ecc_default_enabled =
-(le32_to_cpu(umc_info->v31.umc_config) &
- UMC_CONFIG__DEFAULT_MEM_ECC_ENABLE) ? true : false;
+(umc_config & UMC_CONFIG__DEFAULT_MEM_ECC_ENABLE) ? true : false;
 break;
 case 2:
+umc_config = le32_to_cpu(umc_info->v32.umc_config);
 ecc_default_enabled =
-(le32_to_cpu(umc_info->v32.umc_config) &
- UMC_CONFIG__DEFAULT_MEM_ECC_ENABLE) ? true : false;
+(umc_config & UMC_CONFIG__DEFAULT_MEM_ECC_ENABLE) ? true : false;
 break;
 case 3:
+umc_config = le32_to_cpu(umc_info->v33.umc_config);
+umc_config1 = le32_to_cpu(umc_info->v33.umc_config1);
 ecc_default_enabled =
-(le32_to_cpu(umc_info->v33.umc_config1) &
- UMC_CONFIG1__ENABLE_ECC_CAPABLE) ? true : false;
+((umc_config & UMC_CONFIG__DEFAULT_MEM_ECC_ENABLE) ||
+ (umc_config1 & UMC_CONFIG1__ENABLE_ECC_CAPABLE)) ? true : false;
 break;
 default:
 /* unsupported crev */

--
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx