760-v6.9-net-phy-aquantia-add-AQR111-and-AQR111B0-PHY-ID.patch 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. From 038ba1dc4e54d51d953f5618d8eb5dd39bd9de25 Mon Sep 17 00:00:00 2001
  2. From: Christian Marangi <[email protected]>
  3. Date: Tue, 13 Feb 2024 14:35:51 +0100
  4. Subject: [PATCH] net: phy: aquantia: add AQR111 and AQR111B0 PHY ID
  5. Add Aquantia AQR111 and AQR111B0 PHY ID. These PHY advertise 10G speed
  6. but actually supports up to 5G speed, hence some manual fixup is needed.
  7. The Aquantia AQR111B0 PHY is just a variant of the AQR111 with smaller
  8. chip size.
  9. Signed-off-by: Christian Marangi <[email protected]>
  10. Reviewed-by: Andrew Lunn <[email protected]>
  11. Reviewed-by: Andrew Lunn <[email protected]>
  12. Link: https://lore.kernel.org/r/[email protected]
  13. Signed-off-by: Paolo Abeni <[email protected]>
  14. ---
  15. drivers/net/phy/aquantia/aquantia_main.c | 52 ++++++++++++++++++++++++
  16. 1 file changed, 52 insertions(+)
  17. --- a/drivers/net/phy/aquantia/aquantia_main.c
  18. +++ b/drivers/net/phy/aquantia/aquantia_main.c
  19. @@ -22,6 +22,8 @@
  20. #define PHY_ID_AQR107 0x03a1b4e0
  21. #define PHY_ID_AQCS109 0x03a1b5c2
  22. #define PHY_ID_AQR405 0x03a1b4b0
  23. +#define PHY_ID_AQR111 0x03a1b610
  24. +#define PHY_ID_AQR111B0 0x03a1b612
  25. #define PHY_ID_AQR112 0x03a1b662
  26. #define PHY_ID_AQR412 0x03a1b712
  27. #define PHY_ID_AQR113C 0x31c31c12
  28. @@ -672,6 +674,16 @@ static int aqr107_probe(struct phy_devic
  29. return aqr_hwmon_probe(phydev);
  30. }
  31. +static int aqr111_config_init(struct phy_device *phydev)
  32. +{
  33. + /* AQR111 reports supporting speed up to 10G,
  34. + * however only speeds up to 5G are supported.
  35. + */
  36. + phy_set_max_speed(phydev, SPEED_5000);
  37. +
  38. + return aqr107_config_init(phydev);
  39. +}
  40. +
  41. static struct phy_driver aqr_driver[] = {
  42. {
  43. PHY_ID_MATCH_MODEL(PHY_ID_AQ1202),
  44. @@ -746,6 +758,44 @@ static struct phy_driver aqr_driver[] =
  45. .link_change_notify = aqr107_link_change_notify,
  46. },
  47. {
  48. + PHY_ID_MATCH_MODEL(PHY_ID_AQR111),
  49. + .name = "Aquantia AQR111",
  50. + .probe = aqr107_probe,
  51. + .get_rate_matching = aqr107_get_rate_matching,
  52. + .config_init = aqr111_config_init,
  53. + .config_aneg = aqr_config_aneg,
  54. + .config_intr = aqr_config_intr,
  55. + .handle_interrupt = aqr_handle_interrupt,
  56. + .read_status = aqr107_read_status,
  57. + .get_tunable = aqr107_get_tunable,
  58. + .set_tunable = aqr107_set_tunable,
  59. + .suspend = aqr107_suspend,
  60. + .resume = aqr107_resume,
  61. + .get_sset_count = aqr107_get_sset_count,
  62. + .get_strings = aqr107_get_strings,
  63. + .get_stats = aqr107_get_stats,
  64. + .link_change_notify = aqr107_link_change_notify,
  65. +},
  66. +{
  67. + PHY_ID_MATCH_MODEL(PHY_ID_AQR111B0),
  68. + .name = "Aquantia AQR111B0",
  69. + .probe = aqr107_probe,
  70. + .get_rate_matching = aqr107_get_rate_matching,
  71. + .config_init = aqr111_config_init,
  72. + .config_aneg = aqr_config_aneg,
  73. + .config_intr = aqr_config_intr,
  74. + .handle_interrupt = aqr_handle_interrupt,
  75. + .read_status = aqr107_read_status,
  76. + .get_tunable = aqr107_get_tunable,
  77. + .set_tunable = aqr107_set_tunable,
  78. + .suspend = aqr107_suspend,
  79. + .resume = aqr107_resume,
  80. + .get_sset_count = aqr107_get_sset_count,
  81. + .get_strings = aqr107_get_strings,
  82. + .get_stats = aqr107_get_stats,
  83. + .link_change_notify = aqr107_link_change_notify,
  84. +},
  85. +{
  86. PHY_ID_MATCH_MODEL(PHY_ID_AQR405),
  87. .name = "Aquantia AQR405",
  88. .config_aneg = aqr_config_aneg,
  89. @@ -820,6 +870,8 @@ static struct mdio_device_id __maybe_unu
  90. { PHY_ID_MATCH_MODEL(PHY_ID_AQR107) },
  91. { PHY_ID_MATCH_MODEL(PHY_ID_AQCS109) },
  92. { PHY_ID_MATCH_MODEL(PHY_ID_AQR405) },
  93. + { PHY_ID_MATCH_MODEL(PHY_ID_AQR111) },
  94. + { PHY_ID_MATCH_MODEL(PHY_ID_AQR111B0) },
  95. { PHY_ID_MATCH_MODEL(PHY_ID_AQR112) },
  96. { PHY_ID_MATCH_MODEL(PHY_ID_AQR412) },
  97. { PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) },