diff options
author | Noam Camus <noamc@ezchip.com> | 2012-09-09 04:37:40 -0400 |
---|---|---|
committer | Vineet Gupta <vgupta@synopsys.com> | 2014-03-26 05:01:27 -0400 |
commit | d6579e99bc448a351279cea7469ab64a00d25ff8 (patch) | |
tree | 784445b9378b16692bf4c9657629d36ae5678493 /arch/arc | |
parent | 80c1fe4c0d2747c419a4290c7028c8776932164c (diff) |
ARC: support external initrd
Currently ARC only supports embedded initrd. This patch enables
external ones too.
[vgupta: Changed from "rt_start"=start/"rd_size"=sz to unified "initrd"=start,sz]
Signed-off-by: Noam Camus <noamc@ezchip.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch/arc')
-rw-r--r-- | arch/arc/mm/init.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c index 55e0a85bea78..523412369f70 100644 --- a/arch/arc/mm/init.c +++ b/arch/arc/mm/init.c | |||
@@ -10,6 +10,9 @@ | |||
10 | #include <linux/mm.h> | 10 | #include <linux/mm.h> |
11 | #include <linux/bootmem.h> | 11 | #include <linux/bootmem.h> |
12 | #include <linux/memblock.h> | 12 | #include <linux/memblock.h> |
13 | #ifdef CONFIG_BLK_DEV_INITRD | ||
14 | #include <linux/initrd.h> | ||
15 | #endif | ||
13 | #include <linux/swap.h> | 16 | #include <linux/swap.h> |
14 | #include <linux/module.h> | 17 | #include <linux/module.h> |
15 | #include <asm/page.h> | 18 | #include <asm/page.h> |
@@ -42,6 +45,24 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size) | |||
42 | pr_info("Memory size set via devicetree %ldM\n", TO_MB(arc_mem_sz)); | 45 | pr_info("Memory size set via devicetree %ldM\n", TO_MB(arc_mem_sz)); |
43 | } | 46 | } |
44 | 47 | ||
48 | #ifdef CONFIG_BLK_DEV_INITRD | ||
49 | static int __init early_initrd(char *p) | ||
50 | { | ||
51 | unsigned long start, size; | ||
52 | char *endp; | ||
53 | |||
54 | start = memparse(p, &endp); | ||
55 | if (*endp == ',') { | ||
56 | size = memparse(endp + 1, NULL); | ||
57 | |||
58 | initrd_start = (unsigned long)__va(start); | ||
59 | initrd_end = (unsigned long)__va(start + size); | ||
60 | } | ||
61 | return 0; | ||
62 | } | ||
63 | early_param("initrd", early_initrd); | ||
64 | #endif | ||
65 | |||
45 | /* | 66 | /* |
46 | * First memory setup routine called from setup_arch() | 67 | * First memory setup routine called from setup_arch() |
47 | * 1. setup swapper's mm @init_mm | 68 | * 1. setup swapper's mm @init_mm |
@@ -80,6 +101,12 @@ void __init setup_arch_memory(void) | |||
80 | memblock_reserve(CONFIG_LINUX_LINK_BASE, | 101 | memblock_reserve(CONFIG_LINUX_LINK_BASE, |
81 | __pa(_end) - CONFIG_LINUX_LINK_BASE); | 102 | __pa(_end) - CONFIG_LINUX_LINK_BASE); |
82 | 103 | ||
104 | #ifdef CONFIG_BLK_DEV_INITRD | ||
105 | /*------------- reserve initrd image -----------------------*/ | ||
106 | if (initrd_start) | ||
107 | memblock_reserve(__pa(initrd_start), initrd_end - initrd_start); | ||
108 | #endif | ||
109 | |||
83 | memblock_dump_all(); | 110 | memblock_dump_all(); |
84 | 111 | ||
85 | /*-------------- node setup --------------------------------*/ | 112 | /*-------------- node setup --------------------------------*/ |