mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vasilij Strassheim <v.strassheim@linutronix.de>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Vladimir Oltean <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	 devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org,
	 Martin Kaistra <martin.kaistra@linutronix.de>,
	Benedikt Spranger <b.spranger@linutronix.de>
Subject: Re: [PATCH net-next v2 2/4] dt-bindings: net: dsa: Add SoC-e SWIP switch
Date: Tue, 15 Sep 2026 12:23:42 +0200	[thread overview]
Message-ID: <3c16a2c3a05761b06d51cd0375ba9f87eef277ea.camel@linutronix.de> (raw)
In-Reply-To: <ee045b16-978e-4208-b447-bb422a45dbf5@lunn.ch>

On Thu, 2026-09-10 at 14:12 +0200, Andrew Lunn wrote:
> > > Since this is an FPGA, i assume there are no internal PHYs. Mixed mode
> > > is not something FPGAs do. There are sometime "interesting"
> > > relationships between port number and address on the MDIO bus. But
> > > without internal PHYs you don't need to worry about this.
> > > 
> > 
> > Correct, the FPGA IP has no internal PHYs. Each port is associated with
> > a dedicated external MDIO bus.
> 
> How is a port and the MDIO bus associated?

I had to clarify a few details.
In the particular bitstream and board design I am using, MDIO is enabled
for every external switch port. Each external port therefore has its own
MDIO interface. This is what I meant by "associated". However, it's a
property of this FPGA configuration, not a general Linux requirement or
an inherent mapping for every instance of the IP core.

> 
> Linux, in general, does not care. You have a collection of MDIO
> busses, and on those busses you have a collection of PHYs. The MACs
> use a phandle, or some other means to point to the PHY it should use.
> 
> Given this is a 31 port switch, why would you dedicate 62 pins to
> MDIO, two per port, when you can put 32 PHYs on one MDIO bus?
> 
> So i doubt there is a strong association between port and MDIO bus.
> 
> What i could image is the one real MDIO bus controller is in global
> scope within the RTL design. And then the logic to provide a port with
> its multiplexor on that shared bus is in the per port RTL design
> scope. I've not done much FPGA design, but i assume if you don't
> connect the per port MDIO lines to anything, while place and route is
> performed, they get optimised out?


Yes, MDIO can be enabled per port when generating the bitstream. If it
is disabled for a port, the corresponding physical interface is not
generated, so your assumption about unused interfaces being omitted is
correct.
Linux will still model the topology in the usual way: the generated
interfaces are exposed as MDIO buses, and each switch port refers to its
PHY through a phy-handle. The bus selector identifies a generated MDIO
interface and should not generally be interpreted as a switch port
number.

> 
> > > So in theory, a 0 port switch is possible!
> > 
> > In theory, yes, but I prefer to treat it as invalid until it can be
> > tested.
> 
> Yes, i would treat 0, 1 and probably 2 as invalid. 2 ports would
> technically work in the DSA setup, but is pretty much pointless. It
> only gets interesting with 3 ports or more.

I will add an additional check and reject configurations with fewer than
3 ports.

> 
>      Andrew

Thanks,
Vasilij


  reply	other threads:[~2026-09-15 10:23 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-03 18:10 [PATCH net-next v2 0/4] net: dsa: Add SoC-e DSA driver Vasilij Strassheim
2026-09-03 18:10 ` [PATCH net-next v2 1/4] dt-bindings: vendor-prefixes: Add soce Vasilij Strassheim
2026-09-07  9:14   ` Krzysztof Kozlowski
2026-09-03 18:10 ` [PATCH net-next v2 2/4] dt-bindings: net: dsa: Add SoC-e SWIP switch Vasilij Strassheim
2026-09-07  9:21   ` Krzysztof Kozlowski
2026-09-07 14:01     ` Vasilij Strassheim
2026-09-07 18:56       ` Andrew Lunn
2026-09-08 10:16         ` Vasilij Strassheim
2026-09-08 10:29         ` Kurt Kanzenbach
2026-09-08  9:14       ` Krzysztof Kozlowski
2026-09-08 10:09         ` Vasilij Strassheim
2026-09-07 19:04   ` Andrew Lunn
2026-09-07 19:09     ` Andrew Lunn
2026-09-08 18:15     ` Vasilij Strassheim
2026-09-08 19:10       ` Andrew Lunn
2026-09-09 18:46         ` Vasilij Strassheim
2026-09-10 12:12           ` Andrew Lunn
2026-09-15 10:23             ` Vasilij Strassheim [this message]
2026-09-03 18:11 ` [PATCH net-next v2 3/4] net: dsa: Add tag handling for SoC-e switches Vasilij Strassheim
2026-09-09 12:12   ` netdev-bot+sashiko
2026-09-03 18:11 ` [PATCH net-next v2 4/4] net: dsa: soce: Add basic support for SoC-e switch IP cores Vasilij Strassheim
2026-09-07 19:28   ` Andrew Lunn
2026-09-08 18:44     ` Vasilij Strassheim
2026-09-08 19:20       ` Andrew Lunn
2026-09-09 19:28         ` Vasilij Strassheim
2026-09-10 12:18           ` Andrew Lunn
2026-09-15 10:48             ` Vasilij Strassheim
2026-09-15 12:52               ` Andrew Lunn
2026-09-08  0:37   ` Andrew Lunn
2026-09-10 13:01     ` Vasilij Strassheim
2026-09-10 15:07       ` Andrew Lunn
2026-09-11 13:39         ` Vasilij Strassheim
2026-09-08  8:25   ` Kurt Kanzenbach
2026-09-08 10:12     ` Vasilij Strassheim
2026-09-09 12:12   ` netdev-bot+sashiko
2026-09-15 11:23     ` Vasilij Strassheim
2026-09-15 12:56       ` Andrew Lunn
2026-09-15 18:12         ` Vasilij Strassheim
2026-09-07  9:10 ` [PATCH net-next v2 0/4] net: dsa: Add SoC-e DSA driver Krzysztof Kozlowski

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=3c16a2c3a05761b06d51cd0375ba9f87eef277ea.camel@linutronix.de \
    --to=v.strassheim@linutronix.de \
    --cc=andrew@lunn.ch \
    --cc=b.spranger@linutronix.de \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=martin.kaistra@linutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=robh@kernel.org \
    /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®