All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 04/19] SPL: FIT: factor out spl_load_fit_image()
Date: Wed, 5 Apr 2017 04:29:34 -0600	[thread overview]
Message-ID: <CAPnjgZ2H5vUCFGLVV8EYo8SMfbsxsnsVCky=V9ifQy-fyfwXEQ@mail.gmail.com> (raw)
In-Reply-To: <1490999491-14899-5-git-send-email-andre.przywara@arm.com>

On 31 March 2017 at 16:31, Andre Przywara <andre.przywara@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@arm.com>
> ---
>  common/spl/spl_fit.c | 160 +++++++++++++++++++++++++--------------------------
>  1 file changed, 78 insertions(+), 82 deletions(-)
>

Reviewed-by: Simon Glass <sjg@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?)

  reply	other threads:[~2017-04-05 10:29 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-31 22:31 [U-Boot] [PATCH v3 00/19] SPL: extend FIT loading support Andre Przywara
2017-03-31 22:31 ` [U-Boot] [PATCH v3 01/19] SPL: FIT: refactor FDT loading Andre Przywara
2017-04-05 10:29   ` Simon Glass
2017-04-24 17:08   ` Peter Robinson
2017-03-31 22:31 ` [U-Boot] [PATCH v3 02/19] SPL: FIT: rework U-Boot image loading Andre Przywara
2017-04-05 10:29   ` Simon Glass
2017-03-31 22:31 ` [U-Boot] [PATCH v3 03/19] SPL: FIT: improve error handling Andre Przywara
2017-04-05 10:29   ` Simon Glass
2017-03-31 22:31 ` [U-Boot] [PATCH v3 04/19] SPL: FIT: factor out spl_load_fit_image() Andre Przywara
2017-04-05 10:29   ` Simon Glass [this message]
2017-03-31 22:31 ` [U-Boot] [PATCH v3 05/19] SPL: FIT: allow loading multiple images Andre Przywara
2017-04-03  9:40   ` Lukasz Majewski
2017-04-03 10:05     ` Andre Przywara
2017-04-03 10:15       ` Dr. Philipp Tomsich
2017-04-03 10:50       ` Lukasz Majewski
2017-04-05 10:29   ` Simon Glass
2017-03-31 22:31 ` [U-Boot] [PATCH v3 06/19] Kconfig: fix SPL_FIT dependency Andre Przywara
2017-03-31 22:31 ` [U-Boot] [PATCH v3 07/19] tools: mksunxiboot: allow larger SPL binaries Andre Przywara
2017-03-31 22:31 ` [U-Boot] [PATCH v3 08/19] armv8: SPL: only compile GIC code if needed Andre Przywara
2017-03-31 22:31 ` [U-Boot] [PATCH v3 09/19] armv8: fsl: move ccn504 code into FSL Makefile Andre Przywara
2017-03-31 22:31 ` [U-Boot] [PATCH v3 10/19] sunxi: A64: move SPL stack to end of SRAM A2 Andre Przywara
2017-04-03  7:21   ` Maxime Ripard
2017-03-31 22:31 ` [U-Boot] [PATCH v3 11/19] sunxi: SPL: store RAM size in gd Andre Przywara
2017-04-03  7:22   ` Maxime Ripard
2017-03-31 22:31 ` [U-Boot] [PATCH v3 12/19] sunxi: SPL: add FIT config selector for Pine64 boards Andre Przywara
2017-04-03  7:22   ` Maxime Ripard
2017-03-31 22:31 ` [U-Boot] [PATCH v3 13/19] Makefile: add rules to generate SPL FIT images Andre Przywara
2017-03-31 22:31 ` [U-Boot] [PATCH v3 14/19] sunxi: 64-bit SoCs: introduce FIT generator script Andre Przywara
2017-04-03  7:23   ` Maxime Ripard
2017-03-31 22:31 ` [U-Boot] [PATCH v3 15/19] sunxi: defconfig: add supported DT list for Pine64 and OrangePi PC 2 Andre Przywara
2017-04-03  7:25   ` Maxime Ripard
2017-03-31 22:31 ` [U-Boot] [PATCH v3 16/19] sunxi: enable automatic FIT build for 64-bit SoCs Andre Przywara
2017-04-03  7:26   ` Maxime Ripard
2017-03-31 22:31 ` [U-Boot] [PATCH v3 17/19] sunxi: Store the device tree name in the SPL header Andre Przywara
2017-03-31 22:31 ` [U-Boot] [PATCH v3 18/19] sunxi: use SPL header DT name for FIT board matching Andre Przywara
2017-03-31 22:31 ` [U-Boot] [PATCH v3 19/19] sunxi: update Pine64 README Andre Przywara
2017-04-16  1:20   ` Andreas Färber
2017-04-18 20:38     ` André Przywara
2017-04-19 22:21       ` Andreas Färber
2017-04-19 22:24         ` Dr. Philipp Tomsich
2017-04-20  0:54         ` Tom Rini
2017-04-16 19:34   ` Simon Glass
2017-04-18 18:21   ` Andreas Färber
2017-03-31 22:43 ` [U-Boot] [PATCH v3 00/19] SPL: extend FIT loading support Simon Glass
2017-03-31 23:21   ` André Przywara
2017-04-05 10:29     ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPnjgZ2H5vUCFGLVV8EYo8SMfbsxsnsVCky=V9ifQy-fyfwXEQ@mail.gmail.com' \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.