* [net-next PATCH v5 00/10] Add PCS core support
@ 2025-05-23 20:33 Sean Anderson
2025-05-23 20:33 ` [net-next PATCH v5 01/10] dt-bindings: net: Add Xilinx PCS Sean Anderson
2025-05-23 20:33 ` [net-next PATCH v5 10/10] of: property: Add device link support for PCS Sean Anderson
0 siblings, 2 replies; 3+ messages in thread
From: Sean Anderson @ 2025-05-23 20:33 UTC (permalink / raw)
To: netdev, Andrew Lunn, David S . Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Russell King
Cc: Lei Wei, Heiner Kallweit, Christian Marangi, Kory Maincent,
Simon Horman, Daniel Golle, Vineeth Karumanchi, linux-kernel,
Sean Anderson, Alexandre Belloni, Claudiu Beznea, Claudiu Manoil,
Conor Dooley, Ioana Ciornei, Jonathan Corbet, Krzysztof Kozlowski,
Michal Simek, Nicolas Ferre, Radhey Shyam Pandey, Rob Herring,
Rob Herring, Robert Hancock, Saravana Kannan, UNGLinuxDriver,
Vladimir Oltean, devicetree, imx, linux-arm-kernel, linux-doc,
linux-stm32
This series adds support for creating PCSs as devices on a bus with a
driver (patch 3). As initial users,
- The Lynx PCS (and all of its users) is converted to this system
(patches 4-5)
- The Xilinx PCS is broken out from the AXI Ethernet driver (patches 6-7)
- The Cadence MACB driver is converted to support external PCSs (namely
the Xilinx PCS) (patches 8-9).
Care has been taken to ensure backwards-compatibility. The main source
of this is that many PCS devices lack compatibles and get detected as
PHYs. To address this, pcs_get_by_fwnode_compat allows drivers to edit
the devicetree to add appropriate compatibles.
There is another series [1] with the same goal by Christian Marangi. In
comparison, I believe this series
- Implements a simpler and more-robust method of PCS access.
- Provides a more-direct upgrade path for existing MAC and PCS drivers.
Sending v5 to run CI after rebasing; there are no other major changes.
[1] https://lore.kernel.org/netdev/20250511201250.3789083-1-ansuelsmth@gmail.com/
Changes in v5:
- Export get_phy_c22_id when it is used
- Expose bind attributes, since there is no issue in doing so
- Rebase onto net-next
- Use MDIO_BUS instead of MDIO_DEVICE
Changes in v4:
- Add a note about the license
- Adjust variable ordering in pcs_find_fwnode
- Annotate pcs_wrapper.wrapped with __rcu
- Fix PCS lookup functions missing ERR_PTR casts
- Fix documentation for devm_pcs_register_full
- Fix incorrect condition in pcs_post_config
- Fix linking when PCS && !OF_DYNAMIC
- Fix linking when PCS && OF_DYNAMIC && PHYLIB=m
- Re-add documentation for axienet_xilinx_pcs_get that was accidentally
removed
- Reduce line lengths to under 80 characters
- Remove unused dev parameter to pcs_put
- Use a spinlock instead of a mutex to protect pcs_wrappers
Changes in v3:
- Add '>' modifier for paragraph to description
- Adjust axienet_xilinx_pcs_get for changes to pcs_find_fwnode API
- Drop patches destined for other trees, as they have either already
been applied or are no longer necessary.
- Edit description to reference clocks instead of resets
- Remove support for #pcs-cells. Upon further investigation, the
requested functionality can be accomplished by specifying the PCS's
fwnode manually.
- Select PCS_XILINX unconditionally
Changes in v2:
- Add fallbacks for pcs_get* and pcs_put
- Add support for #pcs-cells
- Change base compatible to just xlnx,pcs
- Change compatible to just xlnx,pcs
- Defer devicetree updates for another series
- Drop #clock-cells description
- Drop PCS_ALTERA_TSE which was accidentally added while rebasing
- Move #clock-cells after compatible
- Move update to macb_pcs_get_state to previous patch
- Remove outdated comment
- Remove second example
- Remove unused variable
- Remove unused variable lynx_properties
- Rename pcs-modes to xlnx,pcs-modes
- Reorder pcs_handle to come before suffix props
- Reword commit message
- Rework xilinx_pcs_validate to just clear out half-duplex modes instead
of constraining modes based on the interface.
Sean Anderson (9):
dt-bindings: net: Add Xilinx PCS
net: phylink: Support setting PCS link change callbacks
net: pcs: Add subsystem
net: pcs: lynx: Convert to an MDIO driver
net: pcs: Add Xilinx PCS driver
net: axienet: Convert to use PCS subsystem
net: macb: Move most of mac_config to mac_prepare
net: macb: Support external PCSs
of: property: Add device link support for PCS
Vladimir Oltean (1):
net: dsa: ocelot: suppress PHY device scanning on the internal MDIO
bus
.../devicetree/bindings/net/xilinx,pcs.yaml | 114 +++
Documentation/networking/index.rst | 1 +
Documentation/networking/kapi.rst | 4 +
Documentation/networking/pcs.rst | 102 +++
MAINTAINERS | 8 +
drivers/net/dsa/ocelot/Kconfig | 4 +
drivers/net/dsa/ocelot/felix_vsc9959.c | 15 +-
drivers/net/dsa/ocelot/seville_vsc9953.c | 16 +-
drivers/net/ethernet/altera/Kconfig | 2 +
drivers/net/ethernet/altera/altera_tse_main.c | 7 +-
drivers/net/ethernet/cadence/macb.h | 1 +
drivers/net/ethernet/cadence/macb_main.c | 229 ++++--
drivers/net/ethernet/freescale/dpaa/Kconfig | 2 +-
drivers/net/ethernet/freescale/dpaa2/Kconfig | 3 +
.../net/ethernet/freescale/dpaa2/dpaa2-mac.c | 11 +-
drivers/net/ethernet/freescale/enetc/Kconfig | 2 +
.../net/ethernet/freescale/enetc/enetc_pf.c | 8 +-
.../net/ethernet/freescale/enetc/enetc_pf.h | 1 -
.../freescale/enetc/enetc_pf_common.c | 4 +-
drivers/net/ethernet/freescale/fman/Kconfig | 4 +-
.../net/ethernet/freescale/fman/fman_memac.c | 25 +-
drivers/net/ethernet/stmicro/stmmac/Kconfig | 3 +
.../ethernet/stmicro/stmmac/dwmac-socfpga.c | 6 +-
drivers/net/ethernet/xilinx/Kconfig | 7 +
drivers/net/ethernet/xilinx/xilinx_axienet.h | 4 +-
.../net/ethernet/xilinx/xilinx_axienet_main.c | 104 +--
drivers/net/pcs/Kconfig | 45 +-
drivers/net/pcs/Makefile | 4 +
drivers/net/pcs/core.c | 686 ++++++++++++++++++
drivers/net/pcs/pcs-lynx.c | 110 +--
drivers/net/pcs/pcs-xilinx.c | 484 ++++++++++++
drivers/net/phy/phy_device.c | 3 +-
drivers/net/phy/phylink.c | 24 +-
drivers/of/property.c | 2 +
include/linux/pcs-lynx.h | 13 +-
include/linux/pcs-xilinx.h | 15 +
include/linux/pcs.h | 205 ++++++
include/linux/phy.h | 1 +
include/linux/phylink.h | 27 +-
39 files changed, 2010 insertions(+), 296 deletions(-)
create mode 100644 Documentation/devicetree/bindings/net/xilinx,pcs.yaml
create mode 100644 Documentation/networking/pcs.rst
create mode 100644 drivers/net/pcs/core.c
create mode 100644 drivers/net/pcs/pcs-xilinx.c
create mode 100644 include/linux/pcs-xilinx.h
create mode 100644 include/linux/pcs.h
--
2.35.1.1320.gc452695387.dirty
^ permalink raw reply [flat|nested] 3+ messages in thread
* [net-next PATCH v5 01/10] dt-bindings: net: Add Xilinx PCS
2025-05-23 20:33 [net-next PATCH v5 00/10] Add PCS core support Sean Anderson
@ 2025-05-23 20:33 ` Sean Anderson
2025-05-23 20:33 ` [net-next PATCH v5 10/10] of: property: Add device link support for PCS Sean Anderson
1 sibling, 0 replies; 3+ messages in thread
From: Sean Anderson @ 2025-05-23 20:33 UTC (permalink / raw)
To: netdev, Andrew Lunn, David S . Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Russell King
Cc: Lei Wei, Heiner Kallweit, Christian Marangi, Kory Maincent,
Simon Horman, Daniel Golle, Vineeth Karumanchi, linux-kernel,
Sean Anderson, Rob Herring, Conor Dooley, Krzysztof Kozlowski,
Michal Simek, Radhey Shyam Pandey, Robert Hancock, devicetree
Add a binding for the Xilinx 1G/2.5G Ethernet PCS/PMA or SGMII LogiCORE
IP. This device is a soft device typically used to adapt between GMII
and SGMII or 1000BASE-X (possbilty in combination with a serdes).
pcs-modes reflects the modes available with the as configured when the
device is synthesized. Multiple modes may be specified if dynamic
reconfiguration is supported.
One PCS may contain "shared logic in core" which can be connected to
other PCSs with "shared logic in example design." This primarily refers
to clocking resources, allowing a reference clock to be shared by a bank
of PCSs. To support this, if #clock-cells is defined then the PCS will
register itself as a clock provider for other PCSs.
Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
---
(no changes since v3)
Changes in v3:
- Add '>' modifier for paragraph to description
- Edit description to reference clocks instead of resets
Changes in v2:
- Change base compatible to just xlnx,pcs
- Drop #clock-cells description
- Move #clock-cells after compatible
- Remove second example
- Rename pcs-modes to xlnx,pcs-modes
- Reword commit message
.../devicetree/bindings/net/xilinx,pcs.yaml | 114 ++++++++++++++++++
1 file changed, 114 insertions(+)
create mode 100644 Documentation/devicetree/bindings/net/xilinx,pcs.yaml
diff --git a/Documentation/devicetree/bindings/net/xilinx,pcs.yaml b/Documentation/devicetree/bindings/net/xilinx,pcs.yaml
new file mode 100644
index 000000000000..11bbae6936eb
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/xilinx,pcs.yaml
@@ -0,0 +1,114 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/xilinx,pcs.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Xilinx 1G/2.5G Ethernet PCS/PMA or SGMII LogiCORE IP
+
+maintainers:
+ - Sean Anderson <sean.anderson@seco.com>
+
+description: >
+ This is a soft device which implements the PCS and (depending on
+ configuration) PMA layers of an IEEE Ethernet PHY. On the MAC side, it
+ implements GMII. It may have an attached SERDES (internal or external), or
+ may directly use LVDS IO resources. Depending on the configuration, it may
+ implement 1000BASE-X, SGMII, 2500BASE-X, or 2.5G SGMII.
+
+ This device has a notion of "shared logic" such as reset and clocking
+ resources which must be shared between multiple PCSs using the same I/O
+ banks. Each PCS can be configured to have the shared logic in the "core"
+ (instantiated internally and made available to other PCSs) or in the "example
+ design" (provided by another PCS). PCSs with shared logic in the core provide
+ a clock for other PCSs in the same bank.
+
+properties:
+ compatible:
+ items:
+ - const: xlnx,pcs-16.2
+ - const: xlnx,pcs
+
+ reg:
+ maxItems: 1
+
+ "#clock-cells":
+ const: 0
+
+ clocks:
+ items:
+ - description:
+ The reference clock for the PCS. Depending on your setup, this may be
+ the gtrefclk, refclk, clk125m signal, or clocks from another PCS.
+
+ clock-names:
+ const: refclk
+
+ done-gpios:
+ maxItems: 1
+ description:
+ GPIO connected to the reset-done output, if present.
+
+ interrupts:
+ items:
+ - description:
+ The an_interrupt autonegotiation-complete interrupt.
+
+ interrupt-names:
+ const: an
+
+ xlnx,pcs-modes:
+ description:
+ The interfaces that the PCS supports. Multiple interfaces may be
+ specified if dynamic reconfiguration is enabled.
+ oneOf:
+ - const: sgmii
+ - const: 1000base-x
+ - const: 2500base-x
+ - items:
+ - const: sgmii
+ - const: 1000base-x
+
+ reset-gpios:
+ maxItems: 1
+ description:
+ GPIO connected to the reset input.
+
+required:
+ - compatible
+ - reg
+ - xlnx,pcs-modes
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/gpio/gpio.h>
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+ #include <dt-bindings/interrupt-controller/irq.h>
+
+ mdio {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ pcs0: ethernet-pcs@0 {
+ compatible = "xlnx,pcs-16.2", "xlnx,pcs";
+ reg = <0>;
+ #clock-cells = <0>;
+ clocks = <&si570>;
+ clock-names = "refclk";
+ interrupts-extended = <&gic GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "an";
+ reset-gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
+ done-gpios = <&gpio 6 GPIO_ACTIVE_HIGH>;
+ xlnx,pcs-modes = "sgmii", "1000base-x";
+ };
+
+ pcs1: ethernet-pcs@1 {
+ compatible = "xlnx,pcs-16.2", "xlnx,pcs";
+ reg = <1>;
+ xlnx,pcs-modes = "sgmii";
+ clocks = <&pcs0>;
+ clock-names = "refclk";
+ };
+ };
--
2.35.1.1320.gc452695387.dirty
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [net-next PATCH v5 10/10] of: property: Add device link support for PCS
2025-05-23 20:33 [net-next PATCH v5 00/10] Add PCS core support Sean Anderson
2025-05-23 20:33 ` [net-next PATCH v5 01/10] dt-bindings: net: Add Xilinx PCS Sean Anderson
@ 2025-05-23 20:33 ` Sean Anderson
1 sibling, 0 replies; 3+ messages in thread
From: Sean Anderson @ 2025-05-23 20:33 UTC (permalink / raw)
To: netdev, Andrew Lunn, David S . Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Russell King
Cc: Lei Wei, Heiner Kallweit, Christian Marangi, Kory Maincent,
Simon Horman, Daniel Golle, Vineeth Karumanchi, linux-kernel,
Sean Anderson, Rob Herring, Saravana Kannan, Rob Herring,
devicetree
This adds device link support for PCS devices, providing
better probe ordering.
Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: Saravana Kannan <saravanak@google.com>
---
(no changes since v2)
Changes in v2:
- Reorder pcs_handle to come before suffix props
drivers/of/property.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/of/property.c b/drivers/of/property.c
index c1feb631e383..1aa28bfadb12 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -1377,6 +1377,7 @@ DEFINE_SIMPLE_PROP(post_init_providers, "post-init-providers", NULL)
DEFINE_SIMPLE_PROP(access_controllers, "access-controllers", "#access-controller-cells")
DEFINE_SIMPLE_PROP(pses, "pses", "#pse-cells")
DEFINE_SIMPLE_PROP(power_supplies, "power-supplies", NULL)
+DEFINE_SIMPLE_PROP(pcs_handle, "pcs-handle", NULL)
DEFINE_SUFFIX_PROP(regulators, "-supply", NULL)
DEFINE_SUFFIX_PROP(gpio, "-gpio", "#gpio-cells")
@@ -1528,6 +1529,7 @@ static const struct supplier_bindings of_supplier_bindings[] = {
{ .parse_prop = parse_interrupts, },
{ .parse_prop = parse_interrupt_map, },
{ .parse_prop = parse_access_controllers, },
+ { .parse_prop = parse_pcs_handle, },
{ .parse_prop = parse_regulators, },
{ .parse_prop = parse_gpio, },
{ .parse_prop = parse_gpios, },
--
2.35.1.1320.gc452695387.dirty
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-05-23 20:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-23 20:33 [net-next PATCH v5 00/10] Add PCS core support Sean Anderson
2025-05-23 20:33 ` [net-next PATCH v5 01/10] dt-bindings: net: Add Xilinx PCS Sean Anderson
2025-05-23 20:33 ` [net-next PATCH v5 10/10] of: property: Add device link support for PCS Sean Anderson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).