aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMagnus Damm <damm@opensource.se>2012-03-06 03:36:37 -0500
committerRafael J. Wysocki <rjw@sisk.pl>2012-03-12 17:19:45 -0400
commit17254bffd6e4fda97d825acec153614f09bb33e7 (patch)
tree2842a19dd938b048589e1e9679b32bf016e05dda
parent03f7beeff44a5ab03bb0afa1f0522cf26a117aeb (diff)
ARM: mach-shmobile: sh7372, AP4EVB and Mackerel timer rework
Move the SoC specific timer code from AP4EVB and Mackerel to sh7372 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-ap4evb.c13
-rw-r--r--arch/arm/mach-shmobile/board-mackerel.c13
-rw-r--r--arch/arm/mach-shmobile/setup-sh7372.c10
3 files changed, 12 insertions, 24 deletions
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index 96368682f495..d07ec186a6cf 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -61,7 +61,6 @@
61 61
62#include <asm/mach-types.h> 62#include <asm/mach-types.h>
63#include <asm/mach/arch.h> 63#include <asm/mach/arch.h>
64#include <asm/mach/time.h>
65#include <asm/setup.h> 64#include <asm/setup.h>
66 65
67/* 66/*
@@ -1436,21 +1435,11 @@ static void __init ap4evb_init(void)
1436 pm_clk_add(&lcdc1_device.dev, "hdmi"); 1435 pm_clk_add(&lcdc1_device.dev, "hdmi");
1437} 1436}
1438 1437
1439static void __init ap4evb_timer_init(void)
1440{
1441 sh7372_clock_init();
1442 shmobile_timer.init();
1443}
1444
1445static struct sys_timer ap4evb_timer = {
1446 .init = ap4evb_timer_init,
1447};
1448
1449MACHINE_START(AP4EVB, "ap4evb") 1438MACHINE_START(AP4EVB, "ap4evb")
1450 .map_io = sh7372_map_io, 1439 .map_io = sh7372_map_io,
1451 .init_early = sh7372_add_early_devices, 1440 .init_early = sh7372_add_early_devices,
1452 .init_irq = sh7372_init_irq, 1441 .init_irq = sh7372_init_irq,
1453 .handle_irq = shmobile_handle_irq_intc, 1442 .handle_irq = shmobile_handle_irq_intc,
1454 .init_machine = ap4evb_init, 1443 .init_machine = ap4evb_init,
1455 .timer = &ap4evb_timer, 1444 .timer = &shmobile_timer,
1456MACHINE_END 1445MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index b0740c82d70b..55da7a115912 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -57,7 +57,6 @@
57#include <mach/sh7372.h> 57#include <mach/sh7372.h>
58 58
59#include <asm/mach/arch.h> 59#include <asm/mach/arch.h>
60#include <asm/mach/time.h>
61#include <asm/mach-types.h> 60#include <asm/mach-types.h>
62 61
63/* 62/*
@@ -1554,21 +1553,11 @@ static void __init mackerel_init(void)
1554 pm_clk_add(&hdmi_lcdc_device.dev, "hdmi"); 1553 pm_clk_add(&hdmi_lcdc_device.dev, "hdmi");
1555} 1554}
1556 1555
1557static void __init mackerel_timer_init(void)
1558{
1559 sh7372_clock_init();
1560 shmobile_timer.init();
1561}
1562
1563static struct sys_timer mackerel_timer = {
1564 .init = mackerel_timer_init,
1565};
1566
1567MACHINE_START(MACKEREL, "mackerel") 1556MACHINE_START(MACKEREL, "mackerel")
1568 .map_io = sh7372_map_io, 1557 .map_io = sh7372_map_io,
1569 .init_early = sh7372_add_early_devices, 1558 .init_early = sh7372_add_early_devices,
1570 .init_irq = sh7372_init_irq, 1559 .init_irq = sh7372_init_irq,
1571 .handle_irq = shmobile_handle_irq_intc, 1560 .handle_irq = shmobile_handle_irq_intc,
1572 .init_machine = mackerel_init, 1561 .init_machine = mackerel_init,
1573 .timer = &mackerel_timer, 1562 .timer = &shmobile_timer,
1574MACHINE_END 1563MACHINE_END
diff --git a/arch/arm/mach-shmobile/setup-sh7372.c b/arch/arm/mach-shmobile/setup-sh7372.c
index 12b437801f00..c14fb35de47c 100644
--- a/arch/arm/mach-shmobile/setup-sh7372.c
+++ b/arch/arm/mach-shmobile/setup-sh7372.c
@@ -37,6 +37,7 @@
37#include <asm/mach/map.h> 37#include <asm/mach/map.h>
38#include <asm/mach-types.h> 38#include <asm/mach-types.h>
39#include <asm/mach/arch.h> 39#include <asm/mach/arch.h>
40#include <asm/mach/time.h>
40 41
41static struct map_desc sh7372_io_desc[] __initdata = { 42static struct map_desc sh7372_io_desc[] __initdata = {
42 /* create a 1:1 entity map for 0xe6xxxxxx 43 /* create a 1:1 entity map for 0xe6xxxxxx
@@ -1064,6 +1065,12 @@ void __init sh7372_add_standard_devices(void)
1064 sh7372_add_device_to_domain(&sh7372_a4r, &jpu_device); 1065 sh7372_add_device_to_domain(&sh7372_a4r, &jpu_device);
1065} 1066}
1066 1067
1068static void __init sh7372_earlytimer_init(void)
1069{
1070 sh7372_clock_init();
1071 shmobile_earlytimer_init();
1072}
1073
1067void __init sh7372_add_early_devices(void) 1074void __init sh7372_add_early_devices(void)
1068{ 1075{
1069 early_platform_add_devices(sh7372_early_devices, 1076 early_platform_add_devices(sh7372_early_devices,
@@ -1071,4 +1078,7 @@ void __init sh7372_add_early_devices(void)
1071 1078
1072 /* setup early console here as well */ 1079 /* setup early console here as well */
1073 shmobile_setup_console(); 1080 shmobile_setup_console();
1081
1082 /* override timer setup with soc-specific code */
1083 shmobile_timer.init = sh7372_earlytimer_init;
1074} 1084}