From 4bd48940190a34fe5a78a1595ec7756edf36b18a Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Mon, 19 Jul 2010 20:55:46 +0100 Subject: ARM: 6234/1: move SPEAr to use common mult/shift calculation code Since the infrastructure for determining shift/mult values from a clock rate and a minimum programmable rate is now in the kernel, lets remove this custom code. Cc: Viresh KUMAR Tested-by: Shiraz Hashim Signed-off-by: Linus Walleij Signed-off-by: Russell King --- arch/arm/plat-spear/time.c | 47 +++++++--------------------------------------- 1 file changed, 7 insertions(+), 40 deletions(-) (limited to 'arch/arm/plat-spear') diff --git a/arch/arm/plat-spear/time.c b/arch/arm/plat-spear/time.c index a1025d38f383..ab211652e4ca 100644 --- a/arch/arm/plat-spear/time.c +++ b/arch/arm/plat-spear/time.c @@ -58,6 +58,11 @@ #define INT_STATUS 0x1 +/* + * Minimum clocksource/clockevent timer range in seconds + */ +#define SPEAR_MIN_RANGE 4 + static __iomem void *gpt_base; static struct clk *gpt_clk; @@ -66,44 +71,6 @@ static void clockevent_set_mode(enum clock_event_mode mode, static int clockevent_next_event(unsigned long evt, struct clock_event_device *clk_event_dev); -/* - * Following clocksource_set_clock and clockevent_set_clock picked - * from arch/mips/kernel/time.c - */ - -void __init clocksource_set_clock(struct clocksource *cs, unsigned int clock) -{ - u64 temp; - u32 shift; - - /* Find a shift value */ - for (shift = 32; shift > 0; shift--) { - temp = (u64) NSEC_PER_SEC << shift; - do_div(temp, clock); - if ((temp >> 32) == 0) - break; - } - cs->shift = shift; - cs->mult = (u32) temp; -} - -void __init clockevent_set_clock(struct clock_event_device *cd, - unsigned int clock) -{ - u64 temp; - u32 shift; - - /* Find a shift value */ - for (shift = 32; shift > 0; shift--) { - temp = (u64) clock << shift; - do_div(temp, NSEC_PER_SEC); - if ((temp >> 32) == 0) - break; - } - cd->shift = shift; - cd->mult = (u32) temp; -} - static cycle_t clocksource_read_cycles(struct clocksource *cs) { return (cycle_t) readw(gpt_base + COUNT(CLKSRC)); @@ -138,7 +105,7 @@ static void spear_clocksource_init(void) val |= CTRL_ENABLE ; writew(val, gpt_base + CR(CLKSRC)); - clocksource_set_clock(&clksrc, tick_rate); + clocksource_calc_mult_shift(&clksrc, tick_rate, SPEAR_MIN_RANGE); /* register the clocksource */ clocksource_register(&clksrc); @@ -233,7 +200,7 @@ static void __init spear_clockevent_init(void) tick_rate = clk_get_rate(gpt_clk); tick_rate >>= CTRL_PRESCALER16; - clockevent_set_clock(&clkevt, tick_rate); + clockevents_calc_mult_shift(&clkevt, tick_rate, SPEAR_MIN_RANGE); clkevt.max_delta_ns = clockevent_delta2ns(0xfff0, &clkevt); -- cgit v1.2.3 From e6b8b3e21a85b06b0617401f5ad8018b9927f6ac Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Thu, 22 Jul 2010 16:34:34 +0100 Subject: ARM: 6260/1: arm/plat-spear: fix debug macro compilation failure mov rx, = isn't valid, use # instead. Signed-off-by: Jeremy Kerr Signed-off-by: Russell King --- arch/arm/plat-spear/include/plat/debug-macro.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/arm/plat-spear') diff --git a/arch/arm/plat-spear/include/plat/debug-macro.S b/arch/arm/plat-spear/include/plat/debug-macro.S index 1670734b7e51..37fa593884ee 100644 --- a/arch/arm/plat-spear/include/plat/debug-macro.S +++ b/arch/arm/plat-spear/include/plat/debug-macro.S @@ -17,8 +17,8 @@ .macro addruart, rx mrc p15, 0, \rx, c1, c0 tst \rx, #1 @ MMU enabled? - moveq \rx, =SPEAR_DBG_UART_BASE @ Physical base - movne \rx, =VA_SPEAR_DBG_UART_BASE @ Virtual base + moveq \rx, #SPEAR_DBG_UART_BASE @ Physical base + movne \rx, #VA_SPEAR_DBG_UART_BASE @ Virtual base .endm .macro senduart, rd, rx -- cgit v1.2.3