aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMagnus Damm <damm@opensource.se>2012-03-06 03:36:45 -0500
committerRafael J. Wysocki <rjw@sisk.pl>2012-03-12 17:19:45 -0400
commit3be26fdba82a2ae8ed568ab5d4a0a2e252f18b13 (patch)
tree4f3b6cae63d97938c2e8a6fac351654fc5998d42
parent17254bffd6e4fda97d825acec153614f09bb33e7 (diff)
ARM: mach-shmobile: sh73a0, AG5EVM and Kota2 timer rework
Move the SoC specific timer code from AG5EVM and Kota2 to sh73a0 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-ag5evm.c14
-rw-r--r--arch/arm/mach-shmobile/board-kota2.c13
-rw-r--r--arch/arm/mach-shmobile/setup-sh73a0.c10
3 files changed, 12 insertions, 25 deletions
diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
index cd894a200d5..675660d951d 100644
--- a/arch/arm/mach-shmobile/board-ag5evm.c
+++ b/arch/arm/mach-shmobile/board-ag5evm.c
@@ -46,7 +46,6 @@
46#include <mach/common.h> 46#include <mach/common.h>
47#include <asm/mach-types.h> 47#include <asm/mach-types.h>
48#include <asm/mach/arch.h> 48#include <asm/mach/arch.h>
49#include <asm/mach/time.h>
50#include <asm/hardware/gic.h> 49#include <asm/hardware/gic.h>
51#include <asm/hardware/cache-l2x0.h> 50#include <asm/hardware/cache-l2x0.h>
52#include <asm/traps.h> 51#include <asm/traps.h>
@@ -600,17 +599,6 @@ static void __init ag5evm_init(void)
600 platform_add_devices(ag5evm_devices, ARRAY_SIZE(ag5evm_devices)); 599 platform_add_devices(ag5evm_devices, ARRAY_SIZE(ag5evm_devices));
601} 600}
602 601
603static void __init ag5evm_timer_init(void)
604{
605 sh73a0_clock_init();
606 shmobile_timer.init();
607 return;
608}
609
610struct sys_timer ag5evm_timer = {
611 .init = ag5evm_timer_init,
612};
613
614MACHINE_START(AG5EVM, "ag5evm") 602MACHINE_START(AG5EVM, "ag5evm")
615 .map_io = sh73a0_map_io, 603 .map_io = sh73a0_map_io,
616 .init_early = sh73a0_add_early_devices, 604 .init_early = sh73a0_add_early_devices,
@@ -618,5 +606,5 @@ MACHINE_START(AG5EVM, "ag5evm")
618 .init_irq = sh73a0_init_irq, 606 .init_irq = sh73a0_init_irq,
619 .handle_irq = gic_handle_irq, 607 .handle_irq = gic_handle_irq,
620 .init_machine = ag5evm_init, 608 .init_machine = ag5evm_init,
621 .timer = &ag5evm_timer, 609 .timer = &shmobile_timer,
622MACHINE_END 610MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-kota2.c b/arch/arm/mach-shmobile/board-kota2.c
index cfc5f413cf0..61c06729466 100644
--- a/arch/arm/mach-shmobile/board-kota2.c
+++ b/arch/arm/mach-shmobile/board-kota2.c
@@ -513,17 +513,6 @@ static void __init kota2_init(void)
513 platform_add_devices(kota2_devices, ARRAY_SIZE(kota2_devices)); 513 platform_add_devices(kota2_devices, ARRAY_SIZE(kota2_devices));
514} 514}
515 515
516static void __init kota2_timer_init(void)
517{
518 sh73a0_clock_init();
519 shmobile_timer.init();
520 return;
521}
522
523struct sys_timer kota2_timer = {
524 .init = kota2_timer_init,
525};
526
527MACHINE_START(KOTA2, "kota2") 516MACHINE_START(KOTA2, "kota2")
528 .map_io = sh73a0_map_io, 517 .map_io = sh73a0_map_io,
529 .init_early = sh73a0_add_early_devices, 518 .init_early = sh73a0_add_early_devices,
@@ -531,5 +520,5 @@ MACHINE_START(KOTA2, "kota2")
531 .init_irq = sh73a0_init_irq, 520 .init_irq = sh73a0_init_irq,
532 .handle_irq = gic_handle_irq, 521 .handle_irq = gic_handle_irq,
533 .init_machine = kota2_init, 522 .init_machine = kota2_init,
534 .timer = &kota2_timer, 523 .timer = &shmobile_timer,
535MACHINE_END 524MACHINE_END
diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c
index 988eeb3782c..b6a0734a738 100644
--- a/arch/arm/mach-shmobile/setup-sh73a0.c
+++ b/arch/arm/mach-shmobile/setup-sh73a0.c
@@ -36,6 +36,7 @@
36#include <asm/mach-types.h> 36#include <asm/mach-types.h>
37#include <asm/mach/map.h> 37#include <asm/mach/map.h>
38#include <asm/mach/arch.h> 38#include <asm/mach/arch.h>
39#include <asm/mach/time.h>
39 40
40static struct map_desc sh73a0_io_desc[] __initdata = { 41static struct map_desc sh73a0_io_desc[] __initdata = {
41 /* create a 1:1 entity map for 0xe6xxxxxx 42 /* create a 1:1 entity map for 0xe6xxxxxx
@@ -686,6 +687,12 @@ void __init sh73a0_add_standard_devices(void)
686 ARRAY_SIZE(sh73a0_late_devices)); 687 ARRAY_SIZE(sh73a0_late_devices));
687} 688}
688 689
690static void __init sh73a0_earlytimer_init(void)
691{
692 sh73a0_clock_init();
693 shmobile_earlytimer_init();
694}
695
689void __init sh73a0_add_early_devices(void) 696void __init sh73a0_add_early_devices(void)
690{ 697{
691 early_platform_add_devices(sh73a0_early_devices, 698 early_platform_add_devices(sh73a0_early_devices,
@@ -693,4 +700,7 @@ void __init sh73a0_add_early_devices(void)
693 700
694 /* setup early console here as well */ 701 /* setup early console here as well */
695 shmobile_setup_console(); 702 shmobile_setup_console();
703
704 /* override timer setup with soc-specific code */
705 shmobile_timer.init = sh73a0_earlytimer_init;
696} 706}