ARM: iop13xx: use runtime ioremap hook
authorRob Herring <rob.herring@calxeda.com>
Wed, 29 Feb 2012 16:56:15 +0000 (10:56 -0600)
committerRob Herring <rob.herring@calxeda.com>
Wed, 7 Mar 2012 03:23:18 +0000 (21:23 -0600)
Convert iop13xx platforms to use run-time ioremap hook instead of the
compile time hook. The custom ioremap is still needed for 64-bit address
handling.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Cc: Russell King <linux@arm.linux.org.uk>
arch/arm/mach-iop13xx/include/mach/io.h
arch/arm/mach-iop13xx/io.c
arch/arm/mach-iop13xx/iq81340mc.c
arch/arm/mach-iop13xx/iq81340sc.c

index dffb234bb967ec9b3e76384a8c9af699747dea12..2a69fc0c7223693abfd45f5c894b357e84c2a460 100644 (file)
 #define __mem_isa(a) (a)
 
 extern void __iomem * __iop13xx_io(unsigned long io_addr);
-extern void __iomem *__iop13xx_ioremap(unsigned long cookie, size_t size,
-       unsigned int mtype);
-extern void __iop13xx_iounmap(void __iomem *addr);
-
 extern u32 iop13xx_atue_mem_base;
 extern u32 iop13xx_atux_mem_base;
 extern size_t iop13xx_atue_mem_size;
 extern size_t iop13xx_atux_mem_size;
 
-#define __arch_ioremap __iop13xx_ioremap
-#define __arch_iounmap __iop13xx_iounmap
-
 #endif
index 48642e66c5663007129db7bec7cd909e6749fa49..6dd5b49241072605e8aadfa269451efe564769ed 100644 (file)
@@ -40,8 +40,8 @@ void * __iomem __iop13xx_io(unsigned long io_addr)
 }
 EXPORT_SYMBOL(__iop13xx_io);
 
-void * __iomem __iop13xx_ioremap(unsigned long cookie, size_t size,
-       unsigned int mtype)
+static void __iomem *__iop13xx_ioremap_caller(unsigned long cookie,
+       size_t size, unsigned int mtype, void *caller)
 {
        void __iomem * retval;
 
@@ -76,17 +76,14 @@ void * __iomem __iop13xx_ioremap(unsigned long cookie, size_t size,
                break;
        default:
                retval = __arm_ioremap_caller(cookie, size, mtype,
-                               __builtin_return_address(0));
+                               caller);
        }
 
        return retval;
 }
-EXPORT_SYMBOL(__iop13xx_ioremap);
 
-void __iop13xx_iounmap(void __iomem *addr)
+static void __iop13xx_iounmap(volatile void __iomem *addr)
 {
-       extern void __iounmap(volatile void __iomem *addr);
-
        if (iop13xx_atue_mem_base)
                if (addr >= (void __iomem *) iop13xx_atue_mem_base &&
                    addr < (void __iomem *) (iop13xx_atue_mem_base +
@@ -110,4 +107,9 @@ void __iop13xx_iounmap(void __iomem *addr)
 skip:
        return;
 }
-EXPORT_SYMBOL(__iop13xx_iounmap);
+
+void __init iop13xx_init_early(void)
+{
+       arch_ioremap_caller = __iop13xx_ioremap_caller;
+       arch_iounmap = __iop13xx_iounmap;
+}
index abaee883358874f4bbaf5c5bf1c7a6a90bf6bf2a..5c96b73e6964c42de4fba7efd00d2c0a932dd827 100644 (file)
@@ -92,6 +92,7 @@ static struct sys_timer iq81340mc_timer = {
 MACHINE_START(IQ81340MC, "Intel IQ81340MC")
        /* Maintainer: Dan Williams <dan.j.williams@intel.com> */
        .atag_offset    = 0x100,
+       .init_early     = iop13xx_init_early,
        .map_io         = iop13xx_map_io,
        .init_irq       = iop13xx_init_irq,
        .timer          = &iq81340mc_timer,
index 690916a09dc6bed10561272d8e300f5838bbb76b..aa4dd750135abc64e15e6fd0787f54aadf32d3ad 100644 (file)
@@ -94,6 +94,7 @@ static struct sys_timer iq81340sc_timer = {
 MACHINE_START(IQ81340SC, "Intel IQ81340SC")
        /* Maintainer: Dan Williams <dan.j.williams@intel.com> */
        .atag_offset    = 0x100,
+       .init_early     = iop13xx_init_early,
        .map_io         = iop13xx_map_io,
        .init_irq       = iop13xx_init_irq,
        .timer          = &iq81340sc_timer,