summaryrefslogtreecommitdiff
path: root/arch/arm/mach-imx/spl_imx_romapi.c
AgeCommit message (Collapse)Author
2023-12-22LFU-573-2 imx8m: hab: Verify optional FIT FDT signatureYe Li
One limitation of verifying FIT hash approach is SPL must bind with FIT, because FIT FDT hash is inserted into SPL image and authenticated by ROM. For use cases need to upgrade the FIT individually, for example, android's dual bootloader, this patch introduces an optional approach. This optional approach adds FIT FDT signature (a new pair of IVT and CSF for FIT FDT structure) after original FIT image IVT and CSF. imx-mkimage always generates the new IVT and reserves the space for the new CSF. Users just need an additional signing step. This approach is default not enabled in SPL except Android build. To enable it, set CONFIG_IMX_SPL_FIT_FDT_SIGNATURE=y with CONFIG_IMX_HAB=y in u-boot defconfig Signed-off-by: Ye Li <ye.li@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Upstream-Status: Inappropriate [downstream specific] Upstream U-Boot fixed this differently in combination with binman to create the final bootcontainer. Commit 6039e0edc854 ("imx: hab: Simplify the mechanism") Backport from NXP downstream [07b688228c5817e4d76cdc5484fd50f92e9cf1f0] Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
2022-08-03LFU-377-2 imx: spl_imx_romapi: Get and print boot stageYe Li
Get and print boot stage through ROM API in SPL Signed-off-by: Ye Li <ye.li@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
2022-04-06LFU-278-18 imx: spl_imx_romapi: Workaround loading to OCRAM ECC regionYe Li
ROM API has a limitation that ROM valid access range does not include the OCRAM ECC 64KB on i.MX8MP. When loading image from nand, the spl_load_fit_image will handle the page unaligned access. In worst case, it requires to read to more 2 pages. For ATF on iMX8MP, it default address is 0x970000, so it is highly possible to read data into OCRAM ECC region after adding more 2 pages. To handle the case, we use a temp buffer to replace the OCRAM ECC region for ROM API. Then copy to OCRAM ECC region. Signed-off-by: Ye Li <ye.li@nxp.com>
2022-04-06MLK-22078 romapi: Fix issue for stream mode with secure boot enabledYe Li
When download image through ROM API for stream mode (USB, eMMC fastboot). We uses tricky way to get the total image size: The spl_load_simple_fit is called but the data reading is invalid, so the image data is not really downloaded. We should not call HAB authenticate in this tricky way. Otherwise it will alway fail. This patch add a new flag SPL_FIT_BYPASS_POST_LOAD to skip the authentication only for this tricky using. Signed-off-by: Ye Li <ye.li@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> (cherry picked from commit 47b0cf6de06ff9b3e2b2755d5c8203210378b26a) (cherry picked from commit 3e50573a7007771586e737b343bdde4d98c21c23) (cherry picked from commit 50ea462702262c65afbd1985d831edf16e47e212) (cherry picked from commit f1c7088597ea5a9d7172e2f0eb06348fb3beed5d) (cherry picked from commit 12859567e106cc47ab546c7aa059a4a4e0a0bb16)
2021-08-09arm: imx8ulp: add container supportYe Li
i.MX8ULP support using ROM API to load container image, it use same ROM API as i.MX8MN/MP, and use same container format as i.MX8QM/QXP. Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2021-05-24ARM: make gd a function call for LTO and set via set_gd()Marek BehĂșn
On ARM, the gd pointer is stored in registers r9 / x18. For this the -ffixed-r9 / -ffixed-x18 flag is used when compiling, but using global register variables causes errors when building with LTO, and these errors are very difficult to overcome. Richard Biener says [1]: Note that global register vars shouldn't be used with LTO and if they are restricted to just a few compilation units the recommended fix is to build those CUs without -flto. We cannot do this for U-Boot since all CUs use -ffixed-reg flag. It seems that with LTO we could in fact store the gd pointer differently and gain performance or size benefit by allowing the compiler to use r9 / x18. But this would need more work. So for now, when building with LTO, go the clang way, and instead of declaring gd a global register variable, we make it a function call via macro. [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68384 Signed-off-by: Marek BehĂșn <marek.behun@nic.cz> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-02-02common: Drop asm/global_data.h from common headerSimon Glass
Move this out of the common header and include it only where needed. In a number of cases this requires adding "struct udevice;" to avoid adding another large header or in other cases replacing / adding missing header files that had been pulled in, very indirectly. Finally, we have a few cases where we did not need to include <asm/global_data.h> at all, so remove that include. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
2020-05-18common: Drop log.h from common headerSimon Glass
Move this header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-11-05imx: add rom api supportPeng Fan
i.MX8MN support loading images with rom api, so we implement reuse board_return_to_bootrom to let ROM loading images. Signed-off-by: Peng Fan <peng.fan@nxp.com>