Article View: linux.kernel.netdev
Article #17240[PATCH 1/8] dt-bindings: net: Add MDIO demultiplexer
From: Jisheng Zhang
Date: Mon, 16 Nov 2026 13:54
Date: Mon, 16 Nov 2026 13:54
143 lines
11378 bytes
11378 bytes
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
Technical Details
Message-ID:
<20261116135442.4827-2-jszhang@kernel.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364425-linux-kernel-netdev=dewy.ruReferences:
<20261116135442.4827-1-jszhang@kernel.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364425-linux-kernel-netdev=dewy.ru From: jszhang@kernel.org (Jisheng Zhang) Newsgroups: linux.kernel.netdev Subject: [PATCH 1/8] dt-bindings: net: Add MDIO demultiplexer Date: Mon, 16 Nov 2026 21:54:35 +0800 Organization: Usenet Network Message-ID: <20261116135442.4827-2-jszhang@kernel.org> References: <20261116135442.4827-1-jszhang@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2082935"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:LGV45684KdhVkwxoF7mFRlNd9fE= sha256:XpcdcO9PiKiaH0TWNh+PGjh+goMD5gbVJaA6iMxfPkE= sha1:x9TWOeu8plPzWlHUu4M8q3egO6k= sha256:fg+RqFL417XWfV5fYrQpkVm5ucc8kROuo0+FLYUi1AU= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 2EBDC114C6A; Mon, 16 Nov 2026 17:15:24 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VHJHx5jCq-yK; Mon, 16 Nov 2026 17:15:19 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-364425-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 8B883114C12; Mon, 16 Nov 2026 17:15:11 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id D53EF39DC4; Mon, 16 Nov 2026 14:15:07 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794838507; b=WBcPWdTBr0JHatiwfsS3cUNeVxr64ZlgCew133wKvw/5LGqyU/Pk+jVqNK6jhBx5WBaZ zV6rCqPeiTdr2TKolAkfoPQWG5GNrV5PaUQUUtXjg3+sxKc0EgVVUF+3Bhq0EZcOTAFPh L6XTxNuySueMqM4gvr030W3AAhsVHEZ1snIb9uE6ZvtIyU1LRBrlcyVyr+CPLSJ0kZpxf DF6JVEPTqx/nnfBcaMY7latJO/HD9TL88M33lH5TI2hoBvTqcfcagNLxtjhahx50VPkA3 bFqXPDXyk2Aru7zy8fzQ5JJm3ZCghkFb8AR2xpLnfr7OxllJpjgsC4AYeweGiH2t1Ng== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794838507; h=X-Original-To:Received:Received:DKIM-Signature:From:To:Cc:Subject: Date:Message-ID:X-Mailer:In-Reply-To:References:X-Mailing-List: List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe: List-Owner:Precedence:MIME-Version:Content-Transfer-Encoding; bh=c6Vm071a/dEow9zT0/S+8fxSEB7JBU9lM9yuxvjQ8wU=; b=aVAKPbifhQ1SgIckIYCuuQDtE4gABvMM3U4h8tTvIqmHhDQLH2r7rvqz4JhnymL3RCvM GFQTU9OoM9tEEgKWoXnZkmwShfUg/F31EZ+QOcz5sf1fi/hHG8SYp9ThWQIKy3OGQ0nfL ThygZzoJ2WT8694A1qTO/p9p0ZJQtOhE9R0uGTtKlAWTTmBvCFwEsrx0Xg0lUeK8rKc2/ 9OVoqQjSM4gEFvIDzrSWe8gtX7pD1Z/89ViJu0ICSTqhYWL/A1jSL2+yZjkgjgz3YrQQ1 f6QlVRmfa3mJmA/ScYxcZD3EjJhpprynxEwvaw1u/OVOl2mAN/ZFJp84WNzeRLqIusw== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=l80TddO1; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 47B67606A333; Mon, 16 Nov 2026 14:15:07 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=l80TddO1 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794838506; b=MQL2r1nv1oMOt9yQZJRPY4Mal3QWiJfD1CypL9+ImBcxuH24pnTQHcz7nB/X071JPpWm V3tXaL132ar+Bx8Su3rpyNWzynjp/pi0ksy56DkKT37Wyk2Y0A1P5NkTdpl9K4zjXKRON gRpa+xdqTZx6yTq769dyolaK2tYSKLa8aCTGFPuE0wmCYDOoofXCDtRXlURs/LOahGLxk ZUP3vsPRY3YmptjKFkCs31IWyBbNVgWXb+KQgQjPGtDxIPLCMnp6LcIxnzP760G488BsI KopEighCMvHeP6sWr9rdIHQls0qB3NFQDIBFsFqti13COHCfmJWnZEskDBAtHW1rMIg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794838506; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=c6Vm071a/dEow9zT0/S+8fxSEB7JBU9lM9yuxvjQ8wU=; b=Id70G3x/R7xWrOrMnlzZsK21u2eWfEwMwmDwtqXJu9bBD/esHthvb+gGHRHOrgA/vGux +th8P88g+8AYH4uKuMyToWL1a8cDsQr4pX+5dfBVt/ZdAF+FQbKMMlqzva/9KEJjAiU0P x/whdEe5VW6IeA7IlIhW8kz1CQJHEdt5bRlAl967nLcTD8Y9LEP6wnxGPPzPJAxNaIZz3 6lrKIx3aHWO2rry/SFqD67PYIjipTAiJ0Y6HoIDlsEZm0jvR5AfQcp3YZpdxFXQedbVyX s2zUCRPX6l2LHf5/PdGgyxdjyLheKW6Nf+svSyG/9RwdvZjzvtWmjy18wfx5sq4qfUA== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=l80TddO1; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 66373606A32C; Mon, 16 Nov 2026 14:15:06 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 808D21F000C5; Mon, 16 Nov 2026 14:15:01 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794838506; bh=c6Vm071a/dEow9zT0/S+8fxSEB7JBU9lM9yuxvjQ8wU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=l80TddO1p8vGXVkYshQA/hjFCyQTxsuFEOL38ggGfle1Iu9oypXQQIMaGs4xHLlvc xmMh08EK3fW08igxmnfQuDBdBrl3CC/gn1x25vPIU7YR0NWL3nT3Oqitvux+jRhpHq xXs0VWU5daVMiPTSIG3wXfiDlV+F86sCh0A79n3VWtO9y8A1enW9RlxyZwf5nwihJv 2lpf06/GsNQJ1Vt5PfjIBhsLpqnEzQl0bOq4pthbnrg/SaRQe0KZ0GNFl3jAjuwa8f q28pliaDPt6Vz8SU7xc0lYXt22GZLKu/niOpkJ3myrdpQ1gQPhgiBlDRE/ghbnWxOy CSbPw27IASDQA== X-Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-Mailer: git-send-email 2.55.0 X-In-Reply-To: <20261116135442.4827-1-jszhang@kernel.org> X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list