u-boot-brain/common/spl
Miquel Raynal 55fe0e2b54
spl: fix binman_sym output check
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: 8bee2d251a ("binman: Add binman symbol support to SPL")
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
2018-04-03 12:10:24 +02:00
..
Kconfig spl: Kconfig: Rename SPL_USBETH_SUPPORT to SPL_USB_ETHER to match with the U-boot CONFIG 2018-03-05 10:06:05 -05:00
Makefile spl: rename config item SPL_ATF_SUPPORT to SPL_ATF 2017-11-26 00:39:07 +01:00
spl_atf.c spl: atf: pass NULL for bl32_ep pc 2018-01-28 17:12:39 +01:00
spl_bootrom.c spl: add a 'return to bootrom' boot method 2017-08-13 17:12:19 +02:00
spl_dfu.c treewide: replace with error() with pr_err() 2017-10-04 11:59:44 -04:00
spl_ext.c env: Rename getenv/_f() to env_get() 2017-08-16 08:30:24 -04:00
spl_fat.c libfdt: move headers to <linux/libfdt.h> and <linux/libfdt_env.h> 2018-03-05 10:16:28 -05:00
spl_fit.c libfdt: move headers to <linux/libfdt.h> and <linux/libfdt_env.h> 2018-03-05 10:16:28 -05:00
spl_mmc.c spl: eMMC/SD: Provide one __weak spl_boot_mode() function 2018-02-07 22:06:18 -05:00
spl_nand.c libfdt: move headers to <linux/libfdt.h> and <linux/libfdt_env.h> 2018-03-05 10:16:28 -05:00
spl_net.c libfdt: move headers to <linux/libfdt.h> and <linux/libfdt_env.h> 2018-03-05 10:16:28 -05:00
spl_nor.c spl: make image arg or fdt blob address reconfigurable 2017-05-08 11:38:40 -04:00
spl_onenand.c spl: Add a name to the SPL load-image methods 2016-12-09 08:40:13 -05:00
spl_ram.c libfdt: move headers to <linux/libfdt.h> and <linux/libfdt_env.h> 2018-03-05 10:16:28 -05:00
spl_sata.c dm: scsi: Document and rename the scsi_scan() parameter 2017-07-11 10:08:19 -06:00
spl_sdp.c usb: gadget: sdp: add missing line breaks 2018-02-21 20:28:15 +01:00
spl_spi.c spl: spi: override CONFIG_SYS_SPI_U_BOOT_OFFS via /config-property 2017-05-11 22:03:39 -04:00
spl_ubi.c spl: Make UBI fastmap support Kconfig selectable 2017-07-06 13:09:37 -04:00
spl_usb.c spl: Add a name to the SPL load-image methods 2016-12-09 08:40:13 -05:00
spl_xip.c stm32: fix STMicroelectronics copyright 2017-11-06 09:51:01 -05:00
spl_ymodem.c libfdt: move headers to <linux/libfdt.h> and <linux/libfdt_env.h> 2018-03-05 10:16:28 -05:00
spl.c spl: fix binman_sym output check 2018-04-03 12:10:24 +02:00