diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-10-25 09:38:09 -0400 |
---|---|---|
committer | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-11-17 02:58:09 -0500 |
commit | 08ff97b5214143c3bd47add6ec49097cb848120a (patch) | |
tree | c0782c278ba2f28f6f622be3ce82aa1a9ddb2e22 /arch/arm/mach-mx3 | |
parent | f5d7a13b18706c3328c6aac3bf782a13cabf255a (diff) |
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.c | 53 |
1 files changed, 19 insertions, 34 deletions
diff --git a/arch/arm/mach-mx3/mm.c b/arch/arm/mach-mx3/mm.c index 809ee40b9f0e..193c18cd5304 100644 --- a/arch/arm/mach-mx3/mm.c +++ b/arch/arm/mach-mx3/mm.c | |||
@@ -36,40 +36,16 @@ | |||
36 | * @ingroup Memory | 36 | * @ingroup Memory |
37 | */ | 37 | */ |
38 | 38 | ||
39 | /*! | 39 | #ifdef CONFIG_ARCH_MX31 |
40 | * This table defines static virtual address mappings for I/O regions. | 40 | static struct map_desc mx31_io_desc[] __initdata = { |
41 | * These are the mappings common across all MX3 boards. | 41 | imx_map_entry(MX31, X_MEMC, MT_DEVICE), |
42 | */ | 42 | imx_map_entry(MX31, AVIC, MT_DEVICE_NONSHARED), |
43 | static struct map_desc mxc_io_desc[] __initdata = { | 43 | imx_map_entry(MX31, AIPS1, MT_DEVICE_NONSHARED), |
44 | { | 44 | imx_map_entry(MX31, AIPS2, MT_DEVICE_NONSHARED), |
45 | .virtual = MX3x_X_MEMC_BASE_ADDR_VIRT, | 45 | imx_map_entry(MX31, SPBA0, MT_DEVICE_NONSHARED), |
46 | .pfn = __phys_to_pfn(MX3x_X_MEMC_BASE_ADDR), | ||
47 | .length = MX3x_X_MEMC_SIZE, | ||
48 | .type = MT_DEVICE | ||
49 | }, { | ||
50 | .virtual = MX3x_AVIC_BASE_ADDR_VIRT, | ||
51 | .pfn = __phys_to_pfn(MX3x_AVIC_BASE_ADDR), | ||
52 | .length = MX3x_AVIC_SIZE, | ||
53 | .type = MT_DEVICE_NONSHARED | ||
54 | }, { | ||
55 | .virtual = MX3x_AIPS1_BASE_ADDR_VIRT, | ||
56 | .pfn = __phys_to_pfn(MX3x_AIPS1_BASE_ADDR), | ||
57 | .length = MX3x_AIPS1_SIZE, | ||
58 | .type = MT_DEVICE_NONSHARED | ||
59 | }, { | ||
60 | .virtual = MX3x_AIPS2_BASE_ADDR_VIRT, | ||
61 | .pfn = __phys_to_pfn(MX3x_AIPS2_BASE_ADDR), | ||
62 | .length = MX3x_AIPS2_SIZE, | ||
63 | .type = MT_DEVICE_NONSHARED | ||
64 | }, { | ||
65 | .virtual = MX3x_SPBA0_BASE_ADDR_VIRT, | ||
66 | .pfn = __phys_to_pfn(MX3x_SPBA0_BASE_ADDR), | ||
67 | .length = MX3x_SPBA0_SIZE, | ||
68 | .type = MT_DEVICE_NONSHARED | ||
69 | }, | ||
70 | }; | 46 | }; |
71 | 47 | ||
72 | /*! | 48 | /* |
73 | * This function initializes the memory map. It is called during the | 49 | * This function initializes the memory map. It is called during the |
74 | * system startup to create static physical to virtual memory mappings | 50 | * system startup to create static physical to virtual memory mappings |
75 | * for the IO modules. | 51 | * for the IO modules. |
@@ -79,17 +55,26 @@ void __init mx31_map_io(void) | |||
79 | mxc_set_cpu_type(MXC_CPU_MX31); | 55 | mxc_set_cpu_type(MXC_CPU_MX31); |
80 | mxc_arch_reset_init(MX31_IO_ADDRESS(MX31_WDOG_BASE_ADDR)); | 56 | mxc_arch_reset_init(MX31_IO_ADDRESS(MX31_WDOG_BASE_ADDR)); |
81 | 57 | ||
82 | iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc)); | 58 | iotable_init(mx31_io_desc, ARRAY_SIZE(mx31_io_desc)); |
83 | } | 59 | } |
60 | #endif | ||
84 | 61 | ||
85 | #ifdef CONFIG_ARCH_MX35 | 62 | #ifdef CONFIG_ARCH_MX35 |
63 | static struct map_desc mx35_io_desc[] __initdata = { | ||
64 | imx_map_entry(MX35, X_MEMC, MT_DEVICE), | ||
65 | imx_map_entry(MX35, AVIC, MT_DEVICE_NONSHARED), | ||
66 | imx_map_entry(MX35, AIPS1, MT_DEVICE_NONSHARED), | ||
67 | imx_map_entry(MX35, AIPS2, MT_DEVICE_NONSHARED), | ||
68 | imx_map_entry(MX35, SPBA0, MT_DEVICE_NONSHARED), | ||
69 | }; | ||
70 | |||
86 | void __init mx35_map_io(void) | 71 | void __init mx35_map_io(void) |
87 | { | 72 | { |
88 | mxc_set_cpu_type(MXC_CPU_MX35); | 73 | mxc_set_cpu_type(MXC_CPU_MX35); |
89 | mxc_iomux_v3_init(MX35_IO_ADDRESS(MX35_IOMUXC_BASE_ADDR)); | 74 | mxc_iomux_v3_init(MX35_IO_ADDRESS(MX35_IOMUXC_BASE_ADDR)); |
90 | mxc_arch_reset_init(MX35_IO_ADDRESS(MX3x_WDOG_BASE_ADDR)); | 75 | mxc_arch_reset_init(MX35_IO_ADDRESS(MX3x_WDOG_BASE_ADDR)); |
91 | 76 | ||
92 | iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc)); | 77 | iotable_init(mx35_io_desc, ARRAY_SIZE(mx35_io_desc)); |
93 | } | 78 | } |
94 | #endif | 79 | #endif |
95 | 80 | ||