From: Christian Marangi <ansuelsmth@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
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>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org, netdev@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [net-next RFC PATCH v2 1/3] dt-bindings: net: dsa: Add Airoha AN8855 Gigabit Switch documentation
Date: Wed, 23 Oct 2024 19:45:39 +0200 [thread overview]
Message-ID: <67193647.5d0a0220.1b234f.2b09@mx.google.com> (raw)
In-Reply-To: <77e99052-a14e-4495-9197-06d98257c590@lunn.ch>
On Wed, Oct 23, 2024 at 07:39:01PM +0200, Andrew Lunn wrote:
> > Well the first case that comes to mind is multiple switch and conflict.
> > I have no idea if there are hw strap to configure this so I assume if a
> > SoC have 2 switch (maybe of the same type), this permits to configure
> > them (with reset pin and deasserting them once the base address is
> > correctly configured)
>
> Is this switch internal on an internal MDIO bus, or external?
External so it can be mounted on any SoC given correct mdio/mdc.
>
> Most PHYs and switches i've seen have strapping pins to set the base
> address. It would be unusual if there was not strapping.
Same feeling, but I didn't found anything in the documentation.
(actually no mention of hw strap or pin)
>
> For the Marvell switches, the strapping moves all the MDIO
> registers. This is why we have a reg at the top level in mv88e6xxx:
>
> ethernet-switch@0 {
> compatible = "marvell,mv88e6085";
> reg = <0>;
>
> There is one family which use the values of 0 or 16, and each switch
> uses 16 addresses. So you can put two on the bus.
>
Yes this is what that property does. Everything is shifted.
> > > > + mdio:
> > > > + $ref: /schemas/net/mdio.yaml#
> > > > + unevaluatedProperties: false
> > > > + description:
> > > > + Define the relative address of the internal PHY for each port.
> > > > +
> > > > + Each reg for the PHY is relative to the switch base PHY address.
> > >
> > > Which is not the usual meaning of reg.
> > >
> > > > + mdio {
> > > > + #address-cells = <1>;
> > > > + #size-cells = <0>;
> > > > +
> > > > + internal_phy0: phy@0 {
> > > > + reg = <0>;
> > >
> > > So given that airoha,base_smi_address defaults to 1, this is actually
> > > address 1 on the MDIO bus?
> > >
> >
> > Yes correct. One problem I had was that moving this outside the swich
> > cause panic as it does conflict with the switch PHY address...
>
> I would make these addresses absolute, not relative. The example above
> from the marvell switch, the device using addresses 16-31 has its PHYs
> within that range, and we uses the absolute reg values.
>
They were relative with the base SMI implementation in mind (as we would
then offset) If the path is to drop that option then yes, these address
should be absolute.
Or do you think even with that option, these address should be absolute?
--
Ansuel
next prev parent reply other threads:[~2024-10-23 17:45 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-23 16:19 [net-next RFC PATCH v2 0/3] net: dsa: Add Airoha AN8855 support Christian Marangi
2024-10-23 16:19 ` [net-next RFC PATCH v2 1/3] dt-bindings: net: dsa: Add Airoha AN8855 Gigabit Switch documentation Christian Marangi
2024-10-23 17:08 ` Andrew Lunn
2024-10-23 17:14 ` Christian Marangi
2024-10-23 17:39 ` Andrew Lunn
2024-10-23 17:45 ` Christian Marangi [this message]
2024-10-24 15:23 ` Rob Herring
2024-10-23 16:19 ` [net-next RFC PATCH v2 2/3] net: dsa: Add Airoha AN8855 5-Port Gigabit DSA Switch driver Christian Marangi
2024-10-23 16:19 ` [net-next RFC PATCH v2 3/3] net: phy: Add Airoha AN8855 Internal Switch Gigabit PHY Christian Marangi
2024-10-23 16:53 ` Andrew Lunn
2024-10-25 10:59 ` Christian Marangi
2024-10-25 12:56 ` Andrew Lunn
2024-10-23 17:00 ` Andrew Lunn
2024-10-23 17:07 ` Christian Marangi
2024-10-25 11:01 ` Christian Marangi
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=67193647.5d0a0220.1b234f.2b09@mx.google.com \
--to=ansuelsmth@gmail.com \
--cc=andrew@lunn.ch \
--cc=angelogioacchino.delregno@collabora.com \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.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-mediatek@lists.infradead.org \
--cc=linux@armlinux.org.uk \
--cc=matthias.bgg@gmail.com \
--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;
as well as URLs for NNTP newsgroup(s).