All of lore.kernel.org
 help / color / mirror / Atom feed
From: "François Ozog" <francois.ozog@linaro.org>
To: Andre Przywara <andre.przywara@arm.com>
Cc: "Liviu Dudau" <liviu.dudau@foss.arm.com>,
	"Neil Armstrong" <narmstrong@baylibre.com>,
	"Vladimir Oltean" <vladimir.oltean@nxp.com>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Bin Meng" <bin.meng@windriver.com>,
	"Kever Yang" <kever.yang@rock-chips.com>,
	"Sean Anderson" <seanga2@gmail.com>,
	"Atish Patra" <atish.patra@wdc.com>,
	"Zong Li" <zong.li@sifive.com>, "Stefan Roese" <sr@denx.de>,
	"Fabio Estevam" <festevam@gmail.com>,
	"Rainer Boschung" <rainer.boschung@hitachi-powergrids.com>,
	"Tom Rini" <trini@konsulko.com>,
	"Stephen Warren" <swarren@nvidia.com>,
	"Oleksandr Andrushchenko" <oleksandr_andrushchenko@epam.com>,
	"Heinrich Schuchardt" <xypron.glpk@gmx.de>,
	"Niel Fourie" <lusus@denx.de>,
	"Michal Simek" <michal.simek@xilinx.com>,
	"Marek Behún" <marek.behun@nic.cz>,
	"Jerry Van Baren" <vanbaren@cideas.com>,
	"Ramon Fried" <rfried.dev@gmail.com>,
	"Jagan Teki" <jagan@amarulasolutions.com>,
	"Valentin Longchamp" <valentin.longchamp@hitachi-powergrids.com>,
	"Heiko Schocher" <hs@denx.de>,
	"Peter Robinson" <pbrobinson@gmail.com>,
	"Sinan Akman" <sinan@writeme.com>,
	"Thomas Fitzsimmons" <fitzsim@fitzsim.org>,
	"Wolfgang Denk" <wd@denx.de>,
	"Stephen Warren" <swarren@wwwdotorg.org>,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
	"Tim Harvey" <tharvey@gateworks.com>,
	"Ashok Reddy Soma" <ashok.reddy.soma@xilinx.com>,
	"Rick Chen" <rick@andestech.com>,
	"Alexander Graf" <agraf@csgraf.de>,
	"Green Wan" <green.wan@sifive.com>,
	"T Karthik Reddy" <t.karthik.reddy@xilinx.com>,
	"Anastasiia Lukianenko" <anastasiia_lukianenko@epam.com>,
	"Albert Aribaud" <albert.u.boot@aribaud.net>,
	"Michal Simek" <monstr@monstr.eu>,
	"Matthias Brugger" <mbrugger@suse.com>,
	Leo <ycliang@andestech.com>, "Tero Kristo" <kristo@kernel.org>,
	"U-Boot Mailing List" <u-boot@lists.denx.de>,
	"David Abdurachmanov" <david.abdurachmanov@sifive.com>,
	"Priyanka Jain" <priyanka.jain@nxp.com>,
	"Simon Glass" <sjg@chromium.org>,
	"Ilias Apalodimas" <ilias.apalodimas@linaro.org>,
	"Christian Hewitt" <christianshewitt@gmail.com>,
	"Aaron Williams" <awilliams@marvell.com>,
	"Tuomas Tynkkynen" <tuomas.tynkkynen@iki.fi>,
	"Heinrich Schuchardt" <heinrich.schuchardt@canonical.com>,
	"Tianrui Wei" <tianrui-wei@outlook.com>,
	"Bin Meng" <bmeng.cn@gmail.com>, "Pali Rohár" <pali@kernel.org>,
	"Dimitri John Ledkov" <dimitri.ledkov@canonical.com>,
	"Padmarao Begari" <padmarao.begari@microchip.com>
Subject: Re: [PATCH 00/16] fdt: Make OF_BOARD a boolean option
Date: Thu, 14 Oct 2021 19:48:35 +0200	[thread overview]
Message-ID: <CAHFG_=VWbkrkYzQCnz7xPdsOAg-1qcYm6+sCiccMu2hazknoWQ@mail.gmail.com> (raw)
In-Reply-To: <20211014172427.1f3e67d1@donnerap.cambridge.arm.com>

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

Le jeu. 14 oct. 2021 à 18:24, Andre Przywara <andre.przywara@arm.com> a
écrit :

> On Thu, 14 Oct 2021 09:17:52 -0600
> Simon Glass <sjg@chromium.org> wrote:
>
> > Hi Tom,
> >
> > On Thu, 14 Oct 2021 at 08:56, Tom Rini <trini@konsulko.com> wrote:
> > >
> > > On Wed, Oct 13, 2021 at 12:06:02PM -0600, Simon Glass wrote:
> > > > Hi François,
> > > >
> > > > On Wed, 13 Oct 2021 at 11:35, François Ozog <
> francois.ozog@linaro.org> wrote:
> > > > >
> > > > > Hi Simon
> > > > >
> > > > > Le mer. 13 oct. 2021 à 16:49, Simon Glass <sjg@chromium.org> a
> écrit :
> > > > >>
> > > > >> Hi Tom, Bin,François,
> > > > >>
> > > > >> On Tue, 12 Oct 2021 at 19:34, Tom Rini <trini@konsulko.com>
> wrote:
> > > > >> >
> > > > >> > On Wed, Oct 13, 2021 at 09:29:14AM +0800, Bin Meng wrote:
> > > > >> > > Hi Simon,
> > > > >> > >
> > > > >> > > On Wed, Oct 13, 2021 at 9:01 AM Simon Glass <sjg@chromium.org>
> wrote:
> > > > >> > > >
> > > > >> > > > With Ilias' efforts we have dropped OF_PRIOR_STAGE and
> OF_HOSTFILE so
> > > > >> > > > there are only three ways to obtain a devicetree:
> > > > >> > > >
> > > > >> > > >    - OF_SEPARATE - the normal way, where the devicetree is
> built and
> > > > >> > > >       appended to U-Boot
> > > > >> > > >    - OF_EMBED - for development purposes, the devicetree is
> embedded in
> > > > >> > > >       the ELF file (also used for EFI)
> > > > >> > > >    - OF_BOARD - the board figures it out on its own
> > > > >> > > >
> > > > >> > > > The last one is currently set up so that no devicetree is
> needed at all
> > > > >> > > > in the U-Boot tree. Most boards do provide one, but some
> don't. Some
> > > > >> > > > don't even provide instructions on how to boot on the board.
> > > > >> > > >
> > > > >> > > > The problems with this approach are documented at [1].
> > > > >> > > >
> > > > >> > > > In practice, OF_BOARD is not really distinct from
> OF_SEPARATE. Any board
> > > > >> > > > can obtain its devicetree at runtime, even it is has a
> devicetree built
> > > > >> > > > in U-Boot. This is because U-Boot may be a second-stage
> bootloader and its
> > > > >> > > > caller may have a better idea about the hardware available
> in the machine.
> > > > >> > > > This is the case with a few QEMU boards, for example.
> > > > >> > > >
> > > > >> > > > So it makes no sense to have OF_BOARD as a 'choice'. It
> should be an
> > > > >> > > > option, available with either OF_SEPARATE or OF_EMBED.
> > > > >> > > >
> > > > >> > > > This series makes this change, adding various missing
> devicetree files
> > > > >> > > > (and placeholders) to make the build work.
> > > > >> > >
> > > > >> > > Adding device trees that are never used sounds like a hack to
> me.
> > > > >> > >
> > > > >> > > For QEMU, device tree is dynamically generated on the fly
> based on
> > > > >> > > command line parameters, and the device tree you put in this
> series
> > > > >> > > has various hardcoded <phandle> values which normally do not
> show up
> > > > >> > > in hand-written dts files.
> > > > >> > >
> > > > >> > > I am not sure I understand the whole point of this.
> > > > >> >
> > > > >> > I am also confused and do not like the idea of adding device
> trees for
> > > > >> > platforms that are capable of and can / do have a device tree
> to give us
> > > > >> > at run time.
> > > > >>
> > > > >> (I'll just reply to this one email, since the same points applies
> to
> > > > >> all replies I think)
> > > > >>
> > > > >> I have been thinking about this and discussing it with people for
> a
> > > > >> few months now. I've been signalling a change like this for over a
> > > > >> month now, on U-Boot contributor calls and in discussions with
> Linaro
> > > > >> people. I sent a patch (below) to try to explain things. I hope
> it is
> > > > >> not a surprise!
> > > > >>
> > > > >> The issue here is that we need a devicetree in-tree in U-Boot, to
> > > > >> avoid the mess that has been created by OF_PRIOR_STAGE, OF_BOARD,
> > > > >> BINMAN_STANDALONE_FDT and to a lesser extent, OF_HOSTFILE. Between
> > > > >> Ilias' series and this one we can get ourselves on a stronger
> footing.
> > > > >> There is just OF_SEPARATE, with OF_EMBED for debugging/ELF use.
> > > > >> For more context:
> > > > >>
> > > > >>
> http://patchwork.ozlabs.org/project/uboot/patch/20210919215111.3830278-3-sjg@chromium.org/
> > > > >>
> > > > >> BTW I did suggest to QEMU ARM that they support a way of adding
> the
> > > > >> u-boot.dtsi but there was not much interest there (in fact the
> > > > >> maintainer would prefer there was no special support even for
> booting
> > > > >> Linux directly!)
> > > > >
> > > > > i understand their point of view and agree with it.
> > > > >>
> > > > >> But in any case it doesn't really help U-Boot. I
> > > > >> think the path forward might be to run QEMU twice, once to get its
> > > > >> generated tree and once to give the 'merged' tree with the U-Boot
> > > > >> properties in it, if people want to use U-Boot features.
> > > > >>
> > > > >> I do strongly believe that OF_BOARD must be a run-time option,
> not a
> > > > >> build-time one. It creates all sorts of problems and obscurity
> which
> > > > >> have taken months to unpick. See the above patch for the
> rationale.
> > > > >>
> > > > >> To add to that rationale, OF_BOARD needs to be an option
> available to
> > > > >> any board. At some point in the future it may become a common way
> > > > >> things are done, e.g. TF-A calling U-Boot and providing a
> devicetree
> > > > >> to it. It doesn't make any sense to have people decide whether or
> not
> > > > >> to set OF_BOARD at build time, thus affecting how the image is put
> > > > >> together. We'll end up with different U-Boot build targets like
> > > > >> capricorn, capricorn_of_board and the like. It should be obvious
> where
> > > > >> that will lead. Instead, OF_BOARD needs to become a commonly used
> > > > >> option, perhaps enabled by most/all boards, so that this sort of
> build
> > > > >> explosion is not needed.
> > > > >
> > > > > If you mean that when boards are by construction providing a DTB
> to U-Boot then I agree very much. But I don’t understand how the patch set
> supports it as it puts dts files for those boards to be built.
> > > > >>
> > > > >> U-Boot needs to be flexible enough to
> > > > >> function correctly in whatever runtime environment in which it
> finds
> > > > >> itself.
> > > > >>
> > > > >> Also as binman is pressed into service more and more to build the
> > > > >> complex firmware images that are becoming fashionable, it needs a
> > > > >> definition (in the devicetree) that describes how to create the
> image.
> > > > >> We can't support that unless we are building a devicetree, nor
> can the
> > > > >> running program access the image layout without that information.
> > > > >>
> > > > >> François's point about 'don't use this with any kernel' is
> > > > >> germane...but of course I am not suggesting doing that, since
> OF_BOARD
> > > > >> is, still, enabled. We already use OF_BOARD for various boards
> that
> > > > >> include an in-tree devicetree - Raspberry Pi 1, 2 and 3, for
> example
> > > > >> (as I said in the cover letter "Most boards do provide one, but
> some
> > > > >> don't."). So this series is just completing the picture by
> enforcing
> > > > >> that *some sort* of devicetree is always present.
> > > > >
> > > > > That seems inconsistent with the OF_BOARD becomes the default.
> > > >
> > > > I think the key point that will get you closer to where I am on this
> > > > issue, is that OF_BOARD needs to be a run-time option. At present it
> > > > has build-time effects and this is quite wrong. If you go through all
> > > > the material I have written on this I think I have motivated that
> very
> > > > clearly.
> > > >
> > > > Another big issue is that I believe we need ONE devicetree for
> U-Boot,
> > > > not two that get merged by U-Boot. Again I have gone through that in
> a
> > > > lot of detail.
> > >
> > > I have a long long reply to your first reply here saved, but, maybe
> > > here's the biggest sticking point.  To be clear, you agree that U-Boot
> > > needs to support being passed a device tree to use, at run time, yes?
> >
> > Yes. The OF_BOARD feature provides this.
> >
> > >
> > > And in that case, would not be using the "fake" tree we built in?
> >
> > Not at runtime.
> >
> > >
> > > So is the sticking point here that we really have two classes of
> > > devices, one class where we will never ever be given the device tree at
> > > run time (think BeagleBone Black) and one where we will always be given
> > > one at run time (think Raspberry Pi) ?
> >
> > I'm not sure it will be that black and white. I suspect there will be
> > (many) boards which can boot happily with the U-Boot devicetree but
> > can also accept one at runtime, if provided. For example, you may want
> > to boot with or without TF-A or some other, earlier stage.
>
> I don't understand this: as Tom mentioned this is a platform decision:
> either it provides a DT somewhere (flash, EEPROM, prior firmware stage),
> or it doesn't. Sure, you can always hack your own DT in, somehow, for
> development or experimentation purposes, but that is a separate issue.
>
> Most of those platforms actually utilise some dynamic DTs, btw, where
> software amends the DT on the fly:
> - Highbank has a stub DT in SPI flash, and the management controller
> firmware detects the size and some extra DRAM (DIMMs!) parameters at boot
> time, and writes the /memory node accordingly.
> - RPi3/4 have DT overlay files on the SD card, and depending on what a
> user wrote in config.txt, they get applied to the DT (or not).
> - Even for the Allwinner H616 we amend the OF_SEPARATE provided DT copy in
> DRAM in TF-A, to carve out the DRAM region TF-A occupies.
> - QEMU is the obvious example, where the whole machine is highly dynamic,
> and there is no such thing as a fixed DT (how many cores?, how much
> memory?, how many virtio devices?, flash?, SCSI?)
>
> > I believe we have  got unstuck because OF_BOARD (perhaps inadvertently)
> > provided a way to entirely omit a devicetree from U-Boot, thus making
> > things like binman and U-Boot /config impossible, for example.
>
> I have the feeling this is because we abuse DT for this. Conceptually the
> DT is not a configuration file, but a hardware description.

+42!!!

> I see that it
> is also a nice and flexible, hierarchical key/value storage, for which we
> have code in anyway, so it makes hardcoding data in the code easier to
> avoid.
> But as we see now, this has problems as well.
>
> So shall we separate those use cases? And attach just a tree with /binman
> and /config (in DTB format), but treat this separately from the hardware
> description? (Admittedly I have still to wrap my head around why we need
> /binman at U-Boot runtime in the first place.)

+1

>
>
> Cheers,
> Andre
>
> > So I
> > want to claw that back, so there is always some sort of devicetree in
> > U-Boot, as we have for rpi_3, etc.
> >
> > Regards,
> > Simon
>
> --
François-Frédéric Ozog | *Director Business Development*
T: +33.67221.6485
francois.ozog@linaro.org | Skype: ffozog

[-- Attachment #2: Type: text/html, Size: 16742 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: "François Ozog" <francois.ozog@linaro.org>
To: Andre Przywara <andre.przywara@arm.com>
Cc: "Aaron Williams" <awilliams@marvell.com>,
	"Albert Aribaud" <albert.u.boot@aribaud.net>,
	"Alexander Graf" <agraf@csgraf.de>,
	"Anastasiia Lukianenko" <anastasiia_lukianenko@epam.com>,
	"Ashok Reddy Soma" <ashok.reddy.soma@xilinx.com>,
	"Atish Patra" <atish.patra@wdc.com>,
	"Bin Meng" <bin.meng@windriver.com>,
	"Bin Meng" <bmeng.cn@gmail.com>,
	"Christian Hewitt" <christianshewitt@gmail.com>,
	"David Abdurachmanov" <david.abdurachmanov@sifive.com>,
	"Dimitri John Ledkov" <dimitri.ledkov@canonical.com>,
	"Fabio Estevam" <festevam@gmail.com>,
	"Green Wan" <green.wan@sifive.com>, "Heiko Schocher" <hs@denx.de>,
	"Heinrich Schuchardt" <heinrich.schuchardt@canonical.com>,
	"Heinrich Schuchardt" <xypron.glpk@gmx.de>,
	"Ilias Apalodimas" <ilias.apalodimas@linaro.org>,
	"Jagan Teki" <jagan@amarulasolutions.com>,
	"Jerry Van Baren" <vanbaren@cideas.com>,
	"Kever Yang" <kever.yang@rock-chips.com>,
	Leo <ycliang@andestech.com>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Liviu Dudau" <liviu.dudau@foss.arm.com>,
	"Marek Behún" <marek.behun@nic.cz>,
	"Matthias Brugger" <mbrugger@suse.com>,
	"Michal Simek" <michal.simek@xilinx.com>,
	"Michal Simek" <monstr@monstr.eu>,
	"Neil Armstrong" <narmstrong@baylibre.com>,
	"Niel Fourie" <lusus@denx.de>,
	"Oleksandr Andrushchenko" <oleksandr_andrushchenko@epam.com>,
	"Padmarao Begari" <padmarao.begari@microchip.com>,
	"Pali Rohár" <pali@kernel.org>,
	"Peter Robinson" <pbrobinson@gmail.com>,
	"Priyanka Jain" <priyanka.jain@nxp.com>,
	"Rainer Boschung" <rainer.boschung@hitachi-powergrids.com>,
	"Ramon Fried" <rfried.dev@gmail.com>,
	"Rick Chen" <rick@andestech.com>,
	"Sean Anderson" <seanga2@gmail.com>,
	"Simon Glass" <sjg@chromium.org>,
	"Sinan Akman" <sinan@writeme.com>, "Stefan Roese" <sr@denx.de>,
	"Stephen Warren" <swarren@wwwdotorg.org>,
	"Stephen Warren" <swarren@nvidia.com>,
	"T Karthik Reddy" <t.karthik.reddy@xilinx.com>,
	"Tero Kristo" <kristo@kernel.org>,
	"Thomas Fitzsimmons" <fitzsim@fitzsim.org>,
	"Tianrui Wei" <tianrui-wei@outlook.com>,
	"Tim Harvey" <tharvey@gateworks.com>,
	"Tom Rini" <trini@konsulko.com>,
	"Tuomas Tynkkynen" <tuomas.tynkkynen@iki.fi>,
	"U-Boot Mailing List" <u-boot@lists.denx.de>,
	"Valentin Longchamp" <valentin.longchamp@hitachi-powergrids.com>,
	"Vladimir Oltean" <vladimir.oltean@nxp.com>,
	"Wolfgang Denk" <wd@denx.de>, "Zong Li" <zong.li@sifive.com>,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>
Subject: Re: [PATCH 00/16] fdt: Make OF_BOARD a boolean option
Date: Thu, 14 Oct 2021 19:48:35 +0200	[thread overview]
Message-ID: <CAHFG_=VWbkrkYzQCnz7xPdsOAg-1qcYm6+sCiccMu2hazknoWQ@mail.gmail.com> (raw)
In-Reply-To: <20211014172427.1f3e67d1@donnerap.cambridge.arm.com>

Le jeu. 14 oct. 2021 à 18:24, Andre Przywara <andre.przywara@arm.com> a
écrit :

> On Thu, 14 Oct 2021 09:17:52 -0600
> Simon Glass <sjg@chromium.org> wrote:
>
> > Hi Tom,
> >
> > On Thu, 14 Oct 2021 at 08:56, Tom Rini <trini@konsulko.com> wrote:
> > >
> > > On Wed, Oct 13, 2021 at 12:06:02PM -0600, Simon Glass wrote:
> > > > Hi François,
> > > >
> > > > On Wed, 13 Oct 2021 at 11:35, François Ozog <
> francois.ozog@linaro.org> wrote:
> > > > >
> > > > > Hi Simon
> > > > >
> > > > > Le mer. 13 oct. 2021 à 16:49, Simon Glass <sjg@chromium.org> a
> écrit :
> > > > >>
> > > > >> Hi Tom, Bin,François,
> > > > >>
> > > > >> On Tue, 12 Oct 2021 at 19:34, Tom Rini <trini@konsulko.com>
> wrote:
> > > > >> >
> > > > >> > On Wed, Oct 13, 2021 at 09:29:14AM +0800, Bin Meng wrote:
> > > > >> > > Hi Simon,
> > > > >> > >
> > > > >> > > On Wed, Oct 13, 2021 at 9:01 AM Simon Glass <sjg@chromium.org>
> wrote:
> > > > >> > > >
> > > > >> > > > With Ilias' efforts we have dropped OF_PRIOR_STAGE and
> OF_HOSTFILE so
> > > > >> > > > there are only three ways to obtain a devicetree:
> > > > >> > > >
> > > > >> > > >    - OF_SEPARATE - the normal way, where the devicetree is
> built and
> > > > >> > > >       appended to U-Boot
> > > > >> > > >    - OF_EMBED - for development purposes, the devicetree is
> embedded in
> > > > >> > > >       the ELF file (also used for EFI)
> > > > >> > > >    - OF_BOARD - the board figures it out on its own
> > > > >> > > >
> > > > >> > > > The last one is currently set up so that no devicetree is
> needed at all
> > > > >> > > > in the U-Boot tree. Most boards do provide one, but some
> don't. Some
> > > > >> > > > don't even provide instructions on how to boot on the board.
> > > > >> > > >
> > > > >> > > > The problems with this approach are documented at [1].
> > > > >> > > >
> > > > >> > > > In practice, OF_BOARD is not really distinct from
> OF_SEPARATE. Any board
> > > > >> > > > can obtain its devicetree at runtime, even it is has a
> devicetree built
> > > > >> > > > in U-Boot. This is because U-Boot may be a second-stage
> bootloader and its
> > > > >> > > > caller may have a better idea about the hardware available
> in the machine.
> > > > >> > > > This is the case with a few QEMU boards, for example.
> > > > >> > > >
> > > > >> > > > So it makes no sense to have OF_BOARD as a 'choice'. It
> should be an
> > > > >> > > > option, available with either OF_SEPARATE or OF_EMBED.
> > > > >> > > >
> > > > >> > > > This series makes this change, adding various missing
> devicetree files
> > > > >> > > > (and placeholders) to make the build work.
> > > > >> > >
> > > > >> > > Adding device trees that are never used sounds like a hack to
> me.
> > > > >> > >
> > > > >> > > For QEMU, device tree is dynamically generated on the fly
> based on
> > > > >> > > command line parameters, and the device tree you put in this
> series
> > > > >> > > has various hardcoded <phandle> values which normally do not
> show up
> > > > >> > > in hand-written dts files.
> > > > >> > >
> > > > >> > > I am not sure I understand the whole point of this.
> > > > >> >
> > > > >> > I am also confused and do not like the idea of adding device
> trees for
> > > > >> > platforms that are capable of and can / do have a device tree
> to give us
> > > > >> > at run time.
> > > > >>
> > > > >> (I'll just reply to this one email, since the same points applies
> to
> > > > >> all replies I think)
> > > > >>
> > > > >> I have been thinking about this and discussing it with people for
> a
> > > > >> few months now. I've been signalling a change like this for over a
> > > > >> month now, on U-Boot contributor calls and in discussions with
> Linaro
> > > > >> people. I sent a patch (below) to try to explain things. I hope
> it is
> > > > >> not a surprise!
> > > > >>
> > > > >> The issue here is that we need a devicetree in-tree in U-Boot, to
> > > > >> avoid the mess that has been created by OF_PRIOR_STAGE, OF_BOARD,
> > > > >> BINMAN_STANDALONE_FDT and to a lesser extent, OF_HOSTFILE. Between
> > > > >> Ilias' series and this one we can get ourselves on a stronger
> footing.
> > > > >> There is just OF_SEPARATE, with OF_EMBED for debugging/ELF use.
> > > > >> For more context:
> > > > >>
> > > > >>
> http://patchwork.ozlabs.org/project/uboot/patch/20210919215111.3830278-3-sjg@chromium.org/
> > > > >>
> > > > >> BTW I did suggest to QEMU ARM that they support a way of adding
> the
> > > > >> u-boot.dtsi but there was not much interest there (in fact the
> > > > >> maintainer would prefer there was no special support even for
> booting
> > > > >> Linux directly!)
> > > > >
> > > > > i understand their point of view and agree with it.
> > > > >>
> > > > >> But in any case it doesn't really help U-Boot. I
> > > > >> think the path forward might be to run QEMU twice, once to get its
> > > > >> generated tree and once to give the 'merged' tree with the U-Boot
> > > > >> properties in it, if people want to use U-Boot features.
> > > > >>
> > > > >> I do strongly believe that OF_BOARD must be a run-time option,
> not a
> > > > >> build-time one. It creates all sorts of problems and obscurity
> which
> > > > >> have taken months to unpick. See the above patch for the
> rationale.
> > > > >>
> > > > >> To add to that rationale, OF_BOARD needs to be an option
> available to
> > > > >> any board. At some point in the future it may become a common way
> > > > >> things are done, e.g. TF-A calling U-Boot and providing a
> devicetree
> > > > >> to it. It doesn't make any sense to have people decide whether or
> not
> > > > >> to set OF_BOARD at build time, thus affecting how the image is put
> > > > >> together. We'll end up with different U-Boot build targets like
> > > > >> capricorn, capricorn_of_board and the like. It should be obvious
> where
> > > > >> that will lead. Instead, OF_BOARD needs to become a commonly used
> > > > >> option, perhaps enabled by most/all boards, so that this sort of
> build
> > > > >> explosion is not needed.
> > > > >
> > > > > If you mean that when boards are by construction providing a DTB
> to U-Boot then I agree very much. But I don’t understand how the patch set
> supports it as it puts dts files for those boards to be built.
> > > > >>
> > > > >> U-Boot needs to be flexible enough to
> > > > >> function correctly in whatever runtime environment in which it
> finds
> > > > >> itself.
> > > > >>
> > > > >> Also as binman is pressed into service more and more to build the
> > > > >> complex firmware images that are becoming fashionable, it needs a
> > > > >> definition (in the devicetree) that describes how to create the
> image.
> > > > >> We can't support that unless we are building a devicetree, nor
> can the
> > > > >> running program access the image layout without that information.
> > > > >>
> > > > >> François's point about 'don't use this with any kernel' is
> > > > >> germane...but of course I am not suggesting doing that, since
> OF_BOARD
> > > > >> is, still, enabled. We already use OF_BOARD for various boards
> that
> > > > >> include an in-tree devicetree - Raspberry Pi 1, 2 and 3, for
> example
> > > > >> (as I said in the cover letter "Most boards do provide one, but
> some
> > > > >> don't."). So this series is just completing the picture by
> enforcing
> > > > >> that *some sort* of devicetree is always present.
> > > > >
> > > > > That seems inconsistent with the OF_BOARD becomes the default.
> > > >
> > > > I think the key point that will get you closer to where I am on this
> > > > issue, is that OF_BOARD needs to be a run-time option. At present it
> > > > has build-time effects and this is quite wrong. If you go through all
> > > > the material I have written on this I think I have motivated that
> very
> > > > clearly.
> > > >
> > > > Another big issue is that I believe we need ONE devicetree for
> U-Boot,
> > > > not two that get merged by U-Boot. Again I have gone through that in
> a
> > > > lot of detail.
> > >
> > > I have a long long reply to your first reply here saved, but, maybe
> > > here's the biggest sticking point.  To be clear, you agree that U-Boot
> > > needs to support being passed a device tree to use, at run time, yes?
> >
> > Yes. The OF_BOARD feature provides this.
> >
> > >
> > > And in that case, would not be using the "fake" tree we built in?
> >
> > Not at runtime.
> >
> > >
> > > So is the sticking point here that we really have two classes of
> > > devices, one class where we will never ever be given the device tree at
> > > run time (think BeagleBone Black) and one where we will always be given
> > > one at run time (think Raspberry Pi) ?
> >
> > I'm not sure it will be that black and white. I suspect there will be
> > (many) boards which can boot happily with the U-Boot devicetree but
> > can also accept one at runtime, if provided. For example, you may want
> > to boot with or without TF-A or some other, earlier stage.
>
> I don't understand this: as Tom mentioned this is a platform decision:
> either it provides a DT somewhere (flash, EEPROM, prior firmware stage),
> or it doesn't. Sure, you can always hack your own DT in, somehow, for
> development or experimentation purposes, but that is a separate issue.
>
> Most of those platforms actually utilise some dynamic DTs, btw, where
> software amends the DT on the fly:
> - Highbank has a stub DT in SPI flash, and the management controller
> firmware detects the size and some extra DRAM (DIMMs!) parameters at boot
> time, and writes the /memory node accordingly.
> - RPi3/4 have DT overlay files on the SD card, and depending on what a
> user wrote in config.txt, they get applied to the DT (or not).
> - Even for the Allwinner H616 we amend the OF_SEPARATE provided DT copy in
> DRAM in TF-A, to carve out the DRAM region TF-A occupies.
> - QEMU is the obvious example, where the whole machine is highly dynamic,
> and there is no such thing as a fixed DT (how many cores?, how much
> memory?, how many virtio devices?, flash?, SCSI?)
>
> > I believe we have  got unstuck because OF_BOARD (perhaps inadvertently)
> > provided a way to entirely omit a devicetree from U-Boot, thus making
> > things like binman and U-Boot /config impossible, for example.
>
> I have the feeling this is because we abuse DT for this. Conceptually the
> DT is not a configuration file, but a hardware description.

+42!!!

> I see that it
> is also a nice and flexible, hierarchical key/value storage, for which we
> have code in anyway, so it makes hardcoding data in the code easier to
> avoid.
> But as we see now, this has problems as well.
>
> So shall we separate those use cases? And attach just a tree with /binman
> and /config (in DTB format), but treat this separately from the hardware
> description? (Admittedly I have still to wrap my head around why we need
> /binman at U-Boot runtime in the first place.)

+1

>
>
> Cheers,
> Andre
>
> > So I
> > want to claw that back, so there is always some sort of devicetree in
> > U-Boot, as we have for rpi_3, etc.
> >
> > 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-14 17:51 UTC|newest]

Thread overview: 164+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-13  1:01 [PATCH 00/16] fdt: Make OF_BOARD a boolean option Simon Glass
2021-10-13  1:01 ` Simon Glass
2021-10-13  1:01 ` [PATCH 01/16] arm: qemu: Mention -nographic in the docs Simon Glass
2021-10-13  1:01   ` Simon Glass
2021-10-13  1:01 ` [PATCH 02/16] arm: qemu: Explain how to extract the generate devicetree Simon Glass
2021-10-13  1:01   ` Simon Glass
2021-10-13  1:19   ` François Ozog
2021-10-13  1:19     ` François Ozog
2021-10-13 16:58     ` Simon Glass
2021-10-13 16:58       ` Simon Glass
2021-10-13 17:36       ` Tom Rini
2021-10-13 17:36         ` Tom Rini
2021-10-13  1:01 ` [PATCH 03/16] riscv: " Simon Glass
2021-10-13  1:01   ` Simon Glass
2021-10-13  1:01 ` [PATCH 04/16] arm: qemu: Add a devicetree file for qemu_arm Simon Glass
2021-10-13  1:01   ` Simon Glass
2021-10-13  1:01 ` [PATCH 05/16] arm: qemu: Add a devicetree file for qemu_arm64 Simon Glass
2021-10-13  1:01   ` Simon Glass
2021-10-13  1:15   ` François Ozog
2021-10-13  1:15     ` François Ozog
2021-10-27 14:44     ` Alex Bennée
2021-10-27 14:44       ` Alex Bennée
2021-10-27 14:56       ` Tom Rini
2021-10-27 14:56         ` Tom Rini
2021-10-27 18:34         ` Simon Glass
2021-10-27 18:34           ` Simon Glass
2021-10-27 18:39           ` Tom Rini
2021-10-27 18:39             ` Tom Rini
2021-10-27 19:45             ` Alex Bennée
2021-10-27 19:45               ` Alex Bennée
2021-10-13  1:01 ` [PATCH 06/16] riscv: qemu: Add devicetree files for qemu_riscv32/64 Simon Glass
2021-10-13  1:01   ` Simon Glass
2021-10-13  4:21   ` Heinrich Schuchardt
2021-10-13  4:21     ` Heinrich Schuchardt
2021-10-13  1:01 ` [PATCH 07/16] arm: rpi: Add a devicetree file for rpi_4 Simon Glass
2021-10-13  1:24   ` François Ozog
2021-10-13  1:01 ` [PATCH 08/16] arm: vexpress: Add a devicetree file for juno Simon Glass
2021-10-13  1:01 ` [PATCH 09/16] arm: xenguest_arm64: Add a fake devicetree file Simon Glass
2021-10-13  1:01 ` [PATCH 10/16] arm: octeontx: " Simon Glass
2021-10-13  1:27   ` François Ozog
2021-10-13  1:01 ` [PATCH 11/16] arm: xilinx_versal_virt: Add a " Simon Glass
2021-10-13  6:13   ` Michal Simek
2021-10-13 16:58     ` Simon Glass
2021-10-13  1:01 ` [PATCH 12/16] arm: bcm7xxx: " Simon Glass
2021-10-13  1:01 ` [PATCH 13/16] arm: qemu-ppce500: " Simon Glass
2021-10-13  1:01 ` [PATCH 14/16] arm: highbank: Add a fake " Simon Glass
2021-10-13  1:01 ` [PATCH 15/16] fdt: Make OF_BOARD a bool option Simon Glass
2021-10-13  4:22   ` Heinrich Schuchardt
2021-10-13 16:58     ` Simon Glass
2021-10-13 17:30       ` Sean Anderson
2021-10-24 19:53         ` Simon Glass
2021-10-13  1:01 ` [PATCH 16/16] Drop CONFIG_BINMAN_STANDALONE_FDT Simon Glass
2021-10-13  1:29 ` [PATCH 00/16] fdt: Make OF_BOARD a boolean option Bin Meng
2021-10-13  1:29   ` Bin Meng
2021-10-13  1:34   ` Tom Rini
2021-10-13  1:34     ` Tom Rini
2021-10-13  8:02     ` François Ozog
2021-10-13  8:02       ` François Ozog
2021-10-13 14:47     ` Simon Glass
2021-10-13 14:47       ` Simon Glass
2021-10-13 17:34       ` François Ozog
2021-10-13 17:34         ` François Ozog
2021-10-13 18:06         ` Simon Glass
2021-10-13 18:06           ` Simon Glass
2021-10-14 14:56           ` Tom Rini
2021-10-14 14:56             ` Tom Rini
2021-10-14 15:17             ` Simon Glass
2021-10-14 15:17               ` Simon Glass
2021-10-14 15:28               ` Tom Rini
2021-10-14 15:28                 ` Tom Rini
2021-10-14 17:58                 ` François Ozog
2021-10-14 17:58                   ` François Ozog
2021-10-15 18:03                 ` Simon Glass
2021-10-15 18:03                   ` Simon Glass
2021-10-26  6:46                   ` Ilias Apalodimas
2021-10-26  6:46                     ` Ilias Apalodimas
2021-10-27 12:59                     ` Tom Rini
2021-10-27 12:59                       ` Tom Rini
2021-10-27 13:30                       ` François Ozog
2021-10-27 13:30                         ` François Ozog
2021-10-27 13:38                         ` Tom Rini
2021-10-27 13:38                           ` Tom Rini
2021-10-27 13:47                           ` Ilias Apalodimas
2021-10-27 13:47                             ` Ilias Apalodimas
2021-10-27 14:26                             ` Tom Rini
2021-10-27 14:26                               ` Tom Rini
2021-10-27 13:48                           ` François Ozog
2021-10-27 13:48                             ` François Ozog
2021-10-27 14:30                             ` Tom Rini
2021-10-27 14:30                               ` Tom Rini
2021-10-28  2:50                     ` Simon Glass
2021-10-28  2:50                       ` Simon Glass
2021-10-28  8:21                       ` François Ozog
2021-10-28  8:21                         ` François Ozog
2021-10-28 14:30                         ` Simon Glass
2021-10-28 14:30                           ` Simon Glass
2021-10-28 14:50                           ` François Ozog
2021-10-28 14:50                             ` François Ozog
2021-10-28 15:44                             ` Simon Glass
2021-10-28 15:44                               ` Simon Glass
2021-10-28 16:25                               ` François Ozog
2021-10-28 16:25                                 ` François Ozog
2021-11-02 14:59                                 ` Simon Glass
2021-11-02 14:59                                   ` Simon Glass
2021-11-01 11:04                       ` Ilias Apalodimas
2021-11-01 11:04                         ` Ilias Apalodimas
2021-11-02 10:06                         ` Michael Walle
2021-11-02 10:06                           ` Michael Walle
2021-11-02 12:34                           ` François Ozog
2021-11-02 12:34                             ` François Ozog
2021-11-02 14:59                         ` Simon Glass
2021-11-02 14:59                           ` Simon Glass
2021-10-27 12:48                   ` Tom Rini
2021-10-27 12:48                     ` Tom Rini
2021-10-27 13:15                     ` François Ozog
2021-10-27 13:15                       ` François Ozog
2021-10-27 13:23                       ` Heinrich Schuchardt
2021-10-27 13:23                         ` Heinrich Schuchardt
2021-10-27 14:55                         ` Tom Rini
2021-10-27 14:55                           ` Tom Rini
2021-10-27 15:02                           ` Heinrich Schuchardt
2021-10-27 15:02                             ` Heinrich Schuchardt
2021-10-27 18:04                             ` Tom Rini
2021-10-27 18:04                               ` Tom Rini
2021-10-27 14:54                       ` Tom Rini
2021-10-27 14:54                         ` Tom Rini
2021-10-27 15:10                       ` Mark Kettenis
2021-10-27 15:10                         ` Mark Kettenis
2021-10-27 15:24                         ` Simon Glass
2021-10-27 15:24                           ` Simon Glass
2021-10-27 18:06                           ` Tom Rini
2021-10-27 18:06                             ` Tom Rini
2021-10-27 18:11                             ` François Ozog
2021-10-27 18:11                               ` François Ozog
2021-10-27 21:52                           ` Mark Kettenis
2021-10-27 21:52                             ` Mark Kettenis
2021-10-27 16:02                         ` François Ozog
2021-10-27 16:02                           ` François Ozog
2021-10-27 19:06                           ` Tom Rini
2021-10-27 19:06                             ` Tom Rini
2021-10-27 22:00                             ` François Ozog
2021-10-27 22:00                               ` François Ozog
2021-10-28 14:41                               ` Tom Rini
2021-10-28 14:41                                 ` Tom Rini
2021-10-14 16:24               ` Andre Przywara
2021-10-14 16:24                 ` Andre Przywara
2021-10-14 17:48                 ` François Ozog [this message]
2021-10-14 17:48                   ` François Ozog
2021-10-14 18:12           ` François Ozog
2021-10-14 18:12             ` François Ozog
2021-10-14 21:00             ` Simon Glass
2021-10-14 21:00               ` Simon Glass
2021-10-13 12:39   ` Philippe Mathieu-Daudé
2021-10-13 12:39     ` Philippe Mathieu-Daudé
2021-10-13 13:06     ` François Ozog
2021-10-13 13:06       ` François Ozog
2021-10-13  4:26 ` Heinrich Schuchardt
2021-10-13  4:26   ` Heinrich Schuchardt
2021-10-13 13:06   ` François Ozog
2021-10-13 13:06     ` François Ozog
2021-10-13  9:50 ` Andre Przywara
2021-10-13  9:50   ` Andre Przywara
2021-10-13 13:05   ` François Ozog
2021-10-13 13:05     ` 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_=VWbkrkYzQCnz7xPdsOAg-1qcYm6+sCiccMu2hazknoWQ@mail.gmail.com' \
    --to=francois.ozog@linaro.org \
    --cc=agraf@csgraf.de \
    --cc=albert.u.boot@aribaud.net \
    --cc=anastasiia_lukianenko@epam.com \
    --cc=andre.przywara@arm.com \
    --cc=ashok.reddy.soma@xilinx.com \
    --cc=atish.patra@wdc.com \
    --cc=awilliams@marvell.com \
    --cc=bin.meng@windriver.com \
    --cc=bmeng.cn@gmail.com \
    --cc=christianshewitt@gmail.com \
    --cc=david.abdurachmanov@sifive.com \
    --cc=dimitri.ledkov@canonical.com \
    --cc=festevam@gmail.com \
    --cc=fitzsim@fitzsim.org \
    --cc=green.wan@sifive.com \
    --cc=heinrich.schuchardt@canonical.com \
    --cc=hs@denx.de \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jagan@amarulasolutions.com \
    --cc=kever.yang@rock-chips.com \
    --cc=kristo@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=liviu.dudau@foss.arm.com \
    --cc=lusus@denx.de \
    --cc=marek.behun@nic.cz \
    --cc=mbrugger@suse.com \
    --cc=michal.simek@xilinx.com \
    --cc=monstr@monstr.eu \
    --cc=narmstrong@baylibre.com \
    --cc=oleksandr_andrushchenko@epam.com \
    --cc=padmarao.begari@microchip.com \
    --cc=pali@kernel.org \
    --cc=pbrobinson@gmail.com \
    --cc=priyanka.jain@nxp.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rainer.boschung@hitachi-powergrids.com \
    --cc=rfried.dev@gmail.com \
    --cc=rick@andestech.com \
    --cc=seanga2@gmail.com \
    --cc=sinan@writeme.com \
    --cc=sjg@chromium.org \
    --cc=sr@denx.de \
    --cc=swarren@nvidia.com \
    --cc=swarren@wwwdotorg.org \
    --cc=t.karthik.reddy@xilinx.com \
    --cc=tharvey@gateworks.com \
    --cc=tianrui-wei@outlook.com \
    --cc=trini@konsulko.com \
    --cc=tuomas.tynkkynen@iki.fi \
    --cc=u-boot@lists.denx.de \
    --cc=valentin.longchamp@hitachi-powergrids.com \
    --cc=vanbaren@cideas.com \
    --cc=vladimir.oltean@nxp.com \
    --cc=wd@denx.de \
    --cc=xypron.glpk@gmx.de \
    --cc=ycliang@andestech.com \
    --cc=zong.li@sifive.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 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.