From da7d19b9d8cce610b329ca84eb44e5a215537363 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Wed, 31 Oct 2012 15:04:37 +0100 Subject: [PATCH] bootm: Add a define for the additional devicetree size 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 --- commands/bootm.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/commands/bootm.c b/commands/bootm.c index 20b49f0cd..d14ec2ba5 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;