diff options
Diffstat (limited to 'arch/arm/mach-orion5x')
-rw-r--r-- | arch/arm/mach-orion5x/common.c | 85 |
1 files changed, 4 insertions, 81 deletions
diff --git a/arch/arm/mach-orion5x/common.c b/arch/arm/mach-orion5x/common.c index 310de50e1bb9..0a1c7600004e 100644 --- a/arch/arm/mach-orion5x/common.c +++ b/arch/arm/mach-orion5x/common.c | |||
@@ -15,7 +15,6 @@ | |||
15 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
16 | #include <linux/serial_8250.h> | 16 | #include <linux/serial_8250.h> |
17 | #include <linux/mbus.h> | 17 | #include <linux/mbus.h> |
18 | #include <linux/mv643xx_eth.h> | ||
19 | #include <linux/mv643xx_i2c.h> | 18 | #include <linux/mv643xx_i2c.h> |
20 | #include <linux/ata_platform.h> | 19 | #include <linux/ata_platform.h> |
21 | #include <linux/spi/orion_spi.h> | 20 | #include <linux/spi/orion_spi.h> |
@@ -150,95 +149,20 @@ void __init orion5x_ehci1_init(void) | |||
150 | /***************************************************************************** | 149 | /***************************************************************************** |
151 | * GE00 | 150 | * GE00 |
152 | ****************************************************************************/ | 151 | ****************************************************************************/ |
153 | struct mv643xx_eth_shared_platform_data orion5x_ge00_shared_data = { | ||
154 | .dram = &orion5x_mbus_dram_info, | ||
155 | }; | ||
156 | |||
157 | static struct resource orion5x_ge00_shared_resources[] = { | ||
158 | { | ||
159 | .start = ORION5X_ETH_PHYS_BASE + 0x2000, | ||
160 | .end = ORION5X_ETH_PHYS_BASE + SZ_16K - 1, | ||
161 | .flags = IORESOURCE_MEM, | ||
162 | }, { | ||
163 | .start = IRQ_ORION5X_ETH_ERR, | ||
164 | .end = IRQ_ORION5X_ETH_ERR, | ||
165 | .flags = IORESOURCE_IRQ, | ||
166 | }, | ||
167 | }; | ||
168 | |||
169 | static struct platform_device orion5x_ge00_shared = { | ||
170 | .name = MV643XX_ETH_SHARED_NAME, | ||
171 | .id = 0, | ||
172 | .dev = { | ||
173 | .platform_data = &orion5x_ge00_shared_data, | ||
174 | }, | ||
175 | .num_resources = ARRAY_SIZE(orion5x_ge00_shared_resources), | ||
176 | .resource = orion5x_ge00_shared_resources, | ||
177 | }; | ||
178 | |||
179 | static struct resource orion5x_ge00_resources[] = { | ||
180 | { | ||
181 | .name = "eth irq", | ||
182 | .start = IRQ_ORION5X_ETH_SUM, | ||
183 | .end = IRQ_ORION5X_ETH_SUM, | ||
184 | .flags = IORESOURCE_IRQ, | ||
185 | }, | ||
186 | }; | ||
187 | |||
188 | static struct platform_device orion5x_eth = { | ||
189 | .name = MV643XX_ETH_NAME, | ||
190 | .id = 0, | ||
191 | .num_resources = 1, | ||
192 | .resource = orion5x_ge00_resources, | ||
193 | .dev = { | ||
194 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
195 | }, | ||
196 | }; | ||
197 | |||
198 | void __init orion5x_eth_init(struct mv643xx_eth_platform_data *eth_data) | 152 | void __init orion5x_eth_init(struct mv643xx_eth_platform_data *eth_data) |
199 | { | 153 | { |
200 | eth_data->shared = &orion5x_ge00_shared; | 154 | orion_ge00_init(eth_data, &orion5x_mbus_dram_info, |
201 | orion5x_eth.dev.platform_data = eth_data; | 155 | ORION5X_ETH_PHYS_BASE, IRQ_ORION5X_ETH_SUM, |
202 | 156 | IRQ_ORION5X_ETH_ERR, orion5x_tclk); | |
203 | platform_device_register(&orion5x_ge00_shared); | ||
204 | platform_device_register(&orion5x_eth); | ||
205 | } | 157 | } |
206 | 158 | ||
207 | 159 | ||
208 | /***************************************************************************** | 160 | /***************************************************************************** |
209 | * Ethernet switch | 161 | * Ethernet switch |
210 | ****************************************************************************/ | 162 | ****************************************************************************/ |
211 | static struct resource orion5x_switch_resources[] = { | ||
212 | { | ||
213 | .start = 0, | ||
214 | .end = 0, | ||
215 | .flags = IORESOURCE_IRQ, | ||
216 | }, | ||
217 | }; | ||
218 | |||
219 | static struct platform_device orion5x_switch_device = { | ||
220 | .name = "dsa", | ||
221 | .id = 0, | ||
222 | .num_resources = 0, | ||
223 | .resource = orion5x_switch_resources, | ||
224 | }; | ||
225 | |||
226 | void __init orion5x_eth_switch_init(struct dsa_platform_data *d, int irq) | 163 | void __init orion5x_eth_switch_init(struct dsa_platform_data *d, int irq) |
227 | { | 164 | { |
228 | int i; | 165 | orion_ge00_switch_init(d, irq); |
229 | |||
230 | if (irq != NO_IRQ) { | ||
231 | orion5x_switch_resources[0].start = irq; | ||
232 | orion5x_switch_resources[0].end = irq; | ||
233 | orion5x_switch_device.num_resources = 1; | ||
234 | } | ||
235 | |||
236 | d->netdev = &orion5x_eth.dev; | ||
237 | for (i = 0; i < d->nr_chips; i++) | ||
238 | d->chip[i].mii_bus = &orion5x_ge00_shared.dev; | ||
239 | orion5x_switch_device.dev.platform_data = d; | ||
240 | |||
241 | platform_device_register(&orion5x_switch_device); | ||
242 | } | 166 | } |
243 | 167 | ||
244 | 168 | ||
@@ -616,7 +540,6 @@ void __init orion5x_init(void) | |||
616 | orion5x_id(&dev, &rev, &dev_name); | 540 | orion5x_id(&dev, &rev, &dev_name); |
617 | printk(KERN_INFO "Orion ID: %s. TCLK=%d.\n", dev_name, orion5x_tclk); | 541 | printk(KERN_INFO "Orion ID: %s. TCLK=%d.\n", dev_name, orion5x_tclk); |
618 | 542 | ||
619 | orion5x_ge00_shared_data.t_clk = orion5x_tclk; | ||
620 | orion5x_spi_plat_data.tclk = orion5x_tclk; | 543 | orion5x_spi_plat_data.tclk = orion5x_tclk; |
621 | 544 | ||
622 | /* | 545 | /* |