Commit 6cdd2bdf authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt Committed by Paul Mackerras

[POWERPC] Fix BootX booting with an initrd

The bootx_init.c trampoline didn't properly add the ramdisk to the
"reserve map" (list of reserved areas of memory), thus causing all sorts
of failures when using BootX with an initrd. Also fixes a possible
problem if the ramdisk is located before the device-tree passed by
BootX.
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 5db9fa95
...@@ -411,8 +411,15 @@ static unsigned long __init bootx_flatten_dt(unsigned long start) ...@@ -411,8 +411,15 @@ static unsigned long __init bootx_flatten_dt(unsigned long start)
DBG("End of boot params: %x\n", mem_end); DBG("End of boot params: %x\n", mem_end);
rsvmap[0] = mem_start; rsvmap[0] = mem_start;
rsvmap[1] = mem_end; rsvmap[1] = mem_end;
if (bootx_info->ramDisk) {
rsvmap[2] = ((unsigned long)bootx_info) + bootx_info->ramDisk;
rsvmap[3] = rsvmap[2] + bootx_info->ramDiskSize;
rsvmap[4] = 0;
rsvmap[5] = 0;
} else {
rsvmap[2] = 0; rsvmap[2] = 0;
rsvmap[3] = 0; rsvmap[3] = 0;
}
return (unsigned long)hdr; return (unsigned long)hdr;
} }
...@@ -543,12 +550,12 @@ void __init bootx_init(unsigned long r3, unsigned long r4) ...@@ -543,12 +550,12 @@ void __init bootx_init(unsigned long r3, unsigned long r4)
*/ */
if (bi->version < 5) { if (bi->version < 5) {
space = bi->deviceTreeOffset + bi->deviceTreeSize; space = bi->deviceTreeOffset + bi->deviceTreeSize;
if (bi->ramDisk) if (bi->ramDisk >= space)
space = bi->ramDisk + bi->ramDiskSize; space = bi->ramDisk + bi->ramDiskSize;
} else } else
space = bi->totalParamsSize; space = bi->totalParamsSize;
bootx_printf("Total space used by parameters & ramdisk: %x \n", space); bootx_printf("Total space used by parameters & ramdisk: 0x%x \n", space);
/* New BootX will have flushed all TLBs and enters kernel with /* New BootX will have flushed all TLBs and enters kernel with
* MMU switched OFF, so this should not be useful anymore. * MMU switched OFF, so this should not be useful anymore.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment