[U-Boot] [PATCH] imx_common: spl: Fix SPL boot from SD card

Marcin Niestroj m.niestroj at grinn-global.com
Fri Dec 2 15:11:41 CET 2016


Hi,

On 30.11.2016 18:12, Breno Lima wrote:
> Since commit 54e4fcfa3c749a78 ("ARM: mx6: add MMC2 boot device detection
> support in SPL") we can no longer boot from SD card on a mx6sx Udoo neo board:
>
> U-Boot SPL 2016.11-32108-g9cd37b0 (Nov 30 2016 - 11:05:54)
> Trying to boot from MMC2
> MMC Device 1 not found
> spl: could not find mmc device. error: -19
> SPL: failed to boot from all boot devices
> ### ERROR ### Please RESET the board ###
>
> Prior to this commit we had the following logic:
>
> 	/* SD/eSD: 8.5.3, Table 8-15  */
> 	case 0x4:
> 	case 0x5:
> 		return BOOT_DEVICE_MMC1;
> 	/* MMC/eMMC: 8.5.3 */
> 	case 0x6:
> 	case 0x7:
> 		return BOOT_DEVICE_MMC1;
>
> and in the case of MX6SX Udoo board we entered the case 0x5 (SD card boot)
> and returned BOOT_DEVICE_MMC1 as expected.

Why is BOOT_DEVICE_MMC1 expected here? As I see in Udoo neo schematics
the SD card is connected to uSDHC2 port, because uSDHC1 is used for
something else.

>
> Now this does not happen anymore and BOOT_DEVICE_MMC2 is returned, which
> breaks the boot.
>
> In order to fix this problem keep the original behavior for the SD card case by
> returning BOOT_DEVICE_MMC1.
>
> Tested on mx6cuboxi and mx6sx UDOO neo boards.
>
> Signed-off-by: Breno Lima <breno.lima at nxp.com>
> ---
>  arch/arm/imx-common/spl.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm/imx-common/spl.c b/arch/arm/imx-common/spl.c
> index 325ba26..cbcd936 100644
> --- a/arch/arm/imx-common/spl.c
> +++ b/arch/arm/imx-common/spl.c
> @@ -58,6 +58,7 @@ u32 spl_boot_device(void)
>  	/* SD/eSD: 8.5.3, Table 8-15  */
>  	case 0x4:
>  	case 0x5:
> +		 return BOOT_DEVICE_MMC1;
>  	/* MMC/eMMC: 8.5.3 */
>  	case 0x6:
>  	case 0x7:
>

-- 
Marcin Niestroj


More information about the U-Boot mailing list