aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2009-11-24 05:26:58 -0500
committerGrant Likely <grant.likely@secretlab.ca>2009-12-10 17:18:03 -0500
commitf7b3a8355ba6cad251297844a0bdd08898ea36e0 (patch)
tree018eee7bfdbf99961e929644a761354bbea12688 /drivers
parent2be09cb993826b52c9fc1d44747c20dd43a50038 (diff)
of/flattree: Merge early_init_dt_check_for_initrd()
Merge common code between PowerPC and Microblaze Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Tested-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/of/fdt.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 43d236cbc17b..6ad98e85dc93 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -11,6 +11,7 @@
11 11
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/lmb.h> 13#include <linux/lmb.h>
14#include <linux/initrd.h>
14#include <linux/of.h> 15#include <linux/of.h>
15#include <linux/of_fdt.h> 16#include <linux/of_fdt.h>
16 17
@@ -369,6 +370,42 @@ unsigned long __init unflatten_dt_node(unsigned long mem,
369 return mem; 370 return mem;
370} 371}
371 372
373#ifdef CONFIG_BLK_DEV_INITRD
374/**
375 * early_init_dt_check_for_initrd - Decode initrd location from flat tree
376 * @node: reference to node containing initrd location ('chosen')
377 */
378void __init early_init_dt_check_for_initrd(unsigned long node)
379{
380 unsigned long len;
381 u32 *prop;
382
383 pr_debug("Looking for initrd properties... ");
384
385 prop = of_get_flat_dt_prop(node, "linux,initrd-start", &len);
386 if (prop) {
387 initrd_start = (unsigned long)
388 __va(of_read_ulong(prop, len/4));
389
390 prop = of_get_flat_dt_prop(node, "linux,initrd-end", &len);
391 if (prop) {
392 initrd_end = (unsigned long)
393 __va(of_read_ulong(prop, len/4));
394 initrd_below_start_ok = 1;
395 } else {
396 initrd_start = 0;
397 }
398 }
399
400 pr_debug("initrd_start=0x%lx initrd_end=0x%lx\n",
401 initrd_start, initrd_end);
402}
403#else
404inline void early_init_dt_check_for_initrd(unsigned long node)
405{
406}
407#endif /* CONFIG_BLK_DEV_INITRD */
408
372/** 409/**
373 * unflatten_device_tree - create tree of device_nodes from flat blob 410 * unflatten_device_tree - create tree of device_nodes from flat blob
374 * 411 *