diff options
author | Florian Fainelli <florian@openwrt.org> | 2010-08-19 14:56:16 +0000 |
---|---|---|
committer | Florian Fainelli <florian@openwrt.org> | 2010-08-19 14:56:16 +0000 |
commit | ed8e4e6a8f82b3c8d2e3a6cbb02b98a489402078 (patch) | |
tree | a838cd7ef1436e0570577b962b743a073374de93 /target/linux/ar7/patches-2.6.32/970-remove_fixed_phy.patch | |
parent | 48edb470575371b0a4b0a72e3354df823e2c32d2 (diff) | |
download | master-187ad058-ed8e4e6a8f82b3c8d2e3a6cbb02b98a489402078.tar.gz master-187ad058-ed8e4e6a8f82b3c8d2e3a6cbb02b98a489402078.tar.bz2 master-187ad058-ed8e4e6a8f82b3c8d2e3a6cbb02b98a489402078.zip |
[ar7] remove fixed phy support, enable most ar7 switch drivers.
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22727 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar7/patches-2.6.32/970-remove_fixed_phy.patch')
-rw-r--r-- | target/linux/ar7/patches-2.6.32/970-remove_fixed_phy.patch | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/target/linux/ar7/patches-2.6.32/970-remove_fixed_phy.patch b/target/linux/ar7/patches-2.6.32/970-remove_fixed_phy.patch new file mode 100644 index 0000000000..289be17318 --- /dev/null +++ b/target/linux/ar7/patches-2.6.32/970-remove_fixed_phy.patch @@ -0,0 +1,89 @@ +--- a/arch/mips/ar7/platform.c ++++ b/arch/mips/ar7/platform.c +@@ -33,7 +33,6 @@ + #include <linux/string.h> + #include <linux/etherdevice.h> + #include <linux/phy.h> +-#include <linux/phy_fixed.h> + + #include <asm/addrspace.h> + #include <asm/mach-ar7/ar7.h> +@@ -294,12 +293,6 @@ static struct physmap_flash_data physmap + .width = 2, + }; + +-static struct fixed_phy_status fixed_phy_status __initdata = { +- .link = 1, +- .speed = 100, +- .duplex = 1, +-}; +- + static struct plat_cpmac_data cpmac_low_data = { + .reset_bit = 17, + .power_bit = 20, +@@ -716,11 +709,6 @@ static int __init ar7_register_devices(v + } + + if (ar7_has_high_cpmac()) { +- res = fixed_phy_add(PHY_POLL, ar7_is_titan() ? cpmac_high_titan.id : cpmac_high.id, +- &fixed_phy_status); +- if (res && res != -ENODEV) +- return res; +- + cpmac_get_mac(1, ar7_is_titan() ? cpmac_high_data_titan.dev_addr : + cpmac_high_data.dev_addr); + res = platform_device_register(ar7_is_titan() ? &cpmac_high_titan : +@@ -736,11 +724,6 @@ static int __init ar7_register_devices(v + + } + +- res = fixed_phy_add(PHY_POLL, ar7_is_titan() ? cpmac_low_titan.id : +- cpmac_low.id, &fixed_phy_status); +- if (res && res != -ENODEV) +- return res; +- + cpmac_get_mac(0, ar7_is_titan() ? cpmac_low_data_titan.dev_addr : + cpmac_low_data.dev_addr); + res = platform_device_register(ar7_is_titan() ? &cpmac_low_titan : +--- a/drivers/net/cpmac.c ++++ b/drivers/net/cpmac.c +@@ -1117,21 +1117,17 @@ static int __devinit cpmac_probe(struct + + pdata = pdev->dev.platform_data; + +- if (external_switch || dumb_switch) { +- strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE); /* fixed phys bus */ +- phy_id = pdev->id; +- } else { +- for (phy_id = 0; phy_id < PHY_MAX_ADDR; phy_id++) { +- if (!(pdata->phy_mask & (1 << phy_id))) +- continue; +- if (!cpmac_mii->phy_map[phy_id]) +- continue; +- strncpy(mdio_bus_id, cpmac_mii->id, MII_BUS_ID_SIZE); +- break; +- } ++ for (phy_id = 0; phy_id < PHY_MAX_ADDR; phy_id++) { ++ if (!(pdata->phy_mask & (1 << phy_id))) ++ continue; ++ if (!cpmac_mii->phy_map[phy_id]) ++ continue; ++ strncpy(mdio_bus_id, cpmac_mii->id, MII_BUS_ID_SIZE); ++ break; + } +- ++ + if (phy_id == PHY_MAX_ADDR) { ++ //This probably wont work as no fixed bus anymore. + dev_err(&pdev->dev, "no PHY present, falling back to switch mode\n"); + strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE); /* fixed phys bus */ + phy_id = pdev->id; +@@ -1268,7 +1264,7 @@ int __devinit cpmac_init(void) + } + + cpmac_mii->phy_mask = ar7_is_titan()? ~(mask | 0x80000000 | 0x40000000): +- ~(mask | 0x80000000); ++ ~(mask | 0x80000001); + snprintf(cpmac_mii->id, MII_BUS_ID_SIZE, "1"); + + res = mdiobus_register(cpmac_mii); |