diff options
author | Ram Chandra Jangir <rjangir@codeaurora.org> | 2018-12-05 19:56:32 +0530 |
---|---|---|
committer | John Crispin <john@phrozen.org> | 2018-12-06 08:15:27 +0100 |
commit | bf7719f22c1f189a350f845b27189efab96b0000 (patch) | |
tree | e429ddfce45849ba06329a7330dd49dcf7145553 /target/linux/generic/files/drivers/net/phy/ar8216.c | |
parent | 99e212171abf44d6e0f7e7ba50a229ad7b3f3a34 (diff) | |
download | upstream-bf7719f22c1f189a350f845b27189efab96b0000.tar.gz upstream-bf7719f22c1f189a350f845b27189efab96b0000.tar.bz2 upstream-bf7719f22c1f189a350f845b27189efab96b0000.zip |
kernel: ar83xx: Add support for three GMAC's connection
We have IPQ8064 AP161 board which has three GMAC's
* RGMII x2
* SGMII x1.
The existing ar8327 driver does not have support for
three GMAC's connection, hence this change adds support
for the same. This has been verified on AP148 and AP161
board.
Signed-off-by: xiaofeis <xiaofeis@codeaurora.org>
Signed-off-by: Ram Chandra Jangir <rjangir@codeaurora.org>
Diffstat (limited to 'target/linux/generic/files/drivers/net/phy/ar8216.c')
-rw-r--r-- | target/linux/generic/files/drivers/net/phy/ar8216.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c index 68754e6096..2f0be1b8da 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8216.c +++ b/target/linux/generic/files/drivers/net/phy/ar8216.c @@ -295,6 +295,17 @@ ar8xxx_rmw(struct ar8xxx_priv *priv, int reg, u32 mask, u32 val) return ret; } +void +ar8xxx_phy_dbg_read(struct ar8xxx_priv *priv, int phy_addr, + u16 dbg_addr, u16 *dbg_data) +{ + struct mii_bus *bus = priv->mii_bus; + + mutex_lock(&bus->mdio_lock); + bus->write(bus, phy_addr, MII_ATH_DBG_ADDR, dbg_addr); + *dbg_data = bus->read(bus, phy_addr, MII_ATH_DBG_DATA); + mutex_unlock(&bus->mdio_lock); +} void ar8xxx_phy_dbg_write(struct ar8xxx_priv *priv, int phy_addr, @@ -2166,7 +2177,7 @@ ar8xxx_phy_probe(struct phy_device *phydev) int ret; /* skip PHYs at unused adresses */ - if (phydev->mdio.addr != 0 && phydev->mdio.addr != 4) + if (phydev->mdio.addr != 0 && phydev->mdio.addr != 3 && phydev->mdio.addr != 4) return -ENODEV; if (!ar8xxx_is_possible(phydev->mdio.bus)) @@ -2225,6 +2236,8 @@ found: phydev->supported |= SUPPORTED_1000baseT_Full; phydev->advertising |= ADVERTISED_1000baseT_Full; } + if (priv->chip->phy_rgmii_set) + priv->chip->phy_rgmii_set(priv, phydev); } phydev->priv = priv; |