Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clocksource/drivers/fttmr010: Switch to use TIMER2 src

This switches the clocksource to TIMER2 like the Moxart driver
does. Mainly to make it more similar to the Moxart/Aspeed driver
but also because it seems more neat to use the timers in order:
use timer 1, then timer 2.

Cc: Joel Stanley <joel@jms.id.au>
Tested-by: Jonas Jensen <jonas.jensen@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>

authored by

Linus Walleij and committed by
Daniel Lezcano
b589da8b d0d76d57

+10 -11
+10 -11
drivers/clocksource/timer-fttmr010.c
··· 49 49 #define TIMER_1_CR_UPDOWN BIT(9) 50 50 #define TIMER_2_CR_UPDOWN BIT(10) 51 51 #define TIMER_3_CR_UPDOWN BIT(11) 52 - #define TIMER_DEFAULT_FLAGS (TIMER_1_CR_UPDOWN | \ 53 - TIMER_3_CR_ENABLE | \ 54 - TIMER_3_CR_UPDOWN) 55 52 56 53 #define TIMER_1_INT_MATCH1 BIT(0) 57 54 #define TIMER_1_INT_MATCH2 BIT(1) ··· 77 80 78 81 static u64 notrace fttmr010_read_sched_clock(void) 79 82 { 80 - return readl(local_fttmr->base + TIMER3_COUNT); 83 + return readl(local_fttmr->base + TIMER2_COUNT); 81 84 } 82 85 83 86 static int fttmr010_timer_set_next_event(unsigned long cycles, ··· 227 230 */ 228 231 writel(TIMER_INT_ALL_MASK, fttmr010->base + TIMER_INTR_MASK); 229 232 writel(0, fttmr010->base + TIMER_INTR_STATE); 230 - writel(TIMER_DEFAULT_FLAGS, fttmr010->base + TIMER_CR); 233 + /* Enable timer 1 count up, timer 2 count up */ 234 + writel((TIMER_1_CR_UPDOWN | TIMER_2_CR_ENABLE | TIMER_2_CR_UPDOWN), 235 + fttmr010->base + TIMER_CR); 231 236 232 237 /* 233 238 * Setup free-running clocksource timer (interrupts 234 239 * disabled.) 235 240 */ 236 241 local_fttmr = fttmr010; 237 - writel(0, fttmr010->base + TIMER3_COUNT); 238 - writel(0, fttmr010->base + TIMER3_LOAD); 239 - writel(0, fttmr010->base + TIMER3_MATCH1); 240 - writel(0, fttmr010->base + TIMER3_MATCH2); 241 - clocksource_mmio_init(fttmr010->base + TIMER3_COUNT, 242 - "FTTMR010-TIMER3", 242 + writel(0, fttmr010->base + TIMER2_COUNT); 243 + writel(0, fttmr010->base + TIMER2_LOAD); 244 + writel(0, fttmr010->base + TIMER2_MATCH1); 245 + writel(0, fttmr010->base + TIMER2_MATCH2); 246 + clocksource_mmio_init(fttmr010->base + TIMER2_COUNT, 247 + "FTTMR010-TIMER2", 243 248 fttmr010->tick_rate, 244 249 300, 32, clocksource_mmio_readl_up); 245 250 sched_clock_register(fttmr010_read_sched_clock, 32,