diff options
author | Tony Lindgren <tony@atomide.com> | 2011-10-05 17:22:39 -0700 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2011-10-19 16:34:11 -0700 |
commit | 8aca3ab5865f8cfbde841b6daf9442cc2279ced3 (patch) | |
tree | 98de30830a3f40247a00a6bccd92255b69a7b52d /arch/arm/plat-omap/io.c | |
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/plat-omap/io.c')
-rw-r--r-- | arch/arm/plat-omap/io.c | 10 |
1 files changed, 10 insertions, 0 deletions
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 @@ #define BETWEEN(p,st,sz) ((p) >= (st) && (p) < ((st) + (sz))) #define XLATE(p,pst,vst) ((void __iomem *)((p) - (pst) + (vst))) +static int initialized; + /* * Intercept ioremap() requests for addresses in our fixed mapping regions. */ void __iomem *omap_ioremap(unsigned long p, size_t size, unsigned int type) { + + WARN(!initialized, "Do not use ioremap before init_early\n"); + #ifdef CONFIG_ARCH_OMAP1 if (cpu_class_is_omap1()) { if (BETWEEN(p, OMAP1_IO_PHYS, OMAP1_IO_SIZE)) @@ -139,3 +144,8 @@ void omap_iounmap(volatile void __iomem *addr) __iounmap(addr); } EXPORT_SYMBOL(omap_iounmap); + +void __init omap_ioremap_init(void) +{ + initialized++; +} |