aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ixp4xx
diff options
context:
space:
mode:
authorImre Kaloz <kaloz@openwrt.org>2008-03-17 12:43:23 +0000
committerImre Kaloz <kaloz@openwrt.org>2008-03-17 12:43:23 +0000
commitb92b0de731c841a50db0e5859123da39962d60a3 (patch)
tree04d4a120ddfbfc38bbec468c8d06e5719b3bf68b /target/linux/ixp4xx
parent34df6484b6d310ec5bd81cb23c142ba72cb07b76 (diff)
downloadupstream-b92b0de731c841a50db0e5859123da39962d60a3.tar.gz
upstream-b92b0de731c841a50db0e5859123da39962d60a3.tar.bz2
upstream-b92b0de731c841a50db0e5859123da39962d60a3.zip
fix switch support on the Compex WP18/NP18A
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@10611 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ixp4xx')
-rw-r--r--target/linux/ixp4xx/patches-2.6.23/202-npe_driver_no_phy.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/target/linux/ixp4xx/patches-2.6.23/202-npe_driver_no_phy.patch b/target/linux/ixp4xx/patches-2.6.23/202-npe_driver_no_phy.patch
new file mode 100644
index 0000000000..766031502b
--- /dev/null
+++ b/target/linux/ixp4xx/patches-2.6.23/202-npe_driver_no_phy.patch
@@ -0,0 +1,41 @@
+diff -Nur linux-2.6.23.16/drivers/net/arm/ixp4xx_eth.c linux-2.6.23.16-owrt/drivers/net/arm/ixp4xx_eth.c
+--- linux-2.6.23.16/drivers/net/arm/ixp4xx_eth.c 2008-02-15 18:18:02.000000000 +0100
++++ linux-2.6.23.16-owrt/drivers/net/arm/ixp4xx_eth.c 2008-02-18 12:14:42.000000000 +0100
+@@ -297,6 +297,27 @@
+ unsigned long flags;
+ u16 val;
+
++ /* For boards that use a switch chip (eg. Marvell 88E6060) */
++ if ( phy_id < 0 || phy_id > 31 ) {
++ switch (location) {
++ case MII_BMCR:
++ val = 0x3100;
++ break;
++ case MII_BMSR:
++ val = 0x406d;
++ break;
++ case MII_ADVERTISE:
++ val = 0x0101;
++ break;
++ case MII_LPA:
++ val = 0x4101;
++ break;
++ default:
++ val = 0;
++ break;
++ }
++ return val;
++ }
+ spin_lock_irqsave(&mdio_lock, flags);
+ val = mdio_cmd(dev, phy_id, location, 0, 0);
+ spin_unlock_irqrestore(&mdio_lock, flags);
+@@ -308,6 +329,9 @@
+ {
+ unsigned long flags;
+
++ if ( phy_id < 0 || phy_id > 31 ) {
++ return;
++ }
+ spin_lock_irqsave(&mdio_lock, flags);
+ mdio_cmd(dev, phy_id, location, 1, val);
+ spin_unlock_irqrestore(&mdio_lock, flags);