mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 1/2] bootm: Add a define for the additional devicetree size
Date: Thu,  1 Nov 2012 12:49:32 +0100	[thread overview]
Message-ID: <1351770573-30009-2-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1351770573-30009-1-git-send-email-s.hauer@pengutronix.de>

The fixed devicetree may need more space than the original one.
We used to use 0x8000 here. Add a define for it to have the
space defined at a single place.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 commands/bootm.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/commands/bootm.c b/commands/bootm.c
index 20b49f0..d14ec2b 100644
--- a/commands/bootm.c
+++ b/commands/bootm.c
@@ -49,6 +49,11 @@
 
 static LIST_HEAD(handler_list);
 
+/*
+ * Additional oftree size for the fixed tree
+ */
+#define OFTREE_SIZE_INCREASE	0x8000
+
 int register_image_handler(struct image_handler *handler)
 {
 	list_add_tail(&handler->list, &handler_list);
@@ -184,12 +189,14 @@ static int bootm_open_oftree(struct image_data *data, const char *oftree, int nu
 				file_type_to_string(ft));
 	}
 
-	fixfdt = xmemalign(4096, size + 0x8000);
+	fixfdt = xmemalign(4096, size + OFTREE_SIZE_INCREASE);
 	memcpy(fixfdt, fdt, size);
 
+
+	ret = fdt_open_into(fdt, fixfdt, size + OFTREE_SIZE_INCREASE);
+
 	free(fdt);
 
-	ret = fdt_open_into(fixfdt, fixfdt, size + 0x8000);
 	if (ret) {
 		printf("unable to parse %s\n", oftree);
 		return -ENODEV;
-- 
1.7.10.4


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

  reply	other threads:[~2012-11-01 11:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-01 11:49 [PATCH] fix devicetree alignment Sascha Hauer
2012-11-01 11:49 ` Sascha Hauer [this message]
2012-11-01 11:49 ` [PATCH 2/2] bootm: Do not cross 1MiB sections for the devicetree Sascha Hauer

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=1351770573-30009-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