aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2011-02-17 09:08:12 -0500
committerSascha Hauer <s.hauer@pengutronix.de>2011-03-07 13:29:38 -0500
commitff255feba1c575311378a3d7a3867e46549c8aa6 (patch)
tree458bd8b9de38fb7edcb8b643e0724084ef73a48c /arch
parent5ae30b477e9fb7319e2976fbf3521c0fac2625f1 (diff)
ARM i.MX: iomux v1 initialization away from initcall
This saves us from soc level dispatching in generic files Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-imx/mm-imx1.c3
-rw-r--r--arch/arm/mach-imx/mm-imx21.c3
-rw-r--r--arch/arm/mach-imx/mm-imx27.c3
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-v1.h2
-rw-r--r--arch/arm/plat-mxc/iomux-v1.c24
5 files changed, 14 insertions, 21 deletions
diff --git a/arch/arm/mach-imx/mm-imx1.c b/arch/arm/mach-imx/mm-imx1.c
index 8613e440e48c..2e482ba5a0e7 100644
--- a/arch/arm/mach-imx/mm-imx1.c
+++ b/arch/arm/mach-imx/mm-imx1.c
@@ -25,6 +25,7 @@
25#include <mach/hardware.h> 25#include <mach/hardware.h>
26#include <mach/gpio.h> 26#include <mach/gpio.h>
27#include <mach/irqs.h> 27#include <mach/irqs.h>
28#include <mach/iomux-v1.h>
28 29
29static struct map_desc imx_io_desc[] __initdata = { 30static struct map_desc imx_io_desc[] __initdata = {
30 imx_map_entry(MX1, IO, MT_DEVICE), 31 imx_map_entry(MX1, IO, MT_DEVICE),
@@ -39,6 +40,8 @@ void __init imx1_init_early(void)
39{ 40{
40 mxc_set_cpu_type(MXC_CPU_MX1); 41 mxc_set_cpu_type(MXC_CPU_MX1);
41 mxc_arch_reset_init(MX1_IO_ADDRESS(MX1_WDT_BASE_ADDR)); 42 mxc_arch_reset_init(MX1_IO_ADDRESS(MX1_WDT_BASE_ADDR));
43 imx_iomuxv1_init(MX1_IO_ADDRESS(MX1_GPIO_BASE_ADDR),
44 MX1_NUM_GPIO_PORT);
42} 45}
43 46
44static struct mxc_gpio_port imx1_gpio_ports[] = { 47static struct mxc_gpio_port imx1_gpio_ports[] = {
diff --git a/arch/arm/mach-imx/mm-imx21.c b/arch/arm/mach-imx/mm-imx21.c
index 6027e35ebfdb..7a0c500ac2c8 100644
--- a/arch/arm/mach-imx/mm-imx21.c
+++ b/arch/arm/mach-imx/mm-imx21.c
@@ -26,6 +26,7 @@
26#include <asm/mach/map.h> 26#include <asm/mach/map.h>
27#include <mach/gpio.h> 27#include <mach/gpio.h>
28#include <mach/irqs.h> 28#include <mach/irqs.h>
29#include <mach/iomux-v1.h>
29 30
30/* MX21 memory map definition */ 31/* MX21 memory map definition */
31static struct map_desc imx21_io_desc[] __initdata = { 32static struct map_desc imx21_io_desc[] __initdata = {
@@ -65,6 +66,8 @@ void __init imx21_init_early(void)
65{ 66{
66 mxc_set_cpu_type(MXC_CPU_MX21); 67 mxc_set_cpu_type(MXC_CPU_MX21);
67 mxc_arch_reset_init(MX21_IO_ADDRESS(MX21_WDOG_BASE_ADDR)); 68 mxc_arch_reset_init(MX21_IO_ADDRESS(MX21_WDOG_BASE_ADDR));
69 imx_iomuxv1_init(MX21_IO_ADDRESS(MX21_GPIO_BASE_ADDR),
70 MX21_NUM_GPIO_PORT);
68} 71}
69 72
70static struct mxc_gpio_port imx21_gpio_ports[] = { 73static struct mxc_gpio_port imx21_gpio_ports[] = {
diff --git a/arch/arm/mach-imx/mm-imx27.c b/arch/arm/mach-imx/mm-imx27.c
index e172e3ed3340..a6761a39f08c 100644
--- a/arch/arm/mach-imx/mm-imx27.c
+++ b/arch/arm/mach-imx/mm-imx27.c
@@ -26,6 +26,7 @@
26#include <asm/mach/map.h> 26#include <asm/mach/map.h>
27#include <mach/gpio.h> 27#include <mach/gpio.h>
28#include <mach/irqs.h> 28#include <mach/irqs.h>
29#include <mach/iomux-v1.h>
29 30
30/* MX27 memory map definition */ 31/* MX27 memory map definition */
31static struct map_desc imx27_io_desc[] __initdata = { 32static struct map_desc imx27_io_desc[] __initdata = {
@@ -65,6 +66,8 @@ void __init imx27_init_early(void)
65{ 66{
66 mxc_set_cpu_type(MXC_CPU_MX27); 67 mxc_set_cpu_type(MXC_CPU_MX27);
67 mxc_arch_reset_init(MX27_IO_ADDRESS(MX27_WDOG_BASE_ADDR)); 68 mxc_arch_reset_init(MX27_IO_ADDRESS(MX27_WDOG_BASE_ADDR));
69 imx_iomuxv1_init(MX27_IO_ADDRESS(MX27_GPIO_BASE_ADDR),
70 MX27_NUM_GPIO_PORT);
68} 71}
69 72
70static struct mxc_gpio_port imx27_gpio_ports[] = { 73static struct mxc_gpio_port imx27_gpio_ports[] = {
diff --git a/arch/arm/plat-mxc/include/mach/iomux-v1.h b/arch/arm/plat-mxc/include/mach/iomux-v1.h
index 884f5753f279..c07d30210c57 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-v1.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-v1.h
@@ -100,4 +100,6 @@ extern int mxc_gpio_setup_multiple_pins(const int *pin_list, unsigned count,
100 const char *label); 100 const char *label);
101extern void mxc_gpio_release_multiple_pins(const int *pin_list, int count); 101extern void mxc_gpio_release_multiple_pins(const int *pin_list, int count);
102 102
103extern int __init imx_iomuxv1_init(void __iomem *base, int numports);
104
103#endif /* __MACH_IOMUX_V1_H__ */ 105#endif /* __MACH_IOMUX_V1_H__ */
diff --git a/arch/arm/plat-mxc/iomux-v1.c b/arch/arm/plat-mxc/iomux-v1.c
index 960a02cbcbaf..3238c10d4e02 100644
--- a/arch/arm/plat-mxc/iomux-v1.c
+++ b/arch/arm/plat-mxc/iomux-v1.c
@@ -211,28 +211,10 @@ void mxc_gpio_release_multiple_pins(const int *pin_list, int count)
211} 211}
212EXPORT_SYMBOL(mxc_gpio_release_multiple_pins); 212EXPORT_SYMBOL(mxc_gpio_release_multiple_pins);
213 213
214static int imx_iomuxv1_init(void) 214int __init imx_iomuxv1_init(void __iomem *base, int numports)
215{ 215{
216#ifdef CONFIG_ARCH_MX1 216 imx_iomuxv1_baseaddr = base;
217 if (cpu_is_mx1()) { 217 imx_iomuxv1_numports = numports;
218 imx_iomuxv1_baseaddr = MX1_IO_ADDRESS(MX1_GPIO_BASE_ADDR);
219 imx_iomuxv1_numports = MX1_NUM_GPIO_PORT;
220 } else
221#endif
222#ifdef CONFIG_MACH_MX21
223 if (cpu_is_mx21()) {
224 imx_iomuxv1_baseaddr = MX21_IO_ADDRESS(MX21_GPIO_BASE_ADDR);
225 imx_iomuxv1_numports = MX21_NUM_GPIO_PORT;
226 } else
227#endif
228#ifdef CONFIG_MACH_MX27
229 if (cpu_is_mx27()) {
230 imx_iomuxv1_baseaddr = MX27_IO_ADDRESS(MX27_GPIO_BASE_ADDR);
231 imx_iomuxv1_numports = MX27_NUM_GPIO_PORT;
232 } else
233#endif
234 return -ENODEV;
235 218
236 return 0; 219 return 0;
237} 220}
238pure_initcall(imx_iomuxv1_init);