ARM: msm: use runtime ioremap hook
authorRob Herring <rob.herring@calxeda.com>
Mon, 13 Feb 2012 19:27:24 +0000 (13:27 -0600)
committerRob Herring <rob.herring@calxeda.com>
Wed, 7 Mar 2012 03:23:17 +0000 (21:23 -0600)
Convert msm platforms to use run-time ioremap hook instead of the compile
time hook.

According to David Brown, only the msm7201 needed the ioremap hook.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Tested-by: David Brown <davidb@codeaurora.org>
Acked-by: David Brown <davidb@codeaurora.org>
Cc: Daniel Walker <dwalker@fifo99.com>
Cc: Bryan Huntsman <bryanh@codeaurora.org>
arch/arm/mach-msm/board-halibut.c
arch/arm/mach-msm/board-trout.c
arch/arm/mach-msm/include/mach/io.h
arch/arm/mach-msm/include/mach/msm_iomap-7x00.h
arch/arm/mach-msm/io.c

index a60ab6d04ec5927ef151b4e62162cdb8f11fffb1..3698a370d6360051f00cb02bbfc62cb861568e6d 100644 (file)
@@ -68,6 +68,11 @@ static struct platform_device *devices[] __initdata = {
 
 extern struct sys_timer msm_timer;
 
+static void __init halibut_init_early(void)
+{
+       arch_ioremap_caller = __msm_ioremap_caller;
+}
+
 static void __init halibut_init_irq(void)
 {
        msm_init_irq();
@@ -96,6 +101,7 @@ MACHINE_START(HALIBUT, "Halibut Board (QCT SURF7200A)")
        .atag_offset    = 0x100,
        .fixup          = halibut_fixup,
        .map_io         = halibut_map_io,
+       .init_early     = halibut_init_early,
        .init_irq       = halibut_init_irq,
        .init_machine   = halibut_init,
        .timer          = &msm_timer,
index 6b9b227c87c59e25108d5570b72a0ebbe1227d66..5414f76ec0a948578b6c2c28c2058acbb2ccf133 100644 (file)
@@ -43,6 +43,11 @@ static struct platform_device *devices[] __initdata = {
 
 extern struct sys_timer msm_timer;
 
+static void __init trout_init_early(void)
+{
+       arch_ioremap_caller = __msm_ioremap_caller;
+}
+
 static void __init trout_init_irq(void)
 {
        msm_init_irq();
@@ -96,6 +101,7 @@ MACHINE_START(TROUT, "HTC Dream")
        .atag_offset    = 0x100,
        .fixup          = trout_fixup,
        .map_io         = trout_map_io,
+       .init_early     = trout_init_early,
        .init_irq       = trout_init_irq,
        .init_machine   = trout_init,
        .timer          = &msm_timer,
index dc1b928745e971a1f21cffa2c5e294a7454ea3d5..c6ff9bb8db31ebd1ae592d10ddb9a31016e0cb1f 100644 (file)
 
 #define IO_SPACE_LIMIT 0xffffffff
 
-#define __arch_ioremap __msm_ioremap
-#define __arch_iounmap __iounmap
-
-void __iomem *__msm_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype);
-
 #define __io(a)                __typesafe_io(a)
 #define __mem_pci(a)    (a)
 
index 8af46123dab6856c3870e82ac519edf62eab5ad8..152b3b70afabc76e1594c13e9f2122bd98381e41 100644 (file)
 #define MSM_AD5_PHYS          0xAC000000
 #define MSM_AD5_SIZE          (SZ_1M*13)
 
+#ifndef __ASSEMBLY__
+
+extern void __iomem *__msm_ioremap_caller(unsigned long phys_addr, size_t size,
+                                         unsigned int mtype, void *caller);
+
+#endif
 
 #endif
index 578b04e42deb8cbc1d29fa66b75fb20c3a21ff43..a1e7b11688500fb0e08040dbe4ddaf7f95f6eabf 100644 (file)
@@ -172,8 +172,8 @@ void __init msm_map_msm7x30_io(void)
 }
 #endif /* CONFIG_ARCH_MSM7X30 */
 
-void __iomem *
-__msm_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype)
+void __iomem *__msm_ioremap_caller(unsigned long phys_addr, size_t size,
+                                  unsigned int mtype, void *caller)
 {
        if (mtype == MT_DEVICE) {
                /* The peripherals in the 88000000 - D0000000 range
@@ -184,7 +184,5 @@ __msm_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype)
                        mtype = MT_DEVICE_NONSHARED;
        }
 
-       return __arm_ioremap_caller(phys_addr, size, mtype,
-               __builtin_return_address(0));
+       return __arm_ioremap_caller(phys_addr, size, mtype, caller);
 }
-EXPORT_SYMBOL(__msm_ioremap);