diff options
author | Simon Glass <sjg@chromium.org> | 2022-08-28 12:32:49 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-09-14 09:03:06 -0400 |
commit | f7659f69f70743dbd772b1dea24f346a63757eb8 (patch) | |
tree | dac2c5c9de3e7a953a75ecb7b2b0c188cae3c0fd /boot | |
parent | 0f81af4897e5875faf3c3d676f8140556b7efc36 (diff) | |
download | u-boot-f7659f69f70743dbd772b1dea24f346a63757eb8.zip u-boot-f7659f69f70743dbd772b1dea24f346a63757eb8.tar.gz u-boot-f7659f69f70743dbd772b1dea24f346a63757eb8.tar.bz2 |
image: Drop one #ifdef for FIT
Drop the #ifdef from near the end of select_ramdisk(). Move some variables
to the top of the function to make this work.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'boot')
-rw-r--r-- | boot/image-board.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/boot/image-board.c b/boot/image-board.c index a80ad08..07b7e46 100644 --- a/boot/image-board.c +++ b/boot/image-board.c @@ -322,14 +322,16 @@ int genimg_has_config(bootm_headers_t *images) static int select_ramdisk(bootm_headers_t *images, const char *select, u8 arch, ulong *rd_datap, ulong *rd_lenp) { + const char *fit_uname_config; + const char *fit_uname_ramdisk; bool done = false; + int rd_noffset; ulong rd_addr; char *buf; #if CONFIG_IS_ENABLED(FIT) - const char *fit_uname_config = images->fit_uname_cfg; - const char *fit_uname_ramdisk = NULL; - int rd_noffset; + fit_uname_config = images->fit_uname_cfg; + fit_uname_ramdisk = NULL; if (select) { ulong default_addr; @@ -403,24 +405,23 @@ static int select_ramdisk(bootm_headers_t *images, const char *select, u8 arch, done = true; } break; -#if CONFIG_IS_ENABLED(FIT) case IMAGE_FORMAT_FIT: - rd_noffset = fit_image_load(images, - rd_addr, &fit_uname_ramdisk, - &fit_uname_config, arch, - IH_TYPE_RAMDISK, - BOOTSTAGE_ID_FIT_RD_START, - FIT_LOAD_OPTIONAL_NON_ZERO, - rd_datap, rd_lenp); - if (rd_noffset < 0) - return rd_noffset; - - images->fit_hdr_rd = map_sysmem(rd_addr, 0); - images->fit_uname_rd = fit_uname_ramdisk; - images->fit_noffset_rd = rd_noffset; - done = true; + if (CONFIG_IS_ENABLED(FIT)) { + rd_noffset = fit_image_load(images, rd_addr, + &fit_uname_ramdisk, &fit_uname_config, + arch, IH_TYPE_RAMDISK, + BOOTSTAGE_ID_FIT_RD_START, + FIT_LOAD_OPTIONAL_NON_ZERO, + rd_datap, rd_lenp); + if (rd_noffset < 0) + return rd_noffset; + + images->fit_hdr_rd = map_sysmem(rd_addr, 0); + images->fit_uname_rd = fit_uname_ramdisk; + images->fit_noffset_rd = rd_noffset; + done = true; + } break; -#endif case IMAGE_FORMAT_ANDROID: if (IS_ENABLED(CONFIG_ANDROID_BOOT_IMAGE)) { void *ptr = map_sysmem(images->os.start, 0); |