diff options
author | Simon Glass <sjg@chromium.org> | 2023-09-26 08:14:22 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-10-06 14:38:12 -0400 |
commit | f817e08ff290c51f6471345d7bc11507cde8ffbc (patch) | |
tree | abefe7ce3ce8ce362a6b5761107766e1043a1492 /include/spl.h | |
parent | e0be6eaf581d06af788509e588129c4dbae967d2 (diff) | |
download | u-boot-f817e08ff290c51f6471345d7bc11507cde8ffbc.zip u-boot-f817e08ff290c51f6471345d7bc11507cde8ffbc.tar.gz u-boot-f817e08ff290c51f6471345d7bc11507cde8ffbc.tar.bz2 |
spl: Drop the switch() statement for OS selection
This code is pretty ugly, with many #ifdefs
There are quite a lot of IH_OS_U_BOOT values so the compiler struggles
to create a jump table here. Also, most of the options are normally
disabled.
Change it to an else...if construct instead. Add an accessor for the
spl_image field behind an #ifdef to avoid needing #ifdef in the C code.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/spl.h')
-rw-r--r-- | include/spl.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/spl.h b/include/spl.h index ab06e32..6c6ca07 100644 --- a/include/spl.h +++ b/include/spl.h @@ -263,6 +263,15 @@ struct spl_image_info { #endif }; +static inline void *spl_image_fdt_addr(struct spl_image_info *info) +{ +#if CONFIG_IS_ENABLED(LOAD_FIT) || CONFIG_IS_ENABLED(LOAD_FIT_FULL) + return info->fdt_addr; +#else + return 0; +#endif +} + /** * Information required to load data from a device * |