linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Raymond Mao <raymond.mao@linaro.org>
Cc: linux-doc@vger.kernel.org, devicetree-spec@vger.kernel.org,
	devicetree@vger.kernel.org, ilias.apalodimas@linaro.org,
	Conor Dooley <conor.dooley@microchip.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] docs: devicetree: overlay-notes: recommend top-level compatible in DTSO
Date: Mon, 8 Sep 2025 14:02:45 +1000	[thread overview]
Message-ID: <aL5VZfOoy1g2uyAH@zatzit> (raw)
In-Reply-To: <CAEfUkULwQxJ-EKT7bQ8+hkH+_xO8esThnL2P_Rc-32tHyMdA1A@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2776 bytes --]

On Thu, Sep 04, 2025 at 10:40:31AM -0400, Raymond Mao wrote:
> Hi David,
> 
> On Wed, 3 Sept 2025 at 22:58, David Gibson <david@gibson.dropbear.id.au> wrote:
> >
> > On Tue, Sep 02, 2025 at 10:43:50AM -0700, Raymond Mao wrote:
> > > When managing multiple base device trees and overlays in a structured
> > > way (e.g. bundled in firmware or tools), it is helpful to identify the
> > > intended target base DT for each overlay, which can be done via a
> > > top-level compatible string in the overlay.
> > >
> > > This provides a way to identify which overlays should be applied once the
> > > DT is selected for the case when a device have a common firmware binary
> > > which only differs on the DT and overlays.
> > >
> > > This patch updates the document with a note and example for this
> > > practice.
> > > For more information on this firmware requirement, please see [1].
> > >
> > > [1] https://github.com/FirmwareHandoff/firmware_handoff/pull/74
> >
> > I think this idea is probably useful enough to be a good idea anyway.
> > However, note that it leans in to an existing ugliness of the overlay format:
> >
> > Overlay dtbs kind of mix "in band" information - the actual new
> > content for the tree - with "out of band" information - how to apply
> > the overlay itself.  Whether a given property is data or metadata is
> > determined by it's place in the tree in a moderately complex and not
> > super obvious way.
> >
> > About the clearest divide that exists is that generally the root and
> > first-level subnodes are information only for overlay application,
> > everything under that is data to be applied to the tree.  This all
> > tends to have names that would be unlikely (though not strictly
> > impossible) in a fully applied tree.
> >
> > Putting 'compatible' at the root of the overlay is putting something
> > that looks very much like a regular device tree property in a place
> > and with a function that's purely about applying / validating the
> > overlay itself.
> >
> 
> Since all information at the root of an overlay is considered as
> metadata (out-of-band),
> If you think 'compatible' is confused, I can change it to
> 'overlay-compatible' - which should be 'unlikely' to exist in a full
> tree.

No, as I said, I think the advantages of this proposal still outweigh
the disadvantages.  Just pointing out that this is highlighting some
of the ugliness in the current way overlays are designed, which is
relevant in the context of concurrent discussions about connectors and
the like.

-- 
David Gibson (he or they)	| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you, not the other way
				| around.
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2025-09-08  4:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-02 17:43 [PATCH v2] docs: devicetree: overlay-notes: recommend top-level compatible in DTSO Raymond Mao
2025-09-04  2:58 ` David Gibson
2025-09-04 14:40   ` Raymond Mao
2025-09-08  4:02     ` David Gibson [this message]
2025-09-08 14:12       ` Raymond Mao

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=aL5VZfOoy1g2uyAH@zatzit \
    --to=david@gibson.dropbear.id.au \
    --cc=conor+dt@kernel.org \
    --cc=conor.dooley@microchip.com \
    --cc=devicetree-spec@vger.kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=raymond.mao@linaro.org \
    --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).