Commit 97e27292 authored by Hawking Zhang's avatar Hawking Zhang Committed by Alex Deucher

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.
Signed-off-by: default avatarHawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: default avatarFrank Min <Frank.Min@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 94ae8dc5
...@@ -361,6 +361,8 @@ bool amdgpu_atomfirmware_mem_ecc_supported(struct amdgpu_device *adev) ...@@ -361,6 +361,8 @@ bool amdgpu_atomfirmware_mem_ecc_supported(struct amdgpu_device *adev)
union umc_info *umc_info; union umc_info *umc_info;
u8 frev, crev; u8 frev, crev;
bool ecc_default_enabled = false; 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, index = get_index_into_master_table(atom_master_list_of_data_tables_v2_1,
umc_info); umc_info);
...@@ -372,19 +374,21 @@ bool amdgpu_atomfirmware_mem_ecc_supported(struct amdgpu_device *adev) ...@@ -372,19 +374,21 @@ bool amdgpu_atomfirmware_mem_ecc_supported(struct amdgpu_device *adev)
(mode_info->atom_context->bios + data_offset); (mode_info->atom_context->bios + data_offset);
switch (crev) { switch (crev) {
case 1: case 1:
umc_config = le32_to_cpu(umc_info->v31.umc_config);
ecc_default_enabled = ecc_default_enabled =
(le32_to_cpu(umc_info->v31.umc_config) & (umc_config & UMC_CONFIG__DEFAULT_MEM_ECC_ENABLE) ? true : false;
UMC_CONFIG__DEFAULT_MEM_ECC_ENABLE) ? true : false;
break; break;
case 2: case 2:
umc_config = le32_to_cpu(umc_info->v32.umc_config);
ecc_default_enabled = ecc_default_enabled =
(le32_to_cpu(umc_info->v32.umc_config) & (umc_config & UMC_CONFIG__DEFAULT_MEM_ECC_ENABLE) ? true : false;
UMC_CONFIG__DEFAULT_MEM_ECC_ENABLE) ? true : false;
break; break;
case 3: 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 = ecc_default_enabled =
(le32_to_cpu(umc_info->v33.umc_config1) & ((umc_config & UMC_CONFIG__DEFAULT_MEM_ECC_ENABLE) ||
UMC_CONFIG1__ENABLE_ECC_CAPABLE) ? true : false; (umc_config1 & UMC_CONFIG1__ENABLE_ECC_CAPABLE)) ? true : false;
break; break;
default: default:
/* unsupported crev */ /* unsupported crev */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment