aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorHeiko Thiery <heiko.thiery@gmail.com>2022-01-17 16:25:41 +0100
committerTom Rini <trini@konsulko.com>2022-01-28 17:58:41 -0500
commitc592292385b484e4da07d395ac67cd7f83f3f326 (patch)
tree7c02d10a90d9229e5fd8c2a970374df91ee32356 /include
parent2d0953c0e0de02dc470345c2b07d77d2a782dba6 (diff)
downloadu-boot-c592292385b484e4da07d395ac67cd7f83f3f326.zip
u-boot-c592292385b484e4da07d395ac67cd7f83f3f326.tar.gz
u-boot-c592292385b484e4da07d395ac67cd7f83f3f326.tar.bz2
spl: add support for custom boot method names
Currently the names MMC1, MMC2 and MMC2_2 are output in the SPL. To achieve more userbility here the name of the boot source can be returned. E.g. for "MMC1" -> "eMMC" or "MMC2" -> "SD card". Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com> Reviewed-by: Michael Walle <michael@walle.cc> Tested-by: Michael Walle <michael@walle.cc>
Diffstat (limited to 'include')
-rw-r--r--include/spl.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/spl.h b/include/spl.h
index 8748497..bb92bc6 100644
--- a/include/spl.h
+++ b/include/spl.h
@@ -463,6 +463,17 @@ int spl_board_ubi_load_image(u32 boot_device);
int spl_board_boot_device(u32 boot_device);
/**
+ * spl_board_loader_name() - Return a name for the loader
+ *
+ * This is a weak function which might be overridden by the board code. With
+ * that a board specific value for the device where the U-Boot will be loaded
+ * from can be set. By default it returns NULL.
+ *
+ * @boot_device: ID of the device which SPL wants to load U-Boot from.
+ */
+const char *spl_board_loader_name(u32 boot_device);
+
+/**
* jump_to_image_linux() - Jump to a Linux kernel from SPL
*
* This jumps into a Linux kernel using the information in @spl_image.
@@ -544,7 +555,9 @@ struct spl_image_loader {
static inline const char *spl_loader_name(const struct spl_image_loader *loader)
{
#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
- return loader->name;
+ const char *name;
+ name = spl_board_loader_name(loader->boot_device);
+ return name ?: loader->name;
#else
return NULL;
#endif