aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/microblaze/kernel/prom.c10
-rw-r--r--arch/powerpc/kernel/prom.c10
-rw-r--r--drivers/of/fdt.c27
-rw-r--r--include/linux/of_fdt.h10
4 files changed, 41 insertions, 16 deletions
diff --git a/arch/microblaze/kernel/prom.c b/arch/microblaze/kernel/prom.c
index 459c32e4a5fe..050b7993c51c 100644
--- a/arch/microblaze/kernel/prom.c
+++ b/arch/microblaze/kernel/prom.c
@@ -118,6 +118,16 @@ void __init early_init_devtree(void *params)
118 pr_debug(" <- early_init_devtree()\n"); 118 pr_debug(" <- early_init_devtree()\n");
119} 119}
120 120
121#ifdef CONFIG_BLK_DEV_INITRD
122void __init early_init_dt_setup_initrd_arch(unsigned long start,
123 unsigned long end)
124{
125 initrd_start = (unsigned long)__va(start);
126 initrd_end = (unsigned long)__va(end);
127 initrd_below_start_ok = 1;
128}
129#endif
130
121/******* 131/*******
122 * 132 *
123 * New implementation of the OF "find" APIs, return a refcounted 133 * New implementation of the OF "find" APIs, return a refcounted
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index e0f368ff8d12..40fce1c2f33b 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -510,6 +510,16 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size)
510 memstart_addr = min((u64)memstart_addr, base); 510 memstart_addr = min((u64)memstart_addr, base);
511} 511}
512 512
513#ifdef CONFIG_BLK_DEV_INITRD
514void __init early_init_dt_setup_initrd_arch(unsigned long start,
515 unsigned long end)
516{
517 initrd_start = (unsigned long)__va(start);
518 initrd_end = (unsigned long)__va(end);
519 initrd_below_start_ok = 1;
520}
521#endif
522
513static void __init early_reserve_mem(void) 523static void __init early_reserve_mem(void)
514{ 524{
515 u64 base, size; 525 u64 base, size;
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)
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h
index bf26bd5df9f1..f32f0fc5314a 100644
--- a/include/linux/of_fdt.h
+++ b/include/linux/of_fdt.h
@@ -80,6 +80,16 @@ extern int early_init_dt_scan_memory(unsigned long node, const char *uname,
80extern void early_init_dt_add_memory_arch(u64 base, u64 size); 80extern void early_init_dt_add_memory_arch(u64 base, u64 size);
81extern u64 dt_mem_next_cell(int s, u32 **cellp); 81extern u64 dt_mem_next_cell(int s, u32 **cellp);
82 82
83/*
84 * If BLK_DEV_INITRD, the fdt early init code will call this function,
85 * to be provided by the arch code. start and end are specified as
86 * physical addresses.
87 */
88#ifdef CONFIG_BLK_DEV_INITRD
89extern void early_init_dt_setup_initrd_arch(unsigned long start,
90 unsigned long end);
91#endif
92
83/* Early flat tree scan hooks */ 93/* Early flat tree scan hooks */
84extern int early_init_dt_scan_root(unsigned long node, const char *uname, 94extern int early_init_dt_scan_root(unsigned long node, const char *uname,
85 int depth, void *data); 95 int depth, void *data);