aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2011-11-22 04:07:26 -0500
committerSascha Hauer <s.hauer@pengutronix.de>2011-11-22 05:10:48 -0500
commit87514fced7c347a7cdd8a7a346d935a168428ff7 (patch)
tree0a5e37b7d8943f60a5c096aedadab78c56b4d7b7 /arch/arm/mach-imx
parentcfcfc9eca2bcbd26a8e206baeb005b055dbf8e37 (diff)
ARM: imx/mm-imx3: conditionally compile i.MX31 and i.MX35 code
This fixes building a kernel for only one of the two SOCs. Without this patch an i.MX31 only build fails with: arch/arm/mach-imx/built-in.o: In function `imx35_init_early': mach-bug.c:(.init.text+0x2c): undefined reference to `mxc_iomux_v3_init' arch/arm/mach-imx/built-in.o: In function `imx35_soc_init': mach-bug.c:(.init.text+0xe4): undefined reference to `mx35_revision' Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r--arch/arm/mach-imx/mm-imx3.c58
1 files changed, 31 insertions, 27 deletions
diff --git a/arch/arm/mach-imx/mm-imx3.c b/arch/arm/mach-imx/mm-imx3.c
index 9f0e82ec3398..72613c4b0e72 100644
--- a/arch/arm/mach-imx/mm-imx3.c
+++ b/arch/arm/mach-imx/mm-imx3.c
@@ -108,6 +108,7 @@ void imx3_init_l2x0(void)
108 l2x0_init(l2x0_base, 0x00030024, 0x00000000); 108 l2x0_init(l2x0_base, 0x00030024, 0x00000000);
109} 109}
110 110
111#ifdef CONFIG_SOC_IMX31
111static struct map_desc mx31_io_desc[] __initdata = { 112static struct map_desc mx31_io_desc[] __initdata = {
112 imx_map_entry(MX31, X_MEMC, MT_DEVICE), 113 imx_map_entry(MX31, X_MEMC, MT_DEVICE),
113 imx_map_entry(MX31, AVIC, MT_DEVICE_NONSHARED), 114 imx_map_entry(MX31, AVIC, MT_DEVICE_NONSHARED),
@@ -126,19 +127,6 @@ void __init mx31_map_io(void)
126 iotable_init(mx31_io_desc, ARRAY_SIZE(mx31_io_desc)); 127 iotable_init(mx31_io_desc, ARRAY_SIZE(mx31_io_desc));
127} 128}
128 129
129static struct map_desc mx35_io_desc[] __initdata = {
130 imx_map_entry(MX35, X_MEMC, MT_DEVICE),
131 imx_map_entry(MX35, AVIC, MT_DEVICE_NONSHARED),
132 imx_map_entry(MX35, AIPS1, MT_DEVICE_NONSHARED),
133 imx_map_entry(MX35, AIPS2, MT_DEVICE_NONSHARED),
134 imx_map_entry(MX35, SPBA0, MT_DEVICE_NONSHARED),
135};
136
137void __init mx35_map_io(void)
138{
139 iotable_init(mx35_io_desc, ARRAY_SIZE(mx35_io_desc));
140}
141
142void __init imx31_init_early(void) 130void __init imx31_init_early(void)
143{ 131{
144 mxc_set_cpu_type(MXC_CPU_MX31); 132 mxc_set_cpu_type(MXC_CPU_MX31);
@@ -147,25 +135,11 @@ void __init imx31_init_early(void)
147 imx_ioremap = imx3_ioremap; 135 imx_ioremap = imx3_ioremap;
148} 136}
149 137
150void __init imx35_init_early(void)
151{
152 mxc_set_cpu_type(MXC_CPU_MX35);
153 mxc_iomux_v3_init(MX35_IO_ADDRESS(MX35_IOMUXC_BASE_ADDR));
154 mxc_arch_reset_init(MX35_IO_ADDRESS(MX35_WDOG_BASE_ADDR));
155 imx_idle = imx3_idle;
156 imx_ioremap = imx3_ioremap;
157}
158
159void __init mx31_init_irq(void) 138void __init mx31_init_irq(void)
160{ 139{
161 mxc_init_irq(MX31_IO_ADDRESS(MX31_AVIC_BASE_ADDR)); 140 mxc_init_irq(MX31_IO_ADDRESS(MX31_AVIC_BASE_ADDR));
162} 141}
163 142
164void __init mx35_init_irq(void)
165{
166 mxc_init_irq(MX35_IO_ADDRESS(MX35_AVIC_BASE_ADDR));
167}
168
169static struct sdma_script_start_addrs imx31_to1_sdma_script __initdata = { 143static struct sdma_script_start_addrs imx31_to1_sdma_script __initdata = {
170 .per_2_per_addr = 1677, 144 .per_2_per_addr = 1677,
171}; 145};
@@ -199,6 +173,35 @@ void __init imx31_soc_init(void)
199 173
200 imx_add_imx_sdma("imx31-sdma", MX31_SDMA_BASE_ADDR, MX31_INT_SDMA, &imx31_sdma_pdata); 174 imx_add_imx_sdma("imx31-sdma", MX31_SDMA_BASE_ADDR, MX31_INT_SDMA, &imx31_sdma_pdata);
201} 175}
176#endif /* ifdef CONFIG_SOC_IMX31 */
177
178#ifdef CONFIG_SOC_IMX35
179static struct map_desc mx35_io_desc[] __initdata = {
180 imx_map_entry(MX35, X_MEMC, MT_DEVICE),
181 imx_map_entry(MX35, AVIC, MT_DEVICE_NONSHARED),
182 imx_map_entry(MX35, AIPS1, MT_DEVICE_NONSHARED),
183 imx_map_entry(MX35, AIPS2, MT_DEVICE_NONSHARED),
184 imx_map_entry(MX35, SPBA0, MT_DEVICE_NONSHARED),
185};
186
187void __init mx35_map_io(void)
188{
189 iotable_init(mx35_io_desc, ARRAY_SIZE(mx35_io_desc));
190}
191
192void __init imx35_init_early(void)
193{
194 mxc_set_cpu_type(MXC_CPU_MX35);
195 mxc_iomux_v3_init(MX35_IO_ADDRESS(MX35_IOMUXC_BASE_ADDR));
196 mxc_arch_reset_init(MX35_IO_ADDRESS(MX35_WDOG_BASE_ADDR));
197 imx_idle = imx3_idle;
198 imx_ioremap = imx3_ioremap;
199}
200
201void __init mx35_init_irq(void)
202{
203 mxc_init_irq(MX35_IO_ADDRESS(MX35_AVIC_BASE_ADDR));
204}
202 205
203static struct sdma_script_start_addrs imx35_to1_sdma_script __initdata = { 206static struct sdma_script_start_addrs imx35_to1_sdma_script __initdata = {
204 .ap_2_ap_addr = 642, 207 .ap_2_ap_addr = 642,
@@ -254,3 +257,4 @@ void __init imx35_soc_init(void)
254 257
255 imx_add_imx_sdma("imx35-sdma", MX35_SDMA_BASE_ADDR, MX35_INT_SDMA, &imx35_sdma_pdata); 258 imx_add_imx_sdma("imx35-sdma", MX35_SDMA_BASE_ADDR, MX35_INT_SDMA, &imx35_sdma_pdata);
256} 259}
260#endif /* ifdef CONFIG_SOC_IMX35 */