diff options
Diffstat (limited to 'arch/arm/mach-pxa/include/mach/hardware.h')
-rw-r--r-- | arch/arm/mach-pxa/include/mach/hardware.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/arm/mach-pxa/include/mach/hardware.h b/arch/arm/mach-pxa/include/mach/hardware.h index de63ca3016b4..8184669dde28 100644 --- a/arch/arm/mach-pxa/include/mach/hardware.h +++ b/arch/arm/mach-pxa/include/mach/hardware.h | |||
@@ -36,22 +36,23 @@ | |||
36 | * Note that not all PXA2xx chips implement all those addresses, and the | 36 | * Note that not all PXA2xx chips implement all those addresses, and the |
37 | * kernel only maps the minimum needed range of this mapping. | 37 | * kernel only maps the minimum needed range of this mapping. |
38 | */ | 38 | */ |
39 | #define io_p2v(x) (0xf2000000 + ((x) & 0x01ffffff) + (((x) & 0x1c000000) >> 1)) | ||
40 | #define io_v2p(x) (0x3c000000 + ((x) & 0x01ffffff) + (((x) & 0x0e000000) << 1)) | 39 | #define io_v2p(x) (0x3c000000 + ((x) & 0x01ffffff) + (((x) & 0x0e000000) << 1)) |
40 | #define io_p2v(x) IOMEM(0xf2000000 + ((x) & 0x01ffffff) + (((x) & 0x1c000000) >> 1)) | ||
41 | 41 | ||
42 | #ifndef __ASSEMBLY__ | 42 | #ifndef __ASSEMBLY__ |
43 | 43 | # define IOMEM(x) ((void __iomem *)(x)) | |
44 | # define __REG(x) (*((volatile u32 *)io_p2v(x))) | 44 | # define __REG(x) (*((volatile u32 __iomem *)io_p2v(x))) |
45 | 45 | ||
46 | /* With indexed regs we don't want to feed the index through io_p2v() | 46 | /* With indexed regs we don't want to feed the index through io_p2v() |
47 | especially if it is a variable, otherwise horrible code will result. */ | 47 | especially if it is a variable, otherwise horrible code will result. */ |
48 | # define __REG2(x,y) \ | 48 | # define __REG2(x,y) \ |
49 | (*(volatile u32 *)((u32)&__REG(x) + (y))) | 49 | (*(volatile u32 __iomem*)((u32)&__REG(x) + (y))) |
50 | 50 | ||
51 | # define __PREG(x) (io_v2p((u32)&(x))) | 51 | # define __PREG(x) (io_v2p((u32)&(x))) |
52 | 52 | ||
53 | #else | 53 | #else |
54 | 54 | ||
55 | # define IOMEM(x) x | ||
55 | # define __REG(x) io_p2v(x) | 56 | # define __REG(x) io_p2v(x) |
56 | # define __PREG(x) io_v2p(x) | 57 | # define __PREG(x) io_v2p(x) |
57 | 58 | ||