summaryrefslogtreecommitdiff
path: root/arch/arm/mach-imx/parse-container.c
AgeCommit message (Collapse)Author
2023-10-17Move i.MX8 container image loading support to common/splSean Anderson
To facilitate testing loading i.MX8 container images, move the parse-container code to common/spl. Signed-off-by: Sean Anderson <seanga2@gmail.com>
2023-10-17arm: imx: Check header before calling spl_load_imx_containerSean Anderson
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-17arm: imx: Add function to validate i.MX8 containersSean Anderson
Add a function to abstract the common task of validating i.MX8 container image headers. Signed-off-by: Sean Anderson <seanga2@gmail.com>
2023-10-17arm: imx: Use log_err for errors in read_auth_containerSean Anderson
To allow for more flexible handling of errors, use log_err instead of printf. Signed-off-by: Sean Anderson <seanga2@gmail.com>
2023-10-17arm: imx: Add newlines after error messagesSean Anderson
These error messages are missing newlines. Add them. Fixes: 6e81ca220e0 ("imx: parse-container: Use malloc for container processing") Signed-off-by: Sean Anderson <seanga2@gmail.com>
2023-10-17arm: imx: Fix i.MX8 container load addressSean Anderson
We should load images to their destination, not their entry point. Fixes: 7b86cd4274e ("imx8: support parsing i.MX8 Container file") Signed-off-by: Sean Anderson <seanga2@gmail.com>
2023-07-13imx: ahab: Update AHAB for iMX8 and iMX8ULPYe Li
Abstract common interfaces for AHAB authentication operations. Then share some common codes for AHAB and SPL container authentication Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2023-07-13imx: parse-container: Use malloc for container processingNitin Garg
If the container has image which conflicts with spl_get_load_buffer address, there are processing failures. Use malloc instead of spl_get_load_buffer. Reviewed-by: Ye Li <ye.li@nxp.com> Signed-off-by: Nitin Garg <nitin.garg@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2023-07-13imx: parse-container: fix build warningPeng Fan
Fix build warning: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘u64’ {aka ‘long long unsigned int’} [-Wformat=] printf("can't find memreg for image %d load address 0x%x, error %d\n", warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘sc_faddr_t’ {aka ‘long long unsigned int’} [-Wformat=] debug("memreg %u 0x%lx -- 0x%lx\n", mr, start, end); Signed-off-by: Peng Fan <peng.fan@nxp.com>
2023-05-21imx: move imx8 sci header file to include/firmware/imxPeng Fan
Move imx8 sci header file to include/firmware/imx, then we could use build macro to reuse some i.MX8 drivers for i.MX9, such as drivers/cpu/imx8_cpu.c. Signed-off-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Stefano Babic <sbabic@denx.de>
2022-04-12arm: imx: parse-container: add some missing end of lineClément Péron
Some printf() have strings that doesn't terminate with end of line and make the output hard to read. Signed-off-by: Clément Péron <peron.clem@gmail.com> Reviewed-by: Fabio Estevam <festevam@denx.de> Reviewed-by: Peng Fan <peng.fan@nxp.com>
2021-08-09arm: imx: parse-container: guard included header filesPeng Fan
Guard included sci.h with CONFIG_AHAB_BOOT to avoid build failure for i.MX8ULP Signed-off-by: Peng Fan <peng.fan@nxp.com>
2021-08-09arm: imx8: Move container image header file to mach-imxYe Li
Since the container is shared among i.MX platforms, move its header file to mach-imx Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2021-08-09arm: imx8: Move container parser and image to mach-imx common folderYe Li
Since we will re-use the container parser on imx8ulp, move the codes to mach-imx Signed-off-by: Ye Li <ye.li@nxp.com>