summaryrefslogtreecommitdiff
path: root/target/linux/ar71xx/files
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2009-12-11 16:41:51 +0000
committerGabor Juhos <juhosg@openwrt.org>2009-12-11 16:41:51 +0000
commit1156a9ac0c408d72f9326bcdef49abfd8d31aa9b (patch)
tree97170e6a4faeb422d47ef0e98763be5a0d261491 /target/linux/ar71xx/files
parent18885b425c38a4d59a773606d0c67fc3caa556bd (diff)
downloadmtk-20170518-1156a9ac0c408d72f9326bcdef49abfd8d31aa9b.zip
mtk-20170518-1156a9ac0c408d72f9326bcdef49abfd8d31aa9b.tar.gz
mtk-20170518-1156a9ac0c408d72f9326bcdef49abfd8d31aa9b.tar.bz2
ar71xx: merge DSA switch patch
SVN-Revision: 18752
Diffstat (limited to 'target/linux/ar71xx/files')
-rw-r--r--target/linux/ar71xx/files/arch/mips/ar71xx/devices.c7
-rw-r--r--target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wr941nd.c7
2 files changed, 12 insertions, 2 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/devices.c b/target/linux/ar71xx/files/arch/mips/ar71xx/devices.c
index 43212ed..e9a80ee 100644
--- a/target/linux/ar71xx/files/arch/mips/ar71xx/devices.c
+++ b/target/linux/ar71xx/files/arch/mips/ar71xx/devices.c
@@ -825,6 +825,8 @@ static struct platform_device ar71xx_dsa_switch_device = {
void __init ar71xx_add_device_dsa(unsigned int id,
struct dsa_platform_data *d)
{
+ int i;
+
switch (id) {
case 0:
d->netdev = &ar71xx_eth0_device.dev;
@@ -838,7 +840,10 @@ void __init ar71xx_add_device_dsa(unsigned int id,
id);
return;
}
- d->mii_bus = &ar71xx_mdio_device.dev;
+
+ for (i = 0; i < d->nr_chips; i++)
+ d->chip[i].mii_bus = &ar71xx_mdio_device.dev;
+
ar71xx_dsa_switch_device.dev.platform_data = d;
platform_device_register(&ar71xx_dsa_switch_device);
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wr941nd.c b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wr941nd.c
index eb1a1b0..580ae19 100644
--- a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wr941nd.c
+++ b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wr941nd.c
@@ -104,7 +104,7 @@ static struct gpio_button tl_wr941nd_gpio_buttons[] __initdata = {
}
};
-static struct dsa_platform_data tl_wr941nd_dsa_data = {
+static struct dsa_chip_data tl_wr941nd_dsa_chip = {
.port_names[0] = "wan",
.port_names[1] = "lan1",
.port_names[2] = "lan2",
@@ -113,6 +113,11 @@ static struct dsa_platform_data tl_wr941nd_dsa_data = {
.port_names[5] = "cpu",
};
+static struct dsa_platform_data tl_wr941nd_dsa_data = {
+ .nr_chips = 1,
+ .chip = &tl_wr941nd_dsa_chip,
+};
+
static void __init tl_wr941nd_setup(void)
{
u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);