All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: "François Ozog" <francois.ozog@linaro.org>
Cc: Simon Glass <sjg@chromium.org>,
	U-Boot Mailing List <u-boot@lists.denx.de>,
	Mark Kettenis <mark.kettenis@xs4all.nl>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Sean Anderson <seanga2@gmail.com>,
	Marcel Ziswiler <marcel.ziswiler@toradex.com>
Subject: Re: [PATCH v5 02/26] doc: Add documentation about devicetree usage
Date: Wed, 27 Oct 2021 15:48:02 -0400	[thread overview]
Message-ID: <20211027194802.GM8284@bill-the-cat> (raw)
In-Reply-To: <CAHFG_=XHh4grEBkBhvOCA7ivGjo01xuM_xO3EsowymH1vFgQBQ@mail.gmail.com>

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

On Wed, Oct 27, 2021 at 05:38:28PM +0200, François Ozog wrote:
> Hi Simon,
> 
> On Wed, 27 Oct 2021 at 16:13, Simon Glass <sjg@chromium.org> wrote:
> 
> > Hi François,
> >
> > On Tue, 26 Oct 2021 at 09:57, François Ozog <francois.ozog@linaro.org>
> > wrote:
> > >
> > >
> > >
> > > On Tue, 26 Oct 2021 at 17:27, Simon Glass <sjg@chromium.org> wrote:
> > >>
> > >> Hi François,
> > >>
> > >> On Tue, 26 Oct 2021 at 08:31, François Ozog <francois.ozog@linaro.org>
> > wrote:
> > >> >
> > >> > Hi Simon,
> > >> >
> > >> > On Tue, 26 Oct 2021 at 02:25, Simon Glass <sjg@chromium.org> wrote:
> > >> >>
> > >> >> At present some of the ideas and techniques behind devicetree in
> > U-Boot
> > >> >> are assumed, implied or unsaid. Add some documentation to cover how
> > >> >> devicetree is build, how it can be modified and the rules about using
> > >> >> the various CONFIG_OF_... options.
> > >> >>
> >
> > [..]
> >
> > >> >> +Why not have two devicetrees?
> > >> >> +-----------------------------
> > >> >> +
> > >> >> +Setting aside the argument for restricting U-Boot from having its
> > own nodes and
> > >> >> +properties, another idea proposed is to have two devicetrees, one
> > for the
> > >> >> +U-Boot-specific bits (here called `special`) and one for everything
> > else (here
> > >> >> +called `linux`).
> > >> >> +
> > >> >> +On the positive side, it might quieten the discussion alluded to in
> > the section
> > >> >> +above. But there are many negatives to consider and many open
> > questions to
> > >> >> +resolve.
> > >> >> +
> > >> >> +- **Bindings** - Presumably the special devicetree would have its
> > own bindings.
> > >> >> +  It would not be necessary to put a `u-boot,` prefix on anything.
> > People coming
> > >> >> +  across the devicetree source would wonder how it fits in with the
> > Linux
> > >> >> +  devicetree.
> > >> >> +
> > >> >> +- **Access** - U-Boot has a nice `ofnode` API for accessing the
> > devicetree. This
> > >> >> +  would need to be expanded to support two trees. Features which
> > need to access
> > >> >> +  both (such as a device driver which reads the special devicetree
> > to get some
> > >> >> +  configuration info) could become quite confusing to read and
> > write.
> > >> >> +
> > >> >> +- **Merging** - Can the two devicetree be merged if a platform
> > desires it? If
> > >> >> +  so, how is this managed in tooling? Does it happen during the
> > build, in which
> > >> >> +  case they are not really separate at all. Or does U-Boot merge
> > them at
> > >> >> +  runtime, in which case this adds time and memory?
> > >> >> +
> > >> >> +- **Efficiency** - A second device tree adds more code and more
> > code paths. It
> > >> >> +  requires that both be made available to the code in U-Boot, e.g.
> > via a
> > >> >> +  separate pointer or argument or API. Overall the separation would
> > certainly
> > >> >> +  not speed up U-Boot, nor decrease its size.
> > >> >> +
> > >> >> +- **Source code** - At present `u-boot.dtsi` files provide the
> > pieces needed for
> > >> >> +  U-Boot for a particular board. Would we use these same files for
> > the special
> > >> >> +  devicetree?
> > >> >> +
> > >> >> +- **Complexity** - Two devicetrees complicates the build system
> > since it must
> > >> >> +  build and package them both. Errors must be reported in such a
> > way that it
> > >> >> +  is obvious which one is failing.
> > >> >> +
> > >> >> +- **Referencing each other** - The `u-boot,dm-xxx` tags used by
> > driver model
> > >> >> +  are currently placed in the nodes they relate to. How would these
> > tags
> > >> >> +  reference a node that is in a separate devicetree? What extra
> > validation would
> > >> >> +  be needed?
> > >> >> +
> > >> >> +- **Storage** - How would the two devicetrees be stored in the
> > image? At present
> > >> >> +  we simply concatenate the U-Boot binary and the devicetree. We
> > could add the
> > >> >> +  special devicetree before the Linux one, so two are concatenated,
> > but it is
> > >> >> +  not pretty. We could use binman to support more complex
> > arrangements, but only
> > >> >> +  some boards use this at present, so it would be a big change.
> > >> >> +
> > >> >> +- **API** - How would another project provide two devicetree files
> > to U-Boot at
> > >> >> +  runtime? Presumably this would just be too painful. But if it
> > doesn't, it
> > >> >> +  would be unable to configure run-time features of U-Boot during
> > the boot.
> > >> >> +
> > >> >> +- **Confusion** - No other project has two devicetrees. U-Boot
> > would be in the
> > >> >> +  unfortunate position of having to describe this fact to new
> > users, along with
> > >> >> +  the (arguably contrived) reason for the arrangement.
> > >> >> +
> > >> >
> > >> > False:
> > >> > 1) projects in trustedfirmware.org are built to have multiple FDT
> > objects, some for "dynamic" configuration purposes.
> > >>
> > >> Can you provided a link and I can update this.
> > >
> > >
> > https://trustedfirmware-a.readthedocs.io/en/latest/components/fconf/index.html
> > > Bindings:
> > > for FCONF:
> > https://trustedfirmware-a.readthedocs.io/en/latest/components/fconf/fconf_properties.html
> > > for FF-A:
> > https://trustedfirmware-a.readthedocs.io/en/latest/components/ffa-manifest-binding.html
> > > For chain-of-trust:
> > https://trustedfirmware-a.readthedocs.io/en/latest/components/cot-binding.html
> > >
> > > For some code:
> > >
> > https://github.com/ARM-software/arm-trusted-firmware/blob/master/tools/fiptool/tbbr_config.c
> > > From there you can wander and see how dynamic config sections of the FIP
> > can contain component specific DTs.
> > > U-Boot "private" DT could be securely stored in NT_FW_CONFIG section.
> >
> > OK I can mention that TF-A supports multiple devicetrees if you like,
> > but I'm not sure we are talking about the same thing.
>
> If I take a possible scenario: OP-TEE to deal with 3 different device
> trees:
> - the one that will be passed to the OS and for which it may want to do
> some fixups
> - the one that it is using to run (it may have secure devices that are
> entirely not visible to any normal world OS)

What relationship does this device tree that OP-TEE is using itself bear
to the one is will pass to the OS?

-- 
Tom

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

  parent reply	other threads:[~2021-10-27 19:48 UTC|newest]

Thread overview: 144+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-26  0:23 [PATCH v5 00/26] fdt: Make OF_BOARD a boolean option Simon Glass
2021-10-26  0:23 ` Simon Glass
2021-10-26  0:23 ` [PATCH v5 01/26] sandbox: Remove OF_HOSTFILE Simon Glass
2021-10-26  0:23 ` [PATCH v5 02/26] doc: Add documentation about devicetree usage Simon Glass
2021-10-26 14:06   ` Ilias Apalodimas
2021-10-26 15:27     ` Simon Glass
2021-10-27  9:29       ` Ilias Apalodimas
2021-10-26 14:31   ` François Ozog
2021-10-26 15:27     ` Simon Glass
2021-10-26 15:57       ` François Ozog
2021-10-27 14:13         ` Simon Glass
2021-10-27 15:38           ` François Ozog
2021-10-27 18:32             ` Simon Glass
2021-10-27 19:12               ` Ilias Apalodimas
2021-10-27 19:52                 ` Simon Glass
2021-10-29 10:20                   ` Ilias Apalodimas
2021-11-01 15:19                     ` Tom Rini
2021-11-02 14:53                     ` Simon Glass
2021-11-02 15:38                       ` Ilias Apalodimas
2021-11-03  3:29                         ` Simon Glass
2021-10-29 17:07                   ` François Ozog
2021-11-02 14:53                     ` Simon Glass
2021-10-27 19:46               ` François Ozog
2021-10-27 19:48             ` Tom Rini [this message]
2021-10-27 20:13               ` François Ozog
2021-10-26  0:23 ` [PATCH v5 03/26] arm: qemu: Mention -nographic in the docs Simon Glass
2021-10-26  0:23   ` Simon Glass
2021-10-26  0:23 ` [PATCH v5 04/26] arm: riscv: qemu: Explain how to extract the generated dt Simon Glass
2021-10-26  0:23   ` Simon Glass
2021-10-26  0:23 ` [PATCH v5 05/26] arm: qemu: Add a devicetree file for qemu_arm Simon Glass
2021-10-26  0:23   ` Simon Glass
2021-10-26  0:23 ` [PATCH v5 06/26] arm: qemu: Add a devicetree file for qemu_arm64 Simon Glass
2021-10-26  0:23   ` Simon Glass
2021-11-01 10:48   ` Peter Maydell
2021-11-01 10:48     ` Peter Maydell
2021-11-01 16:58     ` Simon Glass
2021-11-01 16:58       ` Simon Glass
2021-11-01 17:33       ` François Ozog
2021-11-01 17:33         ` François Ozog
2021-11-01 18:07         ` Tom Rini
2021-11-01 18:07           ` Tom Rini
2021-11-02 15:00           ` Simon Glass
2021-11-02 15:00             ` Simon Glass
2021-11-02 17:28             ` Tom Rini
2021-11-02 17:28               ` Tom Rini
2021-11-03  1:29               ` Simon Glass
2021-11-03  1:29                 ` Simon Glass
2021-11-03  5:29                 ` François Ozog
2021-11-03  5:29                   ` François Ozog
2021-11-03 14:41                   ` Tom Rini
2021-11-03 14:41                     ` Tom Rini
2021-11-04 11:09                     ` Peter Maydell
2021-11-04 11:09                       ` Peter Maydell
2021-11-04 11:22                       ` François Ozog
2021-11-04 11:22                         ` François Ozog
2021-11-04 11:41                         ` Peter Maydell
2021-11-04 11:41                           ` Peter Maydell
2021-11-04 11:48                           ` François Ozog
2021-11-04 11:48                             ` François Ozog
2021-11-03 14:44                   ` François Ozog
2021-11-03 14:44                     ` François Ozog
2021-11-03 14:39                 ` Tom Rini
2021-11-03 14:39                   ` Tom Rini
2021-11-02 14:59         ` Simon Glass
2021-11-02 14:59           ` Simon Glass
2021-11-02 16:57           ` Tom Rini
2021-11-02 16:57             ` Tom Rini
2021-11-03  1:32             ` Simon Glass
2021-11-03  1:32               ` Simon Glass
2021-11-03 14:39               ` Tom Rini
2021-11-03 14:39                 ` Tom Rini
2021-10-26  0:23 ` [PATCH v5 07/26] riscv: qemu: Add devicetree files for qemu_riscv32/64 Simon Glass
2021-10-26  0:23   ` Simon Glass
2021-10-26  0:23 ` [PATCH v5 08/26] arm: rpi: Add a devicetree file for rpi_4 Simon Glass
2021-10-26  0:23 ` [PATCH v5 09/26] arm: vexpress: Add a devicetree file for juno Simon Glass
2021-10-26  0:23 ` [PATCH v5 10/26] arm: xenguest_arm64: Add a fake devicetree file Simon Glass
2021-10-26  0:23 ` [PATCH v5 11/26] arm: octeontx: " Simon Glass
2021-10-26  0:23 ` [PATCH v5 12/26] arm: xilinx_versal_virt: Add a " Simon Glass
2021-10-26  0:23 ` [PATCH v5 13/26] arm: bcm7xxx: " Simon Glass
2021-10-26  0:23 ` [PATCH v5 14/26] arm: qemu-ppce500: " Simon Glass
2021-10-26  0:23 ` [PATCH v5 15/26] arm: highbank: Add a fake " Simon Glass
2021-10-26  0:23 ` [PATCH v5 16/26] fdt: Make OF_BOARD a bool option Simon Glass
2021-10-26  0:23 ` [PATCH v5 17/26] Drop CONFIG_BINMAN_STANDALONE_FDT Simon Glass
2021-10-26  0:23 ` [PATCH v5 18/26] doc: Update info on devicetree update Simon Glass
2021-10-26  0:23 ` [PATCH v5 19/26] fdt: Move MULTI_DTB_FIT handling out of fdtdec_setup() Simon Glass
2021-10-29  5:49   ` Ilias Apalodimas
2021-10-26  0:23 ` [PATCH v5 20/26] fdt: Drop #ifdefs with MULTI_DTB_FIT Simon Glass
2021-10-29  5:55   ` Ilias Apalodimas
2021-10-26  0:23 ` [PATCH v5 21/26] fdt: Drop CONFIG_SPL_BUILD check in fdtdec_setup() Simon Glass
2021-10-26  0:23 ` [PATCH v5 22/26] fdt: Drop #ifdef around board_fdt_blob_setup() Simon Glass
2021-10-26  0:23 ` [PATCH v5 25/26] fdt: Drop remaining preprocessor macros in fdtdec_setup() Simon Glass
2021-10-26  0:23 ` [PATCH v5 26/26] fdt: Don't call board_fdt_blob_setup() without OF_BOARD Simon Glass
2021-10-26 13:55   ` Ilias Apalodimas
2021-10-26 15:27     ` Simon Glass
2021-10-27  7:17       ` Ilias Apalodimas
2021-10-27 19:12         ` Tom Rini
2021-10-27 21:33           ` François Ozog
2021-10-27 21:44             ` Tom Rini
2021-10-26  6:07 ` [PATCH v5 00/26] fdt: Make OF_BOARD a boolean option François Ozog
2021-10-26  6:07   ` François Ozog
2021-10-27 14:08   ` Simon Glass
2021-10-27 14:08     ` Simon Glass
2021-10-27 15:14     ` François Ozog
2021-10-27 15:14       ` François Ozog
2021-10-27 18:23       ` Simon Glass
2021-10-27 18:23         ` Simon Glass
2021-10-27 19:25         ` Tom Rini
2021-10-27 19:25           ` Tom Rini
2021-11-03 16:45           ` Simon Glass
2021-11-03 16:45             ` Simon Glass
2021-11-03 17:21             ` Tom Rini
2021-11-03 17:21               ` Tom Rini
2021-10-27 20:07         ` François Ozog
2021-10-27 20:07           ` François Ozog
2021-11-03  1:20           ` Simon Glass
2021-11-03  1:20             ` Simon Glass
2021-11-03  4:45             ` François Ozog
2021-11-03  4:45               ` François Ozog
2021-10-27 22:30         ` Mark Kettenis
2021-10-27 22:30           ` Mark Kettenis
2021-11-03  1:20           ` Simon Glass
2021-11-03  1:20             ` Simon Glass
2021-11-03  8:22             ` Mark Kettenis
2021-11-03  8:22               ` Mark Kettenis
2021-11-03 16:02               ` Tom Rini
2021-11-03 16:02                 ` Tom Rini
2021-11-03 16:45                 ` Simon Glass
2021-11-03 16:45                   ` Simon Glass
2021-11-03 17:36                   ` Mark Kettenis
2021-11-03 17:36                     ` Mark Kettenis
2021-11-03 15:56             ` Tom Rini
2021-11-03 15:56               ` Tom Rini
2021-11-03 16:45               ` Simon Glass
2021-11-03 16:45                 ` Simon Glass
2021-10-27 15:36     ` Tuomas Tynkkynen
2021-10-27 15:36       ` Tuomas Tynkkynen
2021-10-27 19:13       ` Tom Rini
2021-10-27 19:13         ` Tom Rini
2021-10-27 18:16     ` Tom Rini
2021-10-27 18:16       ` Tom Rini
2021-10-27 18:24     ` Tom Rini
2021-10-27 18:24       ` Tom Rini
2021-11-03 17:13 ` François Ozog
2021-11-03 17:13   ` François Ozog

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=20211027194802.GM8284@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=francois.ozog@linaro.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=marcel.ziswiler@toradex.com \
    --cc=mark.kettenis@xs4all.nl \
    --cc=seanga2@gmail.com \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.