2
0

704-v6.6-net-phy-Introduce-PSGMII-PHY-interface-mode.patch 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. From 9a0e95e34e9c0a713ddfd48c3a88a20d2bdfd514 Mon Sep 17 00:00:00 2001
  2. From: Gabor Juhos <[email protected]>
  3. Date: Fri, 11 Aug 2023 13:10:07 +0200
  4. Subject: [PATCH] net: phy: Introduce PSGMII PHY interface mode
  5. The PSGMII interface is similar to QSGMII. The main difference
  6. is that the PSGMII interface combines five SGMII lines into a
  7. single link while in QSGMII only four lines are combined.
  8. Similarly to the QSGMII, this interface mode might also needs
  9. special handling within the MAC driver.
  10. It is commonly used by Qualcomm with their QCA807x PHY series and
  11. modern WiSoC-s.
  12. Add definitions for the PHY layer to allow to express this type
  13. of connection between the MAC and PHY.
  14. Signed-off-by: Gabor Juhos <[email protected]>
  15. Signed-off-by: Robert Marko <[email protected]>
  16. Signed-off-by: David S. Miller <[email protected]>
  17. ---
  18. Documentation/networking/phy.rst | 4 ++++
  19. drivers/net/phy/phy-core.c | 2 ++
  20. drivers/net/phy/phylink.c | 3 +++
  21. include/linux/phy.h | 4 ++++
  22. 4 files changed, 13 insertions(+)
  23. --- a/Documentation/networking/phy.rst
  24. +++ b/Documentation/networking/phy.rst
  25. @@ -323,6 +323,10 @@ Some of the interface modes are describe
  26. contrast with the 1000BASE-X phy mode used for Clause 38 and 39 PMDs, this
  27. interface mode has different autonegotiation and only supports full duplex.
  28. +``PHY_INTERFACE_MODE_PSGMII``
  29. + This is the Penta SGMII mode, it is similar to QSGMII but it combines 5
  30. + SGMII lines into a single link compared to 4 on QSGMII.
  31. +
  32. Pause frames / flow control
  33. ===========================
  34. --- a/drivers/net/phy/phy-core.c
  35. +++ b/drivers/net/phy/phy-core.c
  36. @@ -140,6 +140,8 @@ int phy_interface_num_ports(phy_interfac
  37. case PHY_INTERFACE_MODE_QSGMII:
  38. case PHY_INTERFACE_MODE_QUSGMII:
  39. return 4;
  40. + case PHY_INTERFACE_MODE_PSGMII:
  41. + return 5;
  42. case PHY_INTERFACE_MODE_MAX:
  43. WARN_ONCE(1, "PHY_INTERFACE_MODE_MAX isn't a valid interface mode");
  44. return 0;
  45. --- a/drivers/net/phy/phylink.c
  46. +++ b/drivers/net/phy/phylink.c
  47. @@ -187,6 +187,7 @@ static int phylink_interface_max_speed(p
  48. case PHY_INTERFACE_MODE_RGMII_RXID:
  49. case PHY_INTERFACE_MODE_RGMII_ID:
  50. case PHY_INTERFACE_MODE_RGMII:
  51. + case PHY_INTERFACE_MODE_PSGMII:
  52. case PHY_INTERFACE_MODE_QSGMII:
  53. case PHY_INTERFACE_MODE_QUSGMII:
  54. case PHY_INTERFACE_MODE_SGMII:
  55. @@ -448,6 +449,7 @@ unsigned long phylink_get_capabilities(p
  56. case PHY_INTERFACE_MODE_RGMII_RXID:
  57. case PHY_INTERFACE_MODE_RGMII_ID:
  58. case PHY_INTERFACE_MODE_RGMII:
  59. + case PHY_INTERFACE_MODE_PSGMII:
  60. case PHY_INTERFACE_MODE_QSGMII:
  61. case PHY_INTERFACE_MODE_QUSGMII:
  62. case PHY_INTERFACE_MODE_SGMII:
  63. @@ -814,6 +816,7 @@ static int phylink_parse_mode(struct phy
  64. switch (pl->link_config.interface) {
  65. case PHY_INTERFACE_MODE_SGMII:
  66. + case PHY_INTERFACE_MODE_PSGMII:
  67. case PHY_INTERFACE_MODE_QSGMII:
  68. case PHY_INTERFACE_MODE_QUSGMII:
  69. case PHY_INTERFACE_MODE_RGMII:
  70. --- a/include/linux/phy.h
  71. +++ b/include/linux/phy.h
  72. @@ -103,6 +103,7 @@ extern const int phy_10gbit_features_arr
  73. * @PHY_INTERFACE_MODE_XGMII: 10 gigabit media-independent interface
  74. * @PHY_INTERFACE_MODE_XLGMII:40 gigabit media-independent interface
  75. * @PHY_INTERFACE_MODE_MOCA: Multimedia over Coax
  76. + * @PHY_INTERFACE_MODE_PSGMII: Penta SGMII
  77. * @PHY_INTERFACE_MODE_QSGMII: Quad SGMII
  78. * @PHY_INTERFACE_MODE_TRGMII: Turbo RGMII
  79. * @PHY_INTERFACE_MODE_100BASEX: 100 BaseX
  80. @@ -140,6 +141,7 @@ typedef enum {
  81. PHY_INTERFACE_MODE_XGMII,
  82. PHY_INTERFACE_MODE_XLGMII,
  83. PHY_INTERFACE_MODE_MOCA,
  84. + PHY_INTERFACE_MODE_PSGMII,
  85. PHY_INTERFACE_MODE_QSGMII,
  86. PHY_INTERFACE_MODE_TRGMII,
  87. PHY_INTERFACE_MODE_100BASEX,
  88. @@ -247,6 +249,8 @@ static inline const char *phy_modes(phy_
  89. return "xlgmii";
  90. case PHY_INTERFACE_MODE_MOCA:
  91. return "moca";
  92. + case PHY_INTERFACE_MODE_PSGMII:
  93. + return "psgmii";
  94. case PHY_INTERFACE_MODE_QSGMII:
  95. return "qsgmii";
  96. case PHY_INTERFACE_MODE_TRGMII: