mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
spl: Provide more information on boot failure
If SPL fails to boot, try to provide an error code to indicate what is wrong. For example, if a uclass is missing, this can return -EPFNOSUPPORT (-96) which provides useful information. Add a helper for accessing the image-loader name so we can drop the use of #ifdefs in this code. Put this feature behind a CONFIG_SHOW_ERRORS option to avoid increasing the code size. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -505,6 +505,16 @@ struct spl_image_loader {
|
||||
struct spl_boot_device *bootdev);
|
||||
};
|
||||
|
||||
/* Helper function for accessing the name */
|
||||
static inline const char *spl_loader_name(const struct spl_image_loader *loader)
|
||||
{
|
||||
#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
|
||||
return loader->name;
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Declare an SPL image loader */
|
||||
#define SPL_LOAD_IMAGE(__name) \
|
||||
ll_entry_declare(struct spl_image_loader, __name, spl_image_loader)
|
||||
|
||||
Reference in New Issue
Block a user