diff options
author | Arnd Bergmann <arnd@arndb.de> | 2011-10-01 16:03:45 -0400 |
---|---|---|
committer | Eric Miao <eric.y.miao@gmail.com> | 2011-10-08 09:03:07 -0400 |
commit | 97b09da4ee36ec4bd0f6e16b84b4bb6fa05db110 (patch) | |
tree | 34c80d050a0cc8538d0fc22213772560dc3db2f3 /arch/arm/mach-mmp | |
parent | 7272889d3f40ed6aa2ade32bed5834789b3299cc (diff) |
ARM: pxa: use correct __iomem annotations
This tries to clear up the confusion between integers and iomem pointers
in the marvell pxa platform. MMIO addresses are supposed to be __iomem*
values, in order to let the Linux type checking work correctly. This
patch moves the cast to __iomem as far back as possible, to the place
where the MMIO virtual address windows are defined.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'arch/arm/mach-mmp')
-rw-r--r-- | arch/arm/mach-mmp/clock.h | 8 | ||||
-rw-r--r-- | arch/arm/mach-mmp/common.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-mmp/include/mach/addr-map.h | 10 | ||||
-rw-r--r-- | arch/arm/mach-mmp/mmp2.c | 3 |
4 files changed, 16 insertions, 9 deletions
diff --git a/arch/arm/mach-mmp/clock.h b/arch/arm/mach-mmp/clock.h index 3143e994e672..149b30cd1469 100644 --- a/arch/arm/mach-mmp/clock.h +++ b/arch/arm/mach-mmp/clock.h | |||
@@ -30,7 +30,7 @@ extern struct clkops apmu_clk_ops; | |||
30 | 30 | ||
31 | #define APBC_CLK(_name, _reg, _fnclksel, _rate) \ | 31 | #define APBC_CLK(_name, _reg, _fnclksel, _rate) \ |
32 | struct clk clk_##_name = { \ | 32 | struct clk clk_##_name = { \ |
33 | .clk_rst = (void __iomem *)APBC_##_reg, \ | 33 | .clk_rst = APBC_##_reg, \ |
34 | .fnclksel = _fnclksel, \ | 34 | .fnclksel = _fnclksel, \ |
35 | .rate = _rate, \ | 35 | .rate = _rate, \ |
36 | .ops = &apbc_clk_ops, \ | 36 | .ops = &apbc_clk_ops, \ |
@@ -38,7 +38,7 @@ struct clk clk_##_name = { \ | |||
38 | 38 | ||
39 | #define APBC_CLK_OPS(_name, _reg, _fnclksel, _rate, _ops) \ | 39 | #define APBC_CLK_OPS(_name, _reg, _fnclksel, _rate, _ops) \ |
40 | struct clk clk_##_name = { \ | 40 | struct clk clk_##_name = { \ |
41 | .clk_rst = (void __iomem *)APBC_##_reg, \ | 41 | .clk_rst = APBC_##_reg, \ |
42 | .fnclksel = _fnclksel, \ | 42 | .fnclksel = _fnclksel, \ |
43 | .rate = _rate, \ | 43 | .rate = _rate, \ |
44 | .ops = _ops, \ | 44 | .ops = _ops, \ |
@@ -46,7 +46,7 @@ struct clk clk_##_name = { \ | |||
46 | 46 | ||
47 | #define APMU_CLK(_name, _reg, _eval, _rate) \ | 47 | #define APMU_CLK(_name, _reg, _eval, _rate) \ |
48 | struct clk clk_##_name = { \ | 48 | struct clk clk_##_name = { \ |
49 | .clk_rst = (void __iomem *)APMU_##_reg, \ | 49 | .clk_rst = APMU_##_reg, \ |
50 | .enable_val = _eval, \ | 50 | .enable_val = _eval, \ |
51 | .rate = _rate, \ | 51 | .rate = _rate, \ |
52 | .ops = &apmu_clk_ops, \ | 52 | .ops = &apmu_clk_ops, \ |
@@ -54,7 +54,7 @@ struct clk clk_##_name = { \ | |||
54 | 54 | ||
55 | #define APMU_CLK_OPS(_name, _reg, _eval, _rate, _ops) \ | 55 | #define APMU_CLK_OPS(_name, _reg, _eval, _rate, _ops) \ |
56 | struct clk clk_##_name = { \ | 56 | struct clk clk_##_name = { \ |
57 | .clk_rst = (void __iomem *)APMU_##_reg, \ | 57 | .clk_rst = APMU_##_reg, \ |
58 | .enable_val = _eval, \ | 58 | .enable_val = _eval, \ |
59 | .rate = _rate, \ | 59 | .rate = _rate, \ |
60 | .ops = _ops, \ | 60 | .ops = _ops, \ |
diff --git a/arch/arm/mach-mmp/common.c b/arch/arm/mach-mmp/common.c index 0ec0ca80bb3e..5720674739f0 100644 --- a/arch/arm/mach-mmp/common.c +++ b/arch/arm/mach-mmp/common.c | |||
@@ -27,12 +27,12 @@ EXPORT_SYMBOL(mmp_chip_id); | |||
27 | static struct map_desc standard_io_desc[] __initdata = { | 27 | static struct map_desc standard_io_desc[] __initdata = { |
28 | { | 28 | { |
29 | .pfn = __phys_to_pfn(APB_PHYS_BASE), | 29 | .pfn = __phys_to_pfn(APB_PHYS_BASE), |
30 | .virtual = APB_VIRT_BASE, | 30 | .virtual = (unsigned long)APB_VIRT_BASE, |
31 | .length = APB_PHYS_SIZE, | 31 | .length = APB_PHYS_SIZE, |
32 | .type = MT_DEVICE, | 32 | .type = MT_DEVICE, |
33 | }, { | 33 | }, { |
34 | .pfn = __phys_to_pfn(AXI_PHYS_BASE), | 34 | .pfn = __phys_to_pfn(AXI_PHYS_BASE), |
35 | .virtual = AXI_VIRT_BASE, | 35 | .virtual = (unsigned long)AXI_VIRT_BASE, |
36 | .length = AXI_PHYS_SIZE, | 36 | .length = AXI_PHYS_SIZE, |
37 | .type = MT_DEVICE, | 37 | .type = MT_DEVICE, |
38 | }, | 38 | }, |
diff --git a/arch/arm/mach-mmp/include/mach/addr-map.h b/arch/arm/mach-mmp/include/mach/addr-map.h index 3254089a644d..3e404acd6ff4 100644 --- a/arch/arm/mach-mmp/include/mach/addr-map.h +++ b/arch/arm/mach-mmp/include/mach/addr-map.h | |||
@@ -11,6 +11,12 @@ | |||
11 | #ifndef __ASM_MACH_ADDR_MAP_H | 11 | #ifndef __ASM_MACH_ADDR_MAP_H |
12 | #define __ASM_MACH_ADDR_MAP_H | 12 | #define __ASM_MACH_ADDR_MAP_H |
13 | 13 | ||
14 | #ifndef __ASSEMBLER__ | ||
15 | #define IOMEM(x) ((void __iomem *)(x)) | ||
16 | #else | ||
17 | #define IOMEM(x) (x) | ||
18 | #endif | ||
19 | |||
14 | /* APB - Application Subsystem Peripheral Bus | 20 | /* APB - Application Subsystem Peripheral Bus |
15 | * | 21 | * |
16 | * NOTE: the DMA controller registers are actually on the AXI fabric #1 | 22 | * NOTE: the DMA controller registers are actually on the AXI fabric #1 |
@@ -18,11 +24,11 @@ | |||
18 | * peripherals on APB, let's count it into the ABP mapping area. | 24 | * peripherals on APB, let's count it into the ABP mapping area. |
19 | */ | 25 | */ |
20 | #define APB_PHYS_BASE 0xd4000000 | 26 | #define APB_PHYS_BASE 0xd4000000 |
21 | #define APB_VIRT_BASE 0xfe000000 | 27 | #define APB_VIRT_BASE IOMEM(0xfe000000) |
22 | #define APB_PHYS_SIZE 0x00200000 | 28 | #define APB_PHYS_SIZE 0x00200000 |
23 | 29 | ||
24 | #define AXI_PHYS_BASE 0xd4200000 | 30 | #define AXI_PHYS_BASE 0xd4200000 |
25 | #define AXI_VIRT_BASE 0xfe200000 | 31 | #define AXI_VIRT_BASE IOMEM(0xfe200000) |
26 | #define AXI_PHYS_SIZE 0x00200000 | 32 | #define AXI_PHYS_SIZE 0x00200000 |
27 | 33 | ||
28 | /* Static Memory Controller - Chip Select 0 and 1 */ | 34 | /* Static Memory Controller - Chip Select 0 and 1 */ |
diff --git a/arch/arm/mach-mmp/mmp2.c b/arch/arm/mach-mmp/mmp2.c index 079c18861d5c..a80cbea40496 100644 --- a/arch/arm/mach-mmp/mmp2.c +++ b/arch/arm/mach-mmp/mmp2.c | |||
@@ -87,7 +87,8 @@ static struct mfp_addr_map mmp2_addr_map[] __initdata = { | |||
87 | 87 | ||
88 | void mmp2_clear_pmic_int(void) | 88 | void mmp2_clear_pmic_int(void) |
89 | { | 89 | { |
90 | unsigned long mfpr_pmic, data; | 90 | void __iomem *mfpr_pmic; |
91 | unsigned long data; | ||
91 | 92 | ||
92 | mfpr_pmic = APB_VIRT_BASE + 0x1e000 + 0x2c4; | 93 | mfpr_pmic = APB_VIRT_BASE + 0x1e000 + 0x2c4; |
93 | data = __raw_readl(mfpr_pmic); | 94 | data = __raw_readl(mfpr_pmic); |