[PATCH 1/8] dt-bindings: net: Add MDIO demultiplexer

From: Jisheng Zhang

Date: Mon Nov 16 2026 - 09:15:24 EST


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@xxxxxxxxxx>
---
.../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@xxxxxxx>
+
+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