Commit dcf1cece authored by Lennert Buytenhek's avatar Lennert Buytenhek Committed by Nicolas Pitre

[ARM] Orion: instantiate the dsa switch driver

This adds DSA switch instantiation hooks to the orion5x and the
kirkwood ARM SoC platform code, and instantiates the DSA switch
driver on the 88F5181L FXO RD, the 88F5181L GE RD, the 6183 AP GE
RD, the Linksys WRT350n v2, and the 88F6281 RD boards.
Signed-off-by: default avatarLennert Buytenhek <buytenh@marvell.com>
Tested-by: default avatarNicolas Pitre <nico@marvell.com>
Tested-by: default avatarPeter van Valderen <linux@ddcrew.com>
Tested-by: default avatarDirk Teurlings <dirk@upexia.nl>
Signed-off-by: default avatarNicolas Pitre <nico@marvell.com>
parent 04185fc6
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <linux/mv643xx_eth.h> #include <linux/mv643xx_eth.h>
#include <linux/ata_platform.h> #include <linux/ata_platform.h>
#include <linux/spi/orion_spi.h> #include <linux/spi/orion_spi.h>
#include <net/dsa.h>
#include <asm/page.h> #include <asm/page.h>
#include <asm/timex.h> #include <asm/timex.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
...@@ -151,6 +152,40 @@ void __init kirkwood_ge00_init(struct mv643xx_eth_platform_data *eth_data) ...@@ -151,6 +152,40 @@ void __init kirkwood_ge00_init(struct mv643xx_eth_platform_data *eth_data)
} }
/*****************************************************************************
* Ethernet switch
****************************************************************************/
static struct resource kirkwood_switch_resources[] = {
{
.start = 0,
.end = 0,
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device kirkwood_switch_device = {
.name = "dsa",
.id = 0,
.num_resources = 0,
.resource = kirkwood_switch_resources,
};
void __init kirkwood_ge00_switch_init(struct dsa_platform_data *d, int irq)
{
if (irq != NO_IRQ) {
kirkwood_switch_resources[0].start = irq;
kirkwood_switch_resources[0].end = irq;
kirkwood_switch_device.num_resources = 1;
}
d->mii_bus = &kirkwood_ge00_shared.dev;
d->netdev = &kirkwood_ge00.dev;
kirkwood_switch_device.dev.platform_data = d;
platform_device_register(&kirkwood_switch_device);
}
/***************************************************************************** /*****************************************************************************
* SoC RTC * SoC RTC
****************************************************************************/ ****************************************************************************/
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#ifndef __ARCH_KIRKWOOD_COMMON_H #ifndef __ARCH_KIRKWOOD_COMMON_H
#define __ARCH_KIRKWOOD_COMMON_H #define __ARCH_KIRKWOOD_COMMON_H
struct dsa_platform_data;
struct mv643xx_eth_platform_data; struct mv643xx_eth_platform_data;
struct mv_sata_platform_data; struct mv_sata_platform_data;
...@@ -29,6 +30,7 @@ void kirkwood_pcie_id(u32 *dev, u32 *rev); ...@@ -29,6 +30,7 @@ void kirkwood_pcie_id(u32 *dev, u32 *rev);
void kirkwood_ehci_init(void); void kirkwood_ehci_init(void);
void kirkwood_ge00_init(struct mv643xx_eth_platform_data *eth_data); void kirkwood_ge00_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_pcie_init(void);
void kirkwood_rtc_init(void); void kirkwood_rtc_init(void);
void kirkwood_sata_init(struct mv_sata_platform_data *sata_data); void kirkwood_sata_init(struct mv_sata_platform_data *sata_data);
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <linux/ata_platform.h> #include <linux/ata_platform.h>
#include <linux/mv643xx_eth.h> #include <linux/mv643xx_eth.h>
#include <linux/ethtool.h> #include <linux/ethtool.h>
#include <net/dsa.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <asm/mach/pci.h> #include <asm/mach/pci.h>
...@@ -74,6 +75,15 @@ static struct mv643xx_eth_platform_data rd88f6281_ge00_data = { ...@@ -74,6 +75,15 @@ static struct mv643xx_eth_platform_data rd88f6281_ge00_data = {
.duplex = DUPLEX_FULL, .duplex = DUPLEX_FULL,
}; };
static struct dsa_platform_data rd88f6281_switch_data = {
.port_names[0] = "lan1",
.port_names[1] = "lan2",
.port_names[2] = "lan3",
.port_names[3] = "lan4",
.port_names[4] = "wan",
.port_names[5] = "cpu",
};
static struct mv_sata_platform_data rd88f6281_sata_data = { static struct mv_sata_platform_data rd88f6281_sata_data = {
.n_ports = 2, .n_ports = 2,
}; };
...@@ -87,6 +97,7 @@ static void __init rd88f6281_init(void) ...@@ -87,6 +97,7 @@ static void __init rd88f6281_init(void)
kirkwood_ehci_init(); kirkwood_ehci_init();
kirkwood_ge00_init(&rd88f6281_ge00_data); kirkwood_ge00_init(&rd88f6281_ge00_data);
kirkwood_ge00_switch_init(&rd88f6281_switch_data, NO_IRQ);
kirkwood_rtc_init(); kirkwood_rtc_init();
kirkwood_sata_init(&rd88f6281_sata_data); kirkwood_sata_init(&rd88f6281_sata_data);
kirkwood_uart0_init(); kirkwood_uart0_init();
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <linux/mv643xx_i2c.h> #include <linux/mv643xx_i2c.h>
#include <linux/ata_platform.h> #include <linux/ata_platform.h>
#include <linux/spi/orion_spi.h> #include <linux/spi/orion_spi.h>
#include <net/dsa.h>
#include <asm/page.h> #include <asm/page.h>
#include <asm/setup.h> #include <asm/setup.h>
#include <asm/timex.h> #include <asm/timex.h>
...@@ -197,6 +198,40 @@ void __init orion5x_eth_init(struct mv643xx_eth_platform_data *eth_data) ...@@ -197,6 +198,40 @@ void __init orion5x_eth_init(struct mv643xx_eth_platform_data *eth_data)
} }
/*****************************************************************************
* Ethernet switch
****************************************************************************/
static struct resource orion5x_switch_resources[] = {
{
.start = 0,
.end = 0,
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device orion5x_switch_device = {
.name = "dsa",
.id = 0,
.num_resources = 0,
.resource = orion5x_switch_resources,
};
void __init orion5x_eth_switch_init(struct dsa_platform_data *d, int irq)
{
if (irq != NO_IRQ) {
orion5x_switch_resources[0].start = irq;
orion5x_switch_resources[0].end = irq;
orion5x_switch_device.num_resources = 1;
}
d->mii_bus = &orion5x_eth_shared.dev;
d->netdev = &orion5x_eth.dev;
orion5x_switch_device.dev.platform_data = d;
platform_device_register(&orion5x_switch_device);
}
/***************************************************************************** /*****************************************************************************
* I2C * I2C
****************************************************************************/ ****************************************************************************/
......
#ifndef __ARCH_ORION5X_COMMON_H #ifndef __ARCH_ORION5X_COMMON_H
#define __ARCH_ORION5X_COMMON_H #define __ARCH_ORION5X_COMMON_H
struct dsa_platform_data;
struct mv643xx_eth_platform_data; struct mv643xx_eth_platform_data;
struct mv_sata_platform_data; struct mv_sata_platform_data;
...@@ -29,6 +30,7 @@ void orion5x_setup_pcie_wa_win(u32 base, u32 size); ...@@ -29,6 +30,7 @@ void orion5x_setup_pcie_wa_win(u32 base, u32 size);
void orion5x_ehci0_init(void); void orion5x_ehci0_init(void);
void orion5x_ehci1_init(void); void orion5x_ehci1_init(void);
void orion5x_eth_init(struct mv643xx_eth_platform_data *eth_data); void orion5x_eth_init(struct mv643xx_eth_platform_data *eth_data);
void orion5x_eth_switch_init(struct dsa_platform_data *d, int irq);
void orion5x_i2c_init(void); void orion5x_i2c_init(void);
void orion5x_sata_init(struct mv_sata_platform_data *sata_data); void orion5x_sata_init(struct mv_sata_platform_data *sata_data);
void orion5x_spi_init(void); void orion5x_spi_init(void);
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <linux/mtd/physmap.h> #include <linux/mtd/physmap.h>
#include <linux/mv643xx_eth.h> #include <linux/mv643xx_eth.h>
#include <linux/ethtool.h> #include <linux/ethtool.h>
#include <net/dsa.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <asm/gpio.h> #include <asm/gpio.h>
#include <asm/leds.h> #include <asm/leds.h>
...@@ -93,6 +94,15 @@ static struct mv643xx_eth_platform_data rd88f5181l_fxo_eth_data = { ...@@ -93,6 +94,15 @@ static struct mv643xx_eth_platform_data rd88f5181l_fxo_eth_data = {
.duplex = DUPLEX_FULL, .duplex = DUPLEX_FULL,
}; };
static struct dsa_platform_data rd88f5181l_fxo_switch_data = {
.port_names[0] = "lan2",
.port_names[1] = "lan1",
.port_names[2] = "wan",
.port_names[3] = "cpu",
.port_names[5] = "lan4",
.port_names[7] = "lan3",
};
static void __init rd88f5181l_fxo_init(void) static void __init rd88f5181l_fxo_init(void)
{ {
/* /*
...@@ -107,6 +117,7 @@ static void __init rd88f5181l_fxo_init(void) ...@@ -107,6 +117,7 @@ static void __init rd88f5181l_fxo_init(void)
*/ */
orion5x_ehci0_init(); orion5x_ehci0_init();
orion5x_eth_init(&rd88f5181l_fxo_eth_data); orion5x_eth_init(&rd88f5181l_fxo_eth_data);
orion5x_eth_switch_init(&rd88f5181l_fxo_switch_data, NO_IRQ);
orion5x_uart0_init(); orion5x_uart0_init();
orion5x_setup_dev_boot_win(RD88F5181L_FXO_NOR_BOOT_BASE, orion5x_setup_dev_boot_win(RD88F5181L_FXO_NOR_BOOT_BASE,
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <linux/mv643xx_eth.h> #include <linux/mv643xx_eth.h>
#include <linux/ethtool.h> #include <linux/ethtool.h>
#include <linux/i2c.h> #include <linux/i2c.h>
#include <net/dsa.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <asm/gpio.h> #include <asm/gpio.h>
#include <asm/leds.h> #include <asm/leds.h>
...@@ -94,6 +95,15 @@ static struct mv643xx_eth_platform_data rd88f5181l_ge_eth_data = { ...@@ -94,6 +95,15 @@ static struct mv643xx_eth_platform_data rd88f5181l_ge_eth_data = {
.duplex = DUPLEX_FULL, .duplex = DUPLEX_FULL,
}; };
static struct dsa_platform_data rd88f5181l_ge_switch_data = {
.port_names[0] = "lan2",
.port_names[1] = "lan1",
.port_names[2] = "wan",
.port_names[3] = "cpu",
.port_names[5] = "lan4",
.port_names[7] = "lan3",
};
static struct i2c_board_info __initdata rd88f5181l_ge_i2c_rtc = { static struct i2c_board_info __initdata rd88f5181l_ge_i2c_rtc = {
I2C_BOARD_INFO("ds1338", 0x68), I2C_BOARD_INFO("ds1338", 0x68),
}; };
...@@ -112,6 +122,7 @@ static void __init rd88f5181l_ge_init(void) ...@@ -112,6 +122,7 @@ static void __init rd88f5181l_ge_init(void)
*/ */
orion5x_ehci0_init(); orion5x_ehci0_init();
orion5x_eth_init(&rd88f5181l_ge_eth_data); orion5x_eth_init(&rd88f5181l_ge_eth_data);
orion5x_eth_switch_init(&rd88f5181l_ge_switch_data, gpio_to_irq(8));
orion5x_i2c_init(); orion5x_i2c_init();
orion5x_uart0_init(); orion5x_uart0_init();
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <linux/spi/orion_spi.h> #include <linux/spi/orion_spi.h>
#include <linux/spi/flash.h> #include <linux/spi/flash.h>
#include <linux/ethtool.h> #include <linux/ethtool.h>
#include <net/dsa.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <asm/gpio.h> #include <asm/gpio.h>
#include <asm/leds.h> #include <asm/leds.h>
...@@ -34,6 +35,15 @@ static struct mv643xx_eth_platform_data rd88f6183ap_ge_eth_data = { ...@@ -34,6 +35,15 @@ static struct mv643xx_eth_platform_data rd88f6183ap_ge_eth_data = {
.duplex = DUPLEX_FULL, .duplex = DUPLEX_FULL,
}; };
static struct dsa_platform_data rd88f6183ap_ge_switch_data = {
.port_names[0] = "lan1",
.port_names[1] = "lan2",
.port_names[2] = "lan3",
.port_names[3] = "lan4",
.port_names[4] = "wan",
.port_names[5] = "cpu",
};
static struct mtd_partition rd88f6183ap_ge_partitions[] = { static struct mtd_partition rd88f6183ap_ge_partitions[] = {
{ {
.name = "kernel", .name = "kernel",
...@@ -79,6 +89,7 @@ static void __init rd88f6183ap_ge_init(void) ...@@ -79,6 +89,7 @@ static void __init rd88f6183ap_ge_init(void)
*/ */
orion5x_ehci0_init(); orion5x_ehci0_init();
orion5x_eth_init(&rd88f6183ap_ge_eth_data); orion5x_eth_init(&rd88f6183ap_ge_eth_data);
orion5x_eth_switch_init(&rd88f6183ap_ge_switch_data, gpio_to_irq(3));
spi_register_board_info(rd88f6183ap_ge_spi_slave_info, spi_register_board_info(rd88f6183ap_ge_spi_slave_info,
ARRAY_SIZE(rd88f6183ap_ge_spi_slave_info)); ARRAY_SIZE(rd88f6183ap_ge_spi_slave_info));
orion5x_spi_init(); orion5x_spi_init();
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <linux/mtd/physmap.h> #include <linux/mtd/physmap.h>
#include <linux/mv643xx_eth.h> #include <linux/mv643xx_eth.h>
#include <linux/ethtool.h> #include <linux/ethtool.h>
#include <net/dsa.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <asm/gpio.h> #include <asm/gpio.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
...@@ -105,6 +106,15 @@ static struct mv643xx_eth_platform_data wrt350n_v2_eth_data = { ...@@ -105,6 +106,15 @@ static struct mv643xx_eth_platform_data wrt350n_v2_eth_data = {
.duplex = DUPLEX_FULL, .duplex = DUPLEX_FULL,
}; };
static struct dsa_platform_data wrt350n_v2_switch_data = {
.port_names[0] = "lan2",
.port_names[1] = "lan1",
.port_names[2] = "wan",
.port_names[3] = "cpu",
.port_names[5] = "lan3",
.port_names[7] = "lan4",
};
static void __init wrt350n_v2_init(void) static void __init wrt350n_v2_init(void)
{ {
/* /*
...@@ -119,6 +129,7 @@ static void __init wrt350n_v2_init(void) ...@@ -119,6 +129,7 @@ static void __init wrt350n_v2_init(void)
*/ */
orion5x_ehci0_init(); orion5x_ehci0_init();
orion5x_eth_init(&wrt350n_v2_eth_data); orion5x_eth_init(&wrt350n_v2_eth_data);
orion5x_eth_switch_init(&wrt350n_v2_switch_data, NO_IRQ);
orion5x_uart0_init(); orion5x_uart0_init();
orion5x_setup_dev_boot_win(WRT350N_V2_NOR_BOOT_BASE, orion5x_setup_dev_boot_win(WRT350N_V2_NOR_BOOT_BASE,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment