2 * Port on Texas Instruments TMS320C6x architecture
4 * Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated
5 * Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
12 #include <linux/swap.h>
13 #include <linux/module.h>
14 #include <linux/bootmem.h>
15 #ifdef CONFIG_BLK_DEV_RAM
16 #include <linux/blkdev.h>
18 #include <linux/initrd.h>
20 #include <asm/sections.h>
21 #include <asm/uaccess.h>
24 * ZERO_PAGE is a special page that is used for zero-initialized
27 unsigned long empty_zero_page;
28 EXPORT_SYMBOL(empty_zero_page);
31 * paging_init() continues the virtual memory environment setup which
32 * was begun by the code in arch/head.S.
33 * The parameters are pointers to where to stick the starting and ending
34 * addresses of available kernel virtual memory.
36 void __init paging_init(void)
38 struct pglist_data *pgdat = NODE_DATA(0);
39 unsigned long zones_size[MAX_NR_ZONES] = {0, };
41 empty_zero_page = (unsigned long) alloc_bootmem_pages(PAGE_SIZE);
42 memset((void *)empty_zero_page, 0, PAGE_SIZE);
45 * Set up user data space
52 zones_size[ZONE_NORMAL] = (memory_end - PAGE_OFFSET) >> PAGE_SHIFT;
53 pgdat->node_zones[ZONE_NORMAL].zone_start_pfn =
54 __pa(PAGE_OFFSET) >> PAGE_SHIFT;
56 free_area_init(zones_size);
59 void __init mem_init(void)
63 unsigned long len = memory_end - memory_start;
65 high_memory = (void *)(memory_end & PAGE_MASK);
67 /* this will put all memory onto the freelists */
68 totalram_pages = free_all_bootmem();
70 codek = (_etext - _stext) >> 10;
71 datak = (_end - _sdata) >> 10;
73 tmp = nr_free_pages() << PAGE_SHIFT;
74 printk(KERN_INFO "Memory: %luk/%luk RAM (%dk kernel code, %dk data)\n",
75 tmp >> 10, len >> 10, codek, datak);
78 #ifdef CONFIG_BLK_DEV_INITRD
79 void __init free_initrd_mem(unsigned long start, unsigned long end)
81 free_reserved_area(start, end, 0, "initrd");
85 void __init free_initmem(void)
87 free_initmem_default(0);