MIPS: ath79: Read the initrd address from the firmware environment
authorAlban Bedel <albeu@free.fr>
Fri, 7 Nov 2014 11:44:36 +0000 (12:44 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Mon, 24 Nov 2014 06:45:30 +0000 (07:45 +0100)
Allow loading an initrd passed by the firmware.

Signed-off-by: Alban Bedel <albeu@free.fr>
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 <ralf@linux-mips.org>
arch/mips/ath79/prom.c

index 80a0bffe5e1c37ab21178eee6504970cb2a0be5b..e1fe6305113612cf2943bff9307a9579a9da3f69 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/init.h>
 #include <linux/io.h>
 #include <linux/string.h>
+#include <linux/initrd.h>
 
 #include <asm/bootinfo.h>
 #include <asm/addrspace.h>
 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)