diff options
author | Marco Felsch <m.felsch@pengutronix.de> | 2023-10-17 16:51:19 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2023-10-18 10:07:44 +0200 |
commit | 4d52ae958f005b1a33de4fadadbe73a958f3b7a3 (patch) | |
tree | d0cd8fbc8244e9fe99f67a501d8b4eb1d1ef142e /scripts/imx/imx.c | |
parent | a695c18052a77535264f94c392a84ad75b962e6c (diff) | |
download | barebox-4d52ae958f005b1a33de4fadadbe73a958f3b7a3.tar.gz barebox-4d52ae958f005b1a33de4fadadbe73a958f3b7a3.tar.xz |
scripts: imx: fix i.MX8M CSF header placement
The current boot flow is broken if both the FlexSPI image and the HAB
support is enabled. The HAB/CST tool need to take the additional FlexSPI
IVT header into account which is added in between the first IVT header
and the barebox pbl code.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Link: https://lore.barebox.org/20231017145131.3069283-18-m.felsch@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'scripts/imx/imx.c')
-rw-r--r-- | scripts/imx/imx.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/imx/imx.c b/scripts/imx/imx.c index 32488455b7..3cfa046504 100644 --- a/scripts/imx/imx.c +++ b/scripts/imx/imx.c @@ -347,8 +347,13 @@ static int do_hab_blocks(struct config_data *data, int argc, char *argv[]) * Ensure we only sign the PBL for i.MX8MQ */ if (data->pbl_code_size && cpu_is_mx8m(data)) { + unsigned int hdrlen = HEADER_LEN; + + if (flexspi_image(data)) + hdrlen += FLEXSPI_HEADER_LEN; + offset += data->header_gap; - signed_size = roundup(data->pbl_code_size + HEADER_LEN, 0x1000); + signed_size = roundup(data->pbl_code_size + hdrlen, 0x1000); if (data->signed_hdmi_firmware_file) offset += PLUGIN_HDMI_SIZE; } |