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 <[email protected]>
---
 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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to