From 56844a22b76c719e600047e23b80465a44d76abd Mon Sep 17 00:00:00 2001 From: Heiko Schocher Date: Thu, 11 Sep 2008 08:11:23 +0200 Subject: powerpc: Fix bootm to boot up again with a Ramdisk Commit 2a1a2cb6 didnt remove the dummy mem reservation in fdt_chosen, and this stopped Linux from booting with a Ramdisk. This patch fixes this, by deleting the useless dummy mem reservation. When booting with a Ramdisk, a fix offset FDT_RAMDISK_OVERHEAD is now added to of_size, so we dont need anymore a dummy mem reservation. I measured the value of FDT_RAMDISK_OVERHEAD on a MPC8270 based system (=0x44 bytes) and rounded it up to 0x80). Signed-off-by: Heiko Schocher Acked-by: Kumar Gala --- lib_ppc/bootm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib_ppc') diff --git a/lib_ppc/bootm.c b/lib_ppc/bootm.c index 348421f..38266e1 100644 --- a/lib_ppc/bootm.c +++ b/lib_ppc/bootm.c @@ -145,8 +145,7 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images) * if the user wants it (the logic is in the subroutines). */ if (of_size) { - /* pass in dummy initrd info, we'll fix up later */ - if (fdt_chosen(of_flat_tree, images->rd_start, images->rd_end, 0) < 0) { + if (fdt_chosen(of_flat_tree, 0) < 0) { puts ("ERROR: "); puts ("/chosen node create failed"); puts (" - must RESET the board to recover.\n"); @@ -169,6 +168,8 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images) goto error; of_size = ret; + if ((of_flat_tree) && (initrd_start && initrd_end)) + of_size += FDT_RAMDISK_OVERHEAD; /* Create a new LMB reservation */ lmb_reserve(lmb, (ulong)of_flat_tree, of_size); } -- cgit v1.1