ramips: mt7620: enable autonegotiation for all ports
authorGaspare Bruno <gaspare@anlix.io>
Wed, 13 Jan 2021 21:03:39 +0000 (18:03 -0300)
committerDavid Bauer <mail@david-bauer.net>
Mon, 7 Jun 2021 22:39:18 +0000 (00:39 +0200)
This enables autonegotiation for all ephy ports on probe.
Some devices do not configure the ports, particularly port 4.

Signed-off-by: Gaspare Bruno <gaspare@anlix.io>
[replace magic values ; reword commit message]
Signed-off-by: David Bauer <mail@david-bauer.net>
target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c

index 451881fc732f80193f5e4563165ed463fb7020e0..0b09814cc8a2d202fc9cf8332e720c6760cfa8cb 100644 (file)
@@ -171,6 +171,7 @@ static void mt7620_hw_init(struct mt7620_gsw *gsw, int mdio_mode)
                for (i = 0; i <= 4; i++) {
                        val = _mt7620_mii_read(gsw, gsw->ephy_base + i, MII_BMCR);
                        val &= ~BMCR_PDOWN;
+                       val |= BMCR_ANRESTART | BMCR_ANENABLE | BMCR_SPEED100;
                        _mt7620_mii_write(gsw, gsw->ephy_base + i, MII_BMCR, val);
                }
        }