]> git.kernelconcepts.de Git - karo-tx-uboot.git/commit
fdt_resize(): fix actualsize calculations with unaligned blobs
authorPeter Korsgaard <jacmet@sunsite.dk>
Wed, 14 Jan 2009 12:52:24 +0000 (13:52 +0100)
committerGerald Van Baren <vanbaren@cideas.com>
Sat, 17 Jan 2009 18:03:29 +0000 (13:03 -0500)
commitc088a108c75db565e07292fd668dfa5491e85bc2
tree0f310a28b1da8173a05e57c6cc30618716d5b0a9
parentfadad1573fb16c90025f08a2861d6047d093cba7
fdt_resize(): fix actualsize calculations with unaligned blobs

The code in fdt_resize() to extend the fdt size to end on a page boundary
is wrong for fdt's not located at an address aligned on a page boundary.
What's even worse, the code would make actualsize shrink rather than grow
if (blob & 0xfff) was bigger than the amount of padding added by ALIGN(),
causing fdt_add_mem_rsv to fail.

Fix it by aligning end address (blob + size) to a page boundary instead.
For aligned fdt's this is equivalent to what we had before.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
common/fdt_support.c