739-net-phy-at803x-add-support-for-AT8032.patch 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. From: Felix Fietkau <nbd@nbd.name>
  2. Date: Wed, 30 Nov 2016 11:31:03 +0100
  3. Subject: [PATCH] net: phy: at803x: add support for AT8032
  4. Like AT8030, this PHY needs the GPIO reset workaround
  5. Signed-off-by: Felix Fietkau <nbd@nbd.name>
  6. ---
  7. --- a/drivers/net/phy/at803x.c
  8. +++ b/drivers/net/phy/at803x.c
  9. @@ -55,6 +55,7 @@
  10. #define AT803X_PHY_ID_MASK 0xffffffef
  11. #define ATH8030_PHY_ID 0x004dd076
  12. #define ATH8031_PHY_ID 0x004dd074
  13. +#define ATH8032_PHY_ID 0x004dd023
  14. #define ATH8035_PHY_ID 0x004dd072
  15. MODULE_DESCRIPTION("Atheros 803x PHY driver");
  16. @@ -250,7 +251,8 @@ static int at803x_probe(struct phy_devic
  17. if (!priv)
  18. return -ENOMEM;
  19. - if (phydev->drv->phy_id != ATH8030_PHY_ID)
  20. + if (phydev->drv->phy_id != ATH8030_PHY_ID &&
  21. + phydev->drv->phy_id != ATH8032_PHY_ID)
  22. goto does_not_require_reset_workaround;
  23. gpiod_reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
  24. @@ -478,6 +480,27 @@ static struct phy_driver at803x_driver[]
  25. .driver = {
  26. .owner = THIS_MODULE,
  27. },
  28. +}, {
  29. + /* ATHEROS 8032 */
  30. + .phy_id = ATH8032_PHY_ID,
  31. + .name = "Atheros 8032 ethernet",
  32. + .phy_id_mask = AT803X_PHY_ID_MASK,
  33. + .probe = at803x_probe,
  34. + .config_init = at803x_config_init,
  35. + .link_change_notify = at803x_link_change_notify,
  36. + .set_wol = at803x_set_wol,
  37. + .get_wol = at803x_get_wol,
  38. + .suspend = at803x_suspend,
  39. + .resume = at803x_resume,
  40. + .features = PHY_GBIT_FEATURES,
  41. + .flags = PHY_HAS_INTERRUPT,
  42. + .config_aneg = genphy_config_aneg,
  43. + .read_status = genphy_read_status,
  44. + .ack_interrupt = &at803x_ack_interrupt,
  45. + .config_intr = &at803x_config_intr,
  46. + .driver = {
  47. + .owner = THIS_MODULE,
  48. + },
  49. } };
  50. module_phy_driver(at803x_driver);
  51. @@ -485,6 +508,7 @@ module_phy_driver(at803x_driver);
  52. static struct mdio_device_id __maybe_unused atheros_tbl[] = {
  53. { ATH8030_PHY_ID, AT803X_PHY_ID_MASK },
  54. { ATH8031_PHY_ID, AT803X_PHY_ID_MASK },
  55. + { ATH8032_PHY_ID, AT803X_PHY_ID_MASK },
  56. { ATH8035_PHY_ID, AT803X_PHY_ID_MASK },
  57. { }
  58. };