[ARM] Kirkwood: allow instantiating the second ethernet port
authorRonen Shitrit <rshitrit@marvell.com>
Sun, 19 Oct 2008 21:10:14 +0000 (23:10 +0200)
committerNicolas Pitre <nico@cam.org>
Thu, 11 Dec 2008 21:39:08 +0000 (16:39 -0500)
The 88f6192 and 88f6281 Kirkwood SoCs support two ethernet ports.
Add the platform glue that will allow board support files to
instantiate the second ethernet port.

Signed-off-by: Ronen Shitrit <rshitrit@marvell.com>
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: Nicolas Pitre <nico@marvell.com>
arch/arm/mach-kirkwood/common.c
arch/arm/mach-kirkwood/common.h
arch/arm/mach-kirkwood/include/mach/irqs.h

index b5c684d96e4e10501878af757ba153bccb4b9f75..7b8ef97fb5016a99127a34b3ce0cdcd5ae3a7574 100644 (file)
@@ -153,6 +153,64 @@ void __init kirkwood_ge00_init(struct mv643xx_eth_platform_data *eth_data)
 }
 
 
+/*****************************************************************************
+ * GE01
+ ****************************************************************************/
+struct mv643xx_eth_shared_platform_data kirkwood_ge01_shared_data = {
+       .dram           = &kirkwood_mbus_dram_info,
+       .shared_smi     = &kirkwood_ge00_shared,
+};
+
+static struct resource kirkwood_ge01_shared_resources[] = {
+       {
+               .name   = "ge01 base",
+               .start  = GE01_PHYS_BASE + 0x2000,
+               .end    = GE01_PHYS_BASE + 0x3fff,
+               .flags  = IORESOURCE_MEM,
+       }, {
+               .name   = "ge01 err irq",
+               .start  = IRQ_KIRKWOOD_GE01_ERR,
+               .end    = IRQ_KIRKWOOD_GE01_ERR,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device kirkwood_ge01_shared = {
+       .name           = MV643XX_ETH_SHARED_NAME,
+       .id             = 1,
+       .dev            = {
+               .platform_data  = &kirkwood_ge01_shared_data,
+       },
+       .num_resources  = ARRAY_SIZE(kirkwood_ge01_shared_resources),
+       .resource       = kirkwood_ge01_shared_resources,
+};
+
+static struct resource kirkwood_ge01_resources[] = {
+       {
+               .name   = "ge01 irq",
+               .start  = IRQ_KIRKWOOD_GE01_SUM,
+               .end    = IRQ_KIRKWOOD_GE01_SUM,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device kirkwood_ge01 = {
+       .name           = MV643XX_ETH_NAME,
+       .id             = 1,
+       .num_resources  = 1,
+       .resource       = kirkwood_ge01_resources,
+};
+
+void __init kirkwood_ge01_init(struct mv643xx_eth_platform_data *eth_data)
+{
+       eth_data->shared = &kirkwood_ge01_shared;
+       kirkwood_ge01.dev.platform_data = eth_data;
+
+       platform_device_register(&kirkwood_ge01_shared);
+       platform_device_register(&kirkwood_ge01);
+}
+
+
 /*****************************************************************************
  * Ethernet switch
  ****************************************************************************/
index 5774632a67e34ac746307c8d749ab6355c71ef63..fe367c18e722f6d598a27f0f9772415c281e4589 100644 (file)
@@ -30,6 +30,7 @@ void kirkwood_pcie_id(u32 *dev, u32 *rev);
 
 void kirkwood_ehci_init(void);
 void kirkwood_ge00_init(struct mv643xx_eth_platform_data *eth_data);
+void kirkwood_ge01_init(struct mv643xx_eth_platform_data *eth_data);
 void kirkwood_ge00_switch_init(struct dsa_platform_data *d, int irq);
 void kirkwood_pcie_init(void);
 void kirkwood_rtc_init(void);
index ffab89f21c11da5aa31d9bbf7abacc9243565072..3a964bb14973299937ddb691f50611a86eb38aa3 100644 (file)
@@ -51,6 +51,7 @@
 #define IRQ_KIRKWOOD_GPIO_HIGH_8_15    40
 #define IRQ_KIRKWOOD_GPIO_HIGH_16_23   41
 #define IRQ_KIRKWOOD_GE00_ERR  46
+#define IRQ_KIRKWOOD_GE01_ERR  47
 
 /*
  * KIRKWOOD General Purpose Pins