diff options
author | vojo <joris.van.vossen@sintecs.nl> | 2018-01-15 08:23:08 (GMT) |
---|---|---|
committer | vojo <joris.van.vossen@sintecs.nl> | 2018-01-22 14:11:19 (GMT) |
commit | aeaf4a9c7a0652d3e770a3a91616fe0e932a8089 (patch) | |
tree | 2e3801929b56df1d867e35f32fcf0962bd51116d | |
parent | 3330c243d1061ce78d24a581510ab3dc37b5beab (diff) | |
download | linux-aeaf4a9c7a0652d3e770a3a91616fe0e932a8089.tar.xz |
Temporary fix to make eth0 PHY work in LSDK Linux on grapeboard prototype
-rw-r--r-- | drivers/staging/fsl_ppfe/pfe_eth.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/staging/fsl_ppfe/pfe_eth.c b/drivers/staging/fsl_ppfe/pfe_eth.c index 7d4493f..85acc10 100644 --- a/drivers/staging/fsl_ppfe/pfe_eth.c +++ b/drivers/staging/fsl_ppfe/pfe_eth.c @@ -1196,7 +1196,7 @@ static void ls1012a_configure_serdes(struct net_device *ndev) pfe_eth_mdio_write(bus, 0, 0x0, value); } else { pfe_eth_mdio_write(bus, 0, 0x14, 0xb); - pfe_eth_mdio_write(bus, 0, 0x4, 0x1a1); + pfe_eth_mdio_write(bus, 0, 0x4, 0x4001); /* Autonegotiation is incorrect with value 0x1a1 */ pfe_eth_mdio_write(bus, 0, 0x12, 0x400); pfe_eth_mdio_write(bus, 0, 0x13, 0x0); pfe_eth_mdio_write(bus, 0, 0x0, 0x1140); @@ -1214,6 +1214,8 @@ static int pfe_phy_init(struct net_device *ndev) char phy_id[MII_BUS_ID_SIZE + 3]; char bus_id[MII_BUS_ID_SIZE]; phy_interface_t interface; + + struct mii_bus *bus = pfe->eth.eth_priv[0]->mii_bus; priv->oldlink = 0; priv->oldspeed = 0; @@ -1239,6 +1241,15 @@ static int pfe_phy_init(struct net_device *ndev) /*Config MDIO from PAD */ regmap_write(pfe->scfg, 0x484, 0x80000000); } + + /* + * Reset external PHY on MDIO bus with address 0 to undo + * changes from the unintended external writes during the + * previous SERDES configuration. (Temporary fix) + */ + pfe_eth_mdio_write(bus, 0, 0x1F, 0x8000); + msleep(10); + pfe_eth_mdio_write(bus, 0, 0x18, 0x61B6); priv->oldlink = 0; priv->oldspeed = 0; |