903-at803x-add-sgmii-aneg-override-pdata.patch 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. --- a/drivers/net/phy/at803x.c
  2. +++ b/drivers/net/phy/at803x.c
  3. @@ -478,12 +478,15 @@ static void at803x_link_change_notify(st
  4. static int at803x_aneg_done(struct phy_device *phydev)
  5. {
  6. + struct at803x_platform_data *pdata;
  7. int ccr;
  8. int aneg_done = genphy_aneg_done(phydev);
  9. if (aneg_done != BMSR_ANEGCOMPLETE)
  10. return aneg_done;
  11. + pdata = dev_get_platdata(&phydev->mdio.dev);
  12. +
  13. /*
  14. * in SGMII mode, if copper side autoneg is successful,
  15. * also check SGMII side autoneg result
  16. @@ -498,7 +501,8 @@ static int at803x_aneg_done(struct phy_d
  17. /* check if the SGMII link is OK. */
  18. if (!(phy_read(phydev, AT803X_PSSR) & AT803X_PSSR_MR_AN_COMPLETE)) {
  19. pr_warn("803x_aneg_done: SGMII link is not ok\n");
  20. - aneg_done = 0;
  21. + if (!pdata || !pdata->override_sgmii_aneg)
  22. + aneg_done = 0;
  23. }
  24. /* switch back to copper page */
  25. phy_write(phydev, AT803X_REG_CHIP_CONFIG, ccr | AT803X_BT_BX_REG_SEL);
  26. --- a/include/linux/platform_data/phy-at803x.h
  27. +++ b/include/linux/platform_data/phy-at803x.h
  28. @@ -7,6 +7,7 @@ struct at803x_platform_data {
  29. int enable_rgmii_rx_delay:1;
  30. int fixup_rgmii_tx_delay:1;
  31. int has_reset_gpio:1;
  32. + int override_sgmii_aneg:1;
  33. int reset_gpio;
  34. };