[U-Boot] [RFC PATCH 0/22] RFC: image: Reduce code duplication and refactor

Simon Glass sjg at chromium.org
Sat Mar 9 22:43:15 CET 2013


Hi,

On Thu, Jan 10, 2013 at 6:58 AM, Simon Glass <sjg at chromium.org> wrote:

> In creating a new feature[*] I found that the image code includes quite
> a bit of duplication in places. In particular the code to load a kernel,
> FDT and ramdisk is all fairly similar, but subtly different.
>
> This series introduces a new function fit_image_load() which loads an image
> from a FIT and supports the various features. For the bootstage updates,
> these are standardised so that each file has its own range and the events
> within that range have corresponding numbers. This means that the boot
> progress numbers will change slightly with this series.
>
> The image.c file is still very long. Rather than perpetuate the #ifdefs
> in the code I have split out the image.c code that is dependent on
> CONFIG_OF_LIBFDT into image-fdt.c.
>
> Several architectures have their own way of setting up a ramdisk and FDT
> for booting. An attempt is made here to unify these by providing a function
> image_setup_linux() to handle the overall task, and image_setup_fdt() to
> set
> up the FDT.
>
> For ARM, the bootm code is a maze of #ifdefs, which means that many boards
> compile the code differently and it takes longer to detect breakages. To
> get
> around this, some defines are added to ARM's bootm.h to permit the use of
> if() instead of #ifdef, making use of the compiler's dead code elimination.
>
> Also this series introduces a very basic test of image loading using
> sandbox.
> Some patches add bootm support for sandbox, and also a 'sb save' command to
> save memory to a host file (used to check that the bootm actually worked).
>
> A test program for sandbox is added as a basic sanity check of image
> loading
> as performed by bootm.
>
> This series depends on the verified boot series since it builds on the
> clean-up in that. You can get this series from:
>
>    http://git.denx.de/u-boot-x86.git
>
> branch name 'image'.
>

Has anyone taken a look at this series? It is mostly a clean-up, but does
also introduces basic tests for FIT.

Regards,
Simon


More information about the U-Boot mailing list