diff options
author | Simon Glass <sjg@chromium.org> | 2022-01-12 19:26:22 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2022-01-13 09:13:41 -0700 |
commit | 99047f5d7f9cb013f7040edd7d20a70cc30646b5 (patch) | |
tree | 8ac10ebed8cff29c9826885294667b76924e6022 /include | |
parent | 5938d654dec74ba42ab06f06d6e0c89b006099b8 (diff) | |
download | u-boot-99047f5d7f9cb013f7040edd7d20a70cc30646b5.zip u-boot-99047f5d7f9cb013f7040edd7d20a70cc30646b5.tar.gz u-boot-99047f5d7f9cb013f7040edd7d20a70cc30646b5.tar.bz2 |
bloblist: Refactor Kconfig to support alloc or fixed
At present we do support allocating the bloblist but the Kconfig is a bit
strange, since we still have to specify an address in that case. Partly
this is because it is a pain to have CONFIG options that disappears when
its dependency is enabled. It means that we must have #ifdefs in the code,
either in the C code or header file.
Make use of IF_ENABLED_INT() and its friend to solve that problem, so we
can separate out the location of bloblist into a choice. Put the address
and size into variables so we can log the result.
Add the options for SPL as well, so we can use CONFIG_IS_ENABLED().
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/bloblist.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/bloblist.h b/include/bloblist.h index 5de4545..13f2b3f 100644 --- a/include/bloblist.h +++ b/include/bloblist.h @@ -147,6 +147,16 @@ struct bloblist_rec { u32 spare; }; +/* access CONFIG_BLOBLIST_ADDR, dealing with it possibly not being defined */ +static inline ulong bloblist_addr(void) +{ +#ifdef CONFIG_BLOBLIST_FIXED + return CONFIG_BLOBLIST_ADDR; +#else + return 0; +#endif +} + /** * bloblist_check_magic() - return a bloblist if the magic matches * |