diff mbox

[U-Boot,v3,7/7] wandboard: Add boot selection support

Message ID 1366378923-15615-7-git-send-email-otavio@ossystems.com.br
State Awaiting Upstream
Delegated to: Stefano Babic
Headers show

Commit Message

Otavio Salvador April 19, 2013, 1:42 p.m. UTC
Adds support for 'bmode' command which let user to choose where to
boot from; this allows U-Boot to load system from another storage
without messing with jumpers.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
Changes in v3: None
Changes in v2: None

 board/wandboard/wandboard.c | 19 +++++++++++++++++++
 include/configs/wandboard.h |  2 ++
 2 files changed, 21 insertions(+)

Comments

Stefano Babic April 25, 2013, 7:41 p.m. UTC | #1
On 19/04/2013 15:42, Otavio Salvador wrote:
> Adds support for 'bmode' command which let user to choose where to
> boot from; this allows U-Boot to load system from another storage
> without messing with jumpers.
> 
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---


Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic
diff mbox

Patch

diff --git a/board/wandboard/wandboard.c b/board/wandboard/wandboard.c
index 2bf121c..c71c90d 100644
--- a/board/wandboard/wandboard.c
+++ b/board/wandboard/wandboard.c
@@ -16,6 +16,7 @@ 
 #include <asm/arch/sys_proto.h>
 #include <asm/gpio.h>
 #include <asm/imx-common/iomux-v3.h>
+#include <asm/imx-common/boot_mode.h>
 #include <asm/io.h>
 #include <asm/sizes.h>
 #include <common.h>
@@ -225,6 +226,24 @@  int board_early_init_f(void)
 	return 0;
 }
 
+#ifdef CONFIG_CMD_BMODE
+static const struct boot_mode board_boot_modes[] = {
+	/* 4 bit bus width */
+	{"mmc0",	  MAKE_CFGVAL(0x40, 0x30, 0x00, 0x00)},
+	{"mmc1",	  MAKE_CFGVAL(0x40, 0x20, 0x00, 0x00)},
+	{NULL,	 0},
+};
+#endif
+
+int board_late_init(void)
+{
+#ifdef CONFIG_CMD_BMODE
+	add_board_boot_modes(board_boot_modes);
+#endif
+
+	return 0;
+}
+
 int board_init(void)
 {
 	/* address of boot parameters */
diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h
index 9898f55..9d7ec3f 100644
--- a/include/configs/wandboard.h
+++ b/include/configs/wandboard.h
@@ -32,6 +32,7 @@ 
 #define CONFIG_SYS_MALLOC_LEN		(3 * SZ_1M)
 
 #define CONFIG_BOARD_EARLY_INIT_F
+#define CONFIG_BOARD_LATE_INIT
 #define CONFIG_MXC_GPIO
 
 #define CONFIG_MXC_UART
@@ -47,6 +48,7 @@ 
 
 #undef CONFIG_CMD_IMLS
 
+#define CONFIG_CMD_BMODE
 #define CONFIG_CMD_SETEXPR
 
 #define CONFIG_BOOTDELAY		5