+#define TSN_EMMC_LINKSPEED_10 0x0 /* 10 Mbit */
If the MAC cannot do 10Mbps, why have this?
+static int emac_open(struct net_device *ndev)
+{
+ struct tsn_emac *emac = netdev_priv(ndev);
+ struct phy_device *phydev = NULL;
+
+ if (emac->phy_node) {
+ phydev = of_phy_connect(emac->ndev, emac->phy_node,
+ tsn_adjust_link_tsn,
+ emac->phy_flags,
+ emac->phy_mode);
+ if (!phydev)
+ dev_err(emac->common->dev, "of_phy_connect() failed\n");
+ else
+ phy_start(phydev);
+ }
Somewhere around here, i would expect you to tell phylib the MAC
cannot do 10Mbps. You don't want the PHY offering those speeds for
autoneg, otherwise it might actually negotiate 10Mbps.
I also think you should be using phylink, not phylib. But we first
need to finish the discussion about DSA vs pure switchdev. If this
ends up being a DSA driver, you will be using phylink anywhere. If it
is a pure switchdev driver, i would still recommend using phylink, you
are less likely to get things wrong, because the API is better
designed.
Andrew