summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/fdt_support.c3
-rw-r--r--common/image-fdt.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/common/fdt_support.c b/common/fdt_support.c
index 202058621a..0609470dfb 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -523,7 +523,7 @@ void fdt_fixup_ethernet(void *fdt)
}
/* Resize the fdt to its actual size + a bit of padding */
-int fdt_shrink_to_minimum(void *blob)
+int fdt_shrink_to_minimum(void *blob, uint extrasize)
{
int i;
uint64_t addr, size;
@@ -551,6 +551,7 @@ int fdt_shrink_to_minimum(void *blob)
actualsize = fdt_off_dt_strings(blob) +
fdt_size_dt_strings(blob) + 5 * sizeof(struct fdt_reserve_entry);
+ actualsize += extrasize;
/* Make it so the fdt ends on a page boundary */
actualsize = ALIGN(actualsize + ((uintptr_t)blob & 0xfff), 0x1000);
actualsize = actualsize - ((uintptr_t)blob & 0xfff);
diff --git a/common/image-fdt.c b/common/image-fdt.c
index 3d23608c04..5454227fc9 100644
--- a/common/image-fdt.c
+++ b/common/image-fdt.c
@@ -503,7 +503,7 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
lmb_free(lmb, (phys_addr_t)(u32)(uintptr_t)blob,
(phys_size_t)fdt_totalsize(blob));
- ret = fdt_shrink_to_minimum(blob);
+ ret = fdt_shrink_to_minimum(blob, 0);
if (ret < 0)
goto err;
of_size = ret;