aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/momentum/ocelot_c/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/momentum/ocelot_c/setup.c')
-rw-r--r--arch/mips/momentum/ocelot_c/setup.c121
1 files changed, 0 insertions, 121 deletions
diff --git a/arch/mips/momentum/ocelot_c/setup.c b/arch/mips/momentum/ocelot_c/setup.c
index b0e82a097f7e..0b6b2338cfb4 100644
--- a/arch/mips/momentum/ocelot_c/setup.c
+++ b/arch/mips/momentum/ocelot_c/setup.c
@@ -50,7 +50,6 @@
50#include <linux/sched.h> 50#include <linux/sched.h>
51#include <linux/interrupt.h> 51#include <linux/interrupt.h>
52#include <linux/pci.h> 52#include <linux/pci.h>
53#include <linux/platform_device.h>
54#include <linux/pm.h> 53#include <linux/pm.h>
55#include <linux/timex.h> 54#include <linux/timex.h>
56#include <linux/vmalloc.h> 55#include <linux/vmalloc.h>
@@ -361,123 +360,3 @@ static int io_base_ioremap(void)
361} 360}
362 361
363module_init(io_base_ioremap); 362module_init(io_base_ioremap);
364
365#if defined(CONFIG_MV643XX_ETH) || defined(CONFIG_MV643XX_ETH_MODULE)
366
367static struct resource mv643xx_eth_shared_resources[] = {
368 [0] = {
369 .name = "ethernet shared base",
370 .start = 0xf1000000 + MV643XX_ETH_SHARED_REGS,
371 .end = 0xf1000000 + MV643XX_ETH_SHARED_REGS +
372 MV643XX_ETH_SHARED_REGS_SIZE - 1,
373 .flags = IORESOURCE_MEM,
374 },
375};
376
377static struct platform_device mv643xx_eth_shared_device = {
378 .name = MV643XX_ETH_SHARED_NAME,
379 .id = 0,
380 .num_resources = ARRAY_SIZE(mv643xx_eth_shared_resources),
381 .resource = mv643xx_eth_shared_resources,
382};
383
384#define MV_SRAM_BASE 0xfe000000UL
385#define MV_SRAM_SIZE (256 * 1024)
386
387#define MV_SRAM_RXRING_SIZE (MV_SRAM_SIZE / 4)
388#define MV_SRAM_TXRING_SIZE (MV_SRAM_SIZE / 4)
389
390#define MV_SRAM_BASE_ETH0 MV_SRAM_BASE
391#define MV_SRAM_BASE_ETH1 (MV_SRAM_BASE + (MV_SRAM_SIZE / 2))
392
393#define MV64x60_IRQ_ETH_0 48
394#define MV64x60_IRQ_ETH_1 49
395
396#ifdef CONFIG_MV643XX_ETH_0
397
398static struct resource mv64x60_eth0_resources[] = {
399 [0] = {
400 .name = "eth0 irq",
401 .start = MV64x60_IRQ_ETH_0,
402 .end = MV64x60_IRQ_ETH_0,
403 .flags = IORESOURCE_IRQ,
404 },
405};
406
407static struct mv643xx_eth_platform_data eth0_pd = {
408 .tx_sram_addr = MV_SRAM_BASE_ETH0,
409 .tx_sram_size = MV_SRAM_TXRING_SIZE,
410 .tx_queue_size = MV_SRAM_TXRING_SIZE / 16,
411
412 .rx_sram_addr = MV_SRAM_BASE_ETH0 + MV_SRAM_TXRING_SIZE,
413 .rx_sram_size = MV_SRAM_RXRING_SIZE,
414 .rx_queue_size = MV_SRAM_RXRING_SIZE / 16,
415};
416
417static struct platform_device eth0_device = {
418 .name = MV643XX_ETH_NAME,
419 .id = 0,
420 .num_resources = ARRAY_SIZE(mv64x60_eth0_resources),
421 .resource = mv64x60_eth0_resources,
422 .dev = {
423 .platform_data = &eth0_pd,
424 },
425};
426#endif /* CONFIG_MV643XX_ETH_0 */
427
428#ifdef CONFIG_MV643XX_ETH_1
429
430static struct resource mv64x60_eth1_resources[] = {
431 [0] = {
432 .name = "eth1 irq",
433 .start = MV64x60_IRQ_ETH_1,
434 .end = MV64x60_IRQ_ETH_1,
435 .flags = IORESOURCE_IRQ,
436 },
437};
438
439static struct mv643xx_eth_platform_data eth1_pd = {
440 .tx_sram_addr = MV_SRAM_BASE_ETH1,
441 .tx_sram_size = MV_SRAM_TXRING_SIZE,
442 .tx_queue_size = MV_SRAM_TXRING_SIZE / 16,
443
444 .rx_sram_addr = MV_SRAM_BASE_ETH1 + MV_SRAM_TXRING_SIZE,
445 .rx_sram_size = MV_SRAM_RXRING_SIZE,
446 .rx_queue_size = MV_SRAM_RXRING_SIZE / 16,
447};
448
449static struct platform_device eth1_device = {
450 .name = MV643XX_ETH_NAME,
451 .id = 1,
452 .num_resources = ARRAY_SIZE(mv64x60_eth1_resources),
453 .resource = mv64x60_eth1_resources,
454 .dev = {
455 .platform_data = &eth1_pd,
456 },
457};
458#endif /* CONFIG_MV643XX_ETH_1 */
459
460static struct platform_device *mv643xx_eth_pd_devs[] __initdata = {
461 &mv643xx_eth_shared_device,
462#ifdef CONFIG_MV643XX_ETH_0
463 &eth0_device,
464#endif
465#ifdef CONFIG_MV643XX_ETH_1
466 &eth1_device,
467#endif
468 /* The third port is not wired up on the Ocelot C */
469};
470
471int mv643xx_eth_add_pds(void)
472{
473 int ret;
474
475 ret = platform_add_devices(mv643xx_eth_pd_devs,
476 ARRAY_SIZE(mv643xx_eth_pd_devs));
477
478 return ret;
479}
480
481device_initcall(mv643xx_eth_add_pds);
482
483#endif /* defined(CONFIG_MV643XX_ETH) || defined(CONFIG_MV643XX_ETH_MODULE) */