diff options
Diffstat (limited to 'arch/arm64/mm/init.c')
-rw-r--r-- | arch/arm64/mm/init.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index e90c5426fe14..5b4526ee3a01 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/dma-mapping.h> | 33 | #include <linux/dma-mapping.h> |
34 | #include <linux/dma-contiguous.h> | 34 | #include <linux/dma-contiguous.h> |
35 | 35 | ||
36 | #include <asm/fixmap.h> | ||
36 | #include <asm/sections.h> | 37 | #include <asm/sections.h> |
37 | #include <asm/setup.h> | 38 | #include <asm/setup.h> |
38 | #include <asm/sizes.h> | 39 | #include <asm/sizes.h> |
@@ -137,20 +138,16 @@ void __init arm64_memblock_init(void) | |||
137 | { | 138 | { |
138 | phys_addr_t dma_phys_limit = 0; | 139 | phys_addr_t dma_phys_limit = 0; |
139 | 140 | ||
140 | /* Register the kernel text, kernel data and initrd with memblock */ | 141 | /* |
142 | * Register the kernel text, kernel data, initrd, and initial | ||
143 | * pagetables with memblock. | ||
144 | */ | ||
141 | memblock_reserve(__pa(_text), _end - _text); | 145 | memblock_reserve(__pa(_text), _end - _text); |
142 | #ifdef CONFIG_BLK_DEV_INITRD | 146 | #ifdef CONFIG_BLK_DEV_INITRD |
143 | if (initrd_start) | 147 | if (initrd_start) |
144 | memblock_reserve(__virt_to_phys(initrd_start), initrd_end - initrd_start); | 148 | memblock_reserve(__virt_to_phys(initrd_start), initrd_end - initrd_start); |
145 | #endif | 149 | #endif |
146 | 150 | ||
147 | /* | ||
148 | * Reserve the page tables. These are already in use, | ||
149 | * and can only be in node 0. | ||
150 | */ | ||
151 | memblock_reserve(__pa(swapper_pg_dir), SWAPPER_DIR_SIZE); | ||
152 | memblock_reserve(__pa(idmap_pg_dir), IDMAP_DIR_SIZE); | ||
153 | |||
154 | early_init_fdt_scan_reserved_mem(); | 151 | early_init_fdt_scan_reserved_mem(); |
155 | 152 | ||
156 | /* 4GB maximum for 32-bit only capable devices */ | 153 | /* 4GB maximum for 32-bit only capable devices */ |
@@ -269,26 +266,33 @@ void __init mem_init(void) | |||
269 | 266 | ||
270 | #define MLK(b, t) b, t, ((t) - (b)) >> 10 | 267 | #define MLK(b, t) b, t, ((t) - (b)) >> 10 |
271 | #define MLM(b, t) b, t, ((t) - (b)) >> 20 | 268 | #define MLM(b, t) b, t, ((t) - (b)) >> 20 |
269 | #define MLG(b, t) b, t, ((t) - (b)) >> 30 | ||
272 | #define MLK_ROUNDUP(b, t) b, t, DIV_ROUND_UP(((t) - (b)), SZ_1K) | 270 | #define MLK_ROUNDUP(b, t) b, t, DIV_ROUND_UP(((t) - (b)), SZ_1K) |
273 | 271 | ||
274 | pr_notice("Virtual kernel memory layout:\n" | 272 | pr_notice("Virtual kernel memory layout:\n" |
275 | " vmalloc : 0x%16lx - 0x%16lx (%6ld MB)\n" | 273 | " vmalloc : 0x%16lx - 0x%16lx (%6ld GB)\n" |
276 | #ifdef CONFIG_SPARSEMEM_VMEMMAP | 274 | #ifdef CONFIG_SPARSEMEM_VMEMMAP |
277 | " vmemmap : 0x%16lx - 0x%16lx (%6ld MB)\n" | 275 | " vmemmap : 0x%16lx - 0x%16lx (%6ld GB maximum)\n" |
276 | " 0x%16lx - 0x%16lx (%6ld MB actual)\n" | ||
278 | #endif | 277 | #endif |
278 | " PCI I/O : 0x%16lx - 0x%16lx (%6ld MB)\n" | ||
279 | " fixed : 0x%16lx - 0x%16lx (%6ld KB)\n" | ||
279 | " modules : 0x%16lx - 0x%16lx (%6ld MB)\n" | 280 | " modules : 0x%16lx - 0x%16lx (%6ld MB)\n" |
280 | " memory : 0x%16lx - 0x%16lx (%6ld MB)\n" | 281 | " memory : 0x%16lx - 0x%16lx (%6ld MB)\n" |
281 | " .init : 0x%p" " - 0x%p" " (%6ld kB)\n" | 282 | " .init : 0x%p" " - 0x%p" " (%6ld KB)\n" |
282 | " .text : 0x%p" " - 0x%p" " (%6ld kB)\n" | 283 | " .text : 0x%p" " - 0x%p" " (%6ld KB)\n" |
283 | " .data : 0x%p" " - 0x%p" " (%6ld kB)\n", | 284 | " .data : 0x%p" " - 0x%p" " (%6ld KB)\n", |
284 | MLM(VMALLOC_START, VMALLOC_END), | 285 | MLG(VMALLOC_START, VMALLOC_END), |
285 | #ifdef CONFIG_SPARSEMEM_VMEMMAP | 286 | #ifdef CONFIG_SPARSEMEM_VMEMMAP |
287 | MLG((unsigned long)vmemmap, | ||
288 | (unsigned long)vmemmap + VMEMMAP_SIZE), | ||
286 | MLM((unsigned long)virt_to_page(PAGE_OFFSET), | 289 | MLM((unsigned long)virt_to_page(PAGE_OFFSET), |
287 | (unsigned long)virt_to_page(high_memory)), | 290 | (unsigned long)virt_to_page(high_memory)), |
288 | #endif | 291 | #endif |
292 | MLM((unsigned long)PCI_IOBASE, (unsigned long)PCI_IOBASE + SZ_16M), | ||
293 | MLK(FIXADDR_START, FIXADDR_TOP), | ||
289 | MLM(MODULES_VADDR, MODULES_END), | 294 | MLM(MODULES_VADDR, MODULES_END), |
290 | MLM(PAGE_OFFSET, (unsigned long)high_memory), | 295 | MLM(PAGE_OFFSET, (unsigned long)high_memory), |
291 | |||
292 | MLK_ROUNDUP(__init_begin, __init_end), | 296 | MLK_ROUNDUP(__init_begin, __init_end), |
293 | MLK_ROUNDUP(_text, _etext), | 297 | MLK_ROUNDUP(_text, _etext), |
294 | MLK_ROUNDUP(_sdata, _edata)); | 298 | MLK_ROUNDUP(_sdata, _edata)); |