mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
of/flattree: use callback to setup initrd from /chosen
At present, the fdt code sets the kernel-wide initrd_start and initrd_end variables when parsing /chosen. On ARM, we only set these once the bootmem has been reserved. This change adds an arch hook to setup the initrd from the device tree: void early_init_dt_setup_initrd_arch(unsigned long start, unsigned long end); The arch-specific code can then setup the initrd however it likes. Compiled on powerpc, with CONFIG_BLK_DEV_INITRD=y and =n. Signed-off-by: Jeremy Kerr <[email protected]> Signed-off-by: Grant Likely <[email protected]>
This commit is contained in:
parent
50ab2fe147
commit
1406bc2f57
4 changed files with 41 additions and 16 deletions
|
|
@ -384,28 +384,23 @@ unsigned long __init unflatten_dt_node(unsigned long mem,
|
|||
*/
|
||||
void __init early_init_dt_check_for_initrd(unsigned long node)
|
||||
{
|
||||
unsigned long len;
|
||||
unsigned long start, end, len;
|
||||
u32 *prop;
|
||||
|
||||
pr_debug("Looking for initrd properties... ");
|
||||
|
||||
prop = of_get_flat_dt_prop(node, "linux,initrd-start", &len);
|
||||
if (prop) {
|
||||
initrd_start = (unsigned long)
|
||||
__va(of_read_ulong(prop, len/4));
|
||||
if (!prop)
|
||||
return;
|
||||
start = of_read_ulong(prop, len/4);
|
||||
|
||||
prop = of_get_flat_dt_prop(node, "linux,initrd-end", &len);
|
||||
if (prop) {
|
||||
initrd_end = (unsigned long)
|
||||
__va(of_read_ulong(prop, len/4));
|
||||
initrd_below_start_ok = 1;
|
||||
} else {
|
||||
initrd_start = 0;
|
||||
}
|
||||
}
|
||||
prop = of_get_flat_dt_prop(node, "linux,initrd-end", &len);
|
||||
if (!prop)
|
||||
return;
|
||||
end = of_read_ulong(prop, len/4);
|
||||
|
||||
pr_debug("initrd_start=0x%lx initrd_end=0x%lx\n",
|
||||
initrd_start, initrd_end);
|
||||
early_init_dt_setup_initrd_arch(start, end);
|
||||
pr_debug("initrd_start=0x%lx initrd_end=0x%lx\n", start, end);
|
||||
}
|
||||
#else
|
||||
inline void early_init_dt_check_for_initrd(unsigned long node)
|
||||
|
|
|
|||
Loading…
Reference in a new issue