Skip to content
Snippets Groups Projects
Commit d535a493 authored by Kumar Gala's avatar Kumar Gala Committed by Wolfgang Denk
Browse files

fdt: Fix fdt padding issue for initrd mem_rsv


Its possible that we end up with a device tree that happens to be a
particular size that after we call fdt_resize() we don't have any
space left for the initrd mem_rsv.

Fix this be adding a second mem_rsv into the size calculation.  We
had one to cover the fdt itself and we have the potential of adding
a second for the initrd.

Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
Acked-by: default avatarGerald Van Baren <vanbaren@cideas.com>
parent 0ac59d0c
No related branches found
No related tags found
No related merge requests found
...@@ -604,10 +604,11 @@ int fdt_resize(void *blob) ...@@ -604,10 +604,11 @@ int fdt_resize(void *blob)
/* /*
* Calculate the actual size of the fdt * Calculate the actual size of the fdt
* plus the size needed for fdt_add_mem_rsv * plus the size needed for two fdt_add_mem_rsv, one
* for the fdt itself and one for a possible initrd
*/ */
actualsize = fdt_off_dt_strings(blob) + actualsize = fdt_off_dt_strings(blob) +
fdt_size_dt_strings(blob) + sizeof(struct fdt_reserve_entry); fdt_size_dt_strings(blob) + 2*sizeof(struct fdt_reserve_entry);
/* Make it so the fdt ends on a page boundary */ /* Make it so the fdt ends on a page boundary */
actualsize = ALIGN(actualsize + ((uint)blob & 0xfff), 0x1000); actualsize = ALIGN(actualsize + ((uint)blob & 0xfff), 0x1000);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment