summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2020-06-19 14:21:47 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2020-07-14 20:18:38 +0200
commit53f289603d401be5852eeaba933d59606fe19f71 (patch)
tree74858a2f2b5e876941426cdb56d0b44d8697b140 /scripts
parent6bb165deb02a78bc9bb553f183716f8b7dcaa85e (diff)
downloadbarebox-53f289603d401be5852eeaba933d59606fe19f71.tar.gz
barebox-53f289603d401be5852eeaba933d59606fe19f71.tar.xz
scripts: imx-image: Add extra code path for i.MX35
The i.MX35 writes two copies of the header at the beginning of the image. This is written in a loop right now. Make the i.MX35 an extra code path so that it is out of the way for the changes in the next patches. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/imx/imx-image.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/imx/imx-image.c b/scripts/imx/imx-image.c
index 04c707cb7f..edff3580dd 100644
--- a/scripts/imx/imx-image.c
+++ b/scripts/imx/imx-image.c
@@ -781,7 +781,6 @@ int main(int argc, char *argv[])
int outfd;
int dcd_only = 0;
int now = 0;
- int i, header_copies;
int add_barebox_header;
uint32_t barebox_image_size = 0;
struct config_data data = {
@@ -978,9 +977,13 @@ int main(int argc, char *argv[])
exit(1);
}
- header_copies = (data.cpu_type == IMX_CPU_IMX35) ? 2 : 1;
-
- for (i = 0; i < header_copies; i++) {
+ if (data.cpu_type == IMX_CPU_IMX35) {
+ xwrite(outfd, add_barebox_header ? bb_header : buf,
+ sizeof_bb_header);
+ xwrite(outfd, buf + sizeof_bb_header,
+ header_len - sizeof_bb_header);
+ xwrite(outfd, buf, header_len);
+ } else {
xwrite(outfd, add_barebox_header ? bb_header : buf,
sizeof_bb_header);