diff options
author | Arnd Bergmann <arnd@arndb.de> | 2012-09-14 16:17:50 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2012-09-19 09:11:54 -0400 |
commit | abf2ba152f5aa31ee56a63b28b04a76d8def6366 (patch) | |
tree | 34ca0fbf16578cbeab68b20fc9f4839175c3ccd9 /arch/arm/mach-iop13xx/include | |
parent | b7a3f8db07c1bca303dbf038f108dd84638bcd82 (diff) |
ARM: iop13xx: use __iomem pointers for MMIO
ARM is moving to stricter checks on readl/write functions,
so we need to use the correct types everywhere.
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/mach-iop13xx/include')
-rw-r--r-- | arch/arm/mach-iop13xx/include/mach/iop13xx.h | 20 | ||||
-rw-r--r-- | arch/arm/mach-iop13xx/include/mach/memory.h | 14 |
2 files changed, 16 insertions, 18 deletions
diff --git a/arch/arm/mach-iop13xx/include/mach/iop13xx.h b/arch/arm/mach-iop13xx/include/mach/iop13xx.h index e190dcd7d72d..01b41abce38c 100644 --- a/arch/arm/mach-iop13xx/include/mach/iop13xx.h +++ b/arch/arm/mach-iop13xx/include/mach/iop13xx.h | |||
@@ -148,18 +148,16 @@ extern unsigned long get_iop_tick_rate(void); | |||
148 | * IOP13XX chipset registers | 148 | * IOP13XX chipset registers |
149 | */ | 149 | */ |
150 | #define IOP13XX_PMMR_PHYS_MEM_BASE 0xffd80000UL /* PMMR phys. address */ | 150 | #define IOP13XX_PMMR_PHYS_MEM_BASE 0xffd80000UL /* PMMR phys. address */ |
151 | #define IOP13XX_PMMR_VIRT_MEM_BASE 0xfee80000UL /* PMMR phys. address */ | 151 | #define IOP13XX_PMMR_VIRT_MEM_BASE (void __iomem *)(0xfee80000UL) /* PMMR phys. address */ |
152 | #define IOP13XX_PMMR_MEM_WINDOW_SIZE 0x80000 | 152 | #define IOP13XX_PMMR_MEM_WINDOW_SIZE 0x80000 |
153 | #define IOP13XX_PMMR_UPPER_MEM_VA (IOP13XX_PMMR_VIRT_MEM_BASE +\ | 153 | #define IOP13XX_PMMR_UPPER_MEM_VA (IOP13XX_PMMR_VIRT_MEM_BASE +\ |
154 | IOP13XX_PMMR_MEM_WINDOW_SIZE - 1) | 154 | IOP13XX_PMMR_MEM_WINDOW_SIZE - 1) |
155 | #define IOP13XX_PMMR_UPPER_MEM_PA (IOP13XX_PMMR_PHYS_MEM_BASE +\ | 155 | #define IOP13XX_PMMR_UPPER_MEM_PA (IOP13XX_PMMR_PHYS_MEM_BASE +\ |
156 | IOP13XX_PMMR_MEM_WINDOW_SIZE - 1) | 156 | IOP13XX_PMMR_MEM_WINDOW_SIZE - 1) |
157 | #define IOP13XX_PMMR_VIRT_TO_PHYS(addr) (u32) ((u32) addr +\ | 157 | #define IOP13XX_PMMR_VIRT_TO_PHYS(addr) (((addr) - IOP13XX_PMMR_VIRT_MEM_BASE)\ |
158 | (IOP13XX_PMMR_PHYS_MEM_BASE\ | 158 | + IOP13XX_PMMR_PHYS_MEM_BASE) |
159 | - IOP13XX_PMMR_VIRT_MEM_BASE)) | 159 | #define IOP13XX_PMMR_PHYS_TO_VIRT(addr) (((addr) - IOP13XX_PMMR_PHYS_MEM_BASE)\ |
160 | #define IOP13XX_PMMR_PHYS_TO_VIRT(addr) (u32) ((u32) addr -\ | 160 | + IOP13XX_PMMR_VIRT_MEM_BASE) |
161 | (IOP13XX_PMMR_PHYS_MEM_BASE\ | ||
162 | - IOP13XX_PMMR_VIRT_MEM_BASE)) | ||
163 | #define IOP13XX_REG_ADDR32(reg) (IOP13XX_PMMR_VIRT_MEM_BASE + (reg)) | 161 | #define IOP13XX_REG_ADDR32(reg) (IOP13XX_PMMR_VIRT_MEM_BASE + (reg)) |
164 | #define IOP13XX_REG_ADDR16(reg) (IOP13XX_PMMR_VIRT_MEM_BASE + (reg)) | 162 | #define IOP13XX_REG_ADDR16(reg) (IOP13XX_PMMR_VIRT_MEM_BASE + (reg)) |
165 | #define IOP13XX_REG_ADDR8(reg) (IOP13XX_PMMR_VIRT_MEM_BASE + (reg)) | 163 | #define IOP13XX_REG_ADDR8(reg) (IOP13XX_PMMR_VIRT_MEM_BASE + (reg)) |
@@ -169,10 +167,10 @@ extern unsigned long get_iop_tick_rate(void); | |||
169 | #define IOP13XX_PMMR_SIZE 0x00080000 | 167 | #define IOP13XX_PMMR_SIZE 0x00080000 |
170 | 168 | ||
171 | /*=================== Defines for Platform Devices =====================*/ | 169 | /*=================== Defines for Platform Devices =====================*/ |
172 | #define IOP13XX_UART0_PHYS (IOP13XX_PMMR_PHYS_MEM_BASE | 0x00002300) | 170 | #define IOP13XX_UART0_PHYS (IOP13XX_PMMR_PHYS_MEM_BASE + 0x00002300) |
173 | #define IOP13XX_UART1_PHYS (IOP13XX_PMMR_PHYS_MEM_BASE | 0x00002340) | 171 | #define IOP13XX_UART1_PHYS (IOP13XX_PMMR_PHYS_MEM_BASE + 0x00002340) |
174 | #define IOP13XX_UART0_VIRT (IOP13XX_PMMR_VIRT_MEM_BASE | 0x00002300) | 172 | #define IOP13XX_UART0_VIRT (IOP13XX_PMMR_VIRT_MEM_BASE + 0x00002300) |
175 | #define IOP13XX_UART1_VIRT (IOP13XX_PMMR_VIRT_MEM_BASE | 0x00002340) | 173 | #define IOP13XX_UART1_VIRT (IOP13XX_PMMR_VIRT_MEM_BASE + 0x00002340) |
176 | 174 | ||
177 | #define IOP13XX_I2C0_PHYS (IOP13XX_PMMR_PHYS_MEM_BASE | 0x00002500) | 175 | #define IOP13XX_I2C0_PHYS (IOP13XX_PMMR_PHYS_MEM_BASE | 0x00002500) |
178 | #define IOP13XX_I2C1_PHYS (IOP13XX_PMMR_PHYS_MEM_BASE | 0x00002520) | 176 | #define IOP13XX_I2C1_PHYS (IOP13XX_PMMR_PHYS_MEM_BASE | 0x00002520) |
diff --git a/arch/arm/mach-iop13xx/include/mach/memory.h b/arch/arm/mach-iop13xx/include/mach/memory.h index 1afa99ef97fa..7c032d0ab24a 100644 --- a/arch/arm/mach-iop13xx/include/mach/memory.h +++ b/arch/arm/mach-iop13xx/include/mach/memory.h | |||
@@ -16,12 +16,12 @@ | |||
16 | #define IOP13XX_PMMR_P_START (IOP13XX_PMMR_PHYS_MEM_BASE) | 16 | #define IOP13XX_PMMR_P_START (IOP13XX_PMMR_PHYS_MEM_BASE) |
17 | #define IOP13XX_PMMR_P_END (IOP13XX_PMMR_PHYS_MEM_BASE + IOP13XX_PMMR_SIZE) | 17 | #define IOP13XX_PMMR_P_END (IOP13XX_PMMR_PHYS_MEM_BASE + IOP13XX_PMMR_SIZE) |
18 | 18 | ||
19 | static inline dma_addr_t __virt_to_lbus(unsigned long x) | 19 | static inline dma_addr_t __virt_to_lbus(void __iomem *x) |
20 | { | 20 | { |
21 | return x + IOP13XX_PMMR_PHYS_MEM_BASE - IOP13XX_PMMR_VIRT_MEM_BASE; | 21 | return x + IOP13XX_PMMR_PHYS_MEM_BASE - IOP13XX_PMMR_VIRT_MEM_BASE; |
22 | } | 22 | } |
23 | 23 | ||
24 | static inline unsigned long __lbus_to_virt(dma_addr_t x) | 24 | static inline void __iomem *__lbus_to_virt(dma_addr_t x) |
25 | { | 25 | { |
26 | return x + IOP13XX_PMMR_VIRT_MEM_BASE - IOP13XX_PMMR_PHYS_MEM_BASE; | 26 | return x + IOP13XX_PMMR_VIRT_MEM_BASE - IOP13XX_PMMR_PHYS_MEM_BASE; |
27 | } | 27 | } |
@@ -38,23 +38,23 @@ static inline unsigned long __lbus_to_virt(dma_addr_t x) | |||
38 | 38 | ||
39 | #define __arch_dma_to_virt(dev, addr) \ | 39 | #define __arch_dma_to_virt(dev, addr) \ |
40 | ({ \ | 40 | ({ \ |
41 | unsigned long __virt; \ | 41 | void * __virt; \ |
42 | dma_addr_t __dma = addr; \ | 42 | dma_addr_t __dma = addr; \ |
43 | if (is_lbus_device(dev) && __is_lbus_dma(__dma)) \ | 43 | if (is_lbus_device(dev) && __is_lbus_dma(__dma)) \ |
44 | __virt = __lbus_to_virt(__dma); \ | 44 | __virt = __lbus_to_virt(__dma); \ |
45 | else \ | 45 | else \ |
46 | __virt = __phys_to_virt(__dma); \ | 46 | __virt = (void *)__phys_to_virt(__dma); \ |
47 | (void *)__virt; \ | 47 | __virt; \ |
48 | }) | 48 | }) |
49 | 49 | ||
50 | #define __arch_virt_to_dma(dev, addr) \ | 50 | #define __arch_virt_to_dma(dev, addr) \ |
51 | ({ \ | 51 | ({ \ |
52 | unsigned long __virt = (unsigned long)addr; \ | 52 | void * __virt = addr; \ |
53 | dma_addr_t __dma; \ | 53 | dma_addr_t __dma; \ |
54 | if (is_lbus_device(dev) && __is_lbus_virt(__virt)) \ | 54 | if (is_lbus_device(dev) && __is_lbus_virt(__virt)) \ |
55 | __dma = __virt_to_lbus(__virt); \ | 55 | __dma = __virt_to_lbus(__virt); \ |
56 | else \ | 56 | else \ |
57 | __dma = __virt_to_phys(__virt); \ | 57 | __dma = __virt_to_phys((unsigned long)__virt); \ |
58 | __dma; \ | 58 | __dma; \ |
59 | }) | 59 | }) |
60 | 60 | ||