From dcdbda5c93bedbce202e2f55903a7f52dd4f84f6 Mon Sep 17 00:00:00 2001 From: Bo-Chen Chen Date: Thu, 18 Aug 2022 18:28:27 +0800 Subject: soc/mediatek/mt8188: Use MHz as unit for current_clk The unit of current_clk in pmif_ulposc_check() should be MHz. We use pmif_get_ulposc_freq_mhz() to get the default hardware value in MHz. Without this modification, the judgement in pmif_ulposc_check() is alway wrong due to the wrong unit. TEST=build pass. BUG=b:233720142 Signed-off-by: Bo-Chen Chen Change-Id: I3bf80a23bb35ff657023eb4b7e009fa233f61244 Reviewed-on: https://review.coreboot.org/c/coreboot/+/66971 Tested-by: build bot (Jenkins) Reviewed-by: Yu-Ping Wu --- src/soc/mediatek/common/pmif_clk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/soc/mediatek/common') diff --git a/src/soc/mediatek/common/pmif_clk.c b/src/soc/mediatek/common/pmif_clk.c index b7f2228a76..cfd1dbce6b 100644 --- a/src/soc/mediatek/common/pmif_clk.c +++ b/src/soc/mediatek/common/pmif_clk.c @@ -10,13 +10,13 @@ int pmif_ulposc_check(u32 current_clk, u32 target_clk) if (current_clk < (target_clk * (1000 - CAL_TOL_RATE) / 1000) || current_clk > (target_clk * (1000 + CAL_TOL_RATE) / 1000)) { printk(BIOS_WARNING, - "[%s] calibration fail: cur=%d, CAL_RATE=%d, target=%dM\n", + "[%s] calibration fail: cur=%dM, CAL_RATE=%d, target=%dM\n", __func__, current_clk, CAL_TOL_RATE, target_clk); return -1; } printk(BIOS_DEBUG, - "[%s] calibration done: cur=%d, CAL_RATE=%d, target=%dM\n", + "[%s] calibration done: cur=%dM, CAL_RATE=%d, target=%dM\n", __func__, current_clk, CAL_TOL_RATE, target_clk); return 0; -- cgit v1.2.3