From 448ab4fb30a88775f60960f1b41d4dd12306f7fe Mon Sep 17 00:00:00 2001 From: Peter Korsgaard Date: Wed, 22 Oct 2008 14:22:32 +0200 Subject: [PATCH] fdt_resize(): Expand to next page boundary independent of offset fdt_resize() adjusted the fdt totalsize so the fdt would end on a page boundary in memory - E.G. the amount of padding depended on the location of the fdt (offset within page). This doesn't work very good with multi file images where the fdt is located after the kernel and hence on a more-or-less random offset within a page. Instead, simply pad fdt to the next page boundary. For the common case of fdt at offset 0 within a page, the same amount of padding as before is added. Signed-off-by: Peter Korsgaard --- common/fdt_support.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/common/fdt_support.c b/common/fdt_support.c index 8ceeb0f..12aebac 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -579,9 +579,8 @@ int fdt_resize(void *blob) actualsize = fdt_off_dt_strings(blob) + fdt_size_dt_strings(blob); - /* Make it so the fdt ends on a page boundary */ + /* Expand to next page boundary */ actualsize = ALIGN(actualsize, 0x1000); - actualsize = actualsize - ((uint)blob & 0xfff); /* Change the fdt header to reflect the correct size */ fdt_set_totalsize(blob, actualsize); -- 1.5.6.5