diff options
author | Jeremy Kerr <jeremy.kerr@canonical.com> | 2010-01-30 03:31:21 -0500 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2010-02-09 10:34:10 -0500 |
commit | 1406bc2f57787797d1f6a3675c019a7093769275 (patch) | |
tree | 2b3bee50a75fa1502ef00eccf7bcecda19acd56a /arch | |
parent | 50ab2fe147e22c8786552cda1791a61ae81b84d2 (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 'arch')
-rw-r--r-- | arch/microblaze/kernel/prom.c | 10 | ||||
-rw-r--r-- | arch/powerpc/kernel/prom.c | 10 |
2 files changed, 20 insertions, 0 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 | ||
122 | void __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 | ||
514 | void __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 | |||
513 | static void __init early_reserve_mem(void) | 523 | static void __init early_reserve_mem(void) |
514 | { | 524 | { |
515 | u64 base, size; | 525 | u64 base, size; |