aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clocksource/arm_arch_timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/clocksource/arm_arch_timer.c')
-rw-r--r--drivers/clocksource/arm_arch_timer.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index 73c487da6d2a..a2503db7e533 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -81,6 +81,7 @@ static struct clock_event_device __percpu *arch_timer_evt;
81static enum ppi_nr arch_timer_uses_ppi = VIRT_PPI; 81static enum ppi_nr arch_timer_uses_ppi = VIRT_PPI;
82static bool arch_timer_c3stop; 82static bool arch_timer_c3stop;
83static bool arch_timer_mem_use_virtual; 83static bool arch_timer_mem_use_virtual;
84static bool arch_counter_suspend_stop;
84 85
85static bool evtstrm_enable = IS_ENABLED(CONFIG_ARM_ARCH_TIMER_EVTSTREAM); 86static bool evtstrm_enable = IS_ENABLED(CONFIG_ARM_ARCH_TIMER_EVTSTREAM);
86 87
@@ -576,7 +577,7 @@ static struct clocksource clocksource_counter = {
576 .rating = 400, 577 .rating = 400,
577 .read = arch_counter_read, 578 .read = arch_counter_read,
578 .mask = CLOCKSOURCE_MASK(56), 579 .mask = CLOCKSOURCE_MASK(56),
579 .flags = CLOCK_SOURCE_IS_CONTINUOUS | CLOCK_SOURCE_SUSPEND_NONSTOP, 580 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
580}; 581};
581 582
582static struct cyclecounter cyclecounter = { 583static struct cyclecounter cyclecounter = {
@@ -616,6 +617,8 @@ static void __init arch_counter_register(unsigned type)
616 arch_timer_read_counter = arch_counter_get_cntvct_mem; 617 arch_timer_read_counter = arch_counter_get_cntvct_mem;
617 } 618 }
618 619
620 if (!arch_counter_suspend_stop)
621 clocksource_counter.flags |= CLOCK_SOURCE_SUSPEND_NONSTOP;
619 start_count = arch_timer_read_counter(); 622 start_count = arch_timer_read_counter();
620 clocksource_register_hz(&clocksource_counter, arch_timer_rate); 623 clocksource_register_hz(&clocksource_counter, arch_timer_rate);
621 cyclecounter.mult = clocksource_counter.mult; 624 cyclecounter.mult = clocksource_counter.mult;
@@ -907,6 +910,10 @@ static int __init arch_timer_of_init(struct device_node *np)
907 of_property_read_bool(np, "arm,cpu-registers-not-fw-configured")) 910 of_property_read_bool(np, "arm,cpu-registers-not-fw-configured"))
908 arch_timer_uses_ppi = PHYS_SECURE_PPI; 911 arch_timer_uses_ppi = PHYS_SECURE_PPI;
909 912
913 /* On some systems, the counter stops ticking when in suspend. */
914 arch_counter_suspend_stop = of_property_read_bool(np,
915 "arm,no-tick-in-suspend");
916
910 return arch_timer_init(); 917 return arch_timer_init();
911} 918}
912CLOCKSOURCE_OF_DECLARE(armv7_arch_timer, "arm,armv7-timer", arch_timer_of_init); 919CLOCKSOURCE_OF_DECLARE(armv7_arch_timer, "arm,armv7-timer", arch_timer_of_init);