aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/b44.c
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2013-12-20 02:16:13 +0100
committerDavid S. Miller <davem@davemloft.net>2013-12-20 20:48:49 -0500
commitb04138b335203b79ffe1b14750fa245a4dab7191 (patch)
tree34b919de0a5f3ab927dda225a84cc624ab624741 /drivers/net/ethernet/broadcom/b44.c
parentb44: do not set PHY address to 30 for every ext PHY (diff)
downloadlinux-dev-b04138b335203b79ffe1b14750fa245a4dab7191.tar.xz
linux-dev-b04138b335203b79ffe1b14750fa245a4dab7191.zip
b44: use fixed PHY device if we do not find any
The ADM6996L switch and some Broadcom switches with two MII interfaces like the BCM5325F connected to two MACs on the SoC, used on some routers do not return a valid value when reading the PHY id register and Linux thinks there is no PHY at all, but that is wrong. This patch registers a fixed phy in the arch code and then searches it when there is no other phy in the Ethernet driver code. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/b44.c')
-rw-r--r--drivers/net/ethernet/broadcom/b44.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/net/ethernet/broadcom/b44.c b/drivers/net/ethernet/broadcom/b44.c
index 839dd9092b17..1f7b5aa114fa 100644
--- a/drivers/net/ethernet/broadcom/b44.c
+++ b/drivers/net/ethernet/broadcom/b44.c
@@ -2233,6 +2233,7 @@ static int b44_register_phy_one(struct b44 *bp)
struct ssb_device *sdev = bp->sdev;
struct phy_device *phydev;
char bus_id[MII_BUS_ID_SIZE + 3];
+ struct ssb_sprom *sprom = &sdev->bus->sprom;
int err;
mii_bus = mdiobus_alloc();
@@ -2266,7 +2267,20 @@ static int b44_register_phy_one(struct b44 *bp)
goto err_out_mdiobus_irq;
}
- snprintf(bus_id, sizeof(bus_id), PHY_ID_FMT, mii_bus->id, bp->phy_addr);
+ if (!bp->mii_bus->phy_map[bp->phy_addr] &&
+ (sprom->boardflags_lo & (B44_BOARDFLAG_ROBO | B44_BOARDFLAG_ADM))) {
+
+ dev_info(sdev->dev,
+ "could not find PHY at %i, use fixed one\n",
+ bp->phy_addr);
+
+ bp->phy_addr = 0;
+ snprintf(bus_id, sizeof(bus_id), PHY_ID_FMT, "fixed-0",
+ bp->phy_addr);
+ } else {
+ snprintf(bus_id, sizeof(bus_id), PHY_ID_FMT, mii_bus->id,
+ bp->phy_addr);
+ }
phydev = phy_connect(bp->dev, bus_id, &b44_adjust_link,
PHY_INTERFACE_MODE_MII);