summaryrefslogtreecommitdiff
path: root/arch/arm/mach-mxs/mach-mxs.c
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2013-03-29 10:04:07 +0400
committerShawn Guo <shawn.guo@linaro.org>2013-04-01 16:42:21 +0400
commit39490ab0ff49138c8613d95ea13b79c8159f306f (patch)
tree0d31068ff3e4f92fd09987e00557961576011788 /arch/arm/mach-mxs/mach-mxs.c
parent3cb7825bdc84d1d6c81ac9a2be201fe5bea5de05 (diff)
downloadlinux-39490ab0ff49138c8613d95ea13b79c8159f306f.tar.xz
ARM: mxs: merge imx23 and imx28 into one machine_desc
Most of the function hooks are same between imx23 and imx28 machine_desc, so merge them into one. Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Diffstat (limited to 'arch/arm/mach-mxs/mach-mxs.c')
-rw-r--r--arch/arm/mach-mxs/mach-mxs.c43
1 files changed, 13 insertions, 30 deletions
diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c
index fc762579d30f..a6e1ccb05066 100644
--- a/arch/arm/mach-mxs/mach-mxs.c
+++ b/arch/arm/mach-mxs/mach-mxs.c
@@ -171,18 +171,6 @@ static struct of_dev_auxdata mxs_auxdata_lookup[] __initdata = {
{ /* sentinel */ }
};
-static void __init imx23_timer_init(void)
-{
- mx23_clocks_init();
- clocksource_of_init();
-}
-
-static void __init imx28_timer_init(void)
-{
- mx28_clocks_init();
- clocksource_of_init();
-}
-
#define OCOTP_WORD_OFFSET 0x20
#define OCOTP_WORD_COUNT 0x20
@@ -573,32 +561,27 @@ soft:
soft_restart(0);
}
-static const char *imx23_dt_compat[] __initdata = {
- "fsl,imx23",
- NULL,
-};
+static void __init mxs_timer_init(void)
+{
+ if (of_machine_is_compatible("fsl,imx23"))
+ mx23_clocks_init();
+ else
+ mx28_clocks_init();
+ clocksource_of_init();
+}
-static const char *imx28_dt_compat[] __initdata = {
+static const char *mxs_dt_compat[] __initdata = {
"fsl,imx28",
+ "fsl,imx23",
NULL,
};
-DT_MACHINE_START(IMX23, "Freescale i.MX23 (Device Tree)")
- .map_io = debug_ll_io_init,
- .init_irq = irqchip_init,
- .handle_irq = icoll_handle_irq,
- .init_time = imx23_timer_init,
- .init_machine = mxs_machine_init,
- .dt_compat = imx23_dt_compat,
- .restart = mxs_restart,
-MACHINE_END
-
-DT_MACHINE_START(IMX28, "Freescale i.MX28 (Device Tree)")
+DT_MACHINE_START(MXS, "Freescale MXS (Device Tree)")
.map_io = debug_ll_io_init,
.init_irq = irqchip_init,
.handle_irq = icoll_handle_irq,
- .init_time = imx28_timer_init,
+ .init_time = mxs_timer_init,
.init_machine = mxs_machine_init,
- .dt_compat = imx28_dt_compat,
+ .dt_compat = mxs_dt_compat,
.restart = mxs_restart,
MACHINE_END