diff options
author | Magnus Damm <damm@opensource.se> | 2012-03-06 03:36:29 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2012-03-12 17:19:44 -0400 |
commit | 03f7beeff44a5ab03bb0afa1f0522cf26a117aeb (patch) | |
tree | a74e69b437950085e278db2f4b43477c1e39c70e | |
parent | 9e8de440da4a6c231e3970566712149d4593831a (diff) |
ARM: mach-shmobile: sh7377 and G4EVM timer rework
Move the SoC specific timer code from G4EVM board code
to sh7377 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>
-rw-r--r-- | arch/arm/mach-shmobile/board-g4evm.c | 13 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/setup-sh7377.c | 10 |
2 files changed, 11 insertions, 12 deletions
diff --git a/arch/arm/mach-shmobile/board-g4evm.c b/arch/arm/mach-shmobile/board-g4evm.c index 4ba2a79fb180..46d757d2759d 100644 --- a/arch/arm/mach-shmobile/board-g4evm.c +++ b/arch/arm/mach-shmobile/board-g4evm.c | |||
@@ -38,7 +38,6 @@ | |||
38 | #include <mach/common.h> | 38 | #include <mach/common.h> |
39 | #include <asm/mach-types.h> | 39 | #include <asm/mach-types.h> |
40 | #include <asm/mach/arch.h> | 40 | #include <asm/mach/arch.h> |
41 | #include <asm/mach/time.h> | ||
42 | 41 | ||
43 | /* | 42 | /* |
44 | * SDHI | 43 | * SDHI |
@@ -375,21 +374,11 @@ static void __init g4evm_init(void) | |||
375 | platform_add_devices(g4evm_devices, ARRAY_SIZE(g4evm_devices)); | 374 | platform_add_devices(g4evm_devices, ARRAY_SIZE(g4evm_devices)); |
376 | } | 375 | } |
377 | 376 | ||
378 | static void __init g4evm_timer_init(void) | ||
379 | { | ||
380 | sh7377_clock_init(); | ||
381 | shmobile_timer.init(); | ||
382 | } | ||
383 | |||
384 | static struct sys_timer g4evm_timer = { | ||
385 | .init = g4evm_timer_init, | ||
386 | }; | ||
387 | |||
388 | MACHINE_START(G4EVM, "g4evm") | 377 | MACHINE_START(G4EVM, "g4evm") |
389 | .map_io = sh7377_map_io, | 378 | .map_io = sh7377_map_io, |
390 | .init_early = sh7377_add_early_devices, | 379 | .init_early = sh7377_add_early_devices, |
391 | .init_irq = sh7377_init_irq, | 380 | .init_irq = sh7377_init_irq, |
392 | .handle_irq = shmobile_handle_irq_intc, | 381 | .handle_irq = shmobile_handle_irq_intc, |
393 | .init_machine = g4evm_init, | 382 | .init_machine = g4evm_init, |
394 | .timer = &g4evm_timer, | 383 | .timer = &shmobile_timer, |
395 | MACHINE_END | 384 | MACHINE_END |
diff --git a/arch/arm/mach-shmobile/setup-sh7377.c b/arch/arm/mach-shmobile/setup-sh7377.c index 979cf815c298..9f146095098b 100644 --- a/arch/arm/mach-shmobile/setup-sh7377.c +++ b/arch/arm/mach-shmobile/setup-sh7377.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <asm/mach/map.h> | 34 | #include <asm/mach/map.h> |
35 | #include <asm/mach-types.h> | 35 | #include <asm/mach-types.h> |
36 | #include <asm/mach/arch.h> | 36 | #include <asm/mach/arch.h> |
37 | #include <asm/mach/time.h> | ||
37 | 38 | ||
38 | static struct map_desc sh7377_io_desc[] __initdata = { | 39 | static struct map_desc sh7377_io_desc[] __initdata = { |
39 | /* create a 1:1 entity map for 0xe6xxxxxx | 40 | /* create a 1:1 entity map for 0xe6xxxxxx |
@@ -475,6 +476,12 @@ void __init sh7377_add_standard_devices(void) | |||
475 | ARRAY_SIZE(sh7377_devices)); | 476 | ARRAY_SIZE(sh7377_devices)); |
476 | } | 477 | } |
477 | 478 | ||
479 | static void __init sh7377_earlytimer_init(void) | ||
480 | { | ||
481 | sh7377_clock_init(); | ||
482 | shmobile_earlytimer_init(); | ||
483 | } | ||
484 | |||
478 | #define SMSTPCR3 0xe615013c | 485 | #define SMSTPCR3 0xe615013c |
479 | #define SMSTPCR3_CMT1 (1 << 29) | 486 | #define SMSTPCR3_CMT1 (1 << 29) |
480 | 487 | ||
@@ -488,4 +495,7 @@ void __init sh7377_add_early_devices(void) | |||
488 | 495 | ||
489 | /* setup early console here as well */ | 496 | /* setup early console here as well */ |
490 | shmobile_setup_console(); | 497 | shmobile_setup_console(); |
498 | |||
499 | /* override timer setup with soc-specific code */ | ||
500 | shmobile_timer.init = sh7377_earlytimer_init; | ||
491 | } | 501 | } |