Netdev List
 help / color / mirror / Atom feed
From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: davem@davemloft.net, "Andrew Lunn" <andrew+netdev@lunn.ch>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Eric Dumazet" <edumazet@kernel.org>,
	"Willem de Bruijn" <willemb@google.com>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Russell King" <linux@armlinux.org.uk>,
	"Marek Behún" <kabel@kernel.org>,
	"Sebastian Hesselbarth" <sebastian.hesselbarth@gmail.com>,
	"Gregory Clement" <gregory.clement@bootlin.com>,
	"Heiner Kallweit" <hkallweit1@gmail.com>
Cc: "Maxime Chevallier" <maxime.chevallier@bootlin.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	thomas.petazzoni@bootlin.com, devicetree@vger.kernel.org,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Christophe Leroy" <christophe.leroy@csgroup.eu>,
	"Herve Codina" <herve.codina@bootlin.com>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"Vladimir Oltean" <vladimir.oltean@nxp.com>,
	"Köry Maincent" <kory.maincent@bootlin.com>,
	"Oleksij Rempel" <o.rempel@pengutronix.de>,
	"Nicolò Veronese" <nicveronese@gmail.com>,
	"Simon Horman" <horms@kernel.org>,
	marcin.s.wojtas@gmail.com, "Daniel Golle" <daniel@makrotopia.org>,
	"Dimitri Fedrau" <dimitri.fedrau@liebherr.com>,
	"Frank Wunderlich" <frank.wunderlich@linux.dev>,
	"Pietro Ameruoso" <p.ameruoso@live.it>,
	"Aleksei Sviridkin" <f@lex.la>
Subject: [PATCH net-next 12/12] ARM: dts: turris-omnia: Describe the WAN port multiplexer
Date: Fri,  4 Dec 2026 12:06:21 +0100	[thread overview]
Message-ID: <20261204110622.1106492-13-maxime.chevallier@bootlin.com> (raw)
In-Reply-To: <20261204110622.1106492-1-maxime.chevallier@bootlin.com>

The Turris Omnia's WAN port has a mux between the MAC and both an SFP
cage and a 88E1514 PHY. The mux is a high-speed analog switch (NXP
CBTL02042A), whose select line is driven by the cage's mod_def0 signal:
it switches to the cage as soon as a module is plugged.

We couldn't deal with that so far. The devicetree only describes the
PHY, and relies on the bootloader to enable the sfp node and drop the
phy-handle when a module is found at boot. Modules plugged or removed
later on aren't taken into account.

Now that we have a binding for these muxes, let's describe that one. The
sfp node is always enabled, and we follow the module at runtime.

Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
---
 .../dts/marvell/armada-385-turris-omnia.dts   | 29 ++++++++++++-------
 1 file changed, 18 insertions(+), 11 deletions(-)

diff --git a/arch/arm/boot/dts/marvell/armada-385-turris-omnia.dts b/arch/arm/boot/dts/marvell/armada-385-turris-omnia.dts
index 83fe00abd652..0501686e2642 100644
--- a/arch/arm/boot/dts/marvell/armada-385-turris-omnia.dts
+++ b/arch/arm/boot/dts/marvell/armada-385-turris-omnia.dts
@@ -103,13 +103,24 @@ sfp: sfp {
 		los-gpios = <&pcawan 3 GPIO_ACTIVE_HIGH>;
 		mod-def0-gpios = <&pcawan 4 GPIO_ACTIVE_LOW>;
 		maximum-power-milliwatt = <3000>;
+	};
 
-		/*
-		 * For now this has to be enabled at boot time by U-Boot when
-		 * a SFP module is present. Read more in the comment in the
-		 * eth2 node below.
-		 */
-		status = "disabled";
+	wan_mux: mii-mux {
+		compatible = "mii-mux-auto";
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		port@0 {
+			reg = <0>;
+			sfp = <&sfp>;
+			takes-precedence;
+		};
+
+		port@1 {
+			reg = <1>;
+			phy-handle = <&phy1>;
+			phy-mode = "sgmii";
+		};
 	};
 
 	gpio-keys {
@@ -199,16 +210,12 @@ &eth2 {
 	 * eth2 is connected via a multiplexor to both the SFP cage and to
 	 * ethernet-phy@1. The multiplexor switches the signal to SFP cage when
 	 * a SFP module is present, as determined by the mode-def0 GPIO.
-	 *
-	 * Until kernel supports this configuration properly, in case SFP module
-	 * is present, U-Boot has to enable the sfp node above, remove phy
-	 * handle and add managed = "in-band-status" property.
 	 */
 	status = "okay";
 	phy-mode = "sgmii";
 	phy-handle = <&phy1>;
+	mii-mux-handle = <&wan_mux>;
 	phys = <&comphy5 2>;
-	sfp = <&sfp>;
 	buffer-manager = <&bm>;
 	bm,pool-long = <2>;
 	bm,pool-short = <3>;
-- 
2.56.1


      parent reply	other threads:[~2026-12-04 11:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 11:06 [PATCH net-next 00/12] net: phy: Introduce MII multiplexers Maxime Chevallier
2026-12-04 11:06 ` [PATCH net-next 01/12] dt-bindings: net: Add Ethernet " Maxime Chevallier
2026-12-04 11:06 ` [PATCH net-next 02/12] net: phy: Introduce phy_mux, a MII multiplexer representation Maxime Chevallier
2026-12-04 11:06 ` [PATCH net-next 03/12] net: phy: Don't create the sysfs links for PHYs behind a mux Maxime Chevallier
2026-12-04 11:06 ` [PATCH net-next 04/12] net: phy: phy_mux: Allow attaching a mux to a net_device Maxime Chevallier
2026-12-04 11:06 ` [PATCH net-next 05/12] net: phy: phy_mux: Add port selection logic Maxime Chevallier
2026-12-04 11:06 ` [PATCH net-next 06/12] net: phy: phy_mux: Support SFP cage ports Maxime Chevallier
2026-12-04 11:06 ` [PATCH net-next 07/12] net: phylink: Factor out phylink_clear_phydev() Maxime Chevallier
2026-12-04 11:06 ` [PATCH net-next 08/12] net: phy: phy_mux: Add phy_mux_set_mac_managed_pm() Maxime Chevallier
2026-12-04 11:06 ` [PATCH net-next 09/12] net: phylink: Support PHYs reached through a phy_mux Maxime Chevallier
2026-12-04 11:06 ` [PATCH net-next 10/12] net: phylink: Support an SFP cage behind " Maxime Chevallier
2026-12-04 11:06 ` [PATCH net-next 11/12] net: phy: mux: Add the mii-mux-auto driver Maxime Chevallier
2026-12-04 11:06 ` Maxime Chevallier [this message]

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=20261204110622.1106492-13-maxime.chevallier@bootlin.com \
    --to=maxime.chevallier@bootlin.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=christophe.leroy@csgroup.eu \
    --cc=conor+dt@kernel.org \
    --cc=daniel@makrotopia.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=dimitri.fedrau@liebherr.com \
    --cc=edumazet@kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=f@lex.la \
    --cc=frank.wunderlich@linux.dev \
    --cc=gregory.clement@bootlin.com \
    --cc=herve.codina@bootlin.com \
    --cc=hkallweit1@gmail.com \
    --cc=horms@kernel.org \
    --cc=kabel@kernel.org \
    --cc=kory.maincent@bootlin.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=marcin.s.wojtas@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nicveronese@gmail.com \
    --cc=o.rempel@pengutronix.de \
    --cc=p.ameruoso@live.it \
    --cc=pabeni@redhat.com \
    --cc=robh@kernel.org \
    --cc=sebastian.hesselbarth@gmail.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=vladimir.oltean@nxp.com \
    --cc=willemb@google.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