Patchwork [U-Boot,v3,4/4] RX-51: Add support for bootmenu

login
register
mail settings
Submitter Pali Rohár
Date March 7, 2013, 3:15 p.m.
Message ID <201303071615.19379@pali>
Download mbox | patch
Permalink /patch/225868/
State Accepted
Delegated to: Anatolij Gustschin
Headers show

Comments

Pali Rohár - March 7, 2013, 3:15 p.m.
Hi, I'm sending new version of patch which try to use also ext filesystem (not only fat)

From 4798e0c932577012ccde38f6b23413109f4b2fba Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali.rohar@gmail.com>
Date: Sat, 14 Jan 2012 18:57:31 +0100
Subject: [PATCH] RX-51: Add support for bootmenu
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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

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

 * when keyboard slide is closed boot first menu entry

 * when keyborad slide is open show bootmenu

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
---
 include/configs/nokia_rx51.h |   40 +++++++++++++++++++++++++++++++++++++---
 1 file changed, 37 insertions(+), 3 deletions(-)
Anatolij Gustschin - March 28, 2013, 11:26 p.m.
Hi,

On Thu, 7 Mar 2013 16:15:19 +0100
Pali Rohár <pali.rohar@gmail.com> wrote:
...
>    attached kernel, internal eMMC memory, external SD card, u-boot boot order
> 
>  * in CONFIG_PREBOOT try load bootmenu.scr from first partition of internal
>    eMMC memory (also known as MyDocs) which (should) overwrite default bootmenu
>    entries
> 
>  * when keyboard slide is closed boot first menu entry
> 
>  * when keyborad slide is open show bootmenu
> 
> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> ---
>  include/configs/nokia_rx51.h |   40 +++++++++++++++++++++++++++++++++++++---
>  1 file changed, 37 insertions(+), 3 deletions(-)

with slightly revised commit log, applied to staging/agust@denx.de.

Thanks,

Anatolij

Patch

diff --git a/include/configs/nokia_rx51.h b/include/configs/nokia_rx51.h
index 8506604..965330a 100644
--- a/include/configs/nokia_rx51.h
+++ b/include/configs/nokia_rx51.h
@@ -148,6 +148,7 @@ 
 #define CONFIG_CMDLINE_EDITING		/* add command line history */
 #define CONFIG_AUTO_COMPLETE		/* add autocompletion support */
 
+#define CONFIG_CMD_BOOTMENU		/* ANSI terminal Boot Menu */
 #define CONFIG_CMD_CLEAR		/* ANSI terminal clear screen command */
 
 #ifdef ONENAND_SUPPORT
@@ -287,8 +288,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" \
@@ -360,10 +359,40 @@  int rx51_kp_getc(void);
 		"fi\0" \
 	"emmcboot=setenv mmcnum 1; run trymmcboot\0" \
 	"sdboot=setenv mmcnum 0; run trymmcboot\0" \
+	"menucmd=bootmenu\0" \
+	"bootmenu_0=Attached kernel=run attachboot\0" \
+	"bootmenu_1=Internal eMMC=run emmcboot\0" \
+	"bootmenu_2=External SD card=run sdboot\0" \
+	"bootmenu_3=U-Boot boot order=boot\0" \
+	"bootmenu_delay=30\0" \
 	""
 
 #define CONFIG_PREBOOT \
-	"if run slide; then true; else run attachboot; fi;" \
+	"setenv mmcnum 1; setenv mmcpart 1;" \
+	"setenv mmcscriptfile bootmenu.scr;" \
+	"if run switchmmc; then " \
+		"setenv mmcdone true;" \
+		"setenv mmctype fat;" \
+		"if run scriptload; then true; else " \
+			"setenv mmctype ext2;" \
+			"if run scriptload; then true; else " \
+				"setenv mmctype ext4;" \
+				"if run scriptload; then true; else " \
+					"setenv mmcdone false;" \
+				"fi;" \
+			"fi;" \
+		"fi;" \
+		"if ${mmcdone}; then " \
+			"run scriptboot;" \
+		"fi;" \
+	"fi;" \
+	"if run slide; then true; else " \
+		"setenv bootmenu_delay 0;" \
+		"setenv bootdelay 0;" \
+	"fi"
+
+#define CONFIG_POSTBOOTMENU \
+	"echo;" \
 	"echo Extra commands:;" \
 	"echo run sercon - Use serial port for control.;" \
 	"echo run usbcon - Use usbtty for control.;" \
@@ -379,6 +408,11 @@  int rx51_kp_getc(void);
 	"run attachboot;" \
 	"echo"
 
+#define CONFIG_BOOTDELAY 30
+#define CONFIG_AUTOBOOT_KEYED
+#define CONFIG_MENU
+#define CONFIG_MENU_SHOW
+
 /*
  * Miscellaneous configurable options
  */