From: Alban Bedel Date: Fri, 7 Nov 2014 11:44:36 +0000 (+0100) Subject: MIPS: ath79: Read the initrd address from the firmware environment X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ebf71ec7e14bd55d0114f625686304979ecff4d0;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git MIPS: ath79: Read the initrd address from the firmware environment Allow loading an initrd passed by the firmware. Signed-off-by: Alban Bedel Cc: linux-kernel@vger.kernel.org Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/8354/ Signed-off-by: Ralf Baechle --- diff --git a/arch/mips/ath79/prom.c b/arch/mips/ath79/prom.c index 80a0bffe5e1c..e1fe63051136 100644 --- a/arch/mips/ath79/prom.c +++ b/arch/mips/ath79/prom.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -23,6 +24,13 @@ void __init prom_init(void) { fw_init_cmdline(); + + /* Read the initrd address from the firmware environment */ + initrd_start = fw_getenvl("initrd_start"); + if (initrd_start) { + initrd_start = KSEG0ADDR(initrd_start); + initrd_end = initrd_start + fw_getenvl("initrd_size"); + } } void __init prom_free_prom_memory(void)