[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>
This commit is contained in:
David Gibson
2007-02-28 14:12:29 +11:00
committed by Paul Mackerras
parent eb6de28637
commit 30437b3e74
2 changed files with 25 additions and 20 deletions

View File

@@ -304,26 +304,8 @@ struct seq_operations cpuinfo_op = {
void __init check_for_initrd(void)
{
#ifdef CONFIG_BLK_DEV_INITRD
const unsigned int *prop;
int len;
DBG(" -> check_for_initrd()\n");
if (of_chosen) {
prop = get_property(of_chosen, "linux,initrd-start", &len);
if (prop != NULL) {
initrd_start = (unsigned long)
__va(of_read_ulong(prop, len / 4));
prop = get_property(of_chosen,
"linux,initrd-end", &len);
if (prop != NULL) {
initrd_end = (unsigned long)
__va(of_read_ulong(prop, len / 4));
initrd_below_start_ok = 1;
} else
initrd_start = 0;
}
}
DBG(" -> check_for_initrd() initrd_start=0x%lx initrd_end=0x%lx\n",
initrd_start, initrd_end);
/* If we were passed an initrd, set the ROOT_DEV properly if the values
* look sensible. If not, clear initrd reference.