diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2023-12-18 16:46:13 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2023-12-18 16:46:13 +0100 |
commit | 0a6c4e93047ea7e7feed7cee169d330d9b866d46 (patch) | |
tree | 656ffb74494ab2500083e22923b1fd77e398daf7 /scripts | |
parent | 695d4526674a7667be83ba633e0bc5cc7dbfcc60 (diff) | |
parent | ca90d0d6b45ff1dcced35a78b575285e3fff28ad (diff) | |
download | barebox-0a6c4e93047ea7e7feed7cee169d330d9b866d46.tar.gz barebox-0a6c4e93047ea7e7feed7cee169d330d9b866d46.tar.xz |
Merge branch 'for-next/imx'
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/imx/imx-image.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/scripts/imx/imx-image.c b/scripts/imx/imx-image.c index 8a5768ca8b..bc2e7af5d6 100644 --- a/scripts/imx/imx-image.c +++ b/scripts/imx/imx-image.c @@ -1102,12 +1102,21 @@ int main(int argc, char *argv[]) xwrite(outfd, infile, insize); - /* pad until next 4k boundary */ - now = 4096 - (insize % 4096); - if (data.csf && now) { - memset(buf, 0x5a, now); + /* + * The alignment may be required on ARMv7 SoCs like i.MX6/7 for HAB + * boot. On newer SoCs like i.MX8MP/N this cause libusb communication + * errors while uploading images because these machines request the + * exact amount of required bytes and move on afterwards while the host + * tool still try to send the whole (padded) file size. + */ + if (!cpu_is_mx8m(&data)) { + /* pad until next 4k boundary */ + now = 4096 - (insize % 4096); + if (data.csf && now) { + memset(buf, 0x5a, now); - xwrite(outfd, buf, now); + xwrite(outfd, buf, now); + } } ret = close(outfd); |