[U-Boot] [PATCH v2 01/20] spl: fix binman_sym output check
Maxime Ripard
maxime.ripard at bootlin.com
Thu Feb 22 14:21:13 UTC 2018
Hi,
On Thu, Feb 22, 2018 at 02:33:31PM +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 check if the value is not null.
>
> The failure happens when using both files sunxi-spl(-with-ecc).bin and
> u-boot-dtb.bin instead of u-boot-sunxi-with-spl.bin. This is because
> u-boot-dtb.bin does not have the U-Boot header while it is present in
> u-boot-sunwi-with-spl.bin. 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.
You should probably rewrite that part a bit. There's nothing specific
about the Allwinner image, since issue will arise on the generic uboot
image as well, and your fix is in the core SPL.
Maxime
--
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/20180222/be4b6f9f/attachment.sig>
More information about the U-Boot
mailing list