diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2006-08-22 21:45:12 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-08-23 01:51:18 -0400 |
commit | 6cdd2bdfb9e2449f1c8a0f729cdf9cfd733dd63f (patch) | |
tree | 49b7507b83c82c26f2f0ab5bd1833460b3baac28 /arch/powerpc | |
parent | 5db9fa9593e2ff69f2b95f9d59229dc4faaa564d (diff) |
[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: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/platforms/powermac/bootx_init.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/powermac/bootx_init.c b/arch/powerpc/platforms/powermac/bootx_init.c index 6a026c733f6a..9d73d0234c5d 100644 --- a/arch/powerpc/platforms/powermac/bootx_init.c +++ b/arch/powerpc/platforms/powermac/bootx_init.c | |||
@@ -411,8 +411,15 @@ static unsigned long __init bootx_flatten_dt(unsigned long start) | |||
411 | DBG("End of boot params: %x\n", mem_end); | 411 | DBG("End of boot params: %x\n", mem_end); |
412 | rsvmap[0] = mem_start; | 412 | rsvmap[0] = mem_start; |
413 | rsvmap[1] = mem_end; | 413 | rsvmap[1] = mem_end; |
414 | rsvmap[2] = 0; | 414 | if (bootx_info->ramDisk) { |
415 | rsvmap[3] = 0; | 415 | rsvmap[2] = ((unsigned long)bootx_info) + bootx_info->ramDisk; |
416 | rsvmap[3] = rsvmap[2] + bootx_info->ramDiskSize; | ||
417 | rsvmap[4] = 0; | ||
418 | rsvmap[5] = 0; | ||
419 | } else { | ||
420 | rsvmap[2] = 0; | ||
421 | rsvmap[3] = 0; | ||
422 | } | ||
416 | 423 | ||
417 | return (unsigned long)hdr; | 424 | return (unsigned long)hdr; |
418 | } | 425 | } |
@@ -543,12 +550,12 @@ void __init bootx_init(unsigned long r3, unsigned long r4) | |||
543 | */ | 550 | */ |
544 | if (bi->version < 5) { | 551 | if (bi->version < 5) { |
545 | space = bi->deviceTreeOffset + bi->deviceTreeSize; | 552 | space = bi->deviceTreeOffset + bi->deviceTreeSize; |
546 | if (bi->ramDisk) | 553 | if (bi->ramDisk >= space) |
547 | space = bi->ramDisk + bi->ramDiskSize; | 554 | space = bi->ramDisk + bi->ramDiskSize; |
548 | } else | 555 | } else |
549 | space = bi->totalParamsSize; | 556 | space = bi->totalParamsSize; |
550 | 557 | ||
551 | bootx_printf("Total space used by parameters & ramdisk: %x \n", space); | 558 | bootx_printf("Total space used by parameters & ramdisk: 0x%x \n", space); |
552 | 559 | ||
553 | /* New BootX will have flushed all TLBs and enters kernel with | 560 | /* New BootX will have flushed all TLBs and enters kernel with |
554 | * MMU switched OFF, so this should not be useful anymore. | 561 | * MMU switched OFF, so this should not be useful anymore. |