diff options
Diffstat (limited to 'arch/arm/mach-orion')
-rw-r--r-- | arch/arm/mach-orion/addr-map.c | 14 | ||||
-rw-r--r-- | arch/arm/mach-orion/common.c | 24 | ||||
-rw-r--r-- | arch/arm/mach-orion/common.h | 6 | ||||
-rw-r--r-- | arch/arm/mach-orion/dns323-setup.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-orion/gpio.c | 12 | ||||
-rw-r--r-- | arch/arm/mach-orion/kurobox_pro-setup.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-orion/ts209-setup.c | 1 |
7 files changed, 47 insertions, 12 deletions
diff --git a/arch/arm/mach-orion/addr-map.c b/arch/arm/mach-orion/addr-map.c index 2e2fd63643c3..58cc3c0333b6 100644 --- a/arch/arm/mach-orion/addr-map.c +++ b/arch/arm/mach-orion/addr-map.c | |||
@@ -97,14 +97,20 @@ | |||
97 | #define PCIE_BAR_CTRL(n) ORION_PCIE_REG(0x1804 + ((n - 1) * 4)) | 97 | #define PCIE_BAR_CTRL(n) ORION_PCIE_REG(0x1804 + ((n - 1) * 4)) |
98 | #define PCIE_BAR_LO(n) ORION_PCIE_REG(0x0010 + ((n) * 8)) | 98 | #define PCIE_BAR_LO(n) ORION_PCIE_REG(0x0010 + ((n) * 8)) |
99 | #define PCIE_BAR_HI(n) ORION_PCIE_REG(0x0014 + ((n) * 8)) | 99 | #define PCIE_BAR_HI(n) ORION_PCIE_REG(0x0014 + ((n) * 8)) |
100 | #define PCIE_WIN_CTRL(n) ORION_PCIE_REG(0x1820 + ((n) << 4)) | 100 | #define PCIE_WIN_CTRL(n) (((n) < 5) ? \ |
101 | #define PCIE_WIN_BASE(n) ORION_PCIE_REG(0x1824 + ((n) << 4)) | 101 | ORION_PCIE_REG(0x1820 + ((n) << 4)) : \ |
102 | #define PCIE_WIN_REMAP(n) ORION_PCIE_REG(0x182c + ((n) << 4)) | 102 | ORION_PCIE_REG(0x1880)) |
103 | #define PCIE_WIN_BASE(n) (((n) < 5) ? \ | ||
104 | ORION_PCIE_REG(0x1824 + ((n) << 4)) : \ | ||
105 | ORION_PCIE_REG(0x1884)) | ||
106 | #define PCIE_WIN_REMAP(n) (((n) < 5) ? \ | ||
107 | ORION_PCIE_REG(0x182c + ((n) << 4)) : \ | ||
108 | ORION_PCIE_REG(0x188c)) | ||
103 | #define PCIE_DEFWIN_CTRL ORION_PCIE_REG(0x18b0) | 109 | #define PCIE_DEFWIN_CTRL ORION_PCIE_REG(0x18b0) |
104 | #define PCIE_EXPROM_WIN_CTRL ORION_PCIE_REG(0x18c0) | 110 | #define PCIE_EXPROM_WIN_CTRL ORION_PCIE_REG(0x18c0) |
105 | #define PCIE_EXPROM_WIN_REMP ORION_PCIE_REG(0x18c4) | 111 | #define PCIE_EXPROM_WIN_REMP ORION_PCIE_REG(0x18c4) |
106 | #define PCIE_MAX_BARS 3 | 112 | #define PCIE_MAX_BARS 3 |
107 | #define PCIE_MAX_WINS 5 | 113 | #define PCIE_MAX_WINS 6 |
108 | 114 | ||
109 | /* | 115 | /* |
110 | * Use PCIE BAR '1' for all DDR banks | 116 | * Use PCIE BAR '1' for all DDR banks |
diff --git a/arch/arm/mach-orion/common.c b/arch/arm/mach-orion/common.c index 5f0ee4b8a9b7..bbc2b4ec932c 100644 --- a/arch/arm/mach-orion/common.c +++ b/arch/arm/mach-orion/common.c | |||
@@ -17,7 +17,9 @@ | |||
17 | #include <linux/mv643xx_eth.h> | 17 | #include <linux/mv643xx_eth.h> |
18 | #include <linux/mv643xx_i2c.h> | 18 | #include <linux/mv643xx_i2c.h> |
19 | #include <asm/page.h> | 19 | #include <asm/page.h> |
20 | #include <asm/setup.h> | ||
20 | #include <asm/timex.h> | 21 | #include <asm/timex.h> |
22 | #include <asm/mach/arch.h> | ||
21 | #include <asm/mach/map.h> | 23 | #include <asm/mach/map.h> |
22 | #include <asm/arch/hardware.h> | 24 | #include <asm/arch/hardware.h> |
23 | #include "common.h" | 25 | #include "common.h" |
@@ -177,8 +179,8 @@ static struct platform_device orion_ehci1 = { | |||
177 | 179 | ||
178 | static struct resource orion_eth_shared_resources[] = { | 180 | static struct resource orion_eth_shared_resources[] = { |
179 | { | 181 | { |
180 | .start = ORION_ETH_PHYS_BASE, | 182 | .start = ORION_ETH_PHYS_BASE + 0x2000, |
181 | .end = ORION_ETH_PHYS_BASE + 0xffff, | 183 | .end = ORION_ETH_PHYS_BASE + 0x3fff, |
182 | .flags = IORESOURCE_MEM, | 184 | .flags = IORESOURCE_MEM, |
183 | }, | 185 | }, |
184 | }; | 186 | }; |
@@ -347,3 +349,21 @@ void __init orion_init(void) | |||
347 | platform_device_register(&orion_ehci1); | 349 | platform_device_register(&orion_ehci1); |
348 | platform_device_register(&orion_i2c); | 350 | platform_device_register(&orion_i2c); |
349 | } | 351 | } |
352 | |||
353 | /* | ||
354 | * Many orion-based systems have buggy bootloader implementations. | ||
355 | * This is a common fixup for bogus memory tags. | ||
356 | */ | ||
357 | void __init tag_fixup_mem32(struct machine_desc *mdesc, struct tag *t, | ||
358 | char **from, struct meminfo *meminfo) | ||
359 | { | ||
360 | for (; t->hdr.size; t = tag_next(t)) | ||
361 | if (t->hdr.tag == ATAG_MEM && | ||
362 | (!t->u.mem.size || t->u.mem.size & ~PAGE_MASK || | ||
363 | t->u.mem.start & ~PAGE_MASK)) { | ||
364 | printk(KERN_WARNING | ||
365 | "Clearing invalid memory bank %dKB@0x%08x\n", | ||
366 | t->u.mem.size / 1024, t->u.mem.start); | ||
367 | t->hdr.tag = 0; | ||
368 | } | ||
369 | } | ||
diff --git a/arch/arm/mach-orion/common.h b/arch/arm/mach-orion/common.h index 10154ec885df..501497cc2c4d 100644 --- a/arch/arm/mach-orion/common.h +++ b/arch/arm/mach-orion/common.h | |||
@@ -83,4 +83,10 @@ struct mv_sata_platform_data; | |||
83 | 83 | ||
84 | void __init orion_sata_init(struct mv_sata_platform_data *sata_data); | 84 | void __init orion_sata_init(struct mv_sata_platform_data *sata_data); |
85 | 85 | ||
86 | struct machine_desc; | ||
87 | struct meminfo; | ||
88 | struct tag; | ||
89 | extern void __init tag_fixup_mem32(struct machine_desc *, struct tag *, | ||
90 | char **, struct meminfo *); | ||
91 | |||
86 | #endif /* __ARCH_ORION_COMMON_H__ */ | 92 | #endif /* __ARCH_ORION_COMMON_H__ */ |
diff --git a/arch/arm/mach-orion/dns323-setup.c b/arch/arm/mach-orion/dns323-setup.c index 02b280c24820..076e155ad510 100644 --- a/arch/arm/mach-orion/dns323-setup.c +++ b/arch/arm/mach-orion/dns323-setup.c | |||
@@ -319,4 +319,5 @@ MACHINE_START(DNS323, "D-Link DNS-323") | |||
319 | .map_io = orion_map_io, | 319 | .map_io = orion_map_io, |
320 | .init_irq = orion_init_irq, | 320 | .init_irq = orion_init_irq, |
321 | .timer = &orion_timer, | 321 | .timer = &orion_timer, |
322 | .fixup = tag_fixup_mem32, | ||
322 | MACHINE_END | 323 | MACHINE_END |
diff --git a/arch/arm/mach-orion/gpio.c b/arch/arm/mach-orion/gpio.c index d5f00c86d616..f713818c66a3 100644 --- a/arch/arm/mach-orion/gpio.c +++ b/arch/arm/mach-orion/gpio.c | |||
@@ -36,7 +36,7 @@ int gpio_direction_input(unsigned pin) | |||
36 | unsigned long flags; | 36 | unsigned long flags; |
37 | 37 | ||
38 | if (pin >= GPIO_MAX || !test_bit(pin, gpio_valid)) { | 38 | if (pin >= GPIO_MAX || !test_bit(pin, gpio_valid)) { |
39 | pr_debug("%s: invalid GPIO %d\n", __FUNCTION__, pin); | 39 | pr_debug("%s: invalid GPIO %d\n", __func__, pin); |
40 | return -EINVAL; | 40 | return -EINVAL; |
41 | } | 41 | } |
42 | 42 | ||
@@ -62,7 +62,7 @@ int gpio_direction_output(unsigned pin, int value) | |||
62 | int mask; | 62 | int mask; |
63 | 63 | ||
64 | if (pin >= GPIO_MAX || !test_bit(pin, gpio_valid)) { | 64 | if (pin >= GPIO_MAX || !test_bit(pin, gpio_valid)) { |
65 | pr_debug("%s: invalid GPIO %d\n", __FUNCTION__, pin); | 65 | pr_debug("%s: invalid GPIO %d\n", __func__, pin); |
66 | return -EINVAL; | 66 | return -EINVAL; |
67 | } | 67 | } |
68 | 68 | ||
@@ -141,7 +141,7 @@ int gpio_request(unsigned pin, const char *label) | |||
141 | unsigned long flags; | 141 | unsigned long flags; |
142 | 142 | ||
143 | if (pin >= GPIO_MAX || !test_bit(pin, gpio_valid)) { | 143 | if (pin >= GPIO_MAX || !test_bit(pin, gpio_valid)) { |
144 | pr_debug("%s: invalid GPIO %d\n", __FUNCTION__, pin); | 144 | pr_debug("%s: invalid GPIO %d\n", __func__, pin); |
145 | return -EINVAL; | 145 | return -EINVAL; |
146 | } | 146 | } |
147 | 147 | ||
@@ -149,7 +149,7 @@ int gpio_request(unsigned pin, const char *label) | |||
149 | 149 | ||
150 | if (gpio_label[pin]) { | 150 | if (gpio_label[pin]) { |
151 | pr_debug("%s: GPIO %d already used as %s\n", | 151 | pr_debug("%s: GPIO %d already used as %s\n", |
152 | __FUNCTION__, pin, gpio_label[pin]); | 152 | __func__, pin, gpio_label[pin]); |
153 | ret = -EBUSY; | 153 | ret = -EBUSY; |
154 | } else | 154 | } else |
155 | gpio_label[pin] = label ? label : "?"; | 155 | gpio_label[pin] = label ? label : "?"; |
@@ -162,12 +162,12 @@ EXPORT_SYMBOL(gpio_request); | |||
162 | void gpio_free(unsigned pin) | 162 | void gpio_free(unsigned pin) |
163 | { | 163 | { |
164 | if (pin >= GPIO_MAX || !test_bit(pin, gpio_valid)) { | 164 | if (pin >= GPIO_MAX || !test_bit(pin, gpio_valid)) { |
165 | pr_debug("%s: invalid GPIO %d\n", __FUNCTION__, pin); | 165 | pr_debug("%s: invalid GPIO %d\n", __func__, pin); |
166 | return; | 166 | return; |
167 | } | 167 | } |
168 | 168 | ||
169 | if (!gpio_label[pin]) | 169 | if (!gpio_label[pin]) |
170 | pr_warning("%s: GPIO %d already freed\n", __FUNCTION__, pin); | 170 | pr_warning("%s: GPIO %d already freed\n", __func__, pin); |
171 | else | 171 | else |
172 | gpio_label[pin] = NULL; | 172 | gpio_label[pin] = NULL; |
173 | } | 173 | } |
diff --git a/arch/arm/mach-orion/kurobox_pro-setup.c b/arch/arm/mach-orion/kurobox_pro-setup.c index 6817aca4aa26..785a07bdf1e2 100644 --- a/arch/arm/mach-orion/kurobox_pro-setup.c +++ b/arch/arm/mach-orion/kurobox_pro-setup.c | |||
@@ -240,4 +240,5 @@ MACHINE_START(KUROBOX_PRO, "Buffalo/Revogear Kurobox Pro") | |||
240 | .map_io = orion_map_io, | 240 | .map_io = orion_map_io, |
241 | .init_irq = orion_init_irq, | 241 | .init_irq = orion_init_irq, |
242 | .timer = &orion_timer, | 242 | .timer = &orion_timer, |
243 | .fixup = tag_fixup_mem32, | ||
243 | MACHINE_END | 244 | MACHINE_END |
diff --git a/arch/arm/mach-orion/ts209-setup.c b/arch/arm/mach-orion/ts209-setup.c index b8cfe6813e9d..45764dad16d0 100644 --- a/arch/arm/mach-orion/ts209-setup.c +++ b/arch/arm/mach-orion/ts209-setup.c | |||
@@ -357,4 +357,5 @@ MACHINE_START(TS209, "QNAP TS-109/TS-209") | |||
357 | .map_io = orion_map_io, | 357 | .map_io = orion_map_io, |
358 | .init_irq = orion_init_irq, | 358 | .init_irq = orion_init_irq, |
359 | .timer = &orion_timer, | 359 | .timer = &orion_timer, |
360 | .fixup = tag_fixup_mem32, | ||
360 | MACHINE_END | 361 | MACHINE_END |