mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/8] net: stmmac: add SL2610 ethernet support
@ 2026-11-16 13:54 Jisheng Zhang
  2026-11-16 13:54 ` [PATCH 1/8] dt-bindings: net: Add MDIO demultiplexer Jisheng Zhang
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Jisheng Zhang @ 2026-11-16 13:54 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Sebastian Hesselbarth,
	Maxime Chevallier, Maxime Coquelin, Alexandre Torgue
  Cc: netdev, devicetree, linux-kernel, linux-arm-kernel

This series add SL2610 ethernet support. First of all, introduce
the mdio demultiplexer, then add the stmmac glue layer, finally
touch dts.

NOTE: this series depends on the sl2610 SoC support series which
is still under review:
https://lore.kernel.org/linux-arm-kernel/20261115102401.3520-1-jszhang@kernel.org/

Jisheng Zhang (8):
  dt-bindings: net: Add MDIO demultiplexer
  net: mdio: Add MDIO demultiplexer driver
  dt-bindings: net: Add Synaptics SL2610 DWMAC
  net: stmmac: Add glue layer for Synaptics SL2610 SoC
  dt-bindings: soc: synaptics: Allow SL2610 mux controller children
  soc: synaptics: Populate SL2610 system controller DT children
  arm64: dts: synaptics: Add SL2610 Ethernet nodes
  arm64: dts: synaptics: Enable Ethernet on SL2619 RDK

 .../devicetree/bindings/net/mdio-demux.yaml   | 102 ++++++
 .../devicetree/bindings/net/snps,dwmac.yaml   |   1 +
 .../bindings/net/syna,sl2610-dwmac.yaml       |  75 +++++
 .../soc/synaptics/syna,sl2610-soc-syscon.yaml |  10 +
 MAINTAINERS                                   |   2 +
 arch/arm64/boot/dts/synaptics/sl2611.dtsi     |  41 +++
 arch/arm64/boot/dts/synaptics/sl2619-rdk.dts  |  77 +++++
 arch/arm64/boot/dts/synaptics/sl2619.dtsi     |  36 +++
 drivers/net/ethernet/stmicro/stmmac/Kconfig   |  11 +
 drivers/net/ethernet/stmicro/stmmac/Makefile  |   1 +
 .../net/ethernet/stmicro/stmmac/dwmac-syna.c  | 116 +++++++
 drivers/net/mdio/Kconfig                      |  12 +
 drivers/net/mdio/Makefile                     |   1 +
 drivers/net/mdio/mdio-demux.c                 | 298 ++++++++++++++++++
 drivers/soc/synaptics/sl2610-syscon.c         |  10 +-
 15 files changed, 791 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/mdio-demux.yaml
 create mode 100644 Documentation/devicetree/bindings/net/syna,sl2610-dwmac.yaml
 create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwmac-syna.c
 create mode 100644 drivers/net/mdio/mdio-demux.c

-- 
2.55.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/8] dt-bindings: net: Add MDIO demultiplexer
  2026-11-16 13:54 [PATCH 0/8] net: stmmac: add SL2610 ethernet support Jisheng Zhang
@ 2026-11-16 13:54 ` Jisheng Zhang
  2026-11-16 15:06   ` Andrew Lunn
  2026-11-16 13:54 ` [PATCH 2/8] net: mdio: Add MDIO demultiplexer driver Jisheng Zhang
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 10+ messages in thread
From: Jisheng Zhang @ 2026-11-16 13:54 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Sebastian Hesselbarth,
	Maxime Chevallier, Maxime Coquelin, Alexandre Torgue
  Cc: netdev, devicetree, linux-kernel, linux-arm-kernel

Assume we have the following implementation:
          ----------
          |mmio reg|
	  ----------
             |
 --------    |      -------
 | MAC0 |--MDIO-----| PHY |
 -------- |     |   -------
          |     |
 -------- |     |   -------
 | MAC1 |--     ----| PHY |
 --------           -------

Both MAC0 and MAC1 have MDIO bus masters, and tie together to
a single set of clock and data lines, which go to some PHYs. While
there's a mmio reg to control which MAC mdio master can operate
the single mdio clock and data lines, so only one MAC can operate
the mdio clock and data lines.

We also need to fully support three use cases: only MAC0 + PHY is used
on board; only MAC1 + PHY is used on board; MAC0 + MAC1 + PHYs are
all used.

To support this kind of usage, we need a kind of mdio demuxer. This
patch add the dt-bindings doc.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 .../devicetree/bindings/net/mdio-demux.yaml   | 102 ++++++++++++++++++
 1 file changed, 102 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/mdio-demux.yaml

diff --git a/Documentation/devicetree/bindings/net/mdio-demux.yaml b/Documentation/devicetree/bindings/net/mdio-demux.yaml
new file mode 100644
index 000000000000..792187d58426
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/mdio-demux.yaml
@@ -0,0 +1,102 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/mdio-demux.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MDIO bus demultiplexer with multiple parent controllers
+
+maintainers:
+  - Andrew Lunn <andrew@lunn.ch>
+
+description: |
+  An MDIO demultiplexer connects multiple independent MDIO controllers to
+  one physical set of MDIO signals. The mux control selects the parent
+  controller used by each child bus. Child buses and their parent buses
+  are listed in matching order: the first child uses the first parent,
+  and so on. The child's reg value is passed to the mux controller as
+  the state to select for that parent.
+
+properties:
+  compatible:
+    const: mdio-demux
+
+  mux-controls:
+    maxItems: 1
+
+  mdio-parent-bus:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    minItems: 1
+    maxItems: 2
+    items:
+      maxItems: 1
+    description:
+      Phandles to parent MDIO controllers, in the same order as the child
+      buses.
+
+  '#address-cells':
+    const: 1
+
+  '#size-cells':
+    const: 0
+
+patternProperties:
+  '^mdio@[0-9a-f]+$':
+    $ref: /schemas/net/mdio.yaml#
+    unevaluatedProperties: false
+    properties:
+      reg:
+        maxItems: 1
+
+required:
+  - compatible
+  - mux-controls
+  - mdio-parent-bus
+  - '#address-cells'
+  - '#size-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    /* MDIO buses registered by two Ethernet MACs. */
+    mac0_mdio: mdio-0 {
+        #address-cells = <1>;
+        #size-cells = <0>;
+    };
+
+    mac1_mdio: mdio-1 {
+        #address-cells = <1>;
+        #size-cells = <0>;
+    };
+
+    mux: mux-controller {
+        compatible = "reg-mux";
+        #mux-control-cells = <1>;
+        mux-reg-masks = <0x4 0x10>;
+    };
+
+    mdio-demux {
+        compatible = "mdio-demux";
+        mux-controls = <&mux 0>;
+        mdio-parent-bus = <&mac0_mdio>, <&mac1_mdio>;
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        mdio@0 {
+            reg = <0>;
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            ethernet-phy@1 {
+                reg = <1>;
+            };
+        };
+
+        mdio@1 {
+            reg = <1>;
+            #address-cells = <1>;
+            #size-cells = <0>;
+        };
+    };
+...
-- 
2.55.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 2/8] net: mdio: Add MDIO demultiplexer driver
  2026-11-16 13:54 [PATCH 0/8] net: stmmac: add SL2610 ethernet support Jisheng Zhang
  2026-11-16 13:54 ` [PATCH 1/8] dt-bindings: net: Add MDIO demultiplexer Jisheng Zhang
@ 2026-11-16 13:54 ` Jisheng Zhang
  2026-11-16 13:54 ` [PATCH 3/8] dt-bindings: net: Add Synaptics SL2610 DWMAC Jisheng Zhang
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Jisheng Zhang @ 2026-11-16 13:54 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Sebastian Hesselbarth,
	Maxime Chevallier, Maxime Coquelin, Alexandre Torgue
  Cc: netdev, devicetree, linux-kernel, linux-arm-kernel

Assume we have the following implementation:
          ----------
          |mmio reg|
	  ----------
             |
 --------    |      -------
 | MAC0 |--MDIO-----| PHY |
 -------- |     |   -------
          |     |
 -------- |     |   -------
 | MAC1 |--     ----| PHY |
 --------           -------

Both MAC0 and MAC1 have MDIO bus masters, and tie together to
a single set of clock and data lines, which go to some PHYs. While
there's a mmio reg to control which MAC mdio master can operate
the single mdio clock and data lines, so only one MAC can operate
the mdio clock and data lines.

We also need to fully support three use cases: only MAC0 + PHY is used
on board; only MAC1 + PHY is used on board; MAC0 + MAC1 + PHYs are
all used.

To support this kind of usage, we need a kind of mdio demuxer. This
patch add the driver code.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 drivers/net/mdio/Kconfig      |  12 ++
 drivers/net/mdio/Makefile     |   1 +
 drivers/net/mdio/mdio-demux.c | 298 ++++++++++++++++++++++++++++++++++
 3 files changed, 311 insertions(+)
 create mode 100644 drivers/net/mdio/mdio-demux.c

diff --git a/drivers/net/mdio/Kconfig b/drivers/net/mdio/Kconfig
index d44278f26fab..e4a3ff594881 100644
--- a/drivers/net/mdio/Kconfig
+++ b/drivers/net/mdio/Kconfig
@@ -289,5 +289,17 @@ config MDIO_BUS_MUX_MMIOREG
 
 	  Currently, only 8/16/32 bits registers are supported.
 
+config MDIO_BUS_DEMUX
+	tristate "MDIO bus demultiplexer"
+	depends on OF_MDIO
+	select MULTIPLEXER
+	help
+	  This driver provides child MDIO buses backed by separate parent
+	  MDIO buses. A shared mux control selects which parent bus is
+	  connected to the physical MDIO lines for each transaction.
+
+	  To compile this driver as a module, choose M here. The module
+	  will be called mdio-demux.
+
 endmenu
 endmenu
diff --git a/drivers/net/mdio/Makefile b/drivers/net/mdio/Makefile
index 048586746026..1f9bb8672fc8 100644
--- a/drivers/net/mdio/Makefile
+++ b/drivers/net/mdio/Makefile
@@ -35,3 +35,4 @@ obj-$(CONFIG_MDIO_BUS_MUX_MESON_G12A)	+= mdio-mux-meson-g12a.o
 obj-$(CONFIG_MDIO_BUS_MUX_MESON_GXL)	+= mdio-mux-meson-gxl.o
 obj-$(CONFIG_MDIO_BUS_MUX_MMIOREG) 	+= mdio-mux-mmioreg.o
 obj-$(CONFIG_MDIO_BUS_MUX_MULTIPLEXER) 	+= mdio-mux-multiplexer.o
+obj-$(CONFIG_MDIO_BUS_DEMUX)		+= mdio-demux.o
diff --git a/drivers/net/mdio/mdio-demux.c b/drivers/net/mdio/mdio-demux.c
new file mode 100644
index 000000000000..a64c1e1bf4ff
--- /dev/null
+++ b/drivers/net/mdio/mdio-demux.c
@@ -0,0 +1,298 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2025 Synaptics Incorporated
+ *
+ * Author: Jisheng Zhang <jszhang@kernel.org>
+ */
+
+#include <linux/atomic.h>
+#include <linux/device.h>
+#include <linux/module.h>
+#include <linux/mux/consumer.h>
+#include <linux/of_mdio.h>
+#include <linux/phy.h>
+#include <linux/platform_device.h>
+
+#define MAX_MDIO_PORT	2
+
+struct mdio_demux_port {
+	struct mii_bus *pb;
+	struct mii_bus *bus;
+	struct mdio_demux_priv *priv;
+	int port;
+};
+
+struct mdio_demux_priv {
+	/* Serialize selector changes and transfers across all parent buses. */
+	struct mutex mdio_demux_lock;
+	int current_port;
+	bool do_deselect;
+	struct mux_control *muxc;
+	struct mdio_demux_port dmxport[MAX_MDIO_PORT];
+	int id;
+};
+
+static atomic_t mdio_demux_id = ATOMIC_INIT(0);
+
+static int mdio_demux_switch(struct mdio_demux_port *dmxport)
+{
+	struct mdio_demux_priv *priv = dmxport->priv;
+	int r;
+
+	if (priv->current_port == dmxport->port)
+		return 0;
+
+	if (priv->do_deselect) {
+		r = mux_control_deselect(priv->muxc);
+		priv->do_deselect = false;
+		priv->current_port = -1;
+		if (r)
+			return r;
+	}
+
+	r = mux_control_select(priv->muxc, dmxport->port);
+	if (r) {
+		priv->current_port = -1;
+		priv->do_deselect = false;
+		return r;
+	}
+	priv->do_deselect = true;
+
+	priv->current_port = dmxport->port;
+
+	return 0;
+}
+
+static int mdio_demux_read(struct mii_bus *bus, int phy_id, int regnum)
+{
+	struct mdio_demux_port *dmxport = bus->priv;
+	struct mdio_demux_priv *priv = dmxport->priv;
+	int r;
+
+	guard(mutex)(&priv->mdio_demux_lock);
+
+	r = mdio_demux_switch(dmxport);
+	if (r)
+		return r;
+
+	return dmxport->pb->read(dmxport->pb, phy_id, regnum);
+}
+
+static int mdio_demux_read_c45(struct mii_bus *bus, int phy_id, int dev_addr,
+			       int regnum)
+{
+	struct mdio_demux_port *dmxport = bus->priv;
+	struct mdio_demux_priv *priv = dmxport->priv;
+	int r;
+
+	guard(mutex)(&priv->mdio_demux_lock);
+
+	r = mdio_demux_switch(dmxport);
+	if (r)
+		return r;
+
+	return dmxport->pb->read_c45(dmxport->pb, phy_id, dev_addr, regnum);
+}
+
+static int mdio_demux_write(struct mii_bus *bus, int phy_id,
+			    int regnum, u16 val)
+{
+	struct mdio_demux_port *dmxport = bus->priv;
+	struct mdio_demux_priv *priv = dmxport->priv;
+	int r;
+
+	guard(mutex)(&priv->mdio_demux_lock);
+
+	r = mdio_demux_switch(dmxport);
+	if (r)
+		return r;
+
+	return dmxport->pb->write(dmxport->pb, phy_id, regnum, val);
+}
+
+static int mdio_demux_write_c45(struct mii_bus *bus, int phy_id, int dev_addr,
+				int regnum, u16 val)
+{
+	struct mdio_demux_port *dmxport = bus->priv;
+	struct mdio_demux_priv *priv = dmxport->priv;
+	int r;
+
+	guard(mutex)(&priv->mdio_demux_lock);
+
+	r = mdio_demux_switch(dmxport);
+	if (r)
+		return r;
+
+	return dmxport->pb->write_c45(dmxport->pb, phy_id, dev_addr, regnum, val);
+}
+
+static int mdio_demux_probe(struct platform_device *pdev)
+{
+	struct device_node *np = pdev->dev.of_node;
+	struct device_node *child_bus_node, *parent_bus_node;
+	struct mii_bus *parent_bus;
+	struct mii_bus *bus;
+	struct mdio_demux_priv *priv;
+	int r, v, i = 0;
+
+	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
+	if (!priv)
+		return -ENOMEM;
+
+	priv->current_port = -1;
+	priv->id = atomic_inc_return(&mdio_demux_id);
+	mutex_init(&priv->mdio_demux_lock);
+
+	priv->muxc = devm_mux_control_get(&pdev->dev, NULL);
+	if (IS_ERR(priv->muxc))
+		return dev_err_probe(&pdev->dev, PTR_ERR(priv->muxc), "Failed to get mux\n");
+
+	for_each_available_child_of_node(np, child_bus_node) {
+		if (i >= MAX_MDIO_PORT) {
+			r = -EINVAL;
+			goto err_child;
+		}
+
+		parent_bus_node = of_parse_phandle(np, "mdio-parent-bus", i);
+		if (!parent_bus_node) {
+			r = -ENODEV;
+			goto err_child;
+		}
+
+		r = of_property_read_u32(child_bus_node, "reg", &v);
+		if (r) {
+			dev_err(&pdev->dev,
+				"Failed to find reg for child %pOF: %pe\n",
+				child_bus_node, ERR_PTR(r));
+			goto err_parent_node;
+		}
+
+		parent_bus = of_mdio_find_bus(parent_bus_node);
+		if (!parent_bus) {
+			r = -EPROBE_DEFER;
+			goto err_parent_node;
+		}
+		if (!device_link_add(&pdev->dev, parent_bus->parent,
+				     DL_FLAG_AUTOREMOVE_CONSUMER)) {
+			r = -ENOMEM;
+			put_device(&parent_bus->dev);
+			goto err_parent_node;
+		}
+		of_node_put(parent_bus_node);
+		parent_bus_node = NULL;
+		priv->dmxport[i].pb = parent_bus;
+		priv->dmxport[i].port = v;
+		priv->dmxport[i].priv = priv;
+
+		bus = devm_mdiobus_alloc(&pdev->dev);
+		if (!bus) {
+			r = -ENOMEM;
+			goto err_parent_bus;
+		}
+
+		bus->priv = &priv->dmxport[i];
+		bus->name = "mdio_demux";
+		snprintf(bus->id, MII_BUS_ID_SIZE, "%s-%x.%x", bus->name,
+			 priv->id, v);
+		bus->parent = &pdev->dev;
+		if (parent_bus->read)
+			bus->read = mdio_demux_read;
+		if (parent_bus->write)
+			bus->write = mdio_demux_write;
+		if (parent_bus->read_c45)
+			bus->read_c45 = mdio_demux_read_c45;
+		if (parent_bus->write_c45)
+			bus->write_c45 = mdio_demux_write_c45;
+		r = of_mdiobus_register(bus, child_bus_node);
+		if (r)
+			goto err_parent_bus;
+		priv->dmxport[i].bus = bus;
+		++i;
+	}
+
+	if (!i)
+		goto err_no_children;
+
+	platform_set_drvdata(pdev, priv);
+
+	return 0;
+
+err_parent_bus:
+	put_device(&parent_bus->dev);
+	of_node_put(child_bus_node);
+	goto err_registered_bus;
+
+err_no_children:
+	return -ENODEV;
+
+err_parent_node:
+	of_node_put(parent_bus_node);
+err_child:
+	of_node_put(child_bus_node);
+err_registered_bus:
+	while (i > 0) {
+		i--;
+		mdiobus_unregister(priv->dmxport[i].bus);
+		put_device(&priv->dmxport[i].pb->dev);
+	}
+	if (priv->do_deselect)
+		mux_control_deselect(priv->muxc);
+	return r;
+}
+
+static void mdio_demux_remove(struct platform_device *pdev)
+{
+	struct mdio_demux_priv *priv = platform_get_drvdata(pdev);
+	int i;
+
+	for (i = MAX_MDIO_PORT - 1; i >= 0; i--)
+		if (priv->dmxport[i].bus) {
+			mdiobus_unregister(priv->dmxport[i].bus);
+			put_device(&priv->dmxport[i].pb->dev);
+		}
+
+	guard(mutex)(&priv->mdio_demux_lock);
+	if (priv->do_deselect) {
+		mux_control_deselect(priv->muxc);
+		priv->do_deselect = false;
+	}
+}
+
+static int mdio_demux_suspend(struct device *dev)
+{
+	struct mdio_demux_priv *priv = dev_get_drvdata(dev);
+	int ret = 0;
+
+	guard(mutex)(&priv->mdio_demux_lock);
+
+	priv->current_port = -1;
+	if (priv->do_deselect) {
+		ret = mux_control_deselect(priv->muxc);
+		priv->do_deselect = false;
+	}
+
+	return ret;
+}
+
+static DEFINE_SIMPLE_DEV_PM_OPS(mdio_demux_pm_ops, mdio_demux_suspend, NULL);
+
+static const struct of_device_id mdio_demux_dt_ids[] = {
+	{ .compatible = "mdio-demux" },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, mdio_demux_dt_ids);
+
+static struct platform_driver mdio_demux_driver = {
+	.probe = mdio_demux_probe,
+	.remove = mdio_demux_remove,
+	.driver = {
+		.name = "mdio-demux",
+		.of_match_table = mdio_demux_dt_ids,
+		.pm = pm_sleep_ptr(&mdio_demux_pm_ops),
+	},
+};
+module_platform_driver(mdio_demux_driver);
+
+MODULE_DESCRIPTION("MDIO bus demux driver");
+MODULE_AUTHOR("Jisheng Zhang <jszhang@kernel.org>");
+MODULE_LICENSE("GPL");
-- 
2.55.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 3/8] dt-bindings: net: Add Synaptics SL2610 DWMAC
  2026-11-16 13:54 [PATCH 0/8] net: stmmac: add SL2610 ethernet support Jisheng Zhang
  2026-11-16 13:54 ` [PATCH 1/8] dt-bindings: net: Add MDIO demultiplexer Jisheng Zhang
  2026-11-16 13:54 ` [PATCH 2/8] net: mdio: Add MDIO demultiplexer driver Jisheng Zhang
@ 2026-11-16 13:54 ` Jisheng Zhang
  2026-11-16 13:54 ` [PATCH 4/8] net: stmmac: Add glue layer for Synaptics SL2610 SoC Jisheng Zhang
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Jisheng Zhang @ 2026-11-16 13:54 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Sebastian Hesselbarth,
	Maxime Chevallier, Maxime Coquelin, Alexandre Torgue
  Cc: netdev, devicetree, linux-kernel, linux-arm-kernel

Describe the Synaptics SL2610 integration of the Synopsys DWMAC 5.20.
The PHY interface mode is selected through a system-controller register,
identified by a syscon phandle and register offset.

Restrict PHY modes to the RMII and RGMII variants supported by the glue
and extend the common DWMAC compatible list for the new integration.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Assisted-by: LLM
---
 .../devicetree/bindings/net/snps,dwmac.yaml   |  1 +
 .../bindings/net/syna,sl2610-dwmac.yaml       | 75 +++++++++++++++++++
 2 files changed, 76 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/syna,sl2610-dwmac.yaml

diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
index 2c4842404bf6..267340a5f45c 100644
--- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
@@ -119,6 +119,7 @@ properties:
         - sophgo,sg2044-dwmac
         - starfive,jh7100-dwmac
         - starfive,jh7110-dwmac
+        - syna,sl2610-dwmac
         - tesla,fsd-ethqos
         - thead,th1520-gmac
         - ultrarisc,dp1000-gmac
diff --git a/Documentation/devicetree/bindings/net/syna,sl2610-dwmac.yaml b/Documentation/devicetree/bindings/net/syna,sl2610-dwmac.yaml
new file mode 100644
index 000000000000..0748b623599b
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/syna,sl2610-dwmac.yaml
@@ -0,0 +1,75 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/syna,sl2610-dwmac.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Synaptics SL2610 DesignWare Ethernet MAC
+
+maintainers:
+  - Jisheng Zhang <jszhang@kernel.org>
+
+select:
+  properties:
+    compatible:
+      contains:
+        const: syna,sl2610-dwmac
+  required:
+    - compatible
+
+allOf:
+  - $ref: snps,dwmac.yaml#
+
+properties:
+  compatible:
+    items:
+      - const: syna,sl2610-dwmac
+      - const: snps,dwmac-5.20
+
+  syna,syscon:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    items:
+      - items:
+          - description: Phandle to the SL2610 system controller.
+          - description: Offset of the Ethernet interface control register.
+    description:
+      Phandle and register offset used to configure the Ethernet PHY
+      interface mode.
+
+  phy-mode:
+    enum:
+      - rmii
+      - rgmii
+      - rgmii-id
+      - rgmii-rxid
+      - rgmii-txid
+
+required:
+  - compatible
+  - syna,syscon
+  - phy-mode
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    chip: syscon@f7e10000 {
+        compatible = "syna,sl2610-soc-syscon", "syscon";
+        reg = <0xf7e10000 0x10000>;
+        clocks = <&osc>;
+        #clock-cells = <1>;
+        #reset-cells = <1>;
+    };
+
+    ethernet@f7a06000 {
+        compatible = "syna,sl2610-dwmac", "snps,dwmac-5.20";
+        reg = <0xf7a06000 0x2000>;
+        interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>;
+        interrupt-names = "macirq";
+        phy-mode = "rgmii-id";
+        syna,syscon = <&chip 0xa3c>;
+    };
+...
-- 
2.55.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 4/8] net: stmmac: Add glue layer for Synaptics SL2610 SoC
  2026-11-16 13:54 [PATCH 0/8] net: stmmac: add SL2610 ethernet support Jisheng Zhang
                   ` (2 preceding siblings ...)
  2026-11-16 13:54 ` [PATCH 3/8] dt-bindings: net: Add Synaptics SL2610 DWMAC Jisheng Zhang
@ 2026-11-16 13:54 ` Jisheng Zhang
  2026-11-16 13:54 ` [PATCH 5/8] dt-bindings: soc: synaptics: Allow SL2610 mux controller children Jisheng Zhang
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Jisheng Zhang @ 2026-11-16 13:54 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Sebastian Hesselbarth,
	Maxime Chevallier, Maxime Coquelin, Alexandre Torgue
  Cc: netdev, devicetree, linux-kernel, linux-arm-kernel

Add dwmac glue driver to support the DesignWare-based GMAC controllers
in the Synaptics SL2610 SoC.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 MAINTAINERS                                   |   2 +
 drivers/net/ethernet/stmicro/stmmac/Kconfig   |  11 ++
 drivers/net/ethernet/stmicro/stmmac/Makefile  |   1 +
 .../net/ethernet/stmicro/stmmac/dwmac-syna.c  | 116 ++++++++++++++++++
 4 files changed, 130 insertions(+)
 create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwmac-syna.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 430758242906..dba0288bf4da 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3808,12 +3808,14 @@ M:	Jisheng Zhang <jszhang@kernel.org>
 M:	Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
 L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:	Maintained
+F:	Documentation/devicetree/bindings/net/syna,sl2610-dwmac.yaml
 F:	Documentation/devicetree/bindings/soc/synaptics/
 F:	arch/arm/boot/dts/synaptics/
 F:	arch/arm/mach-berlin/
 F:	arch/arm64/boot/dts/synaptics/
 F:	drivers/clk/berlin/*sl2610*
 F:	drivers/clk/berlin/sl-*
+F:	drivers/net/ethernet/stmicro/stmmac/dwmac-syna.c
 F:	drivers/pinctrl/berlin/pinctrl-sl2610.c
 F:	drivers/reset/reset-sl2610.c
 F:	drivers/soc/synaptics/
diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig
index c6559e749c0c..79ffebcaba0e 100644
--- a/drivers/net/ethernet/stmicro/stmmac/Kconfig
+++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig
@@ -310,6 +310,17 @@ config DWMAC_SUN55I
 	  stmmac device driver. This driver is used for A523/T527
 	  GMAC200 ethernet controller.
 
+config DWMAC_SYNA
+	tristate "Synaptics SL2610 DWMAC support"
+	depends on OF && HAS_DMA && (ARCH_BERLIN || COMPILE_TEST)
+	select MFD_SYSCON
+	help
+	  Support for the Synaptics SL2610 DesignWare Ethernet MAC glue.
+	  This configures the PHY interface through the system controller.
+
+	  To compile this driver as a module, choose M here. The module
+	  will be called dwmac-syna.
+
 config DWMAC_THEAD
 	tristate "T-HEAD dwmac support"
 	depends on OF && (ARCH_THEAD || COMPILE_TEST)
diff --git a/drivers/net/ethernet/stmicro/stmmac/Makefile b/drivers/net/ethernet/stmicro/stmmac/Makefile
index b16a456b730e..d132353e9403 100644
--- a/drivers/net/ethernet/stmicro/stmmac/Makefile
+++ b/drivers/net/ethernet/stmicro/stmmac/Makefile
@@ -35,6 +35,7 @@ obj-$(CONFIG_DWMAC_STM32)	+= dwmac-stm32.o
 obj-$(CONFIG_DWMAC_SUNXI)	+= dwmac-sunxi.o
 obj-$(CONFIG_DWMAC_SUN8I)	+= dwmac-sun8i.o
 obj-$(CONFIG_DWMAC_SUN55I)	+= dwmac-sun55i.o
+obj-$(CONFIG_DWMAC_SYNA)	+= dwmac-syna.o
 obj-$(CONFIG_DWMAC_THEAD)	+= dwmac-thead.o
 obj-$(CONFIG_DWMAC_ULTRARISC)	+= dwmac-ultrarisc.o
 obj-$(CONFIG_DWMAC_DWC_QOS_ETH)	+= dwmac-dwc-qos-eth.o
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-syna.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-syna.c
new file mode 100644
index 000000000000..c4bc895b29da
--- /dev/null
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-syna.c
@@ -0,0 +1,116 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Synaptics DWMAC platform driver
+ *
+ * Copyright (C) 2026 Jisheng Zhang <jszhang@kernel.org>
+ *
+ */
+
+#include <linux/bitfield.h>
+#include <linux/module.h>
+#include <linux/mfd/syscon.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
+#include <linux/of_net.h>
+#include <linux/platform_device.h>
+#include <linux/regmap.h>
+
+#include "stmmac_platform.h"
+
+#define CTL_PHY_INTF_SEL	GENMASK(4, 1)
+#define CTL_PHY_INTF_RGMII	FIELD_PREP(CTL_PHY_INTF_SEL, 1)
+#define CTL_PHY_INTF_RMII	FIELD_PREP(CTL_PHY_INTF_SEL, 4)
+
+struct syna_dwmac {
+	struct plat_stmmacenet_data *plat;
+	struct regmap *regmap;
+	u32 rgmii_ctl;
+	struct device *dev;
+};
+
+static int syna_dwmac_set_phy_if(struct plat_stmmacenet_data *plat)
+{
+	struct syna_dwmac *dwmac = plat->bsp_priv;
+	u32 phyif;
+
+	switch (plat->phy_interface) {
+	case PHY_INTERFACE_MODE_RMII:
+		phyif = CTL_PHY_INTF_RMII;
+		break;
+	case PHY_INTERFACE_MODE_RGMII:
+	case PHY_INTERFACE_MODE_RGMII_ID:
+	case PHY_INTERFACE_MODE_RGMII_TXID:
+	case PHY_INTERFACE_MODE_RGMII_RXID:
+		phyif = CTL_PHY_INTF_RGMII;
+		break;
+	default:
+		dev_err(dwmac->dev, "unsupported phy interface %s\n",
+			phy_modes(plat->phy_interface));
+		return -EINVAL;
+	}
+
+	return regmap_update_bits(dwmac->regmap, dwmac->rgmii_ctl, CTL_PHY_INTF_SEL, phyif);
+}
+
+static int syna_dwmac_init(struct device *dev, void *priv)
+{
+	struct syna_dwmac *dwmac = priv;
+
+	return syna_dwmac_set_phy_if(dwmac->plat);
+}
+
+static int syna_dwmac_probe(struct platform_device *pdev)
+{
+	struct stmmac_resources stmmac_res;
+	struct plat_stmmacenet_data *plat;
+	struct syna_dwmac *dwmac;
+	int ret;
+
+	ret = stmmac_get_platform_resources(pdev, &stmmac_res);
+	if (ret)
+		return dev_err_probe(&pdev->dev, ret,
+				     "failed to get resources\n");
+
+	plat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac);
+	if (IS_ERR(plat))
+		return dev_err_probe(&pdev->dev, PTR_ERR(plat),
+				     "dt configuration failed\n");
+
+	dwmac = devm_kzalloc(&pdev->dev, sizeof(*dwmac), GFP_KERNEL);
+	if (!dwmac)
+		return -ENOMEM;
+
+	dwmac->regmap = syscon_regmap_lookup_by_phandle_args(pdev->dev.of_node,
+							     "syna,syscon", 1,
+							     &dwmac->rgmii_ctl);
+	if (IS_ERR(dwmac->regmap))
+		return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->regmap),
+				     "Failed to get syscon regmap\n");
+
+	dwmac->dev = &pdev->dev;
+	dwmac->plat = plat;
+	plat->bsp_priv = dwmac;
+	plat->init = syna_dwmac_init;
+
+	return devm_stmmac_pltfr_probe(pdev, plat, &stmmac_res);
+}
+
+static const struct of_device_id syna_dwmac_match[] = {
+	{ .compatible = "syna,sl2610-dwmac" },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, syna_dwmac_match);
+
+static struct platform_driver syna_dwmac_driver = {
+	.probe = syna_dwmac_probe,
+	.driver = {
+		.name = "syna-dwmac",
+		.pm = &stmmac_pltfr_pm_ops,
+		.of_match_table = syna_dwmac_match,
+	},
+};
+module_platform_driver(syna_dwmac_driver);
+
+MODULE_AUTHOR("Jisheng Zhang <jszhang@kernel.org>");
+MODULE_DESCRIPTION("Synaptics DWMAC platform driver");
+MODULE_LICENSE("GPL");
-- 
2.55.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 5/8] dt-bindings: soc: synaptics: Allow SL2610 mux controller children
  2026-11-16 13:54 [PATCH 0/8] net: stmmac: add SL2610 ethernet support Jisheng Zhang
                   ` (3 preceding siblings ...)
  2026-11-16 13:54 ` [PATCH 4/8] net: stmmac: Add glue layer for Synaptics SL2610 SoC Jisheng Zhang
@ 2026-11-16 13:54 ` Jisheng Zhang
  2026-11-16 13:54 ` [PATCH 6/8] soc: synaptics: Populate SL2610 system controller DT children Jisheng Zhang
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Jisheng Zhang @ 2026-11-16 13:54 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Sebastian Hesselbarth,
	Maxime Chevallier, Maxime Coquelin, Alexandre Torgue
  Cc: netdev, devicetree, linux-kernel, linux-arm-kernel

The SL2610 system controller includes selector fields for routing shared
peripheral signals. Allow a mux-controller child using the register mux
binding and show the shared MDIO master selector in the example.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Assisted-by: LLM
---
 .../bindings/soc/synaptics/syna,sl2610-soc-syscon.yaml | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-soc-syscon.yaml b/Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-soc-syscon.yaml
index cdf947cb3e0f..b53a62bf73ae 100644
--- a/Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-soc-syscon.yaml
+++ b/Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-soc-syscon.yaml
@@ -45,6 +45,10 @@ properties:
     $ref: /schemas/types.yaml#/definitions/phandle
     description: Phandle to the SoC system control registers for CPU PLL bypass.
 
+  mux-controller:
+    $ref: /schemas/mux/reg-mux.yaml#
+    description: Selector fields in the system control registers.
+
 patternProperties:
   '-(pmux|pins)$':
     type: object
@@ -136,6 +140,12 @@ examples:
         #clock-cells = <1>;
         #reset-cells = <1>;
 
+        mux-controller {
+            compatible = "mmio-mux";
+            #mux-control-cells = <1>;
+            mux-reg-masks = <0xa04 0x10>;
+        };
+
         i2c2-pmux {
             groups = "GPIO23", "GPIO24";
             function = "tw2";
-- 
2.55.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 6/8] soc: synaptics: Populate SL2610 system controller DT children
  2026-11-16 13:54 [PATCH 0/8] net: stmmac: add SL2610 ethernet support Jisheng Zhang
                   ` (4 preceding siblings ...)
  2026-11-16 13:54 ` [PATCH 5/8] dt-bindings: soc: synaptics: Allow SL2610 mux controller children Jisheng Zhang
@ 2026-11-16 13:54 ` Jisheng Zhang
  2026-11-16 13:54 ` [PATCH 7/8] arm64: dts: synaptics: Add SL2610 Ethernet nodes Jisheng Zhang
  2026-11-16 13:54 ` [PATCH 8/8] arm64: dts: synaptics: Enable Ethernet on SL2619 RDK Jisheng Zhang
  7 siblings, 0 replies; 10+ messages in thread
From: Jisheng Zhang @ 2026-11-16 13:54 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Sebastian Hesselbarth,
	Maxime Chevallier, Maxime Coquelin, Alexandre Torgue
  Cc: netdev, devicetree, linux-kernel, linux-arm-kernel

The SL2610 system controller currently creates only its fixed clock,
reset and pinctrl MFD devices. DT children such as the MDIO mmio-mux
therefore never become platform devices, leaving their consumers in
deferred probe indefinitely.

Populate enabled DT children after adding the MFD devices. Use the
managed helper to remove these children before the MFD devices during
teardown and probe-error cleanup.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Assisted-by: LLM
---
 drivers/soc/synaptics/sl2610-syscon.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/soc/synaptics/sl2610-syscon.c b/drivers/soc/synaptics/sl2610-syscon.c
index c6fc2955ac0d..b7965f4bb963 100644
--- a/drivers/soc/synaptics/sl2610-syscon.c
+++ b/drivers/soc/synaptics/sl2610-syscon.c
@@ -6,6 +6,7 @@
 #include <linux/mfd/core.h>
 #include <linux/module.h>
 #include <linux/of.h>
+#include <linux/of_platform.h>
 #include <linux/platform_device.h>
 
 struct sl2610_syscon_data {
@@ -56,9 +57,14 @@ static const struct sl2610_syscon_data sl2610_cpu_data = {
 static int sl2610_syscon_probe(struct platform_device *pdev)
 {
 	const struct sl2610_syscon_data *data = device_get_match_data(&pdev->dev);
+	int ret;
 
-	return devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO,
-				    data->cells, data->num_cells, NULL, 0, NULL);
+	ret = devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO,
+				   data->cells, data->num_cells, NULL, 0, NULL);
+	if (ret)
+		return ret;
+
+	return devm_of_platform_populate(&pdev->dev);
 }
 
 static const struct of_device_id sl2610_syscon_of_match[] = {
-- 
2.55.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 7/8] arm64: dts: synaptics: Add SL2610 Ethernet nodes
  2026-11-16 13:54 [PATCH 0/8] net: stmmac: add SL2610 ethernet support Jisheng Zhang
                   ` (5 preceding siblings ...)
  2026-11-16 13:54 ` [PATCH 6/8] soc: synaptics: Populate SL2610 system controller DT children Jisheng Zhang
@ 2026-11-16 13:54 ` Jisheng Zhang
  2026-11-16 13:54 ` [PATCH 8/8] arm64: dts: synaptics: Enable Ethernet on SL2619 RDK Jisheng Zhang
  7 siblings, 0 replies; 10+ messages in thread
From: Jisheng Zhang @ 2026-11-16 13:54 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Sebastian Hesselbarth,
	Maxime Chevallier, Maxime Coquelin, Alexandre Torgue
  Cc: netdev, devicetree, linux-kernel, linux-arm-kernel

Add the first DWMAC controller in the common SL2611 dtsi, then add
the second controller for SL2619, including interrupts, clocks, PHY
interface control offsets, queues and AXI burst configuration.

Add the shared MDIO master selector as an mmio-mux child of the global
system controller. Leave the MACs and selector disabled for boards to
enable according to their wiring.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 arch/arm64/boot/dts/synaptics/sl2611.dtsi | 41 +++++++++++++++++++++++
 arch/arm64/boot/dts/synaptics/sl2619.dtsi | 36 ++++++++++++++++++++
 2 files changed, 77 insertions(+)

diff --git a/arch/arm64/boot/dts/synaptics/sl2611.dtsi b/arch/arm64/boot/dts/synaptics/sl2611.dtsi
index 663fe6034ba0..f6e2ce21ed19 100644
--- a/arch/arm64/boot/dts/synaptics/sl2611.dtsi
+++ b/arch/arm64/boot/dts/synaptics/sl2611.dtsi
@@ -281,12 +281,53 @@ aioclk: aviogbl: syscon@f7490000 {
 			clocks = <&osc>;
 		};
 
+		ethernet0: ethernet@f7a04000 {
+			compatible = "syna,sl2610-dwmac", "snps,dwmac-5.20";
+			reg = <0xf7a04000 0x2000>;
+			interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "macirq";
+			clocks = <&clk CLK_GETHRGMII>,
+				 <&clk CLK_GETHRGMIISYS>, <&clk CLK_GE0_PTP_REF>;
+			clock-names = "stmmaceth", "pclk", "ptp_ref";
+			snps,axi-config = <&stmmac_axi_config_0>;
+			snps,mixed-burst;
+			snps,mtl-rx-config = <&mtl_rx_setup_0>;
+			snps,mtl-tx-config = <&mtl_tx_setup_0>;
+			snps,pbl = <32>;
+			syna,syscon = <&chip 0xa18>;
+			status = "disabled";
+
+			mtl_rx_setup_0: rx-queues-config {
+				snps,rx-queues-to-use = <1>;
+				queue0 {};
+			};
+
+			mtl_tx_setup_0: tx-queues-config {
+				snps,tx-queues-to-use = <2>;
+				queue0 {};
+				queue1 {};
+			};
+
+			stmmac_axi_config_0: stmmac-axi-config {
+				snps,blen = <256 128 64 32 0 0 0>;
+				snps,rd_osr_lmt = <0x7>;
+				snps,wr_osr_lmt = <0x7>;
+			};
+		};
+
 		clk: pinctrl: rst: chip: syscon@f7e10000 {
 			compatible = "syna,sl2610-soc-syscon", "syscon";
 			reg = <0xf7e10000 0x10000>;
 			#clock-cells = <1>;
 			#reset-cells = <1>;
 			clocks = <&osc>;
+
+			mux1: mux-controller {
+				compatible = "mmio-mux";
+				#mux-control-cells = <1>;
+				mux-reg-masks = <0xa04 0x10>;
+				status = "disabled";
+			};
 		};
 
 		cpuclk: cpu_wrap: syscon@f7e30000 {
diff --git a/arch/arm64/boot/dts/synaptics/sl2619.dtsi b/arch/arm64/boot/dts/synaptics/sl2619.dtsi
index 96bd58bbed3e..57933a9aba28 100644
--- a/arch/arm64/boot/dts/synaptics/sl2619.dtsi
+++ b/arch/arm64/boot/dts/synaptics/sl2619.dtsi
@@ -41,4 +41,40 @@ pmu {
 		interrupt-affinity = <&cpu0>,
 				     <&cpu1>;
 	};
+
+	soc {
+		ethernet1: ethernet@f7a06000 {
+			compatible = "syna,sl2610-dwmac", "snps,dwmac-5.20";
+			reg = <0xf7a06000 0x2000>;
+			interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "macirq";
+			clocks = <&clk CLK_GETHRGMII1>,
+				 <&clk CLK_GETHRGMII1SYS>, <&clk CLK_GE1_PTP_REF>;
+			clock-names = "stmmaceth", "pclk", "ptp_ref";
+			snps,axi-config = <&stmmac_axi_config_1>;
+			snps,mixed-burst;
+			snps,mtl-rx-config = <&mtl_rx_setup_1>;
+			snps,mtl-tx-config = <&mtl_tx_setup_1>;
+			snps,pbl = <32>;
+			syna,syscon = <&chip 0xa3c>;
+			status = "disabled";
+
+			mtl_rx_setup_1: rx-queues-config {
+				snps,rx-queues-to-use = <1>;
+				queue0 {};
+			};
+
+			mtl_tx_setup_1: tx-queues-config {
+				snps,tx-queues-to-use = <2>;
+				queue0 {};
+				queue1 {};
+			};
+
+			stmmac_axi_config_1: stmmac-axi-config {
+				snps,blen = <256 128 64 32 0 0 0>;
+				snps,rd_osr_lmt = <0x7>;
+				snps,wr_osr_lmt = <0x7>;
+			};
+		};
+	};
 };
-- 
2.55.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 8/8] arm64: dts: synaptics: Enable Ethernet on SL2619 RDK
  2026-11-16 13:54 [PATCH 0/8] net: stmmac: add SL2610 ethernet support Jisheng Zhang
                   ` (6 preceding siblings ...)
  2026-11-16 13:54 ` [PATCH 7/8] arm64: dts: synaptics: Add SL2610 Ethernet nodes Jisheng Zhang
@ 2026-11-16 13:54 ` Jisheng Zhang
  7 siblings, 0 replies; 10+ messages in thread
From: Jisheng Zhang @ 2026-11-16 13:54 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Sebastian Hesselbarth,
	Maxime Chevallier, Maxime Coquelin, Alexandre Torgue
  Cc: netdev, devicetree, linux-kernel, linux-arm-kernel

The SL2619 RDK uses the second MAC with an external RGMII PHY at MDIO
address 2. Enable the MAC, its pin configuration and the shared MDIO
selector. Describe the PHY reset GPIO and timing on the demultiplexed
bus selecting the second MDIO master.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 arch/arm64/boot/dts/synaptics/sl2619-rdk.dts | 77 ++++++++++++++++++++
 1 file changed, 77 insertions(+)

diff --git a/arch/arm64/boot/dts/synaptics/sl2619-rdk.dts b/arch/arm64/boot/dts/synaptics/sl2619-rdk.dts
index 58901ac2a050..d10811e8436a 100644
--- a/arch/arm64/boot/dts/synaptics/sl2619-rdk.dts
+++ b/arch/arm64/boot/dts/synaptics/sl2619-rdk.dts
@@ -13,4 +13,81 @@
 / {
 	model = "Synaptics SL2619 RDK";
 	compatible = "syna,sl2619-rdk", "syna,sl2619";
+
+	aliases {
+		ethernet0 = &ethernet1;
+		ethernet1 = &ethernet0;
+	};
+
+	mdio-demux {
+		compatible = "mdio-demux";
+		mdio-parent-bus = <&mdio1>;
+		mux-controls = <&mux1 0>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		mdio@1 {
+			reg = <0x1>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			ethernet_phy1: ethernet-phy@2 {
+				compatible = "ethernet-phy-id001c.c916";
+				reg = <2>;
+				pinctrl-0 = <&eth1_phy_rst_pmux>;
+				pinctrl-names = "default";
+				realtek,clkout-disable;
+				reset-assert-us = <20000>;
+				reset-deassert-us = <100000>;
+				reset-gpios = <&portf 3 GPIO_ACTIVE_HIGH>;
+			};
+		};
+	};
+};
+
+&sm_pinctrl {
+	eth1_phy_rst_pmux: eth1_phy_rst-pmux {
+		groups = "SM_GPIO35";
+		function = "gpio";
+	};
+};
+
+&pinctrl {
+	eth_mdio_pmux: eth-mdio-pmux {
+		groups = "GPIO31", "GPIO32";
+		function = "rgmii";
+		drive-strength = <7>;
+	};
+
+	eth1_tx_pmux: eth1_tx-pmux {
+		groups = "GPIO48", "GPIO49", "GPIO50", "GPIO51", "GPIO57", "GPIO58";
+		function = "rgmii2";
+		drive-strength = <10>;
+		input-disable;
+		bias-disable;
+	};
+
+	eth1_rx_pmux: eth1_rx-pmux {
+		groups = "GPIO52", "GPIO53", "GPIO54", "GPIO55", "GPIO56", "GPIO59";
+		function = "rgmii2";
+		drive-strength = <7>;
+	};
+};
+
+&mux1 {
+	status = "okay";
+};
+
+&ethernet1 {
+	status = "okay";
+	pinctrl-0 = <&eth_mdio_pmux>, <&eth1_tx_pmux>, <&eth1_rx_pmux>;
+	pinctrl-names = "default";
+	phy-handle = <&ethernet_phy1>;
+	phy-mode = "rgmii-id";
+
+	mdio1: mdio {
+		compatible = "snps,dwmac-mdio";
+		#address-cells = <1>;
+		#size-cells = <0>;
+	};
 };
-- 
2.55.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/8] dt-bindings: net: Add MDIO demultiplexer
  2026-11-16 13:54 ` [PATCH 1/8] dt-bindings: net: Add MDIO demultiplexer Jisheng Zhang
@ 2026-11-16 15:06   ` Andrew Lunn
  0 siblings, 0 replies; 10+ messages in thread
From: Andrew Lunn @ 2026-11-16 15:06 UTC (permalink / raw)
  To: Jisheng Zhang
  Cc: Heiner Kallweit, Russell King, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Sebastian Hesselbarth, Maxime Chevallier,
	Maxime Coquelin, Alexandre Torgue, netdev, devicetree,
	linux-kernel, linux-arm-kernel

On Mon, Nov 16, 2026 at 09:54:35PM +0800, Jisheng Zhang wrote:
> Assume we have the following implementation:
>           ----------
>           |mmio reg|
> 	  ----------
>              |
>  --------    |      -------
>  | MAC0 |--MDIO-----| PHY |
>  -------- |     |   -------
>           |     |
>  -------- |     |   -------
>  | MAC1 |--     ----| PHY |
>  --------           -------
> 
> Both MAC0 and MAC1 have MDIO bus masters, and tie together to
> a single set of clock and data lines, which go to some PHYs. While
> there's a mmio reg to control which MAC mdio master can operate
> the single mdio clock and data lines, so only one MAC can operate
> the mdio clock and data lines.

How does this differ from pinmux?

    Andrew

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-11-16 15:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-16 13:54 [PATCH 0/8] net: stmmac: add SL2610 ethernet support Jisheng Zhang
2026-11-16 13:54 ` [PATCH 1/8] dt-bindings: net: Add MDIO demultiplexer Jisheng Zhang
2026-11-16 15:06   ` Andrew Lunn
2026-11-16 13:54 ` [PATCH 2/8] net: mdio: Add MDIO demultiplexer driver Jisheng Zhang
2026-11-16 13:54 ` [PATCH 3/8] dt-bindings: net: Add Synaptics SL2610 DWMAC Jisheng Zhang
2026-11-16 13:54 ` [PATCH 4/8] net: stmmac: Add glue layer for Synaptics SL2610 SoC Jisheng Zhang
2026-11-16 13:54 ` [PATCH 5/8] dt-bindings: soc: synaptics: Allow SL2610 mux controller children Jisheng Zhang
2026-11-16 13:54 ` [PATCH 6/8] soc: synaptics: Populate SL2610 system controller DT children Jisheng Zhang
2026-11-16 13:54 ` [PATCH 7/8] arm64: dts: synaptics: Add SL2610 Ethernet nodes Jisheng Zhang
2026-11-16 13:54 ` [PATCH 8/8] arm64: dts: synaptics: Enable Ethernet on SL2619 RDK Jisheng Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®