Re: [patches] [PATCH] RISC-V: Support built-in dtb

From: Arnd Bergmann
Date: Thu Dec 21 2017 - 15:43:29 EST

On Thu, Dec 21, 2017 at 9:32 PM, Palmer Dabbelt <palmer@xxxxxxxxxx> wrote:
> On Wed, 20 Dec 2017 01:14:31 PST (-0800), zongbox@xxxxxxxxx wrote:

> I've added Arnd and Olof, in case they have a bit more perspective here. If
> I'm reading this correctly, there isn't an arm or arm64 option to do this.
> There is an option to built in many DTBs, which makes a lot more sense to me
> as it doesn't tie the kernel to any one particular implementation. We'd
> need a mechanism for picking the DTB that Linux should use. We've kicked
> around the idea of:
> * Having the bootloader always provide a DTB.
> * Taking a hash of that DTB when booting Linux.
> * Using that hash to look up DTBs that are built in to Linux.
> This would allow us to support replacing broken DTBs if they escape into the
> wild, but would still allow us to have a portable kernel.

Having an embedded DTB is only necessary for platforms with a legacy bootloader
that doesn't understand DT at all, you should never need that here.

I would suggest to require each bootloader to provide a way to replace the DTB
with one that gets installed alongside the kernel.