All of lore.kernel.org
 help / color / mirror / Atom feed
From: "François Ozog" <francois.ozog@linaro.org>
To: Simon Glass <sjg@chromium.org>
Cc: 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>,
	 Tom Rini <trini@konsulko.com>, 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 17:38:28 +0200	[thread overview]
Message-ID: <CAHFG_=XHh4grEBkBhvOCA7ivGjo01xuM_xO3EsowymH1vFgQBQ@mail.gmail.com> (raw)
In-Reply-To: <CAPnjgZ3JZ_JAOObDnuU1ZK73K-KvYbcHzAb9RTwcyG5-QCWNyA@mail.gmail.com>

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)
- the one that it gets from the FIP and contains runtime configuration
parameters, accessed through FCONF library)


> U-Boot also supports multiple devicetrees in the build - e.g. SPL and
> U-Boot proper. With binman you can create several copies of them for
> use with A/B boot, for example. But only one is used as a control DTB
> by a particular U-Boot phase at a time. Do you see what I mean?
>
> >>
> >> > 2) STM32MP1 can have dedicated DTBs for TF-A, OP-TEE and U-Boot in
> addition to operating system
> >> > As Ilias said, this is not about documentation about the current use
> of DT in U-Boot, but justification of your views on DT.
> >> > If taken by the letter, I feel (may be wrong though) that your views
> prevent establish the DT lifecycle and usage as per the desire of vendors,
> partners and customers that supports Arm SystemReady standards.
> >>
> >> I have gone to great efforts to document things here, as they work in
> >> U-Boot today. As you know, U-Boot supports separate control and active
> >> devicetrees.
> >
> > I don't know what is an active device tree. Is it the device tree to be
> passed to OS?
>
> Yes that's right.
>
> >>
> >> But if you are wanting to change to multiple control
> >> trees within U-Boot, I'd say the answer is "no, thank you".
> >
> > I see only one control DT.
>
> OK good.
>
> > There is a possibility to store it securely in NT_FW_CONFIG section of a
> FIP. it also has associated signature plus hash mechanisms to attest
> authenticity of  it (do not need signature in DT to allow verification:
> this is the associated content certificate section that contains the valid
> hashes).
>
> What does NT mean? I suppose FW means firmware.
>
Non Trusted; it means normal world as opposed to secure world.
It feels unfortunate to say non trusted while it is trusted but running
outside secure world ;-)

>
> It doesn't really matter where it is stored, so long as U-Boot can access
> it.
>
> > You can certain have a similar mechanism for binman.
>
> Note that binman is a packaging tool. Perhaps you should add FIP
> support to it if FIP is going to be required too now?
>
> There may be a need for a FIP explanation. I'll check with other guys to
propose text.


> What I would like, to package up the firmware for ANY board, after all
> the building is done in various projects:
>
> binman -b <board>
>
> FIP deals with a number of firmwares like the SCP and MCP ones running on
other micro-controllers of a board.
So in a sense it is an arm targeted tool.
If you want to package firmware for arm boards with binman you will have to
deal with those firmwares as well as secure world and its trusted services
as secure partitions that are being developed (including when
virtualization is in operation in the secure world).
So in a word, trying to do this is a big undertaking, but you can try.
In a short term future (see Alibaba and Marvell announcements) you will
have to deal with Arm v9 realms and associated firmware.

> >>
> >> If there
> >> is a use case for that, please can you be specific about what we
> >> cannot do with a combined devicetree?
>
> Regards,
> SImon
>


-- 
François-Frédéric Ozog | *Director Business Development*
T: +33.67221.6485
francois.ozog@linaro.org | Skype: ffozog

  reply	other threads:[~2021-10-27 15:38 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 [this message]
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
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='CAHFG_=XHh4grEBkBhvOCA7ivGjo01xuM_xO3EsowymH1vFgQBQ@mail.gmail.com' \
    --to=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=trini@konsulko.com \
    --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.