diff options
Diffstat (limited to 'arch/powerpc/kernel/prom.c')
-rw-r--r-- | arch/powerpc/kernel/prom.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index 15ece3abfb37..ef6bfb70b24a 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c | |||
@@ -719,6 +719,7 @@ static int __init early_init_dt_scan_chosen(unsigned long node, | |||
719 | const char *uname, int depth, void *data) | 719 | const char *uname, int depth, void *data) |
720 | { | 720 | { |
721 | unsigned long *lprop; | 721 | unsigned long *lprop; |
722 | u32 *prop; | ||
722 | unsigned long l; | 723 | unsigned long l; |
723 | char *p; | 724 | char *p; |
724 | 725 | ||
@@ -760,6 +761,22 @@ static int __init early_init_dt_scan_chosen(unsigned long node, | |||
760 | crashk_res.end = crashk_res.start + *lprop - 1; | 761 | crashk_res.end = crashk_res.start + *lprop - 1; |
761 | #endif | 762 | #endif |
762 | 763 | ||
764 | #ifdef CONFIG_BLK_DEV_INITRD | ||
765 | DBG("Looking for initrd properties... "); | ||
766 | prop = of_get_flat_dt_prop(node, "linux,initrd-start", &l); | ||
767 | if (prop) { | ||
768 | initrd_start = (unsigned long)__va(of_read_ulong(prop, l/4)); | ||
769 | prop = of_get_flat_dt_prop(node, "linux,initrd-end", &l); | ||
770 | if (prop) { | ||
771 | initrd_end = (unsigned long)__va(of_read_ulong(prop, l/4)); | ||
772 | initrd_below_start_ok = 1; | ||
773 | } else { | ||
774 | initrd_start = 0; | ||
775 | } | ||
776 | } | ||
777 | DBG("initrd_start=0x%lx initrd_end=0x%lx\n", initrd_start, initrd_end); | ||
778 | #endif /* CONFIG_BLK_DEV_INITRD */ | ||
779 | |||
763 | /* Retreive command line */ | 780 | /* Retreive command line */ |
764 | p = of_get_flat_dt_prop(node, "bootargs", &l); | 781 | p = of_get_flat_dt_prop(node, "bootargs", &l); |
765 | if (p != NULL && l > 0) | 782 | if (p != NULL && l > 0) |
@@ -926,6 +943,12 @@ static void __init early_reserve_mem(void) | |||
926 | self_size = initial_boot_params->totalsize; | 943 | self_size = initial_boot_params->totalsize; |
927 | lmb_reserve(self_base, self_size); | 944 | lmb_reserve(self_base, self_size); |
928 | 945 | ||
946 | #ifdef CONFIG_BLK_DEV_INITRD | ||
947 | /* then reserve the initrd, if any */ | ||
948 | if (initrd_start && (initrd_end > initrd_start)) | ||
949 | lmb_reserve(__pa(initrd_start), initrd_end - initrd_start); | ||
950 | #endif /* CONFIG_BLK_DEV_INITRD */ | ||
951 | |||
929 | #ifdef CONFIG_PPC32 | 952 | #ifdef CONFIG_PPC32 |
930 | /* | 953 | /* |
931 | * Handle the case where we might be booting from an old kexec | 954 | * Handle the case where we might be booting from an old kexec |