diff mbox

[U-Boot,08/11] ARM: at91: ma5d4: Boot from MMC2 when using SAM-BA

Message ID 20170502182750.8907-8-marex@denx.de
State Accepted
Commit 8997de292a8b0bb54d4a9a93d5d9d2387c22a8b8
Delegated to: Tom Rini
Headers show

Commit Message

Marek Vasut May 2, 2017, 6:27 p.m. UTC
Continue loading U-Boot from MMC2 when the SPL was loaded using SAM-BA
loader. This allows the board to boot system from the removable media
instead of the eMMC, which is useful for commissioning purposes. When
booting from the eMMC, always boot from it as it is not possible to
boot from the SD interface directly.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Andreas Bießmann <andreas.devel@googlemail.com>
---
 board/aries/ma5d4evk/ma5d4evk.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

Comments

Tom Rini June 30, 2017, 1:27 a.m. UTC | #1
On Tue, May 02, 2017 at 08:27:47PM +0200, Marek Vasut wrote:

> Continue loading U-Boot from MMC2 when the SPL was loaded using SAM-BA
> loader. This allows the board to boot system from the removable media
> instead of the eMMC, which is useful for commissioning purposes. When
> booting from the eMMC, always boot from it as it is not possible to
> boot from the SD interface directly.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Andreas Bießmann <andreas.devel@googlemail.com>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/board/aries/ma5d4evk/ma5d4evk.c b/board/aries/ma5d4evk/ma5d4evk.c
index 0293b29d0e..6393948c49 100644
--- a/board/aries/ma5d4evk/ma5d4evk.c
+++ b/board/aries/ma5d4evk/ma5d4evk.c
@@ -22,6 +22,7 @@ 
 #include <net.h>
 #include <netdev.h>
 #include <spi.h>
+#include <spl.h>
 #include <version.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -345,6 +346,23 @@  void spl_board_init(void)
 #endif
 }
 
+void board_boot_order(u32 *spl_boot_list)
+{
+	spl_boot_list[0] = spl_boot_device();
+
+	switch (spl_boot_list[0]) {
+	case BOOT_DEVICE_MMC1:
+	case BOOT_DEVICE_MMC2:
+		spl_boot_list[0] = BOOT_DEVICE_MMC1;
+		break;
+	case BOOT_DEVICE_SPI:
+		break;
+	case BOOT_DEVICE_USB:
+		spl_boot_list[0] = BOOT_DEVICE_MMC2;
+		break;
+	}
+}
+
 static void ddr2_conf(struct atmel_mpddrc_config *ddr2)
 {
 	ddr2->md = (ATMEL_MPDDRC_MD_DBW_32_BITS | ATMEL_MPDDRC_MD_DDR2_SDRAM);