[U-Boot] [PATCH] imx-common: spl: Allow booting from eMMC when SPL is loaded from non-eMMC device

Marek Vasut marex at denx.de
Fri Jan 26 15:19:54 UTC 2018


On 01/26/2018 03:57 PM, Lukasz Majewski wrote:
> This patch tries to solve the problem described in following patch:
> https://patchwork.ozlabs.org/patch/796237/

You should explain what the problem is in the commit message. Random
link to a random website which may go away at some point is useless.
Having it below --- is fine, but in the commit message it's not.

> The main argument against the above code was the potential lack of
> consistency if we boot SPL from the SD card (and then eMMC may load
> u-boot proper).
> 
> This patch preserves this consistency if spl_boot_device() detects boot
> from either SD card or eMMC.
> 
> It only will change boot device if boot from non-SD/eMMC device is
> detected - i.e SPI-NOR (as in this case).

And from this, I don't really understand what this patch is trying to
solve. IMO it'd be better to solve this on a board-level.

> Signed-off-by: Lukasz Majewski <lukma at denx.de>
> ---
> 
>  arch/arm/mach-imx/spl.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c
> index 6c16872f59..735d9f6261 100644
> --- a/arch/arm/mach-imx/spl.c
> +++ b/arch/arm/mach-imx/spl.c
> @@ -134,7 +134,12 @@ int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
>  /* called from spl_mmc to see type of boot mode for storage (RAW or FAT) */
>  u32 spl_boot_mode(const u32 boot_device)
>  {
> -	switch (spl_boot_device()) {
> +	u32 spl_bd = spl_boot_device();
> +
> +	if (spl_bd != BOOT_DEVICE_MMC1)
> +		spl_bd = boot_device;
> +
> +	switch (spl_bd) {
>  	/* for MMC return either RAW or FAT mode */
>  	case BOOT_DEVICE_MMC1:
>  	case BOOT_DEVICE_MMC2:
> 


-- 
Best regards,
Marek Vasut


More information about the U-Boot mailing list