summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2013-04-19 03:42:03 +0000
committerLiu Ying <Ying.Liu@freescale.com>2013-11-22 17:25:29 +0800
commitf1485db35c67144c49c18417d31f58aec3ca2944 (patch)
treea5dbb39a6447257004bf5965d805ec829eeeac1d
parenta2d68cdad6a13a48f1b0023afef29988a704567b (diff)
downloadu-boot-imx-f1485db35c67144c49c18417d31f58aec3ca2944.zip
u-boot-imx-f1485db35c67144c49c18417d31f58aec3ca2944.tar.gz
u-boot-imx-f1485db35c67144c49c18417d31f58aec3ca2944.tar.bz2
wandboard: Add boot selection support
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> (cherry picked from commit eaffaa2d25ce6e94a965460467352bd12513bf09) Signed-off-by: Jason Liu <r64343@freescale.com> (cherry picked from commit 101e40f636c950eaf726f26b8246b2dde8ede6a5)
-rw-r--r--board/wandboard/wandboard.c19
-rw-r--r--include/configs/wandboard.h2
2 files changed, 21 insertions, 0 deletions
diff --git a/board/wandboard/wandboard.c b/board/wandboard/wandboard.c
index ac7b89a..0fec7a4 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>
@@ -162,6 +163,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 a5bfc49..54b237d 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