spl: add support for custom boot method names
PATCH v3 1/1 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 <[email protected]>
Reviewed-by Michael Walle <[email protected]>
Tested-by Michael Walle <[email protected]>
---
v2:
- add function documenation
v3:
- fix in documentation
common/spl/spl.c | 5 +++++ include/spl.h | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-)
common/spl/spl.c +5 -0
@@ -174,6 +174,11 @@ __weak void spl_board_prepare_for_optee(void *fdt) { } +__weak const char *spl_board_loader_name (u32 boot_device) +{ +return NULL ; +} +#if CONFIG_IS_ENABLED (OPTEE_IMAGE )__weak void __noreturn jump_to_image_optee (struct spl_image_info *spl_image) {
include/spl.h +14 -1
@@ -459,6 +459,17 @@ void spl_board_prepare_for_boot(void);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 *
@@ -541,7 +552,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
Signature · 1 line
2.30.2
Quoted 7 lines · Heiko Thiery
Currently the names MMC1, MMC2 and
MMC2_2are 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 <[email protected]>Reviewed-by Michael Walle <[email protected]>Tested-by Michael Walle <[email protected]>
Applied to u-boot/master, thanks!
Signature · 1 line
Tom