aboutsummaryrefslogtreecommitdiffstats
path: root/arch/xtensa/mm/init.c
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2014-02-03 17:17:09 -0500
committerMax Filippov <jcmvbkbc@gmail.com>2014-04-06 13:29:21 -0400
commit65559100655c6ed6ce2e17ffc8d4f3852bc2858a (patch)
tree71cf7391732414bce793d0ad7c5d39a03f60e76f /arch/xtensa/mm/init.c
parent04c6b3e2b5e5c1dbd99ad7620033eafd05ff4c26 (diff)
xtensa: add HIGHMEM support
Introduce fixmap area just below the vmalloc region. Use it for atomic mapping of high memory pages. High memory on cores with cache aliasing is not supported and is still to be implemented. Fail build for such configurations for now. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa/mm/init.c')
-rw-r--r--arch/xtensa/mm/init.c45
1 files changed, 31 insertions, 14 deletions
diff --git a/arch/xtensa/mm/init.c b/arch/xtensa/mm/init.c
index 03bd025307e3..4224256bb215 100644
--- a/arch/xtensa/mm/init.c
+++ b/arch/xtensa/mm/init.c
@@ -20,6 +20,7 @@
20#include <linux/errno.h> 20#include <linux/errno.h>
21#include <linux/bootmem.h> 21#include <linux/bootmem.h>
22#include <linux/gfp.h> 22#include <linux/gfp.h>
23#include <linux/highmem.h>
23#include <linux/swap.h> 24#include <linux/swap.h>
24#include <linux/mman.h> 25#include <linux/mman.h>
25#include <linux/nodemask.h> 26#include <linux/nodemask.h>
@@ -296,19 +297,13 @@ void __init bootmem_init(void)
296 297
297void __init zones_init(void) 298void __init zones_init(void)
298{ 299{
299 unsigned long zones_size[MAX_NR_ZONES];
300 int i;
301
302 /* All pages are DMA-able, so we put them all in the DMA zone. */ 300 /* All pages are DMA-able, so we put them all in the DMA zone. */
303 301 unsigned long zones_size[MAX_NR_ZONES] = {
304 zones_size[ZONE_DMA] = max_low_pfn - ARCH_PFN_OFFSET; 302 [ZONE_DMA] = max_low_pfn - ARCH_PFN_OFFSET,
305 for (i = 1; i < MAX_NR_ZONES; i++)
306 zones_size[i] = 0;
307
308#ifdef CONFIG_HIGHMEM 303#ifdef CONFIG_HIGHMEM
309 zones_size[ZONE_HIGHMEM] = max_pfn - max_low_pfn; 304 [ZONE_HIGHMEM] = max_pfn - max_low_pfn,
310#endif 305#endif
311 306 };
312 free_area_init_node(0, zones_size, ARCH_PFN_OFFSET, NULL); 307 free_area_init_node(0, zones_size, ARCH_PFN_OFFSET, NULL);
313} 308}
314 309
@@ -318,16 +313,38 @@ void __init zones_init(void)
318 313
319void __init mem_init(void) 314void __init mem_init(void)
320{ 315{
321 max_mapnr = max_low_pfn - ARCH_PFN_OFFSET;
322 high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT);
323
324#ifdef CONFIG_HIGHMEM 316#ifdef CONFIG_HIGHMEM
325#error HIGHGMEM not implemented in init.c 317 unsigned long tmp;
318
319 reset_all_zones_managed_pages();
320 for (tmp = max_low_pfn; tmp < max_pfn; tmp++)
321 free_highmem_page(pfn_to_page(tmp));
326#endif 322#endif
327 323
324 max_mapnr = max_pfn - ARCH_PFN_OFFSET;
325 high_memory = (void *)__va(max_low_pfn << PAGE_SHIFT);
326
328 free_all_bootmem(); 327 free_all_bootmem();
329 328
330 mem_init_print_info(NULL); 329 mem_init_print_info(NULL);
330 pr_info("virtual kernel memory layout:\n"
331#ifdef CONFIG_HIGHMEM
332 " pkmap : 0x%08lx - 0x%08lx (%5lu kB)\n"
333 " fixmap : 0x%08lx - 0x%08lx (%5lu kB)\n"
334#endif
335 " vmalloc : 0x%08x - 0x%08x (%5u MB)\n"
336 " lowmem : 0x%08x - 0x%08lx (%5lu MB)\n",
337#ifdef CONFIG_HIGHMEM
338 PKMAP_BASE, PKMAP_BASE + LAST_PKMAP * PAGE_SIZE,
339 (LAST_PKMAP*PAGE_SIZE) >> 10,
340 FIXADDR_START, FIXADDR_TOP,
341 (FIXADDR_TOP - FIXADDR_START) >> 10,
342#endif
343 VMALLOC_START, VMALLOC_END,
344 (VMALLOC_END - VMALLOC_START) >> 20,
345 PAGE_OFFSET, PAGE_OFFSET +
346 (max_low_pfn - min_low_pfn) * PAGE_SIZE,
347 ((max_low_pfn - min_low_pfn) * PAGE_SIZE) >> 20);
331} 348}
332 349
333#ifdef CONFIG_BLK_DEV_INITRD 350#ifdef CONFIG_BLK_DEV_INITRD