[PATCH 1/2] fsl-layerscape: add dtb overlay feature

Michael Walle michael at walle.cc
Thu Jan 6 08:40:21 CET 2022


Hi Sahil,

Am 2022-01-06 07:09, schrieb Sahil Malhotra (OSS):

>> I don't know I follow. u-boot and linux should have the same device 
>> tree;
>> regardless if that device is used or not. So applying the overlay just 
>> for linux isn't
>> enough here.
> Ok, I don't think that as of now, in all platforms uboot and linux
> have same devie
> tree.

That doesn't mean it is ok to diverge again. I put a lot of effort in
syncing uboot's LS1028A device tree with linux.

> But I will try to address your concern, but I don’t know how to apply 
> overlay to
> dtb which is embedded in u-boot binary, Can you please point me to one 
> reference
> which is doing this thing, I will take reference from there.

Sorry I can't advise you with that. There is board_fix_fdt() maybe
that will help. But I'm not conviced this is the correct approach,
see below.

>> > We don't use DTB in OP-TEE, but when we use CAAM in OP-TEE, OP-TEE
>> > reserves One Job Ring for its use and that is communicated to Kernel
>> > using DTB overlay.
>> >
>> >> what if the overlay doesn't match the dtb?
>> > I didn't get this point, can you please elaborate a little.
>> 
>> You are merging a dtb fragment with an unknown dtb, right? Who says 
>> they
>> match? you might have an old dtb where the supplied dtb fragment 
>> doesn't
>> make any sense.
>> 
>> I might be missing something here. Eg. where is the linux dtb supposed 
>> to come
>> from? This patchset is really missing an example and a description how 
>> things
>> should work.
> If supplied DTB does not match with DTB overlay fragment. then overlay
> will not get applied.

I don't think this is what happens here. fdt_overlay_apply() will
mark the fdt as damaged and there will be no fdt at all.

> We don't have any control on where user picks the DTB, but we can only
> make sure DTB
> overlay feature must work with DTBs which are upstreamed
> If user makes its own customized DTB, we cannot make sure that things 
> will work.

Again. Is there any documentation on how this should all work
together? Where does optee get its device tree from? Shouldn't
it be the same device tree as u-boot and linux? Shouldn't optee
modify the device tree in place before jumping back to u-boot?

Andrey, do you know how this works on imx?

-michael


More information about the U-Boot mailing list