]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
drm/amdgpu: fix xclk freq on CHIP_STONEY
authorChia-I Wu <olvaffe@gmail.com>
Thu, 1 Jun 2023 21:48:08 +0000 (14:48 -0700)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 9 Jun 2023 16:41:11 +0000 (12:41 -0400)
According to Alex, most APUs from that time seem to have the same issue
(vbios says 48Mhz, actual is 100Mhz).  I only have a CHIP_STONEY so I
limit the fixup to CHIP_STONEY

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/vi.c

index 770f2d7a371fc0a5853e446cadde17f6a2dda521..6a8494f98d3ef488659479270b8a2a5464585868 100644 (file)
@@ -542,8 +542,15 @@ static u32 vi_get_xclk(struct amdgpu_device *adev)
        u32 reference_clock = adev->clock.spll.reference_freq;
        u32 tmp;
 
-       if (adev->flags & AMD_IS_APU)
-               return reference_clock;
+       if (adev->flags & AMD_IS_APU) {
+               switch (adev->asic_type) {
+               case CHIP_STONEY:
+                       /* vbios says 48Mhz, but the actual freq is 100Mhz */
+                       return 10000;
+               default:
+                       return reference_clock;
+               }
+       }
 
        tmp = RREG32_SMC(ixCG_CLKPIN_CNTL_2);
        if (REG_GET_FIELD(tmp, CG_CLKPIN_CNTL_2, MUX_TCLK_TO_XCLK))