spl: Provide more information on boot failure
authorSimon Glass <sjg@chromium.org>
Mon, 5 Jul 2021 22:32:57 +0000 (16:32 -0600)
committerSimon Glass <sjg@chromium.org>
Wed, 21 Jul 2021 16:27:35 +0000 (10:27 -0600)
commit7d84fbb57312ac0224dc67860f4d0306a3bb3f81
tree9550c6a16e8343c80a30a904ef60c48d3e6a6cab
parent1ac9c4cef521c5c5fd6591e83acf9728b167aaee
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>
common/spl/Kconfig
common/spl/spl.c
include/spl.h