mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 1/2] scripts: imx-image: Do not pad image
Date: Thu, 16 Jul 2015 09:48:45 +0200	[thread overview]
Message-ID: <1437032926-25680-2-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1437032926-25680-1-git-send-email-s.hauer@pengutronix.de>

We have to pad the load size to the next 4k boundary, but only for the
HAB4 case we actually care what data is loaded in the rest of the image.
This lets the padding depend on the prepare_sign option.

Background for this patch is a new yet-to-be-introduced image loading
mechanism for i.MX. This new mechanism only loads the PBL portion of
the image to memory, and not the whole image anymore. This means that
the image in this case changes from:

i.MX header (with loadsize: whole image), PBL, payload, padding

to:

i.MX header (with loadsize: header + PBL + padding), PBL, padding, payload

With the padding between PBL and payload we are no longer able to find
the payload, so we cannot add the padding there.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 scripts/imx/imx-image.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/imx/imx-image.c b/scripts/imx/imx-image.c
index e765c1d..f0e8ca3 100644
--- a/scripts/imx/imx-image.c
+++ b/scripts/imx/imx-image.c
@@ -825,7 +825,7 @@ int main(int argc, char *argv[])
 
 	/* pad until next 4k boundary */
 	now = 4096 - now;
-	if (now) {
+	if (prepare_sign && now) {
 		memset(buf, 0x5a, now);
 
 		ret = xwrite(outfd, buf, now);
-- 
2.1.4


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

  reply	other threads:[~2015-07-16  7:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-16  7:48 [PATCH v2]: imx-image changes Sascha Hauer
2015-07-16  7:48 ` Sascha Hauer [this message]
2015-07-16  7:48 ` [PATCH 2/2] scripts: imx-image: Make in-place capable Sascha Hauer
  -- strict thread matches above, loose matches on Subject: below --
2015-07-15  6:02 [PATCH 1/2] scripts: imx-image: Do not pad image Sascha Hauer
2015-07-15 11:10 ` Marc Kleine-Budde
2015-07-15 12:06   ` Sascha Hauer
2015-07-15 12:09     ` Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1437032926-25680-2-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox