Skip to content

Commit e0c5c38

Browse files
Hawking Zhangalexdeucher
authored andcommitted
drm/amdgpu: Support query ecc cap for aqua_vanjaram
Driver queries umc_info v4_0 to identify ecc cap for aqua_vanjaram Signed-off-by: Hawking Zhang <[email protected]> Reviewed-by: Candice Li <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 48d02dc commit e0c5c38

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ union umc_info {
217217
struct atom_umc_info_v3_1 v31;
218218
struct atom_umc_info_v3_2 v32;
219219
struct atom_umc_info_v3_3 v33;
220+
struct atom_umc_info_v4_0 v40;
220221
};
221222

222223
union vram_info {
@@ -508,9 +509,8 @@ bool amdgpu_atomfirmware_mem_ecc_supported(struct amdgpu_device *adev)
508509

509510
if (amdgpu_atom_parse_data_header(mode_info->atom_context,
510511
index, &size, &frev, &crev, &data_offset)) {
512+
umc_info = (union umc_info *)(mode_info->atom_context->bios + data_offset);
511513
if (frev == 3) {
512-
umc_info = (union umc_info *)
513-
(mode_info->atom_context->bios + data_offset);
514514
switch (crev) {
515515
case 1:
516516
umc_config = le32_to_cpu(umc_info->v31.umc_config);
@@ -533,6 +533,20 @@ bool amdgpu_atomfirmware_mem_ecc_supported(struct amdgpu_device *adev)
533533
/* unsupported crev */
534534
return false;
535535
}
536+
} else if (frev == 4) {
537+
switch (crev) {
538+
case 0:
539+
umc_config1 = le32_to_cpu(umc_info->v40.umc_config1);
540+
ecc_default_enabled =
541+
(umc_config1 & UMC_CONFIG1__ENABLE_ECC_CAPABLE) ? true : false;
542+
break;
543+
default:
544+
/* unsupported crev */
545+
return false;
546+
}
547+
} else {
548+
/* unsupported frev */
549+
return false;
536550
}
537551
}
538552

0 commit comments

Comments
 (0)