[PATCH] spl: fit: List DTOs applied by SPL in U-Boot control DT

Marek Vasut marex at denx.de
Fri Jun 28 04:42:20 CEST 2024


On 6/27/24 2:42 PM, Quentin Schulz wrote:
> Hi Marek,

Hi,

> On 6/27/24 1:58 AM, Marek Vasut wrote:
>> Insert /u-boot,<dto-name> = <index> property into the U-Boot control DT
>> during SPL DTO application process. This can be used by user to inspect
>> which DTOs got applied by the SPL and in which order from running U-Boot.
>>
>> Example:
>> ```
>> u-boot=> fdt addr $fdtcontroladdr && fdt list /
>> Working FDT set to aee9aeb0
>> / {
>>          u-boot,fdt-dto-imx8mp-dhcom-pdk3-overlay-rev100 = <0x00000005>;
>>          u-boot,fdt-dto-imx8mp-dhcom-som-overlay-rev100 = <0x00000004>;
>>          u-boot,fdt-dto-imx8mp-dhcom-pdk-overlay-eth2xfast = 
>> <0x00000003>;
>>          u-boot,fdt-dto-imx8mp-dhcom-som-overlay-eth2xfast = 
>> <0x00000002>;
>> ...
>> ```
>>
> 
> Shouldn't this rather be in /config node?

This is what I had there originally, but then I realized that some DTs 
might not have the /config node in them (or am I mistaken?), so I moved 
the new properties into the root node, which surely exists.

It also keeps the code simpler, as it doesn't have to fiddle with 
creation of the /config node if it doesn't exist.

> Also, I am highly suggesting to have an additional prefix aside from 
> u-boot to avoid unfortunate name clashes between DTO and existing 
> properties.

OK, fixed in V2.

> Or could be in its own child node of /config ?

Please see above.

> In any case, can you please add or edit a file somewhere to define this 
> new dt-binding.

Done in V2

> Additional question, what is this index for?

To indicate in which order the DTOs were applied by the SPL. It matches 
the order in which the the DTOs are stored in the fitImage and the order 
in which SPL iterates over them. In case the SPL skips a DTO using 
board_spl_fit_append_fdt_skip(), the integer sequence might have gaps.

> I am wondering if we cannot simply have a string array with overlays 
> applied left-to-right or right-to-left instead? Or u-boot,fdt-dto-N = 
> "imx8mp-dhcom-pdk3-overlay-rev100";

We can, but that is much harder to test for presence of specific DTO on 
U-Boot command line. It is easy to test for presence of boolean or 
integer DT property using 'fdt' command.

Thanks !


More information about the U-Boot mailing list