[PATCH] fit: Load DTO into temporary buffer and ignore load address

Tom Rini trini at konsulko.com
Fri Jul 16 17:52:35 CEST 2021


On Fri, Jun 11, 2021 at 04:09:56AM +0200, Marek Vasut wrote:

> The current fitImage DTO implementation expects each fitImage image
> subnode containing DTO to have 'load' property, pointing somewhere
> into memory where the DTO will be loaded. The address in the 'load'
> property must be different then the base DT load address and there
> must be sufficient amount of space between those two addresses.
> Selecting and using such hard-coded addresses is fragile, error
> prone and difficult to port even across devices with the same SoC
> and different DRAM sizes.
> 
> The DTO cannot be applied in-place because fdt_overlay_apply_verbose()
> modifies the DTO when applying it onto the base DT, so if the DTO was
> used in place within the fitImage, call to fdt_overlay_apply_verbose()
> would corrupt the fitImage.
> 
> Instead of copying the DTO to a specific hard-coded load address,
> allocate a buffer, copy the DTO into that buffer, apply the DTO onto
> the base DT, and free the buffer.
> 
> The upside of this approach is that it is no longer necessary to
> select and hard-code specific DTO load address into the DTO. The
> slight downside is the new malloc()/free() overhead for each DTO,
> but that is negligible (*).
> 
> (*) on iMX8MM/MN and STM32MP1
> 
> Signed-off-by: Marek Vasut <marex at denx.de>
> Cc: Pantelis Antoniou <pantelis.antoniou at konsulko.com>
> Cc: Simon Glass <sjg at chromium.org>
> Cc: Tom Rini <trini at konsulko.com>
> Reviewed-by: Simon Glass <sjg at chromium.org>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210716/3e05aefa/attachment.sig>


More information about the U-Boot mailing list