]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
ARM: at91: use __iomem pointers for MMIO
authorArnd Bergmann <arnd@arndb.de>
Fri, 14 Sep 2012 20:10:19 +0000 (20:10 +0000)
committerArnd Bergmann <arnd@arndb.de>
Tue, 18 Sep 2012 08:15:11 +0000 (10:15 +0200)
ARM is moving to stricter checks on readl/write functions,
so we need to use the correct types everywhere.

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
arch/arm/mach-at91/at91x40.c
arch/arm/mach-at91/at91x40_time.c
arch/arm/mach-at91/include/mach/hardware.h
arch/arm/mach-at91/include/mach/uncompress.h
arch/arm/mach-at91/setup.c

index 46090e642d8eb00b7fe93e05b70c9ea62dc9c8c3..6bd7300a2bc507855f28153e5871a4fcb6c4d5ed 100644 (file)
@@ -47,7 +47,7 @@ static void at91x40_idle(void)
         * Disable the processor clock.  The processor will be automatically
         * re-enabled by an interrupt or by a reset.
         */
-       __raw_writel(AT91_PS_CR_CPU, AT91_PS_CR);
+       __raw_writel(AT91_PS_CR_CPU, AT91_IO_P2V(AT91_PS_CR));
        cpu_do_idle();
 }
 
index 6ca680a1d5d112bb32cfa347c08c845f4d24ff6f..ee06d7bcdf76b79daa8feb5e1f5f9929a9e22f1c 100644 (file)
 #include <mach/at91_tc.h>
 
 #define at91_tc_read(field) \
-       __raw_readl(AT91_TC + field)
+       __raw_readl(AT91_IO_P2V(AT91_TC) + field)
 
 #define at91_tc_write(field, value) \
-       __raw_writel(value, AT91_TC + field);
+       __raw_writel(value, AT91_IO_P2V(AT91_TC) + field);
 
 /*
  *     3 counter/timer units present.
index 09242b67d277593aaf7208cdf07e351fe48f90ae..711a7892d331624fc6fa8315460720f4c9c89b63 100644 (file)
  * to 0xFEF78000 .. 0xFF000000.  (544Kb)
  */
 #define AT91_IO_PHYS_BASE      0xFFF78000
-#define AT91_IO_VIRT_BASE      (0xFF000000 - AT91_IO_SIZE)
+#define AT91_IO_VIRT_BASE      IOMEM(0xFF000000 - AT91_IO_SIZE)
 #else
 /*
  * Identity mapping for the non MMU case.
  */
 #define AT91_IO_PHYS_BASE      AT91_BASE_SYS
-#define AT91_IO_VIRT_BASE      AT91_IO_PHYS_BASE
+#define AT91_IO_VIRT_BASE      IOMEM(AT91_IO_PHYS_BASE)
 #endif
 
 #define AT91_IO_SIZE           (0xFFFFFFFF - AT91_IO_PHYS_BASE + 1)
index 6f6118d1576aa8a48189db75e9ad907d1a896e74..97ad68a826f8559595d133104fa3fd53f891b4cd 100644 (file)
@@ -94,7 +94,7 @@ static const u32 uarts_sam9x5[] = {
        0,
 };
 
-static inline const u32* decomp_soc_detect(u32 dbgu_base)
+static inline const u32* decomp_soc_detect(void __iomem *dbgu_base)
 {
        u32 cidr, socid;
 
@@ -142,10 +142,10 @@ static inline void arch_decomp_setup(void)
        int i = 0;
        const u32* usarts;
 
-       usarts = decomp_soc_detect(AT91_BASE_DBGU0);
+       usarts = decomp_soc_detect((void __iomem *)AT91_BASE_DBGU0);
 
        if (!usarts)
-               usarts = decomp_soc_detect(AT91_BASE_DBGU1);
+               usarts = decomp_soc_detect((void __iomem *)AT91_BASE_DBGU1);
        if (!usarts) {
                at91_uart = NULL;
                return;
index 944bffb08991366a453b1036eff75d19094b6ffd..e6f52de1062fd960fbd3fc015fb5c8e2211ba91f 100644 (file)
@@ -73,7 +73,7 @@ void __init at91_init_sram(int bank, unsigned long base, unsigned int length)
 {
        struct map_desc *desc = &sram_desc[bank];
 
-       desc->virtual = AT91_IO_VIRT_BASE - length;
+       desc->virtual = (unsigned long)AT91_IO_VIRT_BASE - length;
        if (bank > 0)
                desc->virtual -= sram_desc[bank - 1].length;
 
@@ -88,7 +88,7 @@ void __init at91_init_sram(int bank, unsigned long base, unsigned int length)
 }
 
 static struct map_desc at91_io_desc __initdata = {
-       .virtual        = AT91_VA_BASE_SYS,
+       .virtual        = (unsigned long)AT91_VA_BASE_SYS,
        .pfn            = __phys_to_pfn(AT91_BASE_SYS),
        .length         = SZ_16K,
        .type           = MT_DEVICE,