U-boot Archive mirror
 help / color / mirror / Atom feed
From: Tim Harvey <tharvey@gateworks.com>
To: Tom Rini <trini@konsulko.com>, Tim Harvey <tharvey@gateworks.com>,
	Simon Glass <sjg@chromium.org>, Marek Vasut <marex@denx.de>,
	Fabio Estevam <festevam@gmail.com>,
	Jaehoon Chung <jh80.chung@samsung.com>,
	u-boot@lists.denx.de, Dragan Simic <dsimic@manjaro.org>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Avri Altman <avri.altman@wdc.com>
Subject: [PATCH 3/3 v4] venice: show emmc boot hardware partition
Date: Mon, 13 May 2024 16:29:07 -0700	[thread overview]
Message-ID: <20240513232907.2738959-4-tharvey@gateworks.com> (raw)
In-Reply-To: <20240513232907.2738959-1-tharvey@gateworks.com>

To aid in understanding what emmc hardware partition is being
used to boot on power-up, display the hardware partition name in the
SPL.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
---
v4:
 - include previous stand-alone patch in series
 - use emmc hw partition enum and names
---
 board/gateworks/venice/spl.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/board/gateworks/venice/spl.c b/board/gateworks/venice/spl.c
index 6f6dea84feee..ad3af93143d9 100644
--- a/board/gateworks/venice/spl.c
+++ b/board/gateworks/venice/spl.c
@@ -366,16 +366,24 @@ unsigned long board_spl_mmc_get_uboot_raw_sector(struct mmc *mmc, unsigned long
 
 const char *spl_board_loader_name(u32 boot_device)
 {
+	static char name[16];
+	struct mmc *mmc;
+
 	switch (boot_device) {
 	/* SDHC2 */
 	case BOOT_DEVICE_MMC1:
-		return "eMMC";
+		mmc_init_device(0);
+		mmc = find_mmc_device(0);
+		mmc_init(mmc);
+		snprintf(name, sizeof(name), "eMMC %s", emmc_hwpart_names[EXT_CSD_EXTRACT_BOOT_PART(mmc->part_config)]);
+		return name;
 	/* SDHC3 */
 	case BOOT_DEVICE_MMC2:
-		return "SD card";
-	default:
-		return NULL;
+		sprintf(name, "SD card");
+		return name;
 	}
+
+	return NULL;
 }
 
 void spl_board_init(void)
-- 
2.25.1


      parent reply	other threads:[~2024-05-13 23:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-13 23:29 [PATCH 0/3 v4] provide names for emmc hardware partitions Tim Harvey
2024-05-13 23:29 ` [PATCH 1/3 v4] mmc: use an enumerated type to represent PARTITION_CONFIG fields Tim Harvey
2024-05-13 23:29 ` [PATCH 2/3 v4] mmc: allow use of hardware partition names for mmc partconf Tim Harvey
2024-05-13 23:29 ` Tim Harvey [this message]

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=20240513232907.2738959-4-tharvey@gateworks.com \
    --to=tharvey@gateworks.com \
    --cc=avri.altman@wdc.com \
    --cc=dsimic@manjaro.org \
    --cc=festevam@gmail.com \
    --cc=jh80.chung@samsung.com \
    --cc=marex@denx.de \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=ulf.hansson@linaro.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).