aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-orion5x
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2011-05-15 07:32:44 -0400
committerNicolas Pitre <nico@fluxnic.net>2011-05-16 15:06:01 -0400
commit7e3819d820c9aa3536d15fe7310c054bef1f5f04 (patch)
treea65cf874aceae43813e5c03f587e8f5bfaaf32ad /arch/arm/mach-orion5x
parent4748058c5cbf70b3adfa37204c047fcb29f335c0 (diff)
ARM: orion: Consolidate ethernet platform data
Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Diffstat (limited to 'arch/arm/mach-orion5x')
-rw-r--r--arch/arm/mach-orion5x/common.c85
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 ****************************************************************************/
153struct mv643xx_eth_shared_platform_data orion5x_ge00_shared_data = {
154 .dram = &orion5x_mbus_dram_info,
155};
156
157static 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
169static 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
179static 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
188static 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
198void __init orion5x_eth_init(struct mv643xx_eth_platform_data *eth_data) 152void __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 ****************************************************************************/
211static struct resource orion5x_switch_resources[] = {
212 {
213 .start = 0,
214 .end = 0,
215 .flags = IORESOURCE_IRQ,
216 },
217};
218
219static struct platform_device orion5x_switch_device = {
220 .name = "dsa",
221 .id = 0,
222 .num_resources = 0,
223 .resource = orion5x_switch_resources,
224};
225
226void __init orion5x_eth_switch_init(struct dsa_platform_data *d, int irq) 163void __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 /*