Skip to content

Commit 9a53006

Browse files
aaliuamdalexdeucher
authored andcommitted
drm/amdgpu: modify system reference clock source for navi+ (V2)
Starting from Navi+, the rlc reference clock is used for system clock from vbios gfx_info table. It is incorrect to use core_refclk_10khz of vbios smu_info table as system clock. Signed-off-by: Aaron Liu <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Acked-by: Huang Rui <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 87476d1 commit 9a53006

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,21 @@ int amdgpu_atomfirmware_get_clock_info(struct amdgpu_device *adev)
546546
ret = 0;
547547
}
548548

549+
/* if asic is Navi+, the rlc reference clock is used for system clock
550+
* from vbios gfx_info table */
551+
if (adev->asic_type >= CHIP_NAVI10) {
552+
index = get_index_into_master_table(atom_master_list_of_data_tables_v2_1,
553+
gfx_info);
554+
if (amdgpu_atom_parse_data_header(mode_info->atom_context, index, NULL,
555+
&frev, &crev, &data_offset)) {
556+
struct atom_gfx_info_v2_2 *gfx_info = (struct atom_gfx_info_v2_2*)
557+
(mode_info->atom_context->bios + data_offset);
558+
if ((frev == 2) && (crev >= 2))
559+
spll->reference_freq = le32_to_cpu(gfx_info->rlc_gpu_timer_refclk);
560+
ret = 0;
561+
}
562+
}
563+
549564
return ret;
550565
}
551566

0 commit comments

Comments
 (0)