2023-05-06 10:45:56 +00:00
|
|
|
From 157ac9f52fd9b9a22cf12f7755a905fb34ef72f7 Mon Sep 17 00:00:00 2001
|
2021-11-01 12:02:53 +00:00
|
|
|
From: Gabor Juhos <j4g8y7@gmail.com>
|
|
|
|
Date: Fri, 25 Dec 2020 08:02:47 +0100
|
|
|
|
Subject: [PATCH] net: phy: define PSGMII PHY interface mode
|
|
|
|
|
|
|
|
The PSGMII interface is similar to QSGMII. The main difference
|
|
|
|
is that the PSGMII interface combines five SGMII lines into a
|
|
|
|
single link while in QSGMII only four lines are combined.
|
|
|
|
|
|
|
|
Similarly to the QSGMII, this interface mode might also needs
|
|
|
|
special handling within the MAC driver.
|
|
|
|
|
|
|
|
Add definitions for the PHY layer to allow to express this type
|
|
|
|
of connection between the MAC and PHY.
|
|
|
|
|
|
|
|
Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
|
|
|
|
---
|
|
|
|
Documentation/devicetree/bindings/net/ethernet-controller.yaml | 1 +
|
2023-05-06 10:45:56 +00:00
|
|
|
drivers/net/phy/phylink.c | 2 ++
|
2021-11-01 12:02:53 +00:00
|
|
|
include/linux/phy.h | 3 +++
|
2023-05-06 10:45:56 +00:00
|
|
|
3 files changed, 6 insertions(+)
|
2021-11-01 12:02:53 +00:00
|
|
|
|
|
|
|
--- a/Documentation/devicetree/bindings/net/ethernet-controller.yaml
|
|
|
|
+++ b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
|
|
|
|
@@ -64,6 +64,7 @@ properties:
|
|
|
|
- mii
|
|
|
|
- gmii
|
|
|
|
- sgmii
|
|
|
|
+ - psgmii
|
|
|
|
- qsgmii
|
|
|
|
- tbi
|
|
|
|
- rev-mii
|
2024-02-07 08:17:50 +00:00
|
|
|
--- a/drivers/net/phy/phy-core.c
|
|
|
|
+++ b/drivers/net/phy/phy-core.c
|
|
|
|
@@ -140,6 +140,8 @@ int phy_interface_num_ports(phy_interfac
|
|
|
|
case PHY_INTERFACE_MODE_QSGMII:
|
|
|
|
case PHY_INTERFACE_MODE_QUSGMII:
|
|
|
|
return 4;
|
|
|
|
+ case PHY_INTERFACE_MODE_PSGMII:
|
|
|
|
+ return 5;
|
|
|
|
case PHY_INTERFACE_MODE_MAX:
|
|
|
|
WARN_ONCE(1, "PHY_INTERFACE_MODE_MAX isn't a valid interface mode");
|
|
|
|
return 0;
|
2021-11-01 12:02:53 +00:00
|
|
|
--- a/drivers/net/phy/phylink.c
|
|
|
|
+++ b/drivers/net/phy/phylink.c
|
2023-08-26 01:19:18 +00:00
|
|
|
@@ -371,6 +371,7 @@ void phylink_get_linkmodes(unsigned long
|
2023-05-06 10:45:56 +00:00
|
|
|
case PHY_INTERFACE_MODE_RGMII_RXID:
|
|
|
|
case PHY_INTERFACE_MODE_RGMII_ID:
|
|
|
|
case PHY_INTERFACE_MODE_RGMII:
|
|
|
|
+ case PHY_INTERFACE_MODE_PSGMII:
|
|
|
|
case PHY_INTERFACE_MODE_QSGMII:
|
2024-01-26 05:35:27 +00:00
|
|
|
case PHY_INTERFACE_MODE_QUSGMII:
|
2023-05-06 10:45:56 +00:00
|
|
|
case PHY_INTERFACE_MODE_SGMII:
|
2024-01-26 05:35:27 +00:00
|
|
|
@@ -636,6 +637,7 @@ static int phylink_parse_mode(struct phy
|
2021-11-01 12:02:53 +00:00
|
|
|
|
|
|
|
switch (pl->link_config.interface) {
|
|
|
|
case PHY_INTERFACE_MODE_SGMII:
|
|
|
|
+ case PHY_INTERFACE_MODE_PSGMII:
|
|
|
|
case PHY_INTERFACE_MODE_QSGMII:
|
2024-01-26 05:35:27 +00:00
|
|
|
case PHY_INTERFACE_MODE_QUSGMII:
|
2021-11-01 12:02:53 +00:00
|
|
|
phylink_set(pl->supported, 10baseT_Half);
|
|
|
|
--- a/include/linux/phy.h
|
|
|
|
+++ b/include/linux/phy.h
|
2024-01-26 05:35:27 +00:00
|
|
|
@@ -141,6 +141,7 @@ typedef enum {
|
2021-11-01 12:02:53 +00:00
|
|
|
PHY_INTERFACE_MODE_XGMII,
|
|
|
|
PHY_INTERFACE_MODE_XLGMII,
|
|
|
|
PHY_INTERFACE_MODE_MOCA,
|
|
|
|
+ PHY_INTERFACE_MODE_PSGMII,
|
|
|
|
PHY_INTERFACE_MODE_QSGMII,
|
|
|
|
PHY_INTERFACE_MODE_TRGMII,
|
|
|
|
PHY_INTERFACE_MODE_100BASEX,
|
2024-01-26 05:35:27 +00:00
|
|
|
@@ -248,6 +249,8 @@ static inline const char *phy_modes(phy_
|
2021-11-01 12:02:53 +00:00
|
|
|
return "xlgmii";
|
|
|
|
case PHY_INTERFACE_MODE_MOCA:
|
|
|
|
return "moca";
|
|
|
|
+ case PHY_INTERFACE_MODE_PSGMII:
|
|
|
|
+ return "psgmii";
|
|
|
|
case PHY_INTERFACE_MODE_QSGMII:
|
|
|
|
return "qsgmii";
|
|
|
|
case PHY_INTERFACE_MODE_TRGMII:
|