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

Commit f4e14edf authored by Robert Jarzmik's avatar Robert Jarzmik
Browse files

ARM: sa11x0/pxa: acquire timer rate from the clock rate



As both pxa and sa1100 provide a clock to the timer, the rate can be
inferred from the clock rather than hard encoded in a functional call.

This patch changes the pxa timer to have a mandatory clock which is used
as the timer rate.

Signed-off-by: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
Acked-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
parent a758c9b9
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -69,8 +69,7 @@ void __init pxa_timer_init(void)
		pxa27x_clocks_init();
	if (cpu_is_pxa3xx())
		pxa3xx_clocks_init();
	pxa_timer_nodt_init(IRQ_OST0, io_p2v(0x40a00000),
			    get_clock_tick_rate());
	pxa_timer_nodt_init(IRQ_OST0, io_p2v(0x40a00000));
}

/*
+1 −1
Original line number Diff line number Diff line
@@ -378,7 +378,7 @@ void __init sa1100_map_io(void)

void __init sa1100_timer_init(void)
{
	pxa_timer_nodt_init(IRQ_OST0, io_p2v(0x90000000), 3686400);
	pxa_timer_nodt_init(IRQ_OST0, io_p2v(0x90000000));
}

static struct resource irq_resource =
+5 −6
Original line number Diff line number Diff line
@@ -220,17 +220,16 @@ CLOCKSOURCE_OF_DECLARE(pxa_timer, "marvell,pxa-timer", pxa_timer_dt_init);
/*
 * Legacy timer init for non device-tree boards.
 */
void __init pxa_timer_nodt_init(int irq, void __iomem *base,
	unsigned long clock_tick_rate)
void __init pxa_timer_nodt_init(int irq, void __iomem *base)
{
	struct clk *clk;

	timer_base = base;
	clk = clk_get(NULL, "OSTIMER0");
	if (clk && !IS_ERR(clk))
	if (clk && !IS_ERR(clk)) {
		clk_prepare_enable(clk);
	else
		pxa_timer_common_init(irq, clk_get_rate(clk));
	} else {
		pr_crit("%s: unable to get clk\n", __func__);

	pxa_timer_common_init(irq, clock_tick_rate);
	}
}
+1 −2
Original line number Diff line number Diff line
@@ -12,7 +12,6 @@
#ifndef _CLOCKSOURCE_PXA_H
#define _CLOCKSOURCE_PXA_H

extern void pxa_timer_nodt_init(int irq, void __iomem *base,
			   unsigned long clock_tick_rate);
extern void pxa_timer_nodt_init(int irq, void __iomem *base);

#endif