diff --git a/scripts/imx/imx-image.c b/scripts/imx/imx-image.c index a9323f8..c39ceda 100644 --- a/scripts/imx/imx-image.c +++ b/scripts/imx/imx-image.c @@ -28,7 +28,6 @@ #include #include #include -#include #include "../compiler.h" #include "imx.h" @@ -701,9 +700,9 @@ } /* - * For i.MX8, write into the reserved CSF section + * For i.MX8M, write into the reserved CSF section */ - if (data->cpu_type == IMX_CPU_IMX8MQ) + if (cpu_is_mx8m(data)) outfd = open(data->outfile, O_WRONLY); else outfd = open(data->outfile, O_WRONLY | O_APPEND); @@ -714,7 +713,7 @@ exit(1); } - if (data->cpu_type == IMX_CPU_IMX8MQ) { + if (cpu_is_mx8m(data)) { /* * For i.MX8 insert the CSF data into the reserved CSF area * right behind the PBL @@ -779,7 +778,7 @@ static bool cpu_is_aarch64(const struct config_data *data) { - return data->cpu_type == IMX_CPU_IMX8MQ; + return cpu_is_mx8m(data); } int main(int argc, char *argv[]) @@ -886,7 +885,7 @@ exit(1); if (data.max_load_size && (data.encrypt_image || data.csf) - && data.cpu_type != IMX_CPU_IMX8MQ) { + && !cpu_is_mx8m(&data)) { fprintf(stderr, "Specifying max_load_size is incompatible with HAB signing/encrypting\n"); exit(1); } diff --git a/scripts/imx/imx-usb-loader.c b/scripts/imx/imx-usb-loader.c index 0d7de7e..8447ca2 100644 --- a/scripts/imx/imx-usb-loader.c +++ b/scripts/imx/imx-usb-loader.c @@ -1332,7 +1332,7 @@ unsigned *p_header_addr) { int ret; - unsigned header_max = 0x800; + unsigned header_max = 0x10000; unsigned header_inc = 0x400; unsigned header_offset = 0; int header_cnt = 0; diff --git a/scripts/imx/imx.c b/scripts/imx/imx.c index fd119e3..c820c9a 100644 --- a/scripts/imx/imx.c +++ b/scripts/imx/imx.c @@ -24,7 +24,6 @@ #include #include #include -#include #include "imx.h" @@ -353,7 +352,7 @@ /* * Ensure we only sign the PBL for i.MX8MQ */ - if (data->pbl_code_size && data->cpu_type == IMX_CPU_IMX8MQ) { + if (data->pbl_code_size && cpu_is_mx8m(data)) { offset += data->header_gap; signed_size = roundup(data->pbl_code_size + HEADER_LEN, 0x1000); if (data->signed_hdmi_firmware_file) diff --git a/scripts/imx/imx.h b/scripts/imx/imx.h index 20fb1e8..d466e5d 100644 --- a/scripts/imx/imx.h +++ b/scripts/imx/imx.h @@ -1,4 +1,10 @@ #include +#include + +static inline int cpu_is_mx8m(const struct config_data *data) +{ + return data->cpu_type == IMX_CPU_IMX8MQ || data->cpu_type == IMX_CPU_IMX8MM; +} int parse_config(struct config_data *data, const char *filename);