public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime.ripard@bootlin.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 01/20] spl: fix binman_sym output check
Date: Tue, 13 Mar 2018 14:36:06 +0100	[thread overview]
Message-ID: <20180313133606.eb7geqnlvvcjtf47@flea> (raw)
In-Reply-To: <20180228195202.8183-2-miquel.raynal@bootlin.com>

Hi Simon,

On Wed, Feb 28, 2018 at 08:51:43PM +0100, Miquel Raynal wrote:
> A previous commit introduced the use of binman in the SPL.
> 
> After the binman_sym call over the 'pos' symbol, the output value is
> checked against BINMAN_SYM_MISSING (-1UL). According to the
> documentation (tools/binman/README), when it comes to the 'pos'
> attribute:
> 
> pos:
> 	This sets the position of an entry within the image. The first
> 	byte of the image is normally at position 0. If 'pos' is not
> 	provided, binman sets it to the end of the previous region, or
> 	the start of the image's entry area (normally 0) if there is no
> 	previous region.
> 
> So instead of checking if the return value is BINMAN_SYM_MISSING, we
> should also check if the value is not null.
> 
> The failure happens when using both the SPL file and the U-Boot file
> independently instead of the concatenated file (SPL + padding + U-Boot).
> This is because the U-Boot binary file alone does not have the U-Boot
> header while it is present in the concatenation file. Not having the
> header forces the SPL to discover where it should load U-Boot. The
> binman_sym call is supposed to do that but fails. Because of the wrong
> check, the destination address was set to 0 while it should have been
> somewhere in RAM. This, obviously, stalls the board.
> 
> Fixes: 8bee2d251afb ("binman: Add binman symbol support to SPL")
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

I'm not sure why it wasn't sent to you, but could you please have a
look at that patch?

Thanks!
Maxime

> ---
>  common/spl/spl.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/common/spl/spl.c b/common/spl/spl.c
> index b1ce56d0d0..61d3071324 100644
> --- a/common/spl/spl.c
> +++ b/common/spl/spl.c
> @@ -127,8 +127,14 @@ void spl_set_header_raw_uboot(struct spl_image_info *spl_image)
>  	ulong u_boot_pos = binman_sym(ulong, u_boot_any, pos);
>  
>  	spl_image->size = CONFIG_SYS_MONITOR_LEN;
> -	if (u_boot_pos != BINMAN_SYM_MISSING) {
> -		/* biman does not support separate entry addresses at present */
> +
> +	/*
> +	 * Binman error cases: address of the end of the previous region or the
> +	 * start of the image's entry area (usually 0) if there is no previous
> +	 * region.
> +	 */
> +	if (u_boot_pos && u_boot_pos != BINMAN_SYM_MISSING) {
> +		/* Binman does not support separated entry addresses */
>  		spl_image->entry_point = u_boot_pos;
>  		spl_image->load_addr = u_boot_pos;
>  	} else {
> -- 
> 2.14.1
> 

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180313/94202066/attachment.sig>

  reply	other threads:[~2018-03-13 13:36 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-28 19:51 [U-Boot] [PATCH v3 00/20] Bring NAND support to Nintendo NES Classic Miquel Raynal
2018-02-28 19:51 ` [U-Boot] [PATCH v3 01/20] spl: fix binman_sym output check Miquel Raynal
2018-03-13 13:36   ` Maxime Ripard [this message]
2018-03-20 14:24     ` Maxime Ripard
2018-03-31 10:19     ` Simon Glass
2018-02-28 19:51 ` [U-Boot] [PATCH v3 02/20] mtd: nand: sunxi: fix ECC strength choice Miquel Raynal
2018-02-28 19:51 ` [U-Boot] [PATCH v3 03/20] spl: nand: sunxi: fix second case of modulo by zero error Miquel Raynal
2018-02-28 19:51 ` [U-Boot] [PATCH v3 04/20] spl: nand: sunxi: fix typo on register name Miquel Raynal
2018-02-28 19:51 ` [U-Boot] [PATCH v3 05/20] spl: nand: sunxi: introduce the nand_wait_int() helper Miquel Raynal
2018-02-28 19:51 ` [U-Boot] [PATCH v3 06/20] spl: nand: sunxi: introduce the nand_wait_cmd_fifo_empty() helper Miquel Raynal
2018-02-28 19:51 ` [U-Boot] [PATCH v3 07/20] spl: nand: sunxi: add missing status clear Miquel Raynal
2018-02-28 19:51 ` [U-Boot] [PATCH v3 08/20] spl: nand: sunxi: create an helper to handle command execution Miquel Raynal
2018-02-28 19:51 ` [U-Boot] [PATCH v3 09/20] spl: nand: sunxi: ensure enough time has passed after changing the column Miquel Raynal
2018-02-28 19:51 ` [U-Boot] [PATCH v3 10/20] spl: nand: sunxi: make the reset column helper more generic Miquel Raynal
2018-02-28 19:51 ` [U-Boot] [PATCH v3 11/20] sunxi: spl: deassert the NAND controller reset line Miquel Raynal
2018-02-28 19:51 ` [U-Boot] [PATCH v3 12/20] spl: nand: sunxi: declare the ecc_bytes array globally Miquel Raynal
2018-02-28 19:51 ` [U-Boot] [PATCH v3 13/20] spl: nand: sunxi: use PIO instead of DMA Miquel Raynal
2021-06-24 12:05   ` Maxime Ripard
2021-07-06 16:00     ` Miquel Raynal
2021-07-07  9:57       ` Maxime Ripard
2018-02-28 19:51 ` [U-Boot] [PATCH v3 14/20] sunxi: spl: remove DMA related settings of the NAND controller Miquel Raynal
2018-02-28 19:51 ` [U-Boot] [PATCH v3 15/20] sunxi: allow NAND support to be compiled for sun8i platforms Miquel Raynal
2018-02-28 19:51 ` [U-Boot] [PATCH v3 16/20] sunxi: dts: enable NAND on NES classic Miquel Raynal
2018-02-28 19:51 ` [U-Boot] [PATCH v3 17/20] sunxi: automatically select SPL_NAND_SUPPORT in Kconfig Miquel Raynal
2018-02-28 19:52 ` [U-Boot] [PATCH v3 18/20] sunxi: make NAND_SUNXI use ARCH_SUNXI as default " Miquel Raynal
2018-02-28 19:52 ` [U-Boot] [PATCH v3 19/20] sunxi: move the NAND parameters to Kconfig Miquel Raynal
2018-02-28 19:52 ` [U-Boot] [PATCH v3 20/20] configs: add NAND support for NES Classic Miquel Raynal
2018-03-01  8:20 ` [U-Boot] [PATCH v3 00/20] Bring NAND support to Nintendo " Maxime Ripard
2018-03-07  7:57 ` Maxime Ripard
2018-03-12 22:33   ` Scott Wood
2018-03-13 13:36     ` Maxime Ripard
2018-04-03 10:15 ` Maxime Ripard

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=20180313133606.eb7geqnlvvcjtf47@flea \
    --to=maxime.ripard@bootlin.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox