Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d330615b authored by Hans Ulli Kroll's avatar Hans Ulli Kroll Committed by Olof Johansson
Browse files

ARM: gemini: Setup timer3 as free running timer



In the original driver it is missed to setup a free running driver.
This timer is needed for the scheduler.
So setup it.

Signed-off-by: default avatarHans Ulli Kroll <ulli.kroll@googlemail.com>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
parent 5dc90739
Loading
Loading
Loading
Loading
+20 −1
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
#include <asm/mach/time.h>
#include <linux/clockchips.h>
#include <linux/clocksource.h>
#include <linux/sched_clock.h>

/*
 * Register definitions for the timers
@@ -62,6 +63,11 @@

static unsigned int tick_rate;

static u64 notrace gemini_read_sched_clock(void)
{
	return readl(TIMER_COUNT(TIMER3_BASE));
}

static int gemini_timer_set_next_event(unsigned long cycles,
				       struct clock_event_device *evt)
{
@@ -205,6 +211,19 @@ void __init gemini_timer_init(void)
	writel(0, TIMER_INTR_STATE);
	writel(TIMER_DEFAULT_FLAGS, TIMER_CR);

	/*
	 * Setup free-running clocksource timer (interrupts
	 * disabled.)
	 */
	writel(0, TIMER_COUNT(TIMER3_BASE));
	writel(0, TIMER_LOAD(TIMER3_BASE));
	writel(0, TIMER_MATCH1(TIMER3_BASE));
	writel(0, TIMER_MATCH2(TIMER3_BASE));
	clocksource_mmio_init(TIMER_COUNT(TIMER3_BASE),
			      "gemini_clocksource", tick_rate,
			      300, 32, clocksource_mmio_readl_up);
	sched_clock_register(gemini_read_sched_clock, 32, tick_rate);

	/*
	 * Setup clockevent timer (interrupt-driven.)
	*/