From: Linus Walleij <linus.walleij@linaro.org>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: "Pali Rohár" <pali@kernel.org>,
"Enrico Mioso" <mrkiko.rs@gmail.com>,
"Robert Marko" <robert.marko@sartura.hr>,
"Russell King" <linux@armlinux.org.uk>,
"Chris Packham" <chris.packham@alliedtelesis.co.nz>,
"Andrew Lunn" <andrew@lunn.ch>,
"Gregory Clement" <gregory.clement@bootlin.com>,
"Sebastian Hesselbarth" <sebastian.hesselbarth@gmail.com>,
"Rob Herring" <robh+dt@kernel.org>,
"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Florian Fainelli" <f.fainelli@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Marek Behún" <kabel@kernel.org>,
"Christian Marangi" <ansuelsmth@gmail.com>,
linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH net-next v7 5/7] ARM64: dts: marvell: Fix some common switch mistakes
Date: Wed, 25 Oct 2023 22:56:38 +0200 [thread overview]
Message-ID: <CACRpkdaZYUxar8ESi6X7qLWJhuyRcFpYSF-70DvGdSn-rb7r6w@mail.gmail.com> (raw)
In-Reply-To: <CACRpkdb-4GPnVegc+OqyPaZN2rNCkgmNL4qjf-LGnnz27+EBbg@mail.gmail.com>
On Wed, Oct 25, 2023 at 9:48 PM Linus Walleij <linus.walleij@linaro.org> wrote:
> We *COULD* add a second over-specified compatible to the switch
> node. Such as:
>
> switch0@10 {
> compatible = "marvell,turris-mox-mv88e6190-switch",
> "marvell,mv88e6190";
>
> (and the same for the 6085 version)
>
> And use that to relax the requirement for that variant with an - if:
> statemement.
>
> This should work fine since U-Boot is only looking for nodenames, not
> compatible strings. I think I will try this approach.
This works. Compatibles added like such to the turris-mox nodes:
switch0@10 {
- compatible = "marvell,mv88e6190";
+ compatible = "marvell,turris-mox-mv88e6190",
"marvell,mv88e6190";
The mv88e6xxx schema will look like so:
properties:
compatible:
+ oneOf:
+ - enum:
+ - marvell,mv88e6085
+ - marvell,mv88e6190
+ - marvell,mv88e6250
(...)
+ - items:
+ - const: marvell,turris-mox-mv88e6085
+ - const: marvell,mv88e6085
+ - items:
+ - const: marvell,turris-mox-mv88e6190
+ - const: marvell,mv88e6190
Then ethernet-switch.yaml gets this:
-properties:
- $nodename:
- pattern: "^(ethernet-)?switch(@.*)?$"
+allOf:
+ # This condition is here to satisfy the case where certain device
+ # nodes have to preserve non-standard names because of
+ # backward-compatibility with boot loaders inspecting certain
+ # node names.
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - marvell,turris-mox-mv88e6085
+ - marvell,turris-mox-mv88e6190
+ then:
+ properties:
+ $nodename:
+ pattern: "switch[0-3]@[0-3]+$"
+ else:
+ properties:
+ $nodename:
+ pattern: "^(ethernet-)?switch(@.*)?$"
This latter thing is maybe not so nice for everyone to process.
The alternative is however to copy all of dsa.yaml, dsa-port.yaml and
ethernet-port.yaml (maybe more) into the Marvell binding. Which I can do,
of course. (qca8k is already deviant).
Unless there is a better way.
Yours,
Linus Walleij
next prev parent reply other threads:[~2023-10-25 20:56 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-24 13:20 [PATCH net-next v7 0/7] Create a binding for the Marvell MV88E6xxx DSA switches Linus Walleij
2023-10-24 13:20 ` [PATCH net-next v7 1/7] dt-bindings: net: dsa: Require ports or ethernet-ports Linus Walleij
2023-10-24 16:34 ` Florian Fainelli
2023-10-25 13:02 ` Krzysztof Kozlowski
2023-10-24 13:20 ` [PATCH net-next v7 2/7] dt-bindings: net: mvusb: Fix up DSA example Linus Walleij
2023-10-24 16:34 ` Florian Fainelli
2023-10-24 13:20 ` [PATCH net-next v7 3/7] ARM: dts: marvell: Fix some common switch mistakes Linus Walleij
2023-10-24 16:35 ` Florian Fainelli
2023-10-24 13:20 ` [PATCH net-next v7 4/7] ARM: dts: nxp: " Linus Walleij
2023-10-24 16:36 ` Florian Fainelli
2023-10-24 13:20 ` [PATCH net-next v7 5/7] ARM64: dts: marvell: " Linus Walleij
2023-10-24 16:37 ` Florian Fainelli
2023-10-24 18:28 ` Vladimir Oltean
2023-10-24 19:03 ` Russell King (Oracle)
2023-10-24 19:51 ` Vladimir Oltean
2023-10-25 19:52 ` Linus Walleij
2023-10-24 20:10 ` Chris Packham
2023-10-24 20:20 ` Vladimir Oltean
2023-10-25 19:48 ` Linus Walleij
2023-10-25 20:56 ` Linus Walleij [this message]
2023-10-25 21:21 ` Andrew Lunn
2023-10-24 13:20 ` [PATCH net-next v7 6/7] dt-bindings: marvell: Rewrite MV88E6xxx in schema Linus Walleij
2023-10-24 16:39 ` Florian Fainelli
2023-10-24 13:20 ` [PATCH net-next v7 7/7] dt-bindings: marvell: Add Marvell MV88E6060 DSA schema Linus Walleij
2023-10-24 16:40 ` Florian Fainelli
2023-10-25 9:30 ` [PATCH net-next v7 0/7] Create a binding for the Marvell MV88E6xxx DSA switches patchwork-bot+netdevbpf
2023-10-25 9:36 ` Vladimir Oltean
2023-10-25 14:29 ` Jakub Kicinski
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=CACRpkdaZYUxar8ESi6X7qLWJhuyRcFpYSF-70DvGdSn-rb7r6w@mail.gmail.com \
--to=linus.walleij@linaro.org \
--cc=andrew@lunn.ch \
--cc=ansuelsmth@gmail.com \
--cc=chris.packham@alliedtelesis.co.nz \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=gregory.clement@bootlin.com \
--cc=kabel@kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mrkiko.rs@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=pali@kernel.org \
--cc=robert.marko@sartura.hr \
--cc=robh+dt@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;
as well as URLs for NNTP newsgroup(s).