Hello Tim,
Please see my comments below.
On 2024-04-26 18:55, Tim Harvey wrote:
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 <thar...@gateworks.com>
---
board/gateworks/venice/spl.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/board/gateworks/venice/spl.c
b/board/gateworks/venice/spl.c
index 3b0f11f2fd0f..531bad260b6d 100644
--- a/board/gateworks/venice/spl.c
+++ b/board/gateworks/venice/spl.c
@@ -366,9 +366,25 @@ unsigned long
board_spl_mmc_get_uboot_raw_sector(struct mmc *mmc, unsigned long
const char *spl_board_loader_name(u32 boot_device)
{
+ struct mmc *mmc;
+ int part;
+
switch (boot_device) {
/* SDHC2 */
case BOOT_DEVICE_MMC1:
+ mmc_init_device(0);
+ mmc = find_mmc_device(0);
+ mmc_init(mmc);
+ part = EXT_CSD_EXTRACT_BOOT_PART(mmc->part_config);
+ switch (part) {
+ case 1:
+ return "eMMC boot0";
+ case 2:
+ return "eMMC boot1";
+ case 0:
+ case 7:
+ return "eMMC user";
+ }
return "eMMC";
/* SDHC3 */
case BOOT_DEVICE_MMC2:
Your other patch on the mailing list does something similar. [1]
Perhaps this is a good oportunity to extract and unify the logic
that produces the names of eMMC partitions? That would also allow
other boards to use the same logic.
[1]
https://lore.kernel.org/u-boot/a1e9206f-0cbf-44b2-a5e7-351f77c0d...@denx.de/T/#u