aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arc/mm/init.c27
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
49static 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}
63early_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 --------------------------------*/