[U-Boot] [PATCH 14/14] RX-51: Add support for bootmenu

Pali Rohár pali.rohar at gmail.com
Tue Jan 24 15:28:11 CET 2012


 * default bootmenu entries:
   NOLO kernel, internal eMMC memory, external SD card, u-boot boot order

 * when keyboard slide is closed always boot NOLO kernel

 * when keyborad slide is open in CONFIG_PREBOOT try load bootmenu.scr from
   first FAT partition of internal eMMC memory (also known as MyDocs) which
   (should) overwrite default bootmenu entries

Signed-off-by: Pali Rohár <pali.rohar at gmail.com>
Acked-by: Tom Rini <trini at ti.com>
---
Changes since original version:
   - Fixed name of env variables

 include/configs/nokia_rx51.h |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/include/configs/nokia_rx51.h b/include/configs/nokia_rx51.h
index 9045535..8d6596b 100644
--- a/include/configs/nokia_rx51.h
+++ b/include/configs/nokia_rx51.h
@@ -137,6 +137,7 @@
 #define CONFIG_CMD_I2C			/* I2C serial bus support */
 #define CONFIG_CMD_MMC			/* MMC support */
 
+#define CONFIG_CMD_BOOTMENU		/* ANSI terminal Boot Menu */
 #define CONFIG_CMD_CLEAR		/* ANSI terminal clear screen command */
 
 #ifdef ONENAND_SUPPORT
@@ -212,8 +213,6 @@ int rx51_kp_getc(void);
 #endif
 
 /* Environment information */
-#define CONFIG_BOOTDELAY		3
-
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"mtdparts=" MTDPARTS_DEFAULT "\0" \
 	"usbtty=cdc_acm\0" \
@@ -280,10 +279,22 @@ int rx51_kp_getc(void);
 			"run trymmcallpartboot;" \
 		"fi\0" \
 	"emmcboot=setenv mmcnum 1; run trymmcboot\0" \
-	"sdboot=setenv mmcnum 0; run trymmcboot\0"
+	"sdboot=setenv mmcnum 0; run trymmcboot\0" \
+	"menucmd=bootmenu\0" \
+	"bootmenu_0=Internal flash=run noloboot\0" \
+	"bootmenu_1=Internal eMMC=run immcboot\0" \
+	"bootmenu_2=External SD card=run emmcboot\0" \
+	"bootmenu_3=U-Boot boot order=boot\0" \
+	"bootmenu_delay=3\0"
 
 #define CONFIG_PREBOOT \
-	"if test $slide_sw != open; then run noloboot; fi;"
+	"if test $slide_sw = open; then " \
+		"setenv mmcnum 1; setenv mmcpart 1; setenv mmctype fat;" \
+		"setenv mmcscriptfile bootmenu.scr;" \
+		"run trymmcscriptboot;" \
+	"else " \
+		"setenv bootmenu_delay 0;" \
+	"fi"
 
 #define CONFIG_PREMONITOR \
 	"echo Extra commands:;" \
@@ -301,6 +312,8 @@ int rx51_kp_getc(void);
 	"run noloboot;" \
 	"echo"
 
+#define CONFIG_MENUCMD
+
 #define CONFIG_AUTO_COMPLETE
 
 /*
-- 
1.7.5.4



More information about the U-Boot mailing list