Skip to contentSkip to conversation

Add 5gbase-r PHY interface mode

PATCH Applied Marek Behún 2 participants 6 messages Feb 16, 2021

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

cover Add 5gbase-r PHY interface mode

Hello,

there is still some testing needed for Amethyst patches, so I have split the part adding support for 5gbase-r interface mode and am sending it alone.

The first two patches are already reviewed.

Changes since last patches (Amethyst v16):
- added phylink 5gbase-r handler
- added SFP support for 5gbase-r mode

Marek

Marek Behún (2):
net: phylink: Add 5gbase-r support
sfp: add support for 5gbase-t SFPs

Pavana Sharma (2):
dt-bindings: net: Add 5GBASER phy interface
net: phy: Add 5GBASER interface mode

 .../devicetree/bindings/net/ethernet-controller.yaml        | 1 +
 Documentation/networking/phy.rst                            | 6 ++++++
 drivers/net/phy/phylink.c                                   | 4 ++++
 drivers/net/phy/sfp-bus.c                                   | 3 +++
 include/linux/phy.h                                         | 4 ++++
 5 files changed, 18 insertions(+)
Signature · 1 line
2.26.2
#1 lore raw

PATCH 1/4 dt-bindings: net: Add 5GBASER phy interface

From: Pavana Sharma <[email protected]>

Add 5gbase-r PHY interface mode.

---
 Documentation/devicetree/bindings/net/ethernet-controller.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/net/ethernet-controller.yaml +1 -0
index dac4aadb6e2e..f599c1d9c961 100644
@@ -89,6 +89,7 @@ properties:
       - trgmii
       - 1000base-x
       - 2500base-x
+      - 5gbase-r
       - rxaui
       - xaui
 
Signature · 1 line
2.26.2
#2 lore raw

PATCH 2/4 net: phy: Add 5GBASER interface mode

In reply to Marek Behún

From: Pavana Sharma <[email protected]>

Add 5GBASE-R phy interface mode

---
 Documentation/networking/phy.rst | 6 ++++++
 include/linux/phy.h              | 4 ++++
 2 files changed, 10 insertions(+)
Documentation/networking/phy.rst +6 -0
index 70136cc9e25e..06adfc2afcf0 100644
@@ -267,6 +267,12 @@ Some of the interface modes are described below:
     duplex, pause or other settings.  This is dependent on the MAC and/or
     PHY behaviour.
 
+``PHY_INTERFACE_MODE_5GBASER``
+    This is the IEEE 802.3 Clause 129 defined 5GBASE-R protocol. It is
+    identical to the 10GBASE-R protocol defined in Clause 49, with the
+    exception that it operates at half the frequency. Please refer to the
+    IEEE standard for the definition.
+
 ``PHY_INTERFACE_MODE_10GBASER``
     This is the IEEE 802.3 Clause 49 defined 10GBASE-R protocol used with
     various different mediums. Please refer to the IEEE standard for a
include/linux/phy.h +4 -0
index 5d7c4084ade9..0d537f59b77f 100644
@@ -107,6 +107,7 @@ extern const int phy_10gbit_features_array[1];
  * @PHY_INTERFACE_MODE_100BASEX: 100 BaseX
  * @PHY_INTERFACE_MODE_1000BASEX: 1000 BaseX
  * @PHY_INTERFACE_MODE_2500BASEX: 2500 BaseX
+ * @PHY_INTERFACE_MODE_5GBASER: 5G BaseR
  * @PHY_INTERFACE_MODE_RXAUI: Reduced XAUI
  * @PHY_INTERFACE_MODE_XAUI: 10 Gigabit Attachment Unit Interface
  * @PHY_INTERFACE_MODE_10GBASER: 10G BaseR
@@ -139,6 +140,7 @@ typedef enum {
 	PHY_INTERFACE_MODE_100BASEX,
 	PHY_INTERFACE_MODE_1000BASEX,
 	PHY_INTERFACE_MODE_2500BASEX,
+	PHY_INTERFACE_MODE_5GBASER,
 	PHY_INTERFACE_MODE_RXAUI,
 	PHY_INTERFACE_MODE_XAUI,
 	/* 10GBASE-R, XFI, SFI - single lane 10G Serdes */
@@ -209,6 +211,8 @@ static inline const char *phy_modes(phy_interface_t interface)
 		return "1000base-x";
 	case PHY_INTERFACE_MODE_2500BASEX:
 		return "2500base-x";
+	case PHY_INTERFACE_MODE_5GBASER:
+		return "5gbase-r";
 	case PHY_INTERFACE_MODE_RXAUI:
 		return "rxaui";
 	case PHY_INTERFACE_MODE_XAUI:
Signature · 1 line
2.26.2
#3 lore raw

PATCH 3/4 net: phylink: Add 5gbase-r support

In reply to Marek Behún

Add 5GBASER interface type and speed to phylink.

---
 drivers/net/phy/phylink.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/phy/phylink.c +4 -0
index 84f6e197f965..053c92e02cd8 100644
@@ -306,6 +306,10 @@ static int phylink_parse_mode(struct phylink *pl, struct fwnode_handle *fwnode)
 			phylink_set(pl->supported, 2500baseX_Full);
 			break;
 
+		case PHY_INTERFACE_MODE_5GBASER:
+			phylink_set(pl->supported, 5000baseT_Full);
+			break;
+
 		case PHY_INTERFACE_MODE_USXGMII:
 		case PHY_INTERFACE_MODE_10GKR:
 		case PHY_INTERFACE_MODE_10GBASER:
Signature · 1 line
2.26.2
#4 lore raw

PATCH 4/4 sfp: add support for 5gbase-t SFPs

In reply to Marek Behún

The sfp_parse_support() function is setting 5000baseT_Full in some cases. Now that we have PHY_INTERFACE_MODE_5GBASER interface mode available, change sfp_select_interface() to return PHY_INTERFACE_MODE_5GBASER if 5000baseT_Full is set in the link mode mask.

---
 drivers/net/phy/sfp-bus.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/phy/sfp-bus.c +3 -0
index 3cfd773ae5f4..2e11176c6b94 100644
@@ -400,6 +400,9 @@ phy_interface_t sfp_select_interface(struct sfp_bus *bus,
 	    phylink_test(link_modes, 10000baseT_Full))
 		return PHY_INTERFACE_MODE_10GBASER;
 
+	if (phylink_test(link_modes, 5000baseT_Full))
+		return PHY_INTERFACE_MODE_5GBASER;
+
 	if (phylink_test(link_modes, 2500baseX_Full))
 		return PHY_INTERFACE_MODE_2500BASEX;
 
Signature · 1 line
2.26.2
#5 lore raw
In reply to Marek Behún
This series was applied to netdev/net-next.git (refs/heads/master):

Hello:

This series was applied to netdev/net-next.git (refs/heads/master):

Quoted 9 lines · On Tue, 16 Feb 2021 20:20:51 +0100 you wrote:

Hello,

there is still some testing needed for Amethyst patches, so I have split the part adding support for 5gbase-r interface mode and am sending it alone.

The first two patches are already reviewed.

[...]

Here is the summary with links:
- [net-next,1/4] dt-bindings: net: Add 5GBASER phy interface

    https://git.kernel.org/netdev/net-next/c/4b08de909061
  - [net-next,2/4] net: phy: Add 5GBASER interface mode
    https://git.kernel.org/netdev/net-next/c/7331d1d4622b
  - [net-next,3/4] net: phylink: Add 5gbase-r support
    https://git.kernel.org/netdev/net-next/c/f6813bdafdb3
  - [net-next,4/4] sfp: add support for 5gbase-t SFPs
    https://git.kernel.org/netdev/net-next/c/cfb971dec56b

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html