180-net-phy-at803x-add-support-for-AT8032.patch 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. From: Felix Fietkau <[email protected]>
  2. Subject: net: phy: at803x: add support for AT8032
  3. Like AT8030, this PHY needs the GPIO reset workaround
  4. Signed-off-by: Felix Fietkau <[email protected]>
  5. ---
  6. --- a/drivers/net/phy/at803x.c
  7. +++ b/drivers/net/phy/at803x.c
  8. @@ -62,6 +62,7 @@
  9. #define ATH8030_PHY_ID 0x004dd076
  10. #define ATH8031_PHY_ID 0x004dd074
  11. +#define ATH8032_PHY_ID 0x004dd023
  12. #define ATH8035_PHY_ID 0x004dd072
  13. MODULE_DESCRIPTION("Atheros 803x PHY driver");
  14. @@ -259,7 +260,8 @@ static int at803x_probe(struct phy_devic
  15. if (!priv)
  16. return -ENOMEM;
  17. - if (phydev->drv->phy_id != ATH8030_PHY_ID)
  18. + if (phydev->drv->phy_id != ATH8030_PHY_ID &&
  19. + phydev->drv->phy_id != ATH8032_PHY_ID)
  20. goto does_not_require_reset_workaround;
  21. gpiod_reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
  22. @@ -335,7 +337,7 @@ static void at803x_link_change_notify(st
  23. struct at803x_priv *priv = phydev->priv;
  24. /*
  25. - * Conduct a hardware reset for AT8030 every time a link loss is
  26. + * Conduct a hardware reset for AT8030/2 every time a link loss is
  27. * signalled. This is necessary to circumvent a hardware bug that
  28. * occurs when the cable is unplugged while TX packets are pending
  29. * in the FIFO. In such cases, the FIFO enters an error mode it
  30. @@ -447,6 +449,24 @@ static struct phy_driver at803x_driver[]
  31. .aneg_done = at803x_aneg_done,
  32. .ack_interrupt = &at803x_ack_interrupt,
  33. .config_intr = &at803x_config_intr,
  34. +}, {
  35. + /* ATHEROS 8032 */
  36. + .phy_id = ATH8032_PHY_ID,
  37. + .name = "Atheros 8032 ethernet",
  38. + .phy_id_mask = 0xffffffef,
  39. + .probe = at803x_probe,
  40. + .config_init = at803x_config_init,
  41. + .link_change_notify = at803x_link_change_notify,
  42. + .set_wol = at803x_set_wol,
  43. + .get_wol = at803x_get_wol,
  44. + .suspend = at803x_suspend,
  45. + .resume = at803x_resume,
  46. + .features = PHY_BASIC_FEATURES,
  47. + .flags = PHY_HAS_INTERRUPT,
  48. + .config_aneg = genphy_config_aneg,
  49. + .read_status = genphy_read_status,
  50. + .ack_interrupt = at803x_ack_interrupt,
  51. + .config_intr = at803x_config_intr,
  52. } };
  53. module_phy_driver(at803x_driver);
  54. @@ -454,6 +474,7 @@ module_phy_driver(at803x_driver);
  55. static struct mdio_device_id __maybe_unused atheros_tbl[] = {
  56. { ATH8030_PHY_ID, 0xffffffef },
  57. { ATH8031_PHY_ID, 0xffffffef },
  58. + { ATH8032_PHY_ID, 0xffffffef },
  59. { ATH8035_PHY_ID, 0xffffffef },
  60. { }
  61. };