aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmit Daniel Kachhap <amit.daniel@samsung.com>2014-07-04 17:40:23 -0400
committerKukjin Kim <kgene.kim@samsung.com>2014-07-04 17:40:23 -0400
commit8bf13a4346996b5a53d5f0c64b0914693c818fc2 (patch)
tree7a493aadaffa5f9217ea4b3732e48f8fb0d1d332
parent89e6a13b88c8bf7ce1011a8a69113f22889f4585 (diff)
clocksource: exynos_mct: Register the timer for stable udelay
This patch registers the exynos mct clocksource as the current timer as it has constant clock rate. This will generate correct udelay for the exynos platform and avoid using unnecessary calibrated jiffies. This change has been tested on exynos5420 based board and udelay is very close to expected. Without this patch udelay() on exynos5400 / exynos5800 is wildly inaccurate due to big.LITTLE not adjusting loops_per_jiffy correctly. Also without this patch udelay() on exynos5250 can be innacruate during transitions between frequencies < 800 MHz (you'll go 200 MHz -> 800 MHz -> 300 MHz and will run at 800 MHz for a time with the wrong loops_per_jiffy). [dianders: reworked and created version 3] Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Signed-off-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
-rw-r--r--drivers/clocksource/exynos_mct.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c
index 5ce99c07ce8c..ab51bf20a3ed 100644
--- a/drivers/clocksource/exynos_mct.c
+++ b/drivers/clocksource/exynos_mct.c
@@ -200,10 +200,21 @@ static u64 notrace exynos4_read_sched_clock(void)
200 return _exynos4_frc_read(); 200 return _exynos4_frc_read();
201} 201}
202 202
203static struct delay_timer exynos4_delay_timer;
204
205static cycles_t exynos4_read_current_timer(void)
206{
207 return _exynos4_frc_read();
208}
209
203static void __init exynos4_clocksource_init(void) 210static void __init exynos4_clocksource_init(void)
204{ 211{
205 exynos4_mct_frc_start(); 212 exynos4_mct_frc_start();
206 213
214 exynos4_delay_timer.read_current_timer = &exynos4_read_current_timer;
215 exynos4_delay_timer.freq = clk_rate;
216 register_current_timer_delay(&exynos4_delay_timer);
217
207 if (clocksource_register_hz(&mct_frc, clk_rate)) 218 if (clocksource_register_hz(&mct_frc, clk_rate))
208 panic("%s: can't register clocksource\n", mct_frc.name); 219 panic("%s: can't register clocksource\n", mct_frc.name);
209 220