[ARM] 4821/1: RealView: Remove the platform dependencies from localtimer.c

This patch removes the TWD_BASE macro used to set up and configure the
local timers on ARM11MPCore. The twd_base_addr and twd_size variables
are defined in localtimer.c and set from the realview_eb_init function.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by Catalin Marinas and committed by Russell King 39e823e3 8cc4c548

+16 -5
+4
arch/arm/mach-realview/core.h
··· 51 extern struct clk realview_clcd_clk; 52 extern struct clcd_board clcd_plat_data; 53 extern void __iomem *gic_cpu_base_addr; 54 55 extern void realview_leds_event(led_event_t ledevt); 56 extern void realview_timer_init(unsigned int timer_irq);
··· 51 extern struct clk realview_clcd_clk; 52 extern struct clcd_board clcd_plat_data; 53 extern void __iomem *gic_cpu_base_addr; 54 + #ifdef CONFIG_LOCAL_TIMERS 55 + extern void __iomem *twd_base_addr; 56 + extern unsigned int twd_size; 57 + #endif 58 59 extern void realview_leds_event(led_event_t ledevt); 60 extern void realview_timer_init(unsigned int timer_irq);
+6 -3
arch/arm/mach-realview/localtimer.c
··· 24 #include <asm/io.h> 25 #include <asm/irq.h> 26 27 - #define TWD_BASE(cpu) (__io_address(REALVIEW_EB11MP_TWD_BASE) + \ 28 - ((cpu) * REALVIEW_EB11MP_TWD_SIZE)) 29 - 30 static DEFINE_PER_CPU(struct clock_event_device, local_clockevent); 31 32 /* ··· 37 } 38 39 #ifdef CONFIG_LOCAL_TIMERS 40 41 static unsigned long mpcore_timer_rate; 42
··· 24 #include <asm/io.h> 25 #include <asm/irq.h> 26 27 static DEFINE_PER_CPU(struct clock_event_device, local_clockevent); 28 29 /* ··· 40 } 41 42 #ifdef CONFIG_LOCAL_TIMERS 43 + 44 + #define TWD_BASE(cpu) (twd_base_addr + (cpu) * twd_size) 45 + 46 + /* set up by the platform code */ 47 + void __iomem *twd_base_addr; 48 + unsigned int twd_size; 49 50 static unsigned long mpcore_timer_rate; 51
+6 -2
arch/arm/mach-realview/realview_eb.c
··· 309 { 310 unsigned int timer_irq; 311 312 - if (core_tile_eb11mp()) 313 timer_irq = IRQ_EB11MP_TIMER0_1; 314 - else 315 timer_irq = IRQ_EB_TIMER0_1; 316 317 realview_timer_init(timer_irq);
··· 309 { 310 unsigned int timer_irq; 311 312 + if (core_tile_eb11mp()) { 313 + #ifdef CONFIG_LOCAL_TIMERS 314 + twd_base_addr = __io_address(REALVIEW_EB11MP_TWD_BASE); 315 + twd_size = REALVIEW_EB11MP_TWD_SIZE; 316 + #endif 317 timer_irq = IRQ_EB11MP_TIMER0_1; 318 + } else 319 timer_irq = IRQ_EB_TIMER0_1; 320 321 realview_timer_init(timer_irq);