diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2007-02-27 22:12:29 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-03-07 23:43:35 -0500 |
commit | 30437b3e743f33e9b68f813ca24e547aa9fcf7d7 (patch) | |
tree | 6ff8799e8fbfd717f288e7365a5329a01505e9be /arch/powerpc/kernel/setup-common.c | |
parent | eb6de2863750e696201780283e4c9ada19b4728e (diff) |
[POWERPC] Automatically lmb_reserve() initrd
At present, when an initrd is passed to the kernel used flat device
tree properties, the memory the initrd occupies must also be reserved
in the flat tree's reserve map, or the kernel may overwrite it. That
makes life more complicated than it could be for the bootwrapper.
This patch makes the kernel automatically reserve the initrd's space.
That in turn requires parsing the initrd parameters earlier than they
are currently, in early_init_dt_scan_chosen() instead of
check_for_initrd().
Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/setup-common.c')
-rw-r--r-- | arch/powerpc/kernel/setup-common.c | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index 89cfaf49d3de..d050d9a61bd4 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c | |||
@@ -304,26 +304,8 @@ struct seq_operations cpuinfo_op = { | |||
304 | void __init check_for_initrd(void) | 304 | void __init check_for_initrd(void) |
305 | { | 305 | { |
306 | #ifdef CONFIG_BLK_DEV_INITRD | 306 | #ifdef CONFIG_BLK_DEV_INITRD |
307 | const unsigned int *prop; | 307 | DBG(" -> check_for_initrd() initrd_start=0x%lx initrd_end=0x%lx\n", |
308 | int len; | 308 | initrd_start, initrd_end); |
309 | |||
310 | DBG(" -> check_for_initrd()\n"); | ||
311 | |||
312 | if (of_chosen) { | ||
313 | prop = get_property(of_chosen, "linux,initrd-start", &len); | ||
314 | if (prop != NULL) { | ||
315 | initrd_start = (unsigned long) | ||
316 | __va(of_read_ulong(prop, len / 4)); | ||
317 | prop = get_property(of_chosen, | ||
318 | "linux,initrd-end", &len); | ||
319 | if (prop != NULL) { | ||
320 | initrd_end = (unsigned long) | ||
321 | __va(of_read_ulong(prop, len / 4)); | ||
322 | initrd_below_start_ok = 1; | ||
323 | } else | ||
324 | initrd_start = 0; | ||
325 | } | ||
326 | } | ||
327 | 309 | ||
328 | /* If we were passed an initrd, set the ROOT_DEV properly if the values | 310 | /* If we were passed an initrd, set the ROOT_DEV properly if the values |
329 | * look sensible. If not, clear initrd reference. | 311 | * look sensible. If not, clear initrd reference. |