Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jisheng Zhang <jszhang@kernel.org>
To: Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
	Maxime Chevallier <maxime.chevallier@bootlin.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>
Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/8] dt-bindings: net: Add MDIO demultiplexer
Date: Mon, 16 Nov 2026 21:54:35 +0800	[thread overview]
Message-ID: <20261116135442.4827-2-jszhang@kernel.org> (raw)
In-Reply-To: <20261116135442.4827-1-jszhang@kernel.org>

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



  reply	other threads:[~2026-11-16 14:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 13:54 [PATCH 0/8] net: stmmac: add SL2610 ethernet support Jisheng Zhang
2026-11-16 13:54 ` Jisheng Zhang [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261116135442.4827-2-jszhang@kernel.org \
    --to=jszhang@kernel.org \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew@lunn.ch \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=maxime.chevallier@bootlin.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=robh@kernel.org \
    --cc=sebastian.hesselbarth@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox