mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* re: [RESEND v3 50/52] scripts: imx-image: Share the code to write barebox header
@ 2018-06-11  6:39 Alexander Kurz
  2018-06-11  6:55 ` Sascha Hauer
  2018-06-11 17:40 ` Andrey Smirnov
  0 siblings, 2 replies; 4+ messages in thread
From: Alexander Kurz @ 2018-06-11  6:39 UTC (permalink / raw)
  To: Andrey Smirnov <andrew.smirnov@gmail.com>; +Cc: barebox

Hi Andrey,
there's something wrong with this patch,
when generating e.g. the kindle3 image (imx35 / kindle3_defconfig) 
with this patch, the generated imximage differs and the device wont
boot. "Share the code to ..." should not change the program behaviour.

Regards, Alexander

--- barebox.imximg_x4_1 2018-06-11 08:27:31.660011787 +0200
+++ barebox.imximg_x4_2 2018-06-11 08:27:26.676011669 +0200
@@ -1,6 +1,6 @@
 000000 ea0003fe eafffffe eafffffe eafffffe
 000010 eafffffe eafffffe eafffffe eafffffe
-000020 65726162 00786f62 00000000 00022000
+000020 65726162 00786f62 00000000 00000000
 000030 55555555 55555555 55555555 55555555
 *
 000050 00000000 00000000 00000000 00000000
@@ -25,12 +25,8 @@
 000510 00000000 00022000 00000000 00000000
 000520 00000000 00000000 00000000 00000000
 *
-001000 ea0003fe eafffffe eafffffe eafffffe
-001010 eafffffe eafffffe eafffffe eafffffe
-001020 65726162 00786f62 00000000 00022000
-001030 55555555 55555555 55555555 55555555
-*
-001050 00000000 00000000 00000000 00000000
+001020 00000000 00000000 00000000 00022000
+001030 00000000 00000000 00000000 00000000
 *
 001400 87f00400 000000b1 00000000 87eff814
 001410 00000000 87eff81c 87eff400 b17219e9


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RESEND v3 50/52] scripts: imx-image: Share the code to write barebox header
  2018-06-11  6:39 [RESEND v3 50/52] scripts: imx-image: Share the code to write barebox header Alexander Kurz
@ 2018-06-11  6:55 ` Sascha Hauer
  2018-06-11 17:40 ` Andrey Smirnov
  1 sibling, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2018-06-11  6:55 UTC (permalink / raw)
  To: Alexander Kurz; +Cc: barebox

On Mon, Jun 11, 2018 at 06:39:32AM +0000, Alexander Kurz wrote:
> Hi Andrey,
> there's something wrong with this patch,
> when generating e.g. the kindle3 image (imx35 / kindle3_defconfig) 
> with this patch, the generated imximage differs and the device wont
> boot. "Share the code to ..." should not change the program behaviour.

This patch is still not in master. I dropped it (and the one adding
imx-image support for i.MX8) for now until this is resolved.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RESEND v3 50/52] scripts: imx-image: Share the code to write barebox header
  2018-06-11  6:39 [RESEND v3 50/52] scripts: imx-image: Share the code to write barebox header Alexander Kurz
  2018-06-11  6:55 ` Sascha Hauer
@ 2018-06-11 17:40 ` Andrey Smirnov
  1 sibling, 0 replies; 4+ messages in thread
From: Andrey Smirnov @ 2018-06-11 17:40 UTC (permalink / raw)
  To: Alexander Kurz; +Cc: Barebox List

On Sun, Jun 10, 2018 at 11:46 PM Alexander Kurz <akurz@blala.de> wrote:
>
> Hi Andrey,
> there's something wrong with this patch,
> when generating e.g. the kindle3 image (imx35 / kindle3_defconfig)
> with this patch, the generated imximage differs and the device wont
> boot.

My bad, thanks for testing and noticing this! I'll work on fixing this
in v4 of the patchset.

>  "Share the code to ..." should not change the program behaviour.

Yes, agreed.

Thanks,
Andrey Smirnov

>
> Regards, Alexander
>
> --- barebox.imximg_x4_1 2018-06-11 08:27:31.660011787 +0200
> +++ barebox.imximg_x4_2 2018-06-11 08:27:26.676011669 +0200
> @@ -1,6 +1,6 @@
>  000000 ea0003fe eafffffe eafffffe eafffffe
>  000010 eafffffe eafffffe eafffffe eafffffe
> -000020 65726162 00786f62 00000000 00022000
> +000020 65726162 00786f62 00000000 00000000
>  000030 55555555 55555555 55555555 55555555
>  *
>  000050 00000000 00000000 00000000 00000000
> @@ -25,12 +25,8 @@
>  000510 00000000 00022000 00000000 00000000
>  000520 00000000 00000000 00000000 00000000
>  *
> -001000 ea0003fe eafffffe eafffffe eafffffe
> -001010 eafffffe eafffffe eafffffe eafffffe
> -001020 65726162 00786f62 00000000 00022000
> -001030 55555555 55555555 55555555 55555555
> -*
> -001050 00000000 00000000 00000000 00000000
> +001020 00000000 00000000 00000000 00022000
> +001030 00000000 00000000 00000000 00000000
>  *
>  001400 87f00400 000000b1 00000000 87eff814
>  001410 00000000 87eff81c 87eff400 b17219e9
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [RESEND v3 50/52] scripts: imx-image: Share the code to write barebox header
  2018-06-07 13:00 [RESEND v3 00/52] ARM: i.MX8MQ and EVK support Andrey Smirnov
@ 2018-06-07 13:01 ` Andrey Smirnov
  0 siblings, 0 replies; 4+ messages in thread
From: Andrey Smirnov @ 2018-06-07 13:01 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 scripts/imx/imx-image.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/scripts/imx/imx-image.c b/scripts/imx/imx-image.c
index 294f51a90..09686f69c 100644
--- a/scripts/imx/imx-image.c
+++ b/scripts/imx/imx-image.c
@@ -216,9 +216,6 @@ static int add_header_v1(struct config_data *data, void *buf)
 	uint32_t loadaddr = data->image_load_addr;
 	uint32_t imagesize = data->load_size;
 
-	if (add_barebox_header)
-		memcpy(buf, bb_header, sizeof(bb_header));
-
 	buf += offset;
 	hdr = buf;
 
@@ -292,9 +289,6 @@ static int add_header_v2(const struct config_data *data, void *buf)
 	uint32_t loadaddr = data->image_load_addr;
 	uint32_t imagesize = data->load_size;
 
-	if (add_barebox_header)
-		memcpy(buf, bb_header, sizeof(bb_header));
-
 	buf += offset;
 	hdr = buf;
 
@@ -824,7 +818,15 @@ int main(int argc, char *argv[])
 		exit(1);
 	}
 
-	ret = xwrite(outfd, buf, HEADER_LEN);
+	ret = xwrite(outfd, add_barebox_header ? bb_header : buf,
+		     sizeof(bb_header));
+	if (ret < 0) {
+		perror("write");
+		exit(1);
+	}
+
+	ret = xwrite(outfd, buf + sizeof(bb_header),
+		     HEADER_LEN - sizeof(bb_header));
 	if (ret < 0) {
 		perror("write");
 		exit(1);
-- 
2.17.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-06-11 17:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-11  6:39 [RESEND v3 50/52] scripts: imx-image: Share the code to write barebox header Alexander Kurz
2018-06-11  6:55 ` Sascha Hauer
2018-06-11 17:40 ` Andrey Smirnov
  -- strict thread matches above, loose matches on Subject: below --
2018-06-07 13:00 [RESEND v3 00/52] ARM: i.MX8MQ and EVK support Andrey Smirnov
2018-06-07 13:01 ` [RESEND v3 50/52] scripts: imx-image: Share the code to write barebox header Andrey Smirnov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox