diff options
author | Rob Herring <robh@kernel.org> | 2014-04-01 23:46:48 -0400 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2014-04-30 01:59:17 -0400 |
commit | d1552ce449eb0a8d2f0bd6599da3a8a3d7f77a84 (patch) | |
tree | 10e5d7505664ee5270eb8e0b895099decea030de /arch/arm64 | |
parent | b0a6fb36a49f720c93c3da0b3f040e49e42435ad (diff) |
of/fdt: move memreserve and dtb memory reservations into core
Move the /memreserve/ processing and dtb memory reservations into
early_init_fdt_scan_reserved_mem. This converts arm, arm64, and powerpc
as they are the only users of early_init_fdt_scan_reserved_mem.
memblock_reserve is safe to call on the same region twice, so the
reservation check for the dtb in powerpc 32-bit reservations is safe to
remove.
Signed-off-by: Rob Herring <robh@kernel.org>
Tested-by: Michal Simek <michal.simek@xilinx.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Tested-by: Grant Likely <grant.likely@linaro.org>
Tested-by: Stephen Chivers <schivers@csc.com>
Diffstat (limited to 'arch/arm64')
-rw-r--r-- | arch/arm64/mm/init.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index 51d5352e6ad5..091d428d64ac 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c | |||
@@ -126,8 +126,6 @@ static void arm64_memory_present(void) | |||
126 | 126 | ||
127 | void __init arm64_memblock_init(void) | 127 | void __init arm64_memblock_init(void) |
128 | { | 128 | { |
129 | u64 *reserve_map, base, size; | ||
130 | |||
131 | /* Register the kernel text, kernel data and initrd with memblock */ | 129 | /* Register the kernel text, kernel data and initrd with memblock */ |
132 | memblock_reserve(__pa(_text), _end - _text); | 130 | memblock_reserve(__pa(_text), _end - _text); |
133 | #ifdef CONFIG_BLK_DEV_INITRD | 131 | #ifdef CONFIG_BLK_DEV_INITRD |
@@ -142,25 +140,6 @@ void __init arm64_memblock_init(void) | |||
142 | memblock_reserve(__pa(swapper_pg_dir), SWAPPER_DIR_SIZE); | 140 | memblock_reserve(__pa(swapper_pg_dir), SWAPPER_DIR_SIZE); |
143 | memblock_reserve(__pa(idmap_pg_dir), IDMAP_DIR_SIZE); | 141 | memblock_reserve(__pa(idmap_pg_dir), IDMAP_DIR_SIZE); |
144 | 142 | ||
145 | /* Reserve the dtb region */ | ||
146 | memblock_reserve(virt_to_phys(initial_boot_params), | ||
147 | be32_to_cpu(initial_boot_params->totalsize)); | ||
148 | |||
149 | /* | ||
150 | * Process the reserve map. This will probably overlap the initrd | ||
151 | * and dtb locations which are already reserved, but overlapping | ||
152 | * doesn't hurt anything | ||
153 | */ | ||
154 | reserve_map = ((void*)initial_boot_params) + | ||
155 | be32_to_cpu(initial_boot_params->off_mem_rsvmap); | ||
156 | while (1) { | ||
157 | base = be64_to_cpup(reserve_map++); | ||
158 | size = be64_to_cpup(reserve_map++); | ||
159 | if (!size) | ||
160 | break; | ||
161 | memblock_reserve(base, size); | ||
162 | } | ||
163 | |||
164 | early_init_fdt_scan_reserved_mem(); | 143 | early_init_fdt_scan_reserved_mem(); |
165 | dma_contiguous_reserve(0); | 144 | dma_contiguous_reserve(0); |
166 | 145 | ||