diff options
author | Tony Lindgren <tony@atomide.com> | 2011-10-05 20:22:39 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2011-10-19 19:34:11 -0400 |
commit | 8aca3ab5865f8cfbde841b6daf9442cc2279ced3 (patch) | |
tree | 98de30830a3f40247a00a6bccd92255b69a7b52d /arch/arm | |
parent | 4c3cf90117f1f4906d5975aeccc5ffd414807fd2 (diff) |
ARM: OMAP: Warn if omap_ioremap is called before SoC detection
We don't have cpu_is_omapxxxx SoC detection initialized until
SoC detection is initialized from init_early.
Note that with the common map_io we should no longer need
cpu_is_omapxxxx for ioremap.
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-omap1/io.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-omap2/io.c | 1 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/io.h | 2 | ||||
-rw-r--r-- | arch/arm/plat-omap/io.c | 10 |
4 files changed, 14 insertions, 0 deletions
diff --git a/arch/arm/mach-omap1/io.c b/arch/arm/mach-omap1/io.c index 8140a4ed66e4..fd9eb0984121 100644 --- a/arch/arm/mach-omap1/io.c +++ b/arch/arm/mach-omap1/io.c | |||
@@ -121,6 +121,7 @@ void __init omap16xx_map_io(void) | |||
121 | void omap1_init_early(void) | 121 | void omap1_init_early(void) |
122 | { | 122 | { |
123 | omap_check_revision(); | 123 | omap_check_revision(); |
124 | omap_ioremap_init(); | ||
124 | 125 | ||
125 | /* REVISIT: Refer to OMAP5910 Errata, Advisory SYS_1: "Timeout Abort | 126 | /* REVISIT: Refer to OMAP5910 Errata, Advisory SYS_1: "Timeout Abort |
126 | * on a Posted Write in the TIPB Bridge". | 127 | * on a Posted Write in the TIPB Bridge". |
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index d5caac3698dd..aa96538f3fee 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c | |||
@@ -323,6 +323,7 @@ void __iomem *omap_irq_base; | |||
323 | static void __init omap_common_init_early(void) | 323 | static void __init omap_common_init_early(void) |
324 | { | 324 | { |
325 | omap2_check_revision(); | 325 | omap2_check_revision(); |
326 | omap_ioremap_init(); | ||
326 | } | 327 | } |
327 | 328 | ||
328 | static void __init omap_hwmod_init_postsetup(void) | 329 | static void __init omap_hwmod_init_postsetup(void) |
diff --git a/arch/arm/plat-omap/include/plat/io.h b/arch/arm/plat-omap/include/plat/io.h index c0c785073141..5ffbea60be45 100644 --- a/arch/arm/plat-omap/include/plat/io.h +++ b/arch/arm/plat-omap/include/plat/io.h | |||
@@ -247,6 +247,8 @@ | |||
247 | * NOTE: Please use ioremap + __raw_read/write where possible instead of these | 247 | * NOTE: Please use ioremap + __raw_read/write where possible instead of these |
248 | */ | 248 | */ |
249 | 249 | ||
250 | void omap_ioremap_init(void); | ||
251 | |||
250 | extern u8 omap_readb(u32 pa); | 252 | extern u8 omap_readb(u32 pa); |
251 | extern u16 omap_readw(u32 pa); | 253 | extern u16 omap_readw(u32 pa); |
252 | extern u32 omap_readl(u32 pa); | 254 | extern u32 omap_readl(u32 pa); |
diff --git a/arch/arm/plat-omap/io.c b/arch/arm/plat-omap/io.c index f1ecfa9fc61d..1bbcbde76400 100644 --- a/arch/arm/plat-omap/io.c +++ b/arch/arm/plat-omap/io.c | |||
@@ -23,11 +23,16 @@ | |||
23 | #define BETWEEN(p,st,sz) ((p) >= (st) && (p) < ((st) + (sz))) | 23 | #define BETWEEN(p,st,sz) ((p) >= (st) && (p) < ((st) + (sz))) |
24 | #define XLATE(p,pst,vst) ((void __iomem *)((p) - (pst) + (vst))) | 24 | #define XLATE(p,pst,vst) ((void __iomem *)((p) - (pst) + (vst))) |
25 | 25 | ||
26 | static int initialized; | ||
27 | |||
26 | /* | 28 | /* |
27 | * Intercept ioremap() requests for addresses in our fixed mapping regions. | 29 | * Intercept ioremap() requests for addresses in our fixed mapping regions. |
28 | */ | 30 | */ |
29 | void __iomem *omap_ioremap(unsigned long p, size_t size, unsigned int type) | 31 | void __iomem *omap_ioremap(unsigned long p, size_t size, unsigned int type) |
30 | { | 32 | { |
33 | |||
34 | WARN(!initialized, "Do not use ioremap before init_early\n"); | ||
35 | |||
31 | #ifdef CONFIG_ARCH_OMAP1 | 36 | #ifdef CONFIG_ARCH_OMAP1 |
32 | if (cpu_class_is_omap1()) { | 37 | if (cpu_class_is_omap1()) { |
33 | if (BETWEEN(p, OMAP1_IO_PHYS, OMAP1_IO_SIZE)) | 38 | if (BETWEEN(p, OMAP1_IO_PHYS, OMAP1_IO_SIZE)) |
@@ -139,3 +144,8 @@ void omap_iounmap(volatile void __iomem *addr) | |||
139 | __iounmap(addr); | 144 | __iounmap(addr); |
140 | } | 145 | } |
141 | EXPORT_SYMBOL(omap_iounmap); | 146 | EXPORT_SYMBOL(omap_iounmap); |
147 | |||
148 | void __init omap_ioremap_init(void) | ||
149 | { | ||
150 | initialized++; | ||
151 | } | ||