diff options
author | hauke <hauke@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2013-10-06 18:31:32 +0000 |
---|---|---|
committer | hauke <hauke@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2013-10-06 18:31:32 +0000 |
commit | 943d5f1181d42f26356649d208cebd82929d8e77 (patch) | |
tree | 7b5b4605847117ea899238febafe37a380647fa8 /target/linux/brcm47xx/patches-3.10/203-b44-abort-when-no-PHY-is-available-at-all.patch | |
parent | c26a3589020c44740293aebea97f04ab2c82f3ea (diff) |
brcm47xx: b44: fix some problems with the phy
* do not try initialize a unused phy
* some improvements to the phylib patch
* do not turn the phy off when mac is off
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@38306 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/brcm47xx/patches-3.10/203-b44-abort-when-no-PHY-is-available-at-all.patch')
-rw-r--r-- | target/linux/brcm47xx/patches-3.10/203-b44-abort-when-no-PHY-is-available-at-all.patch | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/target/linux/brcm47xx/patches-3.10/203-b44-abort-when-no-PHY-is-available-at-all.patch b/target/linux/brcm47xx/patches-3.10/203-b44-abort-when-no-PHY-is-available-at-all.patch new file mode 100644 index 0000000000..54256dbaa0 --- /dev/null +++ b/target/linux/brcm47xx/patches-3.10/203-b44-abort-when-no-PHY-is-available-at-all.patch @@ -0,0 +1,40 @@ +From 1bfdc259652abe22a587fd6d856c1b71168cccb2 Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens <hauke@hauke-m.de> +Date: Thu, 3 Oct 2013 20:49:10 +0200 +Subject: [PATCH 3/5] b44: abort when no PHY is available at all + +When the phy address is 31, this means that there is no PHY connected +to this MAC at all, no internal and no external PHY. Reading these PHY +registers causes a system reset on some routers. + +Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> +--- + drivers/net/ethernet/broadcom/b44.c | 6 ++++++ + drivers/net/ethernet/broadcom/b44.h | 1 + + 2 files changed, 7 insertions(+) + +--- a/drivers/net/ethernet/broadcom/b44.c ++++ b/drivers/net/ethernet/broadcom/b44.c +@@ -2207,6 +2207,12 @@ static int b44_init_one(struct ssb_devic + goto err_out_powerdown; + } + ++ if (bp->phy_addr == B44_PHY_ADDR_NO_PHY) { ++ dev_err(sdev->dev, "No PHY present on this MAC, aborting\n"); ++ err = -ENODEV; ++ goto err_out_powerdown; ++ } ++ + bp->mii_if.dev = dev; + bp->mii_if.mdio_read = b44_mii_read; + bp->mii_if.mdio_write = b44_mii_write; +--- a/drivers/net/ethernet/broadcom/b44.h ++++ b/drivers/net/ethernet/broadcom/b44.h +@@ -282,6 +282,7 @@ struct ring_info { + + #define B44_MCAST_TABLE_SIZE 32 + #define B44_PHY_ADDR_NO_LOACL_PHY 30 /* no local phy regs */ ++#define B44_PHY_ADDR_NO_PHY 31 /* no phy present at all */ + #define B44_MDC_RATIO 5000000 + + #define B44_STAT_REG_DECLARE \ |