832-v6.7-net-phy-amd-Support-the-Altima-AMI101L.patch 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. From 49e5663b505070424e18099841943f34342aa405 Mon Sep 17 00:00:00 2001
  2. From: Linus Walleij <[email protected]>
  3. Date: Sun, 24 Sep 2023 01:09:01 +0200
  4. Subject: [PATCH] net: phy: amd: Support the Altima AMI101L
  5. The Altima AC101L is obviously compatible with the AMD PHY,
  6. as seen by reading the datasheet.
  7. Datasheet: https://docs.broadcom.com/doc/AC101L-DS05-405-RDS.pdf
  8. Signed-off-by: Linus Walleij <[email protected]>
  9. ---
  10. drivers/net/phy/Kconfig | 4 ++--
  11. drivers/net/phy/amd.c | 33 +++++++++++++++++++++++----------
  12. 2 files changed, 25 insertions(+), 12 deletions(-)
  13. --- a/drivers/net/phy/Kconfig
  14. +++ b/drivers/net/phy/Kconfig
  15. @@ -69,9 +69,9 @@ config SFP
  16. comment "MII PHY device drivers"
  17. config AMD_PHY
  18. - tristate "AMD PHYs"
  19. + tristate "AMD and Altima PHYs"
  20. help
  21. - Currently supports the am79c874
  22. + Currently supports the AMD am79c874 and Altima AC101L.
  23. config MESON_GXL_PHY
  24. tristate "Amlogic Meson GXL Internal PHY"
  25. --- a/drivers/net/phy/amd.c
  26. +++ b/drivers/net/phy/amd.c
  27. @@ -13,6 +13,7 @@
  28. #include <linux/mii.h>
  29. #include <linux/phy.h>
  30. +#define PHY_ID_AC101L 0x00225520
  31. #define PHY_ID_AM79C874 0x0022561b
  32. #define MII_AM79C_IR 17 /* Interrupt Status/Control Register */
  33. @@ -87,19 +88,31 @@ static irqreturn_t am79c_handle_interrup
  34. return IRQ_HANDLED;
  35. }
  36. -static struct phy_driver am79c_driver[] = { {
  37. - .phy_id = PHY_ID_AM79C874,
  38. - .name = "AM79C874",
  39. - .phy_id_mask = 0xfffffff0,
  40. - /* PHY_BASIC_FEATURES */
  41. - .config_init = am79c_config_init,
  42. - .config_intr = am79c_config_intr,
  43. - .handle_interrupt = am79c_handle_interrupt,
  44. -} };
  45. +static struct phy_driver am79c_drivers[] = {
  46. + {
  47. + .phy_id = PHY_ID_AM79C874,
  48. + .name = "AM79C874",
  49. + .phy_id_mask = 0xfffffff0,
  50. + /* PHY_BASIC_FEATURES */
  51. + .config_init = am79c_config_init,
  52. + .config_intr = am79c_config_intr,
  53. + .handle_interrupt = am79c_handle_interrupt,
  54. + },
  55. + {
  56. + .phy_id = PHY_ID_AC101L,
  57. + .name = "AC101L",
  58. + .phy_id_mask = 0xfffffff0,
  59. + /* PHY_BASIC_FEATURES */
  60. + .config_init = am79c_config_init,
  61. + .config_intr = am79c_config_intr,
  62. + .handle_interrupt = am79c_handle_interrupt,
  63. + },
  64. +};
  65. -module_phy_driver(am79c_driver);
  66. +module_phy_driver(am79c_drivers);
  67. static struct mdio_device_id __maybe_unused amd_tbl[] = {
  68. + { PHY_ID_AC101L, 0xfffffff0 },
  69. { PHY_ID_AM79C874, 0xfffffff0 },
  70. { }
  71. };