diff options
| author | Tom Rini <trini@konsulko.com> | 2026-01-18 13:56:10 -0600 |
|---|---|---|
| committer | Tom Rini <trini@konsulko.com> | 2026-01-27 16:19:11 -0600 |
| commit | 272b8784faf33b0eded27ba78ad4251151ef357b (patch) | |
| tree | eaafdff167c6fcc0d3db0b6ac21fe14591e6a048 /common | |
| parent | cfce859b16ffc43c6eb0afb6c49c95e1ec25f5f1 (diff) | |
| download | u-boot-272b8784faf33b0eded27ba78ad4251151ef357b.tar.gz u-boot-272b8784faf33b0eded27ba78ad4251151ef357b.zip | |
fit: Rework SPL_LOAD_FIT_ADDRESS slightly
Options which deal with memory locations and have a default value of 0x0
are dangerous, as that is often not a valid memory location. Rework
SPL_LOAD_FIT_ADDRESS as follows:
- Add SPL_HAS_LOAD_FIT_ADDRESS to guard prompting the question as the
case of loading a FIT image does not strictly require setting an
address and allows for a malloc()'d area to be used.
- For SPL_RAM_SUPPORT, select the new guard symbol if SPL_LOAD_FIT is
enabled because in that case an address must be provided.
- Update defconfigs for these new changes. Largely this means some
defconfigs need to enable SPL_HAS_LOAD_FIT_ADDRESS to maintain their
current status. In the case of sandbox, we also need to set
SPL_LOAD_FIT_ADDRESS to 0x0.
Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'common')
| -rw-r--r-- | common/spl/Kconfig | 1 | ||||
| -rw-r--r-- | common/spl/spl_fit.c | 8 |
2 files changed, 3 insertions, 6 deletions
diff --git a/common/spl/Kconfig b/common/spl/Kconfig index e456d02dc8b..2998b7acb75 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -1375,6 +1375,7 @@ config SPL_POWER_DOMAIN config SPL_RAM_SUPPORT bool + select SPL_HAS_LOAD_FIT_ADDRESS if SPL_LOAD_FIT config SPL_RAM_DEVICE bool "Support booting from preloaded image in RAM" diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c index a588d13eb40..46ebcabe56a 100644 --- a/common/spl/spl_fit.c +++ b/common/spl/spl_fit.c @@ -593,9 +593,10 @@ static int spl_fit_image_get_os(const void *fit, int noffset, uint8_t *os) * The purpose of the FIT load buffer is to provide a memory location that is * independent of the load address of any FIT component. */ -static void *spl_get_fit_load_buffer(size_t size) +__weak void *board_spl_fit_buffer_addr(ulong fit_size, int sectors, int bl_len) { void *buf; + size_t size = sectors * bl_len; buf = malloc_cache_aligned(size); if (!buf) { @@ -611,11 +612,6 @@ static void *spl_get_fit_load_buffer(size_t size) return buf; } -__weak void *board_spl_fit_buffer_addr(ulong fit_size, int sectors, int bl_len) -{ - return spl_get_fit_load_buffer(sectors * bl_len); -} - /* * Weak default function to allow customizing SPL fit loading for load-only * use cases by allowing to skip the parsing/processing of the FIT contents |
