Devicetree
 help / color / mirror / Atom feed
From: Artur Weber <aweber.kernel@gmail.com>
To: Stanislav Jakubek <stano.jakubek@gmail.com>
Cc: Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Florian Fainelli <florian.fainelli@broadcom.com>,
	Ray Jui <rjui@broadcom.com>,
	Scott Branden <sbranden@broadcom.com>,
	Broadcom internal kernel review list
	<bcm-kernel-feedback-list@broadcom.com>,
	~postmarketos/upstreaming@lists.sr.ht,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/2] ARM: dts: bcm-mobile: Split out nodes used by both BCM21664 and BCM23550
Date: Wed, 12 Jun 2024 19:00:25 +0200	[thread overview]
Message-ID: <e34a1e18-28c9-4aff-827f-d9f11bcb1d49@gmail.com> (raw)
In-Reply-To: <ZmRXTgPxrGZIYjQa@standask-GA-A55M-S2HP>

On 8.06.2024 15:06, Stanislav Jakubek wrote:
>> To make development for both platforms easier, split out the common
>> nodes into a separate DTSI, bcm21664-common.dtsi. This only leaves
>> the device-specific nodes - so, CPU and related things - in the SoC-
>> specific DTSIs (bcm21664.dtsi and bcm23550.dtsi).
> 
> The name "bcm21664-common" makes me think that it's a DTSI for common
> properties of multiple BCM21664 *board* DTs, which is obviously not the
> case here. IMO something like "bcm21664-bcm23550-common" makes more sense here.
> 
The "bcm21664-common" name sounds fine to me, though I can certainly see
how it could be interpreted as a board DTSI (I was planning to make a
bcm21664-samsung-common.dtsi for Samsung's BCM21664-based phones, funny
enough...)

The idea of just putting together the two model numbers sounded a bit
awkward to me at first, but I've been thinking about it and I'm starting
to warm up to it. There are a handful of examples of a similar double-
naming scheme: e.g. intel-ixp45x-ixp46x.dtsi, sunxi-h3-h5.dtsi, sun8i-
a23-a33.dtsi. The difference is that these DTSIs have a manufacturer
prefix and no "-common" suffix.

I had many ideas for naming the common DTSI. My initial idea was
"bcm216xx.dtsi", but that would cover the BCM21654 (which has a few more
differences); then "bcm2166x.dtsi" which would cover the BCM21663 and
BCM21664 (which AFAIK are largely the same). We could combine it with
the current name and get "bcm2166x-common.dtsi". That already sounds
less like a board file to me, what do you think?

>> It's worth noting though that some bcm23550 compatibles now go unused,
>> since the bcm21664-common.dtsi file uses bcm21664 compatibles.
> 
> I don't think this is the way to go. While in these cases the Linux drivers
> match only on the generic brcm,kona-* fallback compatible (AFAIK anyway),
> the compatibles in DT should still be (SoC-)specific.
> 
> I think the common DTSI should omit the compatible values altogether
> and instead have the compatible be specified in SoC DTSI. You could keep
> a note in the common DTSI saying that the compatible is in SoC DTSI or
> something similar.

There's plenty of DTSIs in the kernel that have "device-specific"
compatibles in common DTSIs. Off the top of my head I can name the
Exynos 4 DTSIs that do this pretty often[1][2][3] (4210 and 4212
compatibles in DTSIs that are later included from the 4412 DTSI, but
which does not override any of them).

While looking around for examples I stumbled upon some sunxi DTSIs that
actually do *both*: have some compatibles that mention one of the two
models they cover, but leave some compatibles to be set in the child
DTSIs[4][5].

Since as I mentioned the underlying components seem to be the exact
same, the compatibles are really just cosmetic; plus I feel like lots of
such compatible-only nodes could add unnecessary noise to the SoC DTSIs.

With that said, I'm not against the idea, and I suppose it's not too
much extra work. I'm curious what other reviewers will have to say, but
either way I'll try to incorporate this into the next version of this
patchset.

Best regards
Artur

[1] 
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/arch/arm/boot/dts/samsung/exynos4.dtsi
[2] 
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/arch/arm/boot/dts/samsung/exynos4x12.dtsi
[3] 
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/arch/arm/boot/dts/samsung/exynos4412.dtsi
[4] 
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/arch/arm/boot/dts/allwinner/sunxi-h3-h5.dtsi
[5] 
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/arch/arm/boot/dts/allwinner/sun8i-a23-a33.dtsi

      reply	other threads:[~2024-06-12 17:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-05  6:40 [PATCH 0/2] ARM: dts: bcm-mobile: Split out nodes used by both BCM21664 and BCM23550 Artur Weber
2024-06-05  6:40 ` [PATCH 1/2] ARM: dts: broadcom: bcm21664: Move chosen node into bcm21664-garnet DTS Artur Weber
2024-06-05  6:40 ` [PATCH 2/2] ARM: dts: bcm-mobile: Split out nodes used by both BCM21664 and BCM23550 Artur Weber
2024-06-07  1:47   ` kernel test robot
2024-06-08 13:14   ` Stanislav Jakubek
2024-06-05  7:21 ` [PATCH 0/2] " Artur Weber
2024-06-08 13:06 ` Stanislav Jakubek
2024-06-12 17:00   ` Artur Weber [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=e34a1e18-28c9-4aff-827f-d9f11bcb1d49@gmail.com \
    --to=aweber.kernel@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=florian.fainelli@broadcom.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjui@broadcom.com \
    --cc=robh@kernel.org \
    --cc=sbranden@broadcom.com \
    --cc=stano.jakubek@gmail.com \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /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