aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of/fdt.c
diff options
context:
space:
mode:
authorJeremy Kerr <jeremy.kerr@canonical.com>2010-01-30 03:31:21 -0500
committerGrant Likely <grant.likely@secretlab.ca>2010-02-09 10:34:10 -0500
commit1406bc2f57787797d1f6a3675c019a7093769275 (patch)
tree2b3bee50a75fa1502ef00eccf7bcecda19acd56a /drivers/of/fdt.c
parent50ab2fe147e22c8786552cda1791a61ae81b84d2 (diff)
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 <jeremy.kerr@canonical.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/of/fdt.c')
-rw-r--r--drivers/of/fdt.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index f84152d112b0..9290ca5aa892 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -384,28 +384,23 @@ unsigned long __init unflatten_dt_node(unsigned long mem,
384 */ 384 */
385void __init early_init_dt_check_for_initrd(unsigned long node) 385void __init early_init_dt_check_for_initrd(unsigned long node)
386{ 386{
387 unsigned long len; 387 unsigned long start, end, len;
388 u32 *prop; 388 u32 *prop;
389 389
390 pr_debug("Looking for initrd properties... "); 390 pr_debug("Looking for initrd properties... ");
391 391
392 prop = of_get_flat_dt_prop(node, "linux,initrd-start", &len); 392 prop = of_get_flat_dt_prop(node, "linux,initrd-start", &len);
393 if (prop) { 393 if (!prop)
394 initrd_start = (unsigned long) 394 return;
395 __va(of_read_ulong(prop, len/4)); 395 start = of_read_ulong(prop, len/4);
396 396
397 prop = of_get_flat_dt_prop(node, "linux,initrd-end", &len); 397 prop = of_get_flat_dt_prop(node, "linux,initrd-end", &len);
398 if (prop) { 398 if (!prop)
399 initrd_end = (unsigned long) 399 return;
400 __va(of_read_ulong(prop, len/4)); 400 end = of_read_ulong(prop, len/4);
401 initrd_below_start_ok = 1;
402 } else {
403 initrd_start = 0;
404 }
405 }
406 401
407 pr_debug("initrd_start=0x%lx initrd_end=0x%lx\n", 402 early_init_dt_setup_initrd_arch(start, end);
408 initrd_start, initrd_end); 403 pr_debug("initrd_start=0x%lx initrd_end=0x%lx\n", start, end);
409} 404}
410#else 405#else
411inline void early_init_dt_check_for_initrd(unsigned long node) 406inline void early_init_dt_check_for_initrd(unsigned long node)