mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jisheng Zhang <jszhang@kernel.org>
To: Andrew Lunn <andrew@lunn.ch>
Cc: 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>,
	netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/8] dt-bindings: net: Add MDIO demultiplexer
Date: Tue, 17 Nov 2026 23:55:08 +0800	[thread overview]
Message-ID: <avx43Nv-DJCX5_Rr@xhacker> (raw)
In-Reply-To: <6eb16cd9-27bd-4934-9621-b8928dce6902@lunn.ch>

On Tue, Nov 17, 2026 at 03:59:30PM +0100, Andrew Lunn wrote:
> On Tue, Nov 17, 2026 at 10:13:58PM +0800, Jisheng Zhang wrote:
> > On Tue, Nov 17, 2026 at 02:24:16PM +0100, Andrew Lunn wrote:
> > > On Tue, Nov 17, 2026 at 01:06:19PM +0800, Jisheng Zhang wrote:
> > > > On Mon, Nov 16, 2026 at 04:06:25PM +0100, Andrew Lunn wrote:
> > > > > 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?
> > > > > 
> > > > 
> > > > in my case, the two MAC MDIO bus masters share the same MDC and MDIO
> > > > pins.
> > > 
> > > That does not answer my question. How is this different to pinmux?
> > 
> > Let me explain the HW in details:
> > The pad have their own pinmux configuation, which selects the MDC/MDIO
> > fucntion instead of GPIO or another perif function. That pad
> > configuration stays MDC/MDIO, I.E unchanged.
> > 
> > The register discussed here is a separate selector between the two
> > MACs' MDIO controllers. With the pads already configured for MDC/MDIO,
> > it choose whether MAC0 or MAC1 drives the MDC and MDIO.
> > 
> > So the proposed demux controls this internal selector and serializes
> > selection plus the complete MDIO transaction across both MDIO
> > controllers.
> > 
> > Would you prefer model the selector as pinctrl states, with an MDIO
> > demux selecting the appropriate state under a shared lock before each
> > transaction?
> 
> Each transaction?
> 
> Are you proposing to use both MDIO bus master? Why? To the outside
> world, it is one MDIO bus, so you only need one active MDIO bus

Yep, both MDIO bus masters. I wanted to let each MAC uses its own
MDIO rather than disturbe another MAC for dual MACs case.
But now it looks like a over-designed solution.

> master. All the PHYs are then on that one bus.
> 
> I would let the DT pinctrl node connect one MDIO bus master to the
> outside world, and that is all you need.

What about coping with the selector in sl2610 stmmac glue layer? I.E
use the presence of the mdio child node to identify the provider.

For dual MACs case:

&ethernet0 {
	phy-phandle = <&phy0>;
};

&ethernet1 {
	phy-phandle = <&phy1>;

	mdio {
		...
		phy0: ethernet-phy@1 {
			reg = <1>;
			...
		};

		phy1: ethernet-phy@2 {
			reg = <2>;
			...
		};
	};
};

For single MAC case, it should be as simple as coding the selector
to let itself act as the provider.

This way looks simpler than modeling it as pinctrl. what do you think?

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

Thread overview: 17+ 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 ` [PATCH 1/8] dt-bindings: net: Add MDIO demultiplexer Jisheng Zhang
2026-11-16 15:06   ` Andrew Lunn
2026-11-17  5:06     ` Jisheng Zhang
2026-11-17 13:24       ` Andrew Lunn
2026-11-17 14:13         ` Jisheng Zhang
2026-11-17 14:59           ` Andrew Lunn
2026-11-17 15:55             ` Jisheng Zhang [this message]
2026-11-17 16:20               ` Andrew Lunn
2026-11-17 16:18                 ` Jisheng Zhang
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=avx43Nv-DJCX5_Rr@xhacker \
    --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

all inboxes | Powered by JetHome®