aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx3
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-10-25 15:38:09 +0200
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-11-17 08:58:09 +0100
commit08ff97b5214143c3bd47add6ec49097cb848120a (patch)
treec0782c278ba2f28f6f622be3ce82aa1a9ddb2e22 /arch/arm/mach-mx3
parentf5d7a13b18706c3328c6aac3bf782a13cabf255a (diff)
downloadkernel_samsung_crespo-08ff97b5214143c3bd47add6ec49097cb848120a.zip
kernel_samsung_crespo-08ff97b5214143c3bd47add6ec49097cb848120a.tar.gz
kernel_samsung_crespo-08ff97b5214143c3bd47add6ec49097cb848120a.tar.bz2
ARM: imx: use MXxy_IO_P2V macros to setup static mappings
This makes less code rely on the virtual constants. To further simplify code and reduce the needed boilerplate when defining the static mappings a new helper macro is defined in mach/hardware.h. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx3')
-rw-r--r--arch/arm/mach-mx3/mm.c53
1 files changed, 19 insertions, 34 deletions
diff --git a/arch/arm/mach-mx3/mm.c b/arch/arm/mach-mx3/mm.c
index 809ee40..193c18c 100644
--- a/arch/arm/mach-mx3/mm.c
+++ b/arch/arm/mach-mx3/mm.c
@@ -36,40 +36,16 @@
* @ingroup Memory
*/
-/*!
- * This table defines static virtual address mappings for I/O regions.
- * These are the mappings common across all MX3 boards.
- */
-static struct map_desc mxc_io_desc[] __initdata = {
- {
- .virtual = MX3x_X_MEMC_BASE_ADDR_VIRT,
- .pfn = __phys_to_pfn(MX3x_X_MEMC_BASE_ADDR),
- .length = MX3x_X_MEMC_SIZE,
- .type = MT_DEVICE
- }, {
- .virtual = MX3x_AVIC_BASE_ADDR_VIRT,
- .pfn = __phys_to_pfn(MX3x_AVIC_BASE_ADDR),
- .length = MX3x_AVIC_SIZE,
- .type = MT_DEVICE_NONSHARED
- }, {
- .virtual = MX3x_AIPS1_BASE_ADDR_VIRT,
- .pfn = __phys_to_pfn(MX3x_AIPS1_BASE_ADDR),
- .length = MX3x_AIPS1_SIZE,
- .type = MT_DEVICE_NONSHARED
- }, {
- .virtual = MX3x_AIPS2_BASE_ADDR_VIRT,
- .pfn = __phys_to_pfn(MX3x_AIPS2_BASE_ADDR),
- .length = MX3x_AIPS2_SIZE,
- .type = MT_DEVICE_NONSHARED
- }, {
- .virtual = MX3x_SPBA0_BASE_ADDR_VIRT,
- .pfn = __phys_to_pfn(MX3x_SPBA0_BASE_ADDR),
- .length = MX3x_SPBA0_SIZE,
- .type = MT_DEVICE_NONSHARED
- },
+#ifdef CONFIG_ARCH_MX31
+static struct map_desc mx31_io_desc[] __initdata = {
+ imx_map_entry(MX31, X_MEMC, MT_DEVICE),
+ imx_map_entry(MX31, AVIC, MT_DEVICE_NONSHARED),
+ imx_map_entry(MX31, AIPS1, MT_DEVICE_NONSHARED),
+ imx_map_entry(MX31, AIPS2, MT_DEVICE_NONSHARED),
+ imx_map_entry(MX31, SPBA0, MT_DEVICE_NONSHARED),
};
-/*!
+/*
* This function initializes the memory map. It is called during the
* system startup to create static physical to virtual memory mappings
* for the IO modules.
@@ -79,17 +55,26 @@ void __init mx31_map_io(void)
mxc_set_cpu_type(MXC_CPU_MX31);
mxc_arch_reset_init(MX31_IO_ADDRESS(MX31_WDOG_BASE_ADDR));
- iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc));
+ iotable_init(mx31_io_desc, ARRAY_SIZE(mx31_io_desc));
}
+#endif
#ifdef CONFIG_ARCH_MX35
+static struct map_desc mx35_io_desc[] __initdata = {
+ imx_map_entry(MX35, X_MEMC, MT_DEVICE),
+ imx_map_entry(MX35, AVIC, MT_DEVICE_NONSHARED),
+ imx_map_entry(MX35, AIPS1, MT_DEVICE_NONSHARED),
+ imx_map_entry(MX35, AIPS2, MT_DEVICE_NONSHARED),
+ imx_map_entry(MX35, SPBA0, MT_DEVICE_NONSHARED),
+};
+
void __init mx35_map_io(void)
{
mxc_set_cpu_type(MXC_CPU_MX35);
mxc_iomux_v3_init(MX35_IO_ADDRESS(MX35_IOMUXC_BASE_ADDR));
mxc_arch_reset_init(MX35_IO_ADDRESS(MX3x_WDOG_BASE_ADDR));
- iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc));
+ iotable_init(mx35_io_desc, ARRAY_SIZE(mx35_io_desc));
}
#endif