diff options
author | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2012-09-11 08:27:19 -0400 |
---|---|---|
committer | Jason Cooper <jason@lakedaemon.net> | 2012-09-21 14:03:35 -0400 |
commit | 060f3d191b1d80312d7c90de2f3c3356db413f40 (patch) | |
tree | 084ff4029442389bcdf1e4cf5c2d6081f08c458a /arch | |
parent | c3c5a2815d0b7ebde157556685a0ef8ffa34b98c (diff) |
arm: mach-kirkwood: use IOMEM() for base address definitions
We now define all virtual base address constants using IOMEM() so that
those are naturally typed as void __iomem pointers, and we do the
necessary adjustements in the mach-kirkwood code.
Note that we introduce a few temporary additional "unsigned long"
casts when calling into plat-orion functions. Those are removed by
followup patches converting plat-orion functions to void __iomem
pointers as well.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-kirkwood/addr-map.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/common.c | 23 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/include/mach/kirkwood.h | 6 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/irq.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/mpp.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/pcie.c | 12 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/ts41x-setup.c | 3 |
7 files changed, 31 insertions, 27 deletions
diff --git a/arch/arm/mach-kirkwood/addr-map.c b/arch/arm/mach-kirkwood/addr-map.c index e9a7180863d9..1b8c75c529dc 100644 --- a/arch/arm/mach-kirkwood/addr-map.c +++ b/arch/arm/mach-kirkwood/addr-map.c | |||
@@ -41,7 +41,7 @@ | |||
41 | static struct __initdata orion_addr_map_cfg addr_map_cfg = { | 41 | static struct __initdata orion_addr_map_cfg addr_map_cfg = { |
42 | .num_wins = 8, | 42 | .num_wins = 8, |
43 | .remappable_wins = 4, | 43 | .remappable_wins = 4, |
44 | .bridge_virt_base = BRIDGE_VIRT_BASE, | 44 | .bridge_virt_base = (unsigned long) BRIDGE_VIRT_BASE, |
45 | }; | 45 | }; |
46 | 46 | ||
47 | static const struct __initdata orion_addr_map_info addr_map_info[] = { | 47 | static const struct __initdata orion_addr_map_info addr_map_info[] = { |
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c index 1201191d7f1b..75bc04da8d99 100644 --- a/arch/arm/mach-kirkwood/common.c +++ b/arch/arm/mach-kirkwood/common.c | |||
@@ -42,17 +42,17 @@ | |||
42 | ****************************************************************************/ | 42 | ****************************************************************************/ |
43 | static struct map_desc kirkwood_io_desc[] __initdata = { | 43 | static struct map_desc kirkwood_io_desc[] __initdata = { |
44 | { | 44 | { |
45 | .virtual = KIRKWOOD_PCIE_IO_VIRT_BASE, | 45 | .virtual = (unsigned long) KIRKWOOD_PCIE_IO_VIRT_BASE, |
46 | .pfn = __phys_to_pfn(KIRKWOOD_PCIE_IO_PHYS_BASE), | 46 | .pfn = __phys_to_pfn(KIRKWOOD_PCIE_IO_PHYS_BASE), |
47 | .length = KIRKWOOD_PCIE_IO_SIZE, | 47 | .length = KIRKWOOD_PCIE_IO_SIZE, |
48 | .type = MT_DEVICE, | 48 | .type = MT_DEVICE, |
49 | }, { | 49 | }, { |
50 | .virtual = KIRKWOOD_PCIE1_IO_VIRT_BASE, | 50 | .virtual = (unsigned long) KIRKWOOD_PCIE1_IO_VIRT_BASE, |
51 | .pfn = __phys_to_pfn(KIRKWOOD_PCIE1_IO_PHYS_BASE), | 51 | .pfn = __phys_to_pfn(KIRKWOOD_PCIE1_IO_PHYS_BASE), |
52 | .length = KIRKWOOD_PCIE1_IO_SIZE, | 52 | .length = KIRKWOOD_PCIE1_IO_SIZE, |
53 | .type = MT_DEVICE, | 53 | .type = MT_DEVICE, |
54 | }, { | 54 | }, { |
55 | .virtual = KIRKWOOD_REGS_VIRT_BASE, | 55 | .virtual = (unsigned long) KIRKWOOD_REGS_VIRT_BASE, |
56 | .pfn = __phys_to_pfn(KIRKWOOD_REGS_PHYS_BASE), | 56 | .pfn = __phys_to_pfn(KIRKWOOD_REGS_PHYS_BASE), |
57 | .length = KIRKWOOD_REGS_SIZE, | 57 | .length = KIRKWOOD_REGS_SIZE, |
58 | .type = MT_DEVICE, | 58 | .type = MT_DEVICE, |
@@ -215,8 +215,7 @@ static struct clk *tclk; | |||
215 | 215 | ||
216 | static struct clk __init *kirkwood_register_gate(const char *name, u8 bit_idx) | 216 | static struct clk __init *kirkwood_register_gate(const char *name, u8 bit_idx) |
217 | { | 217 | { |
218 | return clk_register_gate(NULL, name, "tclk", 0, | 218 | return clk_register_gate(NULL, name, "tclk", 0, CLOCK_GATING_CTRL, |
219 | (void __iomem *)CLOCK_GATING_CTRL, | ||
220 | bit_idx, 0, &gating_lock); | 219 | bit_idx, 0, &gating_lock); |
221 | } | 220 | } |
222 | 221 | ||
@@ -225,8 +224,7 @@ static struct clk __init *kirkwood_register_gate_fn(const char *name, | |||
225 | void (*fn_en)(void), | 224 | void (*fn_en)(void), |
226 | void (*fn_dis)(void)) | 225 | void (*fn_dis)(void)) |
227 | { | 226 | { |
228 | return clk_register_gate_fn(NULL, name, "tclk", 0, | 227 | return clk_register_gate_fn(NULL, name, "tclk", 0, CLOCK_GATING_CTRL, |
229 | (void __iomem *)CLOCK_GATING_CTRL, | ||
230 | bit_idx, 0, &gating_lock, fn_en, fn_dis); | 228 | bit_idx, 0, &gating_lock, fn_en, fn_dis); |
231 | } | 229 | } |
232 | 230 | ||
@@ -458,7 +456,8 @@ void __init kirkwood_i2c_init(void) | |||
458 | 456 | ||
459 | void __init kirkwood_uart0_init(void) | 457 | void __init kirkwood_uart0_init(void) |
460 | { | 458 | { |
461 | orion_uart0_init(UART0_VIRT_BASE, UART0_PHYS_BASE, | 459 | orion_uart0_init((unsigned long) UART0_VIRT_BASE, |
460 | UART0_PHYS_BASE, | ||
462 | IRQ_KIRKWOOD_UART_0, tclk); | 461 | IRQ_KIRKWOOD_UART_0, tclk); |
463 | } | 462 | } |
464 | 463 | ||
@@ -468,7 +467,8 @@ void __init kirkwood_uart0_init(void) | |||
468 | ****************************************************************************/ | 467 | ****************************************************************************/ |
469 | void __init kirkwood_uart1_init(void) | 468 | void __init kirkwood_uart1_init(void) |
470 | { | 469 | { |
471 | orion_uart1_init(UART1_VIRT_BASE, UART1_PHYS_BASE, | 470 | orion_uart1_init((unsigned long) UART1_VIRT_BASE, |
471 | UART1_PHYS_BASE, | ||
472 | IRQ_KIRKWOOD_UART_1, tclk); | 472 | IRQ_KIRKWOOD_UART_1, tclk); |
473 | } | 473 | } |
474 | 474 | ||
@@ -516,7 +516,7 @@ void __init kirkwood_wdt_init(void) | |||
516 | ****************************************************************************/ | 516 | ****************************************************************************/ |
517 | void __init kirkwood_init_early(void) | 517 | void __init kirkwood_init_early(void) |
518 | { | 518 | { |
519 | orion_time_set_base(TIMER_VIRT_BASE); | 519 | orion_time_set_base((unsigned long) TIMER_VIRT_BASE); |
520 | 520 | ||
521 | /* | 521 | /* |
522 | * Some Kirkwood devices allocate their coherent buffers from atomic | 522 | * Some Kirkwood devices allocate their coherent buffers from atomic |
@@ -545,7 +545,8 @@ static void __init kirkwood_timer_init(void) | |||
545 | { | 545 | { |
546 | kirkwood_tclk = kirkwood_find_tclk(); | 546 | kirkwood_tclk = kirkwood_find_tclk(); |
547 | 547 | ||
548 | orion_time_init(BRIDGE_VIRT_BASE, BRIDGE_INT_TIMER1_CLR, | 548 | orion_time_init((unsigned long) BRIDGE_VIRT_BASE, |
549 | BRIDGE_INT_TIMER1_CLR, | ||
549 | IRQ_KIRKWOOD_BRIDGE, kirkwood_tclk); | 550 | IRQ_KIRKWOOD_BRIDGE, kirkwood_tclk); |
550 | } | 551 | } |
551 | 552 | ||
diff --git a/arch/arm/mach-kirkwood/include/mach/kirkwood.h b/arch/arm/mach-kirkwood/include/mach/kirkwood.h index 9695592d332b..d3ea68269c90 100644 --- a/arch/arm/mach-kirkwood/include/mach/kirkwood.h +++ b/arch/arm/mach-kirkwood/include/mach/kirkwood.h | |||
@@ -37,17 +37,17 @@ | |||
37 | #define KIRKWOOD_NAND_MEM_SIZE SZ_1K | 37 | #define KIRKWOOD_NAND_MEM_SIZE SZ_1K |
38 | 38 | ||
39 | #define KIRKWOOD_PCIE1_IO_PHYS_BASE 0xf3000000 | 39 | #define KIRKWOOD_PCIE1_IO_PHYS_BASE 0xf3000000 |
40 | #define KIRKWOOD_PCIE1_IO_VIRT_BASE 0xfef00000 | 40 | #define KIRKWOOD_PCIE1_IO_VIRT_BASE IOMEM(0xfef00000) |
41 | #define KIRKWOOD_PCIE1_IO_BUS_BASE 0x00100000 | 41 | #define KIRKWOOD_PCIE1_IO_BUS_BASE 0x00100000 |
42 | #define KIRKWOOD_PCIE1_IO_SIZE SZ_1M | 42 | #define KIRKWOOD_PCIE1_IO_SIZE SZ_1M |
43 | 43 | ||
44 | #define KIRKWOOD_PCIE_IO_PHYS_BASE 0xf2000000 | 44 | #define KIRKWOOD_PCIE_IO_PHYS_BASE 0xf2000000 |
45 | #define KIRKWOOD_PCIE_IO_VIRT_BASE 0xfee00000 | 45 | #define KIRKWOOD_PCIE_IO_VIRT_BASE IOMEM(0xfee00000) |
46 | #define KIRKWOOD_PCIE_IO_BUS_BASE 0x00000000 | 46 | #define KIRKWOOD_PCIE_IO_BUS_BASE 0x00000000 |
47 | #define KIRKWOOD_PCIE_IO_SIZE SZ_1M | 47 | #define KIRKWOOD_PCIE_IO_SIZE SZ_1M |
48 | 48 | ||
49 | #define KIRKWOOD_REGS_PHYS_BASE 0xf1000000 | 49 | #define KIRKWOOD_REGS_PHYS_BASE 0xf1000000 |
50 | #define KIRKWOOD_REGS_VIRT_BASE 0xfed00000 | 50 | #define KIRKWOOD_REGS_VIRT_BASE IOMEM(0xfed00000) |
51 | #define KIRKWOOD_REGS_SIZE SZ_1M | 51 | #define KIRKWOOD_REGS_SIZE SZ_1M |
52 | 52 | ||
53 | #define KIRKWOOD_PCIE_MEM_PHYS_BASE 0xe0000000 | 53 | #define KIRKWOOD_PCIE_MEM_PHYS_BASE 0xe0000000 |
diff --git a/arch/arm/mach-kirkwood/irq.c b/arch/arm/mach-kirkwood/irq.c index 720063ffa19d..f4ac804dc664 100644 --- a/arch/arm/mach-kirkwood/irq.c +++ b/arch/arm/mach-kirkwood/irq.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/gpio.h> | 10 | #include <linux/gpio.h> |
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/irq.h> | 12 | #include <linux/irq.h> |
13 | #include <linux/io.h> | ||
13 | #include <mach/bridge-regs.h> | 14 | #include <mach/bridge-regs.h> |
14 | #include <plat/irq.h> | 15 | #include <plat/irq.h> |
15 | 16 | ||
@@ -29,14 +30,14 @@ static int __initdata gpio1_irqs[4] = { | |||
29 | 30 | ||
30 | void __init kirkwood_init_irq(void) | 31 | void __init kirkwood_init_irq(void) |
31 | { | 32 | { |
32 | orion_irq_init(0, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_LOW_OFF)); | 33 | orion_irq_init(0, IRQ_VIRT_BASE + IRQ_MASK_LOW_OFF); |
33 | orion_irq_init(32, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF)); | 34 | orion_irq_init(32, IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF); |
34 | 35 | ||
35 | /* | 36 | /* |
36 | * Initialize gpiolib for GPIOs 0-49. | 37 | * Initialize gpiolib for GPIOs 0-49. |
37 | */ | 38 | */ |
38 | orion_gpio_init(NULL, 0, 32, (void __iomem *)GPIO_LOW_VIRT_BASE, 0, | 39 | orion_gpio_init(NULL, 0, 32, GPIO_LOW_VIRT_BASE, 0, |
39 | IRQ_KIRKWOOD_GPIO_START, gpio0_irqs); | 40 | IRQ_KIRKWOOD_GPIO_START, gpio0_irqs); |
40 | orion_gpio_init(NULL, 32, 18, (void __iomem *)GPIO_HIGH_VIRT_BASE, 0, | 41 | orion_gpio_init(NULL, 32, 18, GPIO_HIGH_VIRT_BASE, 0, |
41 | IRQ_KIRKWOOD_GPIO_START + 32, gpio1_irqs); | 42 | IRQ_KIRKWOOD_GPIO_START + 32, gpio1_irqs); |
42 | } | 43 | } |
diff --git a/arch/arm/mach-kirkwood/mpp.c b/arch/arm/mach-kirkwood/mpp.c index 0c6ad63f10c7..67742793f3c4 100644 --- a/arch/arm/mach-kirkwood/mpp.c +++ b/arch/arm/mach-kirkwood/mpp.c | |||
@@ -38,5 +38,6 @@ static unsigned int __init kirkwood_variant(void) | |||
38 | void __init kirkwood_mpp_conf(unsigned int *mpp_list) | 38 | void __init kirkwood_mpp_conf(unsigned int *mpp_list) |
39 | { | 39 | { |
40 | orion_mpp_conf(mpp_list, kirkwood_variant(), | 40 | orion_mpp_conf(mpp_list, kirkwood_variant(), |
41 | MPP_MAX, DEV_BUS_VIRT_BASE); | 41 | MPP_MAX, |
42 | (unsigned long) DEV_BUS_VIRT_BASE); | ||
42 | } | 43 | } |
diff --git a/arch/arm/mach-kirkwood/pcie.c b/arch/arm/mach-kirkwood/pcie.c index 6e8b2efa3c35..df6399dea745 100644 --- a/arch/arm/mach-kirkwood/pcie.c +++ b/arch/arm/mach-kirkwood/pcie.c | |||
@@ -47,8 +47,8 @@ void kirkwood_enable_pcie(void) | |||
47 | void kirkwood_pcie_id(u32 *dev, u32 *rev) | 47 | void kirkwood_pcie_id(u32 *dev, u32 *rev) |
48 | { | 48 | { |
49 | kirkwood_enable_pcie(); | 49 | kirkwood_enable_pcie(); |
50 | *dev = orion_pcie_dev_id((void __iomem *)PCIE_VIRT_BASE); | 50 | *dev = orion_pcie_dev_id(PCIE_VIRT_BASE); |
51 | *rev = orion_pcie_rev((void __iomem *)PCIE_VIRT_BASE); | 51 | *rev = orion_pcie_rev(PCIE_VIRT_BASE); |
52 | } | 52 | } |
53 | 53 | ||
54 | struct pcie_port { | 54 | struct pcie_port { |
@@ -133,7 +133,7 @@ static struct pci_ops pcie_ops = { | |||
133 | 133 | ||
134 | static void __init pcie0_ioresources_init(struct pcie_port *pp) | 134 | static void __init pcie0_ioresources_init(struct pcie_port *pp) |
135 | { | 135 | { |
136 | pp->base = (void __iomem *)PCIE_VIRT_BASE; | 136 | pp->base = PCIE_VIRT_BASE; |
137 | pp->irq = IRQ_KIRKWOOD_PCIE; | 137 | pp->irq = IRQ_KIRKWOOD_PCIE; |
138 | 138 | ||
139 | /* | 139 | /* |
@@ -155,7 +155,7 @@ static void __init pcie0_ioresources_init(struct pcie_port *pp) | |||
155 | 155 | ||
156 | static void __init pcie1_ioresources_init(struct pcie_port *pp) | 156 | static void __init pcie1_ioresources_init(struct pcie_port *pp) |
157 | { | 157 | { |
158 | pp->base = (void __iomem *)PCIE1_VIRT_BASE; | 158 | pp->base = PCIE1_VIRT_BASE; |
159 | pp->irq = IRQ_KIRKWOOD_PCIE1; | 159 | pp->irq = IRQ_KIRKWOOD_PCIE1; |
160 | 160 | ||
161 | /* | 161 | /* |
@@ -273,11 +273,11 @@ static struct hw_pci kirkwood_pci __initdata = { | |||
273 | .map_irq = kirkwood_pcie_map_irq, | 273 | .map_irq = kirkwood_pcie_map_irq, |
274 | }; | 274 | }; |
275 | 275 | ||
276 | static void __init add_pcie_port(int index, unsigned long base) | 276 | static void __init add_pcie_port(int index, void __iomem *base) |
277 | { | 277 | { |
278 | printk(KERN_INFO "Kirkwood PCIe port %d: ", index); | 278 | printk(KERN_INFO "Kirkwood PCIe port %d: ", index); |
279 | 279 | ||
280 | if (orion_pcie_link_up((void __iomem *)base)) { | 280 | if (orion_pcie_link_up(base)) { |
281 | printk(KERN_INFO "link up\n"); | 281 | printk(KERN_INFO "link up\n"); |
282 | pcie_port_map[num_pcie_ports++] = index; | 282 | pcie_port_map[num_pcie_ports++] = index; |
283 | } else | 283 | } else |
diff --git a/arch/arm/mach-kirkwood/ts41x-setup.c b/arch/arm/mach-kirkwood/ts41x-setup.c index 5bbca2680442..367a9400f532 100644 --- a/arch/arm/mach-kirkwood/ts41x-setup.c +++ b/arch/arm/mach-kirkwood/ts41x-setup.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/gpio.h> | 20 | #include <linux/gpio.h> |
21 | #include <linux/gpio_keys.h> | 21 | #include <linux/gpio_keys.h> |
22 | #include <linux/input.h> | 22 | #include <linux/input.h> |
23 | #include <linux/io.h> | ||
23 | #include <asm/mach-types.h> | 24 | #include <asm/mach-types.h> |
24 | #include <asm/mach/arch.h> | 25 | #include <asm/mach/arch.h> |
25 | #include <mach/kirkwood.h> | 26 | #include <mach/kirkwood.h> |
@@ -161,7 +162,7 @@ static int __init ts41x_pci_init(void) | |||
161 | * (Marvell 88sx7042/sata_mv) is known to stop working | 162 | * (Marvell 88sx7042/sata_mv) is known to stop working |
162 | * after a few minutes. | 163 | * after a few minutes. |
163 | */ | 164 | */ |
164 | orion_pcie_reset((void __iomem *)PCIE_VIRT_BASE); | 165 | orion_pcie_reset(PCIE_VIRT_BASE); |
165 | 166 | ||
166 | kirkwood_pcie_id(&dev, &rev); | 167 | kirkwood_pcie_id(&dev, &rev); |
167 | if (dev == MV88F6282_DEV_ID) | 168 | if (dev == MV88F6282_DEV_ID) |