LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Paul Walmsley <firstname.lastname@example.org>
To: Atish Patra <email@example.com>
Cc: Paul Walmsley <firstname.lastname@example.org>,
Christoph Hellwig <email@example.com>,
Paul Walmsley <firstname.lastname@example.org>, Albert Ou <email@example.com>,
Palmer Dabbelt <firstname.lastname@example.org>,
Subject: Re: [PATCH 1/6] arch: riscv: add support for building DTB files from DT source data
Date: Thu, 11 Apr 2019 17:08:11 -0700 (PDT) [thread overview]
Message-ID: <alpine.DEB.email@example.com> (raw)
On Thu, 11 Apr 2019, Atish Patra wrote:
> On 4/11/19 2:12 PM, Paul Walmsley wrote:
> > On Thu, 11 Apr 2019, Christoph Hellwig wrote:
> > > On Thu, Apr 11, 2019 at 01:42:59AM -0700, Paul Walmsley wrote:
> > > > Similar to ARM64, add support for building DTB files from DT source
> > > > data for RISC-V boards.
> > > >
> > > > This patch starts with the infrastructure needed for SiFive boards.
> > > > Boards from other vendors would add support here in a similar form.
> > >
> > > What do we build it for? We'd really need something like this:
> > >
> > > http://git.infradead.org/users/hch/misc.git/commitdiff/d6242aa147baf57e05e2932199c74d8d24b9926e
> > > http://git.infradead.org/users/hch/misc.git/commitdiff/0cd5413c8094ab57b68e0629dacfed695f4c1ef1
> > >
> > > To actually use the DT files.
> > Those patches might be useful - I have not reviewed them closely - but
> > they are not necessary.
> > The FSBL already supplies a DTB to Linux. I assume the U-boot port works
> > the same way.
> I am bit confused here. I thought the idea behind putting the the DTS in
> kernel so that Kernel don't need to depend on DT passed from boot loaders.
Some users will want to do that - mostly embedded device integrators and
kernel developers. We should definitely support these use-cases. So the
basic idea behind Christoph's patch to do that is good (I have not yet
reviewed the code nor tested it).
In fact, there has been an unofficial patch to do something similar for
ARM for about a decade now. But for various reasons, some technical, some
managerial - it was never merged. To be clear, I do agree that we should
merge something like that for RISC-V.
However: the vast majority of users -- even embedded users -- will not use
a kernel with a bundled DTB. This is because it irrevocably ties that
kernel binary to one specific board type. I hope it is obvious why this
would be a non-starter for Linux distributions, and, more generally,
anyone who wants their kernels to be usable on multiple boards. Those
distributors would need to ship one kernel binary per board, or bloat
their kernels with DTBs and come up with some new mechanism to select one.
> Currently, DTB passed from FSBL is modified by OpenSBI/BBL before passing to
> U-Boot or Linux.
This should be avoided whenever possible. I'd be interested in hearing
what OpenSBI is doing now to the DTB; perhaps there is a case where it
makes sense. But in general, doing this makes development and maintenance
quite difficult. Considre that different operating systems that may use
the same SBI layer may use different DT data formats, or may not even use
DT at all. And when the DT data format changes - as is happening now - a
maintenance hassle is created, since then versions across multiple pieces
of software may need to be synchronized. It is also very disconcerting as
a kernel developer to have multiple pieces of software modifying one's
The DT data is meant to represent hardware fact. DT is also used to pass
in some non-hardware-related runtime configuration parameters, via the
"chosen" node. But that's about it. So from that point of view, only the
first-stage bootloader should be altering the DT data, and only then in
very minimal ways.
> If Linux kernel can boot from the DTS contained within its source code as is,
> that would be much more helpful.
If you are thinking about embedded system builders, and developers who
only care about their test kernel being compatible with one board, I agree
with you for those specific use-cases. Almost everyone else will pass in
a separate DTB, specific to the board they are using, from U-Boot or
Coreboot or GRUB.
> > I haven't switched to U-boot yet for these driver tests, so I
> > personally have been using the open-source FSBL
> > (freedom-u540-c000-bootloader) with the following trivial patches
> > applied:
> > https://github.com/sifive/freedom-u540-c000-bootloader/tree/dev/paulw/supply-fsbl-dtb-v5.1-rc4
> > The fsbl/ux00_fsbl.dtb file can be symlinked to the kernel DTB output,
> > e.g., ~/linux/arch/riscv/boot/dts/sifive/hifive-unleashed-a00-fu540.dtb.
> This assumes that FSBL has to be rebuilt every time I want to change the DT. I
> was hoping to avoid that.
The FSBL is on its way out. It is just a short-term workaround until the
various popular bootloader ports become more stable. After that happens,
it's likely that almost no one to use the current SiFive FSBLs. We plan
to transition our Freedom-U development environment away from it
The point of what I wrote to Christoph earlier is simply that everyone is
already using DTB data that is passed in from an early bootloader, whether
they realize it or not. So there is an existence proof that no additional
patches are needed for the basics to function. It may not be functioning
well in some cases, and may need patching; but that is a separate matter.
next prev parent reply other threads:[~2019-04-12 0:08 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-11 8:42 Paul Walmsley
2019-04-11 8:43 ` [PATCH 2/6] dt-bindings: riscv: sifive: add YAML documentation for the SiFive FU540 Paul Walmsley
2019-04-29 18:08 ` Rob Herring
2019-04-29 18:13 ` Paul Walmsley
2019-04-11 8:43 ` [PATCH 3/6] dt-bindings: riscv: convert cpu binding to json-schema Paul Walmsley
2019-04-11 12:55 ` Rob Herring
2019-04-11 8:43 ` [PATCH 4/6] riscv: dts: add initial support for the SiFive FU540-C000 SoC Paul Walmsley
2019-04-11 13:10 ` Rob Herring
2019-04-11 8:43 ` [PATCH 5/6] riscv: dts: add initial board data for the SiFive HiFive Unleashed Paul Walmsley
2019-04-11 13:03 ` Rob Herring
2019-04-11 8:43 ` [PATCH 6/6] riscv: defconfig: enable ARCH_SIFIVE Paul Walmsley
2019-04-11 11:46 ` [PATCH 1/6] arch: riscv: add support for building DTB files from DT source data Christoph Hellwig
2019-04-11 21:11 ` Paul Walmsley
2019-04-11 21:52 ` Atish Patra
2019-04-12 0:08 ` Paul Walmsley [this message]
2019-04-12 5:49 ` Christoph Hellwig
2019-04-12 7:37 ` Atish Patra
2019-04-11 21:38 ` Atish Patra
2019-05-22 19:18 ` Loys Ollivier
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:
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--subject='Re: [PATCH 1/6] arch: riscv: add support for building DTB files from DT source data' \
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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).