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

Marcin Niestroj m.niestroj at grinn-global.com
Fri Dec 2 18:16:34 CET 2016


On 02.12.2016 16:03, Fabio Estevam wrote:
> Hi Marcin,
>
> On Fri, Dec 2, 2016 at 12:11 PM, Marcin Niestroj
> <m.niestroj at grinn-global.com> wrote:
>
>> 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.
>
> Yes, Udoo Neo boots from the SDHC2 port.
>
> However BOOT_DEVICE_MMC1 does not mean "boot from the SDHC1 port".
> BOOT_DEVICE_MMC1 just tells SPL to boot from the first registered mmc device.
>
> Please take a look at common/spl/spl_mmc.c
>
> int spl_mmc_get_device_index(u32 boot_device)
> {
>   switch (boot_device) {
>   case BOOT_DEVICE_MMC1:
>       return 0;
>   case BOOT_DEVICE_MMC2:
>   case BOOT_DEVICE_MMC2_2:
>     return 1;
> }
>
> ,so we should return BOOT_DEVICE_MMC1 as we always did.
>
> mx6cuboxi is also broken for the same reason.
>
> If you took the assumption that in "BOOT_DEVICE_MMC1 = Boot from SDHC1
> port" in 54e4fcfa3c749a78 ("ARM: mx6: add MMC2 boot device detection
> support in SPL") I suggest we need to revert it.
>

Indeed it was my assumption. I agree it should be reverted then.

So to support booting from two SD/MMC devices one should create
board_boot_order() function? That way BOOT_CFG2[3:4] can be read there
to figure out which MMC1 or MMC2 should be configured as the first boot
device.

-- 
Marcin Niestroj


More information about the U-Boot mailing list