All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali@kernel.org>
To: Lokesh Vutla <lokeshvutla@ti.com>
Cc: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>,
	Merlijn Wajer <merlijn@wizzup.org>,
	maemo-leste@lists.dyne.org, u-boot@lists.denx.de
Subject: [PATCH 2/2] Nokia RX-51: Load bootmenu also from uSD card
Date: Fri, 18 Jun 2021 15:27:04 +0200	[thread overview]
Message-ID: <20210618132704.32066-2-pali@kernel.org> (raw)
In-Reply-To: <20210618132704.32066-1-pali@kernel.org>

By default bootmenu is loaded only from eMMC. After this change U-Boot
first tries to load bootmenu from uSD card and if it fails then fallback to
eMMC. People want to boot alternative OS from removable uSD without need to
modify eMMC content. So this backward compatible change allows it.

Part of this change is also optimization of trymmc* macros so they can be
used in preboot macro for loading bootmenu.

Signed-off-by: Pali Rohár <pali@kernel.org>
---
 include/configs/nokia_rx51.h | 35 +++++++++--------------------------
 1 file changed, 9 insertions(+), 26 deletions(-)

diff --git a/include/configs/nokia_rx51.h b/include/configs/nokia_rx51.h
index 742c1a646545..7ef25ea8389c 100644
--- a/include/configs/nokia_rx51.h
+++ b/include/configs/nokia_rx51.h
@@ -138,23 +138,10 @@ int rx51_kp_getc(struct stdio_dev *sdev);
 		"setenv setup_omap_atag 1;" \
 		"bootm ${attkernaddr} || bootz ${attkernaddr};" \
 		"setenv setup_omap_atag\0" \
-	"trymmcscriptboot=if run switchmmc; then " \
-			"if run scriptload; then " \
-				"run scriptboot;" \
-			"fi;" \
-		"fi\0" \
-	"trymmckernboot=if run switchmmc; then " \
-			"if run kernload; then " \
-				"run kernboot;" \
-			"fi;" \
-		"fi\0" \
-	"trymmckerninitrdboot=if run switchmmc; then " \
-			"if run initrdload; then " \
-				"if run kernload; then " \
-					"run kerninitrdboot;" \
-				"fi;" \
-			"fi; " \
-		"fi\0" \
+	"trymmcscriptboot=run switchmmc && run scriptload && run scriptboot\0" \
+	"trymmckernboot=run switchmmc && run kernload && run kernboot\0" \
+	"trymmckerninitrdboot=run switchmmc && run initrdload && " \
+		"run kernload && run kerninitrdboot\0" \
 	"trymmcpartboot=setenv mmcscriptfile boot.scr; run trymmcscriptboot;" \
 		"setenv mmckernfile uImage; run trymmckernboot;" \
 		"setenv mmckernfile zImage; run trymmckernboot\0" \
@@ -170,15 +157,11 @@ int rx51_kp_getc(struct stdio_dev *sdev);
 		"fi\0" \
 	"emmcboot=setenv mmcnum 1; run trymmcboot\0" \
 	"sdboot=setenv mmcnum 0; run trymmcboot\0" \
-	"preboot=setenv mmcnum 1; setenv mmcpart 1;" \
-		"setenv mmcscriptfile bootmenu.scr;" \
-		"if run switchmmc; then " \
-			"setenv mmctype fat;" \
-			"if run scriptload; then run scriptboot; else " \
-				"setenv mmctype ext4;" \
-				"if run scriptload; then run scriptboot; fi;" \
-			"fi;" \
-		"fi;" \
+	"trymmcbootmenu=setenv mmctype fat && run trymmcscriptboot || " \
+		"setenv mmctype ext4 && run trymmcscriptboot\0" \
+	"preboot=setenv mmcpart 1; setenv mmcscriptfile bootmenu.scr;" \
+		"setenv mmcnum 0 && run trymmcbootmenu || " \
+		"setenv mmcnum 1 && run trymmcbootmenu;" \
 		"if run slide; then true; else " \
 			"setenv bootmenu_delay 0;" \
 			"setenv bootdelay 0;" \
-- 
2.20.1


  reply	other threads:[~2021-06-18 13:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-18 13:27 [PATCH 1/2] Nokia RX-51: Add support for booting kernel in zImage format Pali Rohár
2021-06-18 13:27 ` Pali Rohár [this message]
2021-07-15 11:51 ` Lokesh Vutla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210618132704.32066-2-pali@kernel.org \
    --to=pali@kernel.org \
    --cc=ivo.g.dimitrov.75@gmail.com \
    --cc=lokeshvutla@ti.com \
    --cc=maemo-leste@lists.dyne.org \
    --cc=merlijn@wizzup.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.