aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/clocksource/Kconfig13
-rw-r--r--drivers/clocksource/vt8500_timer.c6
2 files changed, 12 insertions, 7 deletions
diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index b251013eef0a..56777f04d2d9 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -152,7 +152,7 @@ config CLKSRC_EFM32
152 152
153config CLKSRC_LPC32XX 153config CLKSRC_LPC32XX
154 bool "Clocksource for LPC32XX" if COMPILE_TEST 154 bool "Clocksource for LPC32XX" if COMPILE_TEST
155 depends on GENERIC_CLOCKEVENTS 155 depends on GENERIC_CLOCKEVENTS && HAS_IOMEM
156 select CLKSRC_MMIO 156 select CLKSRC_MMIO
157 select CLKSRC_OF 157 select CLKSRC_OF
158 help 158 help
@@ -160,6 +160,7 @@ config CLKSRC_LPC32XX
160 160
161config CLKSRC_PISTACHIO 161config CLKSRC_PISTACHIO
162 bool "Clocksource for Pistachio SoC" if COMPILE_TEST 162 bool "Clocksource for Pistachio SoC" if COMPILE_TEST
163 depends on HAS_IOMEM
163 select CLKSRC_OF 164 select CLKSRC_OF
164 help 165 help
165 Enables the clocksource for the Pistachio SoC. 166 Enables the clocksource for the Pistachio SoC.
@@ -256,6 +257,7 @@ config CLKSRC_SAMSUNG_PWM
256config FSL_FTM_TIMER 257config FSL_FTM_TIMER
257 bool "Freescale FlexTimer Module driver" if COMPILE_TEST 258 bool "Freescale FlexTimer Module driver" if COMPILE_TEST
258 depends on GENERIC_CLOCKEVENTS 259 depends on GENERIC_CLOCKEVENTS
260 select CLKSRC_MMIO
259 help 261 help
260 Support for Freescale FlexTimer Module (FTM) timer. 262 Support for Freescale FlexTimer Module (FTM) timer.
261 263
@@ -269,7 +271,7 @@ config SYS_SUPPORTS_SH_CMT
269 271
270config MTK_TIMER 272config MTK_TIMER
271 bool "Mediatek timer driver" if COMPILE_TEST 273 bool "Mediatek timer driver" if COMPILE_TEST
272 depends on GENERIC_CLOCKEVENTS 274 depends on GENERIC_CLOCKEVENTS && HAS_IOMEM
273 select CLKSRC_OF 275 select CLKSRC_OF
274 select CLKSRC_MMIO 276 select CLKSRC_MMIO
275 help 277 help
@@ -365,20 +367,20 @@ config CLKSRC_PXA
365 367
366config H8300_TMR8 368config H8300_TMR8
367 bool "Clockevent timer for the H8300 platform" if COMPILE_TEST 369 bool "Clockevent timer for the H8300 platform" if COMPILE_TEST
368 depends on GENERIC_CLOCKEVENTS 370 depends on GENERIC_CLOCKEVENTS && HAS_IOMEM
369 help 371 help
370 This enables the 8 bits timer for the H8300 platform. 372 This enables the 8 bits timer for the H8300 platform.
371 373
372config H8300_TMR16 374config H8300_TMR16
373 bool "Clockevent timer for the H83069 platform" if COMPILE_TEST 375 bool "Clockevent timer for the H83069 platform" if COMPILE_TEST
374 depends on GENERIC_CLOCKEVENTS 376 depends on GENERIC_CLOCKEVENTS && HAS_IOMEM
375 help 377 help
376 This enables the 16 bits timer for the H8300 platform with the 378 This enables the 16 bits timer for the H8300 platform with the
377 H83069 cpu. 379 H83069 cpu.
378 380
379config H8300_TPU 381config H8300_TPU
380 bool "Clocksource for the H8300 platform" if COMPILE_TEST 382 bool "Clocksource for the H8300 platform" if COMPILE_TEST
381 depends on GENERIC_CLOCKEVENTS 383 depends on GENERIC_CLOCKEVENTS && HAS_IOMEM
382 help 384 help
383 This enables the clocksource for the H8300 platform with the 385 This enables the clocksource for the H8300 platform with the
384 H8S2678 cpu. 386 H8S2678 cpu.
@@ -391,6 +393,7 @@ config CLKSRC_IMX_GPT
391config CLKSRC_ST_LPC 393config CLKSRC_ST_LPC
392 bool "Low power clocksource found in the LPC" if COMPILE_TEST 394 bool "Low power clocksource found in the LPC" if COMPILE_TEST
393 select CLKSRC_OF if OF 395 select CLKSRC_OF if OF
396 depends on HAS_IOMEM
394 help 397 help
395 Enable this option to use the Low Power controller timer 398 Enable this option to use the Low Power controller timer
396 as clocksource. 399 as clocksource.
diff --git a/drivers/clocksource/vt8500_timer.c b/drivers/clocksource/vt8500_timer.c
index de49805fbb09..ddb409274f45 100644
--- a/drivers/clocksource/vt8500_timer.c
+++ b/drivers/clocksource/vt8500_timer.c
@@ -49,6 +49,8 @@
49 49
50#define msecs_to_loops(t) (loops_per_jiffy / 1000 * HZ * t) 50#define msecs_to_loops(t) (loops_per_jiffy / 1000 * HZ * t)
51 51
52#define MIN_OSCR_DELTA 16
53
52static void __iomem *regbase; 54static void __iomem *regbase;
53 55
54static cycle_t vt8500_timer_read(struct clocksource *cs) 56static cycle_t vt8500_timer_read(struct clocksource *cs)
@@ -79,7 +81,7 @@ static int vt8500_timer_set_next_event(unsigned long cycles,
79 cpu_relax(); 81 cpu_relax();
80 writel((unsigned long)alarm, regbase + TIMER_MATCH_VAL); 82 writel((unsigned long)alarm, regbase + TIMER_MATCH_VAL);
81 83
82 if ((signed)(alarm - clocksource.read(&clocksource)) <= 16) 84 if ((signed)(alarm - clocksource.read(&clocksource)) <= MIN_OSCR_DELTA)
83 return -ETIME; 85 return -ETIME;
84 86
85 writel(1, regbase + TIMER_IER_VAL); 87 writel(1, regbase + TIMER_IER_VAL);
@@ -150,7 +152,7 @@ static void __init vt8500_timer_init(struct device_node *np)
150 pr_err("%s: setup_irq failed for %s\n", __func__, 152 pr_err("%s: setup_irq failed for %s\n", __func__,
151 clockevent.name); 153 clockevent.name);
152 clockevents_config_and_register(&clockevent, VT8500_TIMER_HZ, 154 clockevents_config_and_register(&clockevent, VT8500_TIMER_HZ,
153 4, 0xf0000000); 155 MIN_OSCR_DELTA * 2, 0xf0000000);
154} 156}
155 157
156CLOCKSOURCE_OF_DECLARE(vt8500, "via,vt8500-timer", vt8500_timer_init); 158CLOCKSOURCE_OF_DECLARE(vt8500, "via,vt8500-timer", vt8500_timer_init);