U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Reuben Dowle <reuben.dowle@4rf.com>
To: u-boot@lists.denx.de
Subject: [PATCH] Expose active mmc boot partition to scripts
Date: Tue, 1 Sep 2020 22:01:18 +0000	[thread overview]
Message-ID: <a04b5926ffb24020b0d953fa0c06f261@4rf.com> (raw)

This patch allows uboot scripts make choices about where to boot from based on 
the active mmc boot partition. This allows having two copies of kernel, 
filesystems etc, and choosing which to boot from based off the active 
bootloader partition.

Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
---
 cmd/mmc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/cmd/mmc.c b/cmd/mmc.c
index 1529a3e..88de0c4 100644
--- a/cmd/mmc.c
+++ b/cmd/mmc.c
@@ -784,6 +784,8 @@ static int mmc_partconf_print(struct mmc *mmc)
 	ack = EXT_CSD_EXTRACT_BOOT_ACK(mmc->part_config);
 	part = EXT_CSD_EXTRACT_BOOT_PART(mmc->part_config);
 
+	env_set_hex("activepart", part);
+
 	printf("EXT_CSD[179], PARTITION_CONFIG:\n"
 		"BOOT_ACK: 0x%x\n"
 		"BOOT_PARTITION_ENABLE: 0x%x\n"
-- 
2.7.4

             reply	other threads:[~2020-09-01 22:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-01 22:01 Reuben Dowle [this message]
2020-09-02  0:40 ` [PATCH] Expose active mmc boot partition to scripts Tom Rini

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=a04b5926ffb24020b0d953fa0c06f261@4rf.com \
    --to=reuben.dowle@4rf.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox