u-boot/common/spl
Sean Anderson ab12179b3e arm: imx: Check header before calling spl_load_imx_container
Make sure we have an IMX header before calling spl_load_imx_container,
since if we don't it will fail with -ENOENT. This allows us to fall back to
legacy/raw images if they are also enabled.

This is a functional change, one which likely should have been in place
from the start, but a functional change nonetheless. Previously, all
non-IMX8 images (except FITs without FIT_FULL) would be optimized out if
the only image load method enabled supported IMX8 images. With this change,
support for other image types now has an effect.

There are seven boards with SPL_LOAD_IMX_CONTAINER enabled: three with
SPL_BOOTROM_SUPPORT:

    imx93_11x11_evk_ld imx93_11x11_evk imx8ulp_evk

and four with SPL_MMC:

    deneb imx8qxp_mek giedi imx8qm_mek

All of these boards also have SPL_RAW_IMAGE_SUPPORT and
SPL_LEGACY_IMAGE_FORMAT enabled as well. However, none have FIT support
enabled. Of the six load methods affected by this patch, only SPL_MMC and
SPL_BOOTROM_SUPPORT are enabled with SPL_LOAD_IMX_CONTAINER.
spl_romapi_load_image_seekable does not support legacy or raw images, so
there is no growth. However, mmc_load_image_raw_sector does support loading
legacy/raw images. Since these images could not have been booted before, I
have disabled support for legacy/raw images on these four boards. This
reduces bloat from around 800 bytes to around 200.

There are no in-tree boards with SPL_LOAD_IMX_CONTAINER and AHAB_BOOT both
enabled, so we do not need to worry about potentially falling back to
legacy images in a secure boot scenario.

Future work could include merging imx_container.h with imx8image.h, since
they appear to define mostly the same structures.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
2023-10-17 20:50:52 -04:00
..
Kconfig spl: Rename SYS_SPL_ARGS_ADDR to SPL_PAYLOAD_ARGS_ADDR 2023-10-06 14:38:11 -04:00
Kconfig.nxp spl: Use CONFIG_SPL... instead of CONFIG_..._SPL_... 2023-10-06 14:38:11 -04:00
Kconfig.tpl Kconfigs: Correct default of "0" on hex type entries 2023-08-09 09:21:42 -04:00
Kconfig.vpl vbe: Add Kconfig options for VPL 2022-10-31 11:03:59 -04:00
Makefile common: spl: Add spl NVMe boot support 2023-06-19 17:47:41 -04:00
spl.c spl: Jump to image at end of board_init_r 2023-10-09 15:24:31 -04:00
spl_atf.c spl: add __noreturn attribute to spl_invoke_atf function 2023-10-09 15:24:31 -04:00
spl_blk_fs.c spl: undefined return value in spl_blk_load_image 2023-09-09 06:12:47 +02:00
spl_bootrom.c spl: pass args to board_return_to_bootrom 2019-10-08 16:35:16 +02:00
spl_dfu.c common: Drop linux/printk.h from common header 2023-09-24 09:54:57 -04:00
spl_ext.c spl: Rename SYS_SPL_ARGS_ADDR to SPL_PAYLOAD_ARGS_ADDR 2023-10-06 14:38:11 -04:00
spl_fat.c spl: Rename SYS_SPL_ARGS_ADDR to SPL_PAYLOAD_ARGS_ADDR 2023-10-06 14:38:11 -04:00
spl_fit.c spl: fit: Fix entry point for SPL_LOAD_FIT_FULL 2023-10-17 20:50:52 -04:00
spl_legacy.c spl: legacy: Fix referencing _image_binary_end 2023-10-17 20:50:52 -04:00
spl_mmc.c arm: imx: Check header before calling spl_load_imx_container 2023-10-17 20:50:52 -04:00
spl_nand.c arm: imx: Check header before calling spl_load_imx_container 2023-10-17 20:50:52 -04:00
spl_net.c treewide: Drop image_header_t typedef 2022-09-29 16:07:57 -04:00
spl_nor.c arm: imx: Check header before calling spl_load_imx_container 2023-10-17 20:50:52 -04:00
spl_nvme.c spl: initialize PCI before booting 2023-07-30 18:53:08 +02:00
spl_onenand.c treewide: Drop image_header_t typedef 2022-09-29 16:07:57 -04:00
spl_opensbi.c Merge branch 'next' 2023-10-02 10:55:44 -04:00
spl_optee.S Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE 2022-10-31 11:01:31 -04:00
spl_ram.c spl: Tidy up load address in spl_ram 2023-09-19 11:36:26 -04:00
spl_sata.c spl: sata: Rework the loading case it not use IS_ENABLED(...) 2023-01-20 12:27:06 -05:00
spl_sdp.c common: Drop linux/printk.h from common header 2023-09-24 09:54:57 -04:00
spl_semihosting.c spl: add FIT support to semihosting boot method 2023-08-14 17:55:53 -04:00
spl_spi.c arm: imx: Check header before calling spl_load_imx_container 2023-10-17 20:50:52 -04:00
spl_ubi.c spl: Rename SYS_SPL_ARGS_ADDR to SPL_PAYLOAD_ARGS_ADDR 2023-10-06 14:38:11 -04:00
spl_usb.c blk: Rename if_type to uclass_id 2022-09-25 08:30:05 -06:00
spl_xip.c spl: Rename SYS_SPL_ARGS_ADDR to SPL_PAYLOAD_ARGS_ADDR 2023-10-06 14:38:11 -04:00
spl_ymodem.c treewide: Drop image_header_t typedef 2022-09-29 16:07:57 -04:00