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

Pali Rohár pali.rohar at gmail.com
Thu Sep 1 13:34:41 CEST 2011


---
 include/configs/nokia_rx51.h |   54 +++++++++++++++++++++++++++++++-----------
 1 files changed, 40 insertions(+), 14 deletions(-)

diff --git a/include/configs/nokia_rx51.h b/include/configs/nokia_rx51.h
index 6d93146..1c599e2 100644
--- a/include/configs/nokia_rx51.h
+++ b/include/configs/nokia_rx51.h
@@ -130,6 +130,8 @@
 #define CONFIG_CMD_MMC		/* MMC support			*/
 #define CONFIG_CMD_ONENAND	/* NAND support			*/
 
+#define CONFIG_CMD_BOOTMENU	/* ANSI terminal Boot Menu	*/
+
 #undef CONFIG_CMD_FLASH		/* flinfo, erase, protect	*/
 #undef CONFIG_CMD_FPGA		/* FPGA configuration Support	*/
 #undef CONFIG_CMD_IMI		/* iminfo			*/
@@ -176,7 +178,7 @@ int rx51_kp_getc(void);
 #endif
 
 /* Environment information */
-#define CONFIG_BOOTDELAY		3
+#define CONFIG_MENU
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"usbtty=cdc_acm\0" \
@@ -191,29 +193,42 @@ int rx51_kp_getc(void);
 	"meegoargs=setenv bootargs\0" \
 	"loadbootscript=fatload mmc 0:3 ${loadaddr} boot.scr\0" \
 	"loadibootscript=fatload mmc 2:1 ${loadaddr} boot.scr\0" \
-	"bootscript=echo Running bootscript from mmc ...; " \
+	"bootscript=echo Running bootscript ...; " \
 		"source ${loadaddr}\0" \
 	"loaduimage=fatload mmc 0:3 ${loadaddr} uImage\0" \
 	"loadiuimage=fatload mmc 2:1 ${loadaddr} uImage\0" \
-	"mmcboot=echo Booting from mmc ...; " \
-		"run meegoargs; " \
-		"bootm ${loadaddr}\0" \
 	"noloboot=echo Booting NOLO supplied kernel ...; " \
 		"setenv atags ${nolo_atagaddr};" \
 		"bootm ${nolo_kernaddr}\0" \
-	"mmciboot=echo Booting from internal mmc ...; " \
-		"fatload mmc 2:1 ${loadaddr} uImage;" \
+	"mmcboot=echo Booting from external SD card ...; " \
+		"loaduimage; " \
 		"run meegoargs; " \
-		"bootm ${loadaddr}\0"
+		"bootm ${loadaddr}\0" \
+	"mmciboot=echo Booting from internal eMMC memory ...; " \
+		"loadiuimage; " \
+		"run meegoargs; " \
+		"bootm ${loadaddr}\0" \
+	"menucmd=bootmenu\0" \
+	"bootmenu_0=Maemo 5 kernel (Internal flash): run noloboot\0" \
+	"bootmenu_1=Boot script (Internal eMMC, partition 1): if run loadibootscript; then run bootscript; fi\0" \
+	"bootmenu_2=Boot script (External SD card, partition 3): if run loadbootscript; then run bootscript; fi\0" \
+	"bootmenu_3=uImage kernel (Internal eMMC, partition 1): run mmciboot\0" \
+	"bootmenu_4=uImage kernel (External SD card, partition 3): run mmcboot\0" \
+	"bootmenu_5=Follow 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 bootmenu_delay 0; fi"
+
+#define CONFIG_PREMONITOR \
 	"echo Extra commands:;" \
 	"echo run sercon - Use serial port for control.;" \
 	"echo run usbcon - Use usbtty for control.;" \
 	"echo run vgacon - Use framebuffer/keyboard.;" \
+	"echo run noloboot - Boot kernel loaded by NOLO.;" \
+	"echo run mmciboot - Boot from internal eMMC.;" \
 	"echo run mmcboot - Boot from SD card slot.;" \
-	"echo run noloboot - Boot kernel loaded by NOLO."
+	"echo"
 
 #define CONFIG_BOOTCOMMAND \
 	"if mmc init; then " \
@@ -225,13 +240,24 @@ int rx51_kp_getc(void);
 				"echo Found boot.scr on mmc 0:3; " \
 				"run bootscript; " \
 			"else " \
-				"if run loaduimage; then " \
-					"run mmcboot; " \
-				"else run noloboot; " \
+				"if run loadiuimage; then " \
+					"echo Found uImage on mmc 2:1; " \
+					"run mmciboot; " \
+				"else " \
+					"if run loaduimage; then " \
+						"echo Found uImage on mmc 0:3; " \
+						"run mmcboot; " \
+					"else " \
+						"echo Not found boot.scr or uImage on mmc 2:1 or 0:3; " \
+						"run noloboot; " \
+					"fi; " \
 				"fi; " \
 			"fi; " \
 		"fi; " \
-	"else run noloboot; fi"
+	"else " \
+		"echo Initializing eMMC and/or SD card failed; " \
+		"run noloboot; " \
+	"fi"
 
 #define CONFIG_AUTO_COMPLETE		1
 /*
-- 
1.7.4.1



More information about the U-Boot mailing list