diff options
Diffstat (limited to 'arch/powerpc/kernel/setup-common.c')
| -rw-r--r-- | arch/powerpc/kernel/setup-common.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index d43fa8c0e5ac..e22856ecb5a0 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c | |||
| @@ -405,6 +405,46 @@ static int __init set_preferred_console(void) | |||
| 405 | console_initcall(set_preferred_console); | 405 | console_initcall(set_preferred_console); |
| 406 | #endif /* CONFIG_PPC_MULTIPLATFORM */ | 406 | #endif /* CONFIG_PPC_MULTIPLATFORM */ |
| 407 | 407 | ||
| 408 | void __init check_for_initrd(void) | ||
| 409 | { | ||
| 410 | #ifdef CONFIG_BLK_DEV_INITRD | ||
| 411 | unsigned long *prop; | ||
| 412 | |||
| 413 | DBG(" -> check_for_initrd()\n"); | ||
| 414 | |||
| 415 | if (of_chosen) { | ||
| 416 | prop = (unsigned long *)get_property(of_chosen, | ||
| 417 | "linux,initrd-start", NULL); | ||
| 418 | if (prop != NULL) { | ||
| 419 | initrd_start = (unsigned long)__va(*prop); | ||
| 420 | prop = (unsigned long *)get_property(of_chosen, | ||
| 421 | "linux,initrd-end", NULL); | ||
| 422 | if (prop != NULL) { | ||
| 423 | initrd_end = (unsigned long)__va(*prop); | ||
| 424 | initrd_below_start_ok = 1; | ||
| 425 | } else | ||
| 426 | initrd_start = 0; | ||
| 427 | } | ||
| 428 | } | ||
| 429 | |||
| 430 | /* If we were passed an initrd, set the ROOT_DEV properly if the values | ||
| 431 | * look sensible. If not, clear initrd reference. | ||
| 432 | */ | ||
| 433 | if (initrd_start >= KERNELBASE && initrd_end >= KERNELBASE && | ||
| 434 | initrd_end > initrd_start) | ||
| 435 | ROOT_DEV = Root_RAM0; | ||
| 436 | else { | ||
| 437 | printk("Bogus initrd %08lx %08lx\n", initrd_start, initrd_end); | ||
| 438 | initrd_start = initrd_end = 0; | ||
| 439 | } | ||
| 440 | |||
| 441 | if (initrd_start) | ||
| 442 | printk("Found initrd at 0x%lx:0x%lx\n", initrd_start, initrd_end); | ||
| 443 | |||
| 444 | DBG(" <- check_for_initrd()\n"); | ||
| 445 | #endif /* CONFIG_BLK_DEV_INITRD */ | ||
| 446 | } | ||
| 447 | |||
| 408 | #ifdef CONFIG_SMP | 448 | #ifdef CONFIG_SMP |
| 409 | 449 | ||
| 410 | /** | 450 | /** |
