[U-Boot] [PATCH v3 04/19] SPL: FIT: factor out spl_load_fit_image()

Simon Glass sjg at chromium.org
Wed Apr 5 10:29:34 UTC 2017


On 31 March 2017 at 16:31, Andre Przywara <andre.przywara at arm.com> wrote:
> At the moment we load two images from a FIT image: the actual U-Boot
> image and the .dtb file. Both times we have very similar code, that deals
> with alignment requirements the media we load from imposes upon us.
> Factor out this code into a new function, which we just call twice.
>
> Signed-off-by: Andre Przywara <andre.przywara at arm.com>
> ---
>  common/spl/spl_fit.c | 160 +++++++++++++++++++++++++--------------------------
>  1 file changed, 78 insertions(+), 82 deletions(-)
>

Reviewed-by: Simon Glass <sjg at chromium.org>

nit below

> diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
> index 55da37a..cfcb1fe 100644
> --- a/common/spl/spl_fit.c
> +++ b/common/spl/spl_fit.c
> @@ -158,19 +158,79 @@ static int get_aligned_image_size(struct spl_load_info *info, int data_size,
>         return (data_size + info->bl_len - 1) / info->bl_len;
>  }
>
> +/*
> + * spl_load_fit_image loads the image described in a certain FIT node.
> + * @info: points to information about the device to load data from
> + * @sector: the start sector of the FIT image on the device
> + * @fit: points to the flattened device tree blob describing the FIT image
> + * @base_offset: the beginning of the data area containing the actual
> + *              image data, relative to the beginning of the FIT
> + * @node: offset of the DT node describing the image to load (relative to @fit)
> + * @image_info: will be filled with information about the loaded image
> + *             If the FIT node does not contain a "load" (address) property,
> + *             the image gets loaded to the address pointed to by the
> + *             load_addr member in this struct.
> + *
> + * Returns an error value or 0 on success.

@return 0 on success, or -ve error value

(is that right?)


More information about the U-Boot mailing list