]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
wandboard: Add boot selection support
authorOtavio Salvador <otavio@ossystems.com.br>
Fri, 19 Apr 2013 03:42:03 +0000 (03:42 +0000)
committerStefano Babic <sbabic@denx.de>
Thu, 25 Apr 2013 19:34:48 +0000 (21:34 +0200)
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>
board/wandboard/wandboard.c
include/configs/wandboard.h

index 2bf121c15b5360d4c50b3e34f04bb4adaffe08a3..c71c90d6564dc3335d36cd9ecaa231682d679e07 100644 (file)
@@ -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 */
index 9898f55d6c2782049e901949918ef44ab682f5c2..9d7ec3f6ff0bb8feffa4a844811270d57d204d07 100644 (file)
@@ -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