]> git.sur5r.net Git - u-boot/commitdiff
ARM: at91: spl: specify MMC and NAND boot device
authorWenyou Yang <wenyou.yang@atmel.com>
Fri, 24 Mar 2017 03:34:03 +0000 (11:34 +0800)
committerSimon Glass <sjg@chromium.org>
Thu, 13 Apr 2017 20:44:51 +0000 (14:44 -0600)
When OF_CONTROL is enabled, MMC boot device should not be detected
automatically, it should be MMC1 fixedly only the status "enabled"
is available.

Add NAND Flash boot device as well.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
arch/arm/mach-at91/spl.c

index 98f280cbf7732c460d291a1da0e64be08ecd57f0..e113336b7bfca467ea7049e4c5e0682584ae469f 100644 (file)
@@ -39,12 +39,16 @@ u32 spl_boot_device(void)
 
 #if defined(CONFIG_SYS_USE_MMC)
        if (dev == ATMEL_SAMA5_BOOT_FROM_MCI) {
+#if defined(CONFIG_SPL_OF_CONTROL)
+               return BOOT_DEVICE_MMC1;
+#else
                if (off == 0)
                        return BOOT_DEVICE_MMC1;
                if (off == 1)
                        return BOOT_DEVICE_MMC2;
                printf("ERROR: MMC controller %i not present!\n", dev);
                hang();
+#endif
        }
 #endif
 
@@ -53,6 +57,9 @@ u32 spl_boot_device(void)
                return BOOT_DEVICE_SPI;
 #endif
 
+       if (dev == ATMEL_SAMA5_BOOT_FROM_SMC)
+               return BOOT_DEVICE_NAND;
+
        if (dev == ATMEL_SAMA5_BOOT_FROM_SAMBA)
                return BOOT_DEVICE_USB;