diff mbox

[U-Boot,v2,1/4] ARM: at91: spl: specify MMC and NAND boot device

Message ID 20170324033406.16457-2-wenyou.yang@atmel.com
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Wenyou Yang March 24, 2017, 3:34 a.m. UTC
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>
---

Changes in v2: None

 arch/arm/mach-at91/spl.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Simon Glass April 13, 2017, 9:17 p.m. UTC | #1
On 23 March 2017 at 21:34, Wenyou Yang <wenyou.yang@atmel.com> wrote:
> 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>
> ---
>
> Changes in v2: None
>
>  arch/arm/mach-at91/spl.c | 7 +++++++
>  1 file changed, 7 insertions(+)

Applied to u-boot-dm, thanks!
diff mbox

Patch

diff --git a/arch/arm/mach-at91/spl.c b/arch/arm/mach-at91/spl.c
index 98f280cbf7..e113336b7b 100644
--- a/arch/arm/mach-at91/spl.c
+++ b/arch/arm/mach-at91/spl.c
@@ -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;