[U-Boot] [PATCH] ARM: at91: Fix 'boot.bin' generation when CONFIG_SD_BOOT is enabled

Eugen.Hristev at microchip.com Eugen.Hristev at microchip.com
Mon Dec 10 08:32:33 UTC 2018



On 08.12.2018 21:49, Derald D. Woods wrote:
> On AT91 platforms configured for SD_BOOT, this commit avoids the
> generation of the PMECC header used for booting from NAND flash. This
> issue was found by attempting to boot the SAMA5D3-XPLD board with the
> 'sama5d3_xplained_mmc_defconfig'.
> 
> [PMECC Reference]
> http://www.at91.com/linux4sam/bin/view/Linux4SAM/AT91Bootstrap
> 
> [Mailing List Thread]
> https://lists.denx.de/pipermail/u-boot/2018-December/350666.html
> 
> Fixes: 5541543f ("configs: at91: Remove CONFIG_SYS_EXTRA_OPTIONS assignment")
> Reported-by: Daniel Evans <photonthunder at gmail.com>
> Cc: Robert Nelson <robertcnelson at gmail.com>
> Cc: Eugen Hristev <eugen.hristev at microchip.com>
> Cc: Wenyou Yang <wenyou.yang at microchip.com>
> Signed-off-by: Derald D. Woods <woods.technical at gmail.com>
> ---
>   scripts/Makefile.spl | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
> index 22bd8f7c27..e727cb610f 100644
> --- a/scripts/Makefile.spl
> +++ b/scripts/Makefile.spl
> @@ -166,10 +166,12 @@ ifeq ($(CONFIG_SYS_SOC),"at91")
>   MKIMAGEFLAGS_boot.bin = -T atmelimage
>   
>   ifeq ($(CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER),y)
> +ifneq ($(CONFIG_SD_BOOT),y)

Hi Derald,

Thanks for your patch, however, I don't like that we do not use the 
CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER anymore... isn't this config 
supposed to say whether we are going to generate the header or not ?

Checking if "not sd-boot" doesn't look like a good option... we may use 
SPI boot or QSPI or some other type at some point and the issue will 
still be there.

I would rather fix the original patch by Wenyou, namely move the #ifdef 
below to not have the GENERATE_ATMEL_PMECC enabled for SDBOOT.

Does this sound good for you?

Thanks again,

Eugen

>   MKIMAGEFLAGS_boot.bin += -n $(shell $(obj)/../tools/atmel_pmecc_params)
>   
>   boot.bin: $(obj)/../tools/atmel_pmecc_params
>   endif
> +endif
>   
>   boot.bin: $(obj)/u-boot-spl.bin FORCE
>   	$(call if_changed,mkimage)
> 


More information about the U-Boot mailing list