aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-mxc/include/mach/hardware.h
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-10-25 09:44:25 -0400
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-11-17 02:58:11 -0500
commita99631489bbd1b4647b82d0822b6a3942e2dd731 (patch)
tree9af7ee56eea709ae48587ca5409e768fbf68917a /arch/arm/plat-mxc/include/mach/hardware.h
parentcf3a6aba2f8402d4e45f7f263a0e69f779cd1bdc (diff)
ARM: imx: change static io mapping to use a function
Now only the virtual addresses [0xf4000000, 0xf5ffffff] are used for static per-SoC mappings. The few mappings of whole chip selects are moved accordingly. The now wrong defines for virtual base addresses are removed. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch/arm/plat-mxc/include/mach/hardware.h')
-rw-r--r--arch/arm/plat-mxc/include/mach/hardware.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/arch/arm/plat-mxc/include/mach/hardware.h b/arch/arm/plat-mxc/include/mach/hardware.h
index 409cec6223df..dde777c10176 100644
--- a/arch/arm/plat-mxc/include/mach/hardware.h
+++ b/arch/arm/plat-mxc/include/mach/hardware.h
@@ -32,6 +32,73 @@
32 (((addr) - module ## _BASE_ADDR) < module ## _SIZE ? \ 32 (((addr) - module ## _BASE_ADDR) < module ## _SIZE ? \
33 (addr) - (module ## _BASE_ADDR) + (module ## _BASE_ADDR_VIRT) : 0) 33 (addr) - (module ## _BASE_ADDR) + (module ## _BASE_ADDR_VIRT) : 0)
34 34
35/*
36 * This is rather complicated for humans and ugly to verify, but for a machine
37 * it's OK. Still more as it is usually only applied to constants. The upsides
38 * on using this approach are:
39 *
40 * - same mapping on all i.MX machines
41 * - works for assembler, too
42 * - no need to nurture #defines for virtual addresses
43 *
44 * The downside it, it's hard to verify (but I have a script for that).
45 *
46 * Obviously this needs to be injective for each SoC. In general it maps the
47 * whole address space to [0xf4000000, 0xf5ffffff]. So [0xf6000000,0xfeffffff]
48 * is free for per-machine use (e.g. KZM_ARM11_01 uses 64MiB there).
49 *
50 * It applies the following mappings for the different SoCs:
51 *
52 * mx1:
53 * IO 0x00200000+0x100000 -> 0xf4000000+0x100000
54 * mx21:
55 * AIPI 0x10000000+0x100000 -> 0xf4400000+0x100000
56 * SAHB1 0x80000000+0x100000 -> 0xf4000000+0x100000
57 * X_MEMC 0xdf000000+0x004000 -> 0xf5f00000+0x004000
58 * mx25:
59 * AIPS1 0x43f00000+0x100000 -> 0xf5300000+0x100000
60 * AIPS2 0x53f00000+0x100000 -> 0xf5700000+0x100000
61 * AVIC 0x68000000+0x100000 -> 0xf5800000+0x100000
62 * mx27:
63 * AIPI 0x10000000+0x100000 -> 0xf4400000+0x100000
64 * SAHB1 0x80000000+0x100000 -> 0xf4000000+0x100000
65 * X_MEMC 0xd8000000+0x100000 -> 0xf5c00000+0x100000
66 * mx31:
67 * AIPS1 0x43f00000+0x100000 -> 0xf5300000+0x100000
68 * AIPS2 0x53f00000+0x100000 -> 0xf5700000+0x100000
69 * AVIC 0x68000000+0x100000 -> 0xf5800000+0x100000
70 * X_MEMC 0xb8000000+0x010000 -> 0xf4c00000+0x010000
71 * SPBA0 0x50000000+0x100000 -> 0xf5400000+0x100000
72 * mx35:
73 * AIPS1 0x43f00000+0x100000 -> 0xf5300000+0x100000
74 * AIPS2 0x53f00000+0x100000 -> 0xf5700000+0x100000
75 * AVIC 0x68000000+0x100000 -> 0xf5800000+0x100000
76 * X_MEMC 0xb8000000+0x010000 -> 0xf4c00000+0x010000
77 * SPBA0 0x50000000+0x100000 -> 0xf5400000+0x100000
78 * mx51:
79 * IRAM 0x1ffe0000+0x020000 -> 0xf4fe0000+0x020000
80 * DEBUG 0x60000000+0x100000 -> 0xf5000000+0x100000
81 * SPBA0 0x70000000+0x100000 -> 0xf5400000+0x100000
82 * AIPS1 0x73f00000+0x100000 -> 0xf5700000+0x100000
83 * AIPS2 0x83f00000+0x100000 -> 0xf4300000+0x100000
84 * mxc91231:
85 * L2CC 0x30000000+0x010000 -> 0xf4400000+0x010000
86 * X_MEMC 0xb8000000+0x010000 -> 0xf4c00000+0x010000
87 * ROMP 0x60000000+0x010000 -> 0xf5000000+0x010000
88 * AVIC 0x68000000+0x010000 -> 0xf5800000+0x010000
89 * AIPS1 0x43f00000+0x100000 -> 0xf5300000+0x100000
90 * SPBA0 0x50000000+0x100000 -> 0xf5400000+0x100000
91 * SPBA1 0x52000000+0x100000 -> 0xf5600000+0x100000
92 * AIPS2 0x53f00000+0x100000 -> 0xf5700000+0x100000
93 */
94#define IMX_IO_P2V(x) ( \
95 0xf4000000 + \
96 (((x) & 0x50000000) >> 6) + \
97 (((x) & 0x0b000000) >> 4) + \
98 (((x) & 0x000fffff)))
99
100#define IMX_IO_ADDRESS(x) IOMEM(IMX_IO_P2V(x))
101
35#ifdef CONFIG_ARCH_MX5 102#ifdef CONFIG_ARCH_MX5
36#include <mach/mx51.h> 103#include <mach/mx51.h>
37#endif 104#endif