aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMagnus Damm <damm@opensource.se>2012-03-06 03:37:01 -0500
committerRafael J. Wysocki <rjw@sisk.pl>2012-03-12 17:19:46 -0400
commitdf27a2d8f1d5e366ef84e9916fa6aab80904b8db (patch)
tree2506ba04f181b5674f8a595f5aefffd28734483e /arch
parent23e5bc03e3b07185d61c212bf39aaf126cc958e3 (diff)
ARM: mach-shmobile: r8a7779 and Marzen timer rework
Move the SoC specific timer code from Marzen board code to r8a7779 setup code. This makes is possible to share the SoC specific timer code across boards and it also removes the need for a board specific timer structure. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-shmobile/board-marzen.c14
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7779.c10
2 files changed, 11 insertions, 13 deletions
diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
index 43a77d912b4..cbd5e4cd06d 100644
--- a/arch/arm/mach-shmobile/board-marzen.c
+++ b/arch/arm/mach-shmobile/board-marzen.c
@@ -33,7 +33,6 @@
33#include <mach/common.h> 33#include <mach/common.h>
34#include <asm/mach-types.h> 34#include <asm/mach-types.h>
35#include <asm/mach/arch.h> 35#include <asm/mach/arch.h>
36#include <asm/mach/time.h>
37#include <asm/hardware/gic.h> 36#include <asm/hardware/gic.h>
38#include <asm/traps.h> 37#include <asm/traps.h>
39 38
@@ -91,17 +90,6 @@ static void __init marzen_init(void)
91 platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices)); 90 platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices));
92} 91}
93 92
94static void __init marzen_timer_init(void)
95{
96 r8a7779_clock_init();
97 shmobile_timer.init();
98 return;
99}
100
101struct sys_timer marzen_timer = {
102 .init = marzen_timer_init,
103};
104
105MACHINE_START(MARZEN, "marzen") 93MACHINE_START(MARZEN, "marzen")
106 .map_io = r8a7779_map_io, 94 .map_io = r8a7779_map_io,
107 .init_early = r8a7779_add_early_devices, 95 .init_early = r8a7779_add_early_devices,
@@ -109,5 +97,5 @@ MACHINE_START(MARZEN, "marzen")
109 .init_irq = r8a7779_init_irq, 97 .init_irq = r8a7779_init_irq,
110 .handle_irq = gic_handle_irq, 98 .handle_irq = gic_handle_irq,
111 .init_machine = marzen_init, 99 .init_machine = marzen_init,
112 .timer = &marzen_timer, 100 .timer = &shmobile_timer,
113MACHINE_END 101MACHINE_END
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c
index 9bb133c2a93..ce57d90c4bb 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -33,6 +33,7 @@
33#include <mach/common.h> 33#include <mach/common.h>
34#include <asm/mach-types.h> 34#include <asm/mach-types.h>
35#include <asm/mach/arch.h> 35#include <asm/mach/arch.h>
36#include <asm/mach/time.h>
36#include <asm/mach/map.h> 37#include <asm/mach/map.h>
37#include <asm/hardware/cache-l2x0.h> 38#include <asm/hardware/cache-l2x0.h>
38 39
@@ -260,6 +261,12 @@ void __init r8a7779_add_standard_devices(void)
260 ARRAY_SIZE(r8a7779_late_devices)); 261 ARRAY_SIZE(r8a7779_late_devices));
261} 262}
262 263
264static void __init r8a7779_earlytimer_init(void)
265{
266 r8a7779_clock_init();
267 shmobile_earlytimer_init();
268}
269
263void __init r8a7779_add_early_devices(void) 270void __init r8a7779_add_early_devices(void)
264{ 271{
265 early_platform_add_devices(r8a7779_early_devices, 272 early_platform_add_devices(r8a7779_early_devices,
@@ -280,4 +287,7 @@ void __init r8a7779_add_early_devices(void)
280 * As a final step pass earlyprint=sh-sci.2,115200 on the kernel 287 * As a final step pass earlyprint=sh-sci.2,115200 on the kernel
281 * command line in case of the marzen board. 288 * command line in case of the marzen board.
282 */ 289 */
290
291 /* override timer setup with soc-specific code */
292 shmobile_timer.init = r8a7779_earlytimer_init;
283} 293}