Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2fc62d51 authored by Chia-I Wu's avatar Chia-I Wu Committed by Greg Kroah-Hartman
Browse files

drm/amdgpu: fix xclk freq on CHIP_STONEY



commit b447b079cf3a9971ea4d31301e673f49612ccc18 upstream.

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: default avatarChia-I Wu <olvaffe@gmail.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e752bb1c
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -329,8 +329,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)
	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))