]> git.karo-electronics.de Git - linux-beck.git/commitdiff
BECK: Fix linkup failure according to KSZ8061 phy errata
authorOle Reinhardt <ole.reinhardt@kernelconcepts.de>
Wed, 8 Mar 2017 15:01:28 +0000 (16:01 +0100)
committerOle Reinhardt <ole.reinhardt@kernelconcepts.de>
Mon, 13 Mar 2017 13:25:56 +0000 (14:25 +0100)
drivers/net/phy/micrel.c

index ea92d524d5a814ff22727eefa1818c0b0fd47a32..8d37ed5072f5e8d04873fae55306960e595ce6fe 100644 (file)
@@ -785,6 +785,18 @@ static int kszphy_probe(struct phy_device *phydev)
        return 0;
 }
 
+/* BECK: add special config function for KSZ8061 PHY */
+static int ksz8061_config_aneg(struct phy_device *phydev)
+{
+       /* KSZ8061 Errata: Fix link-up failure */
+       phy_write(phydev, 0xD, 0x0001);
+       phy_write(phydev, 0xE, 0x0002);
+       phy_write(phydev, 0xD, 0x4001);
+       phy_write(phydev, 0xE, 0xB61A);
+
+       return genphy_config_aneg(phydev);
+}
+
 static struct phy_driver ksphy_driver[] = {
 {
        .phy_id         = PHY_ID_KS8737,
@@ -941,7 +953,8 @@ static struct phy_driver ksphy_driver[] = {
        .features       = (PHY_BASIC_FEATURES | SUPPORTED_Pause),
        .flags          = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
        .config_init    = kszphy_config_init,
-       .config_aneg    = genphy_config_aneg,
+       /* BECK: add special config for KSZ8061 */
+       .config_aneg    = ksz8061_config_aneg,
        .read_status    = genphy_read_status,
        .ack_interrupt  = kszphy_ack_interrupt,
        .config_intr    = kszphy_config_intr,