aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx5
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2011-06-22 10:41:30 -0400
committerSascha Hauer <s.hauer@pengutronix.de>2011-07-07 04:01:12 -0400
commit3622360430e90d47a0d028dd5333a13771589331 (patch)
treea2a4df6d905d4157bf0e3cb5e5d6b3b5d481d0b6 /arch/arm/mach-mx5
parent8dd7b817a1135940406a3271346a4a8e39e2b87c (diff)
ARM: mxc: clean up imx-dma device registration
The patch follows the implementation of gpio-mxc device registration to break the concentrated imx-dma device registration into soc specific setup function. Then we can avoid the churn of "#ifdef" and the cpu_is_mx checking on such a long list, which makes no sense, considering more soc supports need to be added and we need to support single image for multiple socs in the long run. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx5')
-rw-r--r--arch/arm/mach-mx5/mm.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/arch/arm/mach-mx5/mm.c b/arch/arm/mach-mx5/mm.c
index 800bb8b21081..aa848ea987e8 100644
--- a/arch/arm/mach-mx5/mm.c
+++ b/arch/arm/mach-mx5/mm.c
@@ -18,6 +18,7 @@
18 18
19#include <mach/hardware.h> 19#include <mach/hardware.h>
20#include <mach/common.h> 20#include <mach/common.h>
21#include <mach/devices-common.h>
21#include <mach/iomux-v3.h> 22#include <mach/iomux-v3.h>
22 23
23/* 24/*
@@ -100,12 +101,58 @@ void __init mx53_init_irq(void)
100 tzic_init_irq(tzic_virt); 101 tzic_init_irq(tzic_virt);
101} 102}
102 103
104static struct sdma_script_start_addrs imx51_sdma_script __initdata = {
105 .ap_2_ap_addr = 642,
106 .uart_2_mcu_addr = 817,
107 .mcu_2_app_addr = 747,
108 .mcu_2_shp_addr = 961,
109 .ata_2_mcu_addr = 1473,
110 .mcu_2_ata_addr = 1392,
111 .app_2_per_addr = 1033,
112 .app_2_mcu_addr = 683,
113 .shp_2_per_addr = 1251,
114 .shp_2_mcu_addr = 892,
115};
116
117static struct sdma_platform_data imx51_sdma_pdata __initdata = {
118 .sdma_version = 2,
119 .cpu_name = "imx51",
120 .to_version = 1,
121 .script_addrs = &imx51_sdma_script,
122};
123
124static struct sdma_script_start_addrs imx53_sdma_script __initdata = {
125 .ap_2_ap_addr = 642,
126 .app_2_mcu_addr = 683,
127 .mcu_2_app_addr = 747,
128 .uart_2_mcu_addr = 817,
129 .shp_2_mcu_addr = 891,
130 .mcu_2_shp_addr = 960,
131 .uartsh_2_mcu_addr = 1032,
132 .spdif_2_mcu_addr = 1100,
133 .mcu_2_spdif_addr = 1134,
134 .firi_2_mcu_addr = 1193,
135 .mcu_2_firi_addr = 1290,
136};
137
138static struct sdma_platform_data imx53_sdma_pdata __initdata = {
139 .sdma_version = 2,
140 .cpu_name = "imx53",
141 .to_version = 1,
142 .script_addrs = &imx53_sdma_script,
143};
144
103void __init imx51_soc_init(void) 145void __init imx51_soc_init(void)
104{ 146{
147 int to_version = mx51_revision() >> 4;
148
105 mxc_register_gpio(0, MX51_GPIO1_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO1_LOW, MX51_MXC_INT_GPIO1_HIGH); 149 mxc_register_gpio(0, MX51_GPIO1_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO1_LOW, MX51_MXC_INT_GPIO1_HIGH);
106 mxc_register_gpio(1, MX51_GPIO2_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO2_LOW, MX51_MXC_INT_GPIO2_HIGH); 150 mxc_register_gpio(1, MX51_GPIO2_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO2_LOW, MX51_MXC_INT_GPIO2_HIGH);
107 mxc_register_gpio(2, MX51_GPIO3_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO3_LOW, MX51_MXC_INT_GPIO3_HIGH); 151 mxc_register_gpio(2, MX51_GPIO3_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO3_LOW, MX51_MXC_INT_GPIO3_HIGH);
108 mxc_register_gpio(3, MX51_GPIO4_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO4_LOW, MX51_MXC_INT_GPIO4_HIGH); 152 mxc_register_gpio(3, MX51_GPIO4_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO4_LOW, MX51_MXC_INT_GPIO4_HIGH);
153
154 imx51_sdma_pdata.to_version = to_version;
155 imx_add_imx_sdma(MX51_SDMA_BASE_ADDR, MX51_INT_SDMA, &imx51_sdma_pdata);
109} 156}
110 157
111void __init imx53_soc_init(void) 158void __init imx53_soc_init(void)
@@ -117,4 +164,6 @@ void __init imx53_soc_init(void)
117 mxc_register_gpio(4, MX53_GPIO5_BASE_ADDR, SZ_16K, MX53_INT_GPIO5_LOW, MX53_INT_GPIO5_HIGH); 164 mxc_register_gpio(4, MX53_GPIO5_BASE_ADDR, SZ_16K, MX53_INT_GPIO5_LOW, MX53_INT_GPIO5_HIGH);
118 mxc_register_gpio(5, MX53_GPIO6_BASE_ADDR, SZ_16K, MX53_INT_GPIO6_LOW, MX53_INT_GPIO6_HIGH); 165 mxc_register_gpio(5, MX53_GPIO6_BASE_ADDR, SZ_16K, MX53_INT_GPIO6_LOW, MX53_INT_GPIO6_HIGH);
119 mxc_register_gpio(6, MX53_GPIO7_BASE_ADDR, SZ_16K, MX53_INT_GPIO7_LOW, MX53_INT_GPIO7_HIGH); 166 mxc_register_gpio(6, MX53_GPIO7_BASE_ADDR, SZ_16K, MX53_INT_GPIO7_LOW, MX53_INT_GPIO7_HIGH);
167
168 imx_add_imx_sdma(MX53_SDMA_BASE_ADDR, MX53_INT_SDMA, &imx53_sdma_pdata);
120} 169}