aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mm/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/blackfin/mm/init.c')
-rw-r--r--arch/blackfin/mm/init.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/arch/blackfin/mm/init.c b/arch/blackfin/mm/init.c
index 9f007cace6e6..eb1a12ac9e33 100644
--- a/arch/blackfin/mm/init.c
+++ b/arch/blackfin/mm/init.c
@@ -128,8 +128,8 @@ void __init paging_init(void)
128void __init mem_init(void) 128void __init mem_init(void)
129{ 129{
130 unsigned int codek = 0, datak = 0, initk = 0; 130 unsigned int codek = 0, datak = 0, initk = 0;
131 unsigned int reservedpages = 0, freepages = 0;
131 unsigned long tmp; 132 unsigned long tmp;
132 unsigned int len = _ramend - _rambase;
133 unsigned long start_mem = memory_start; 133 unsigned long start_mem = memory_start;
134 unsigned long end_mem = memory_end; 134 unsigned long end_mem = memory_end;
135 135
@@ -138,19 +138,36 @@ void __init mem_init(void)
138 138
139 start_mem = PAGE_ALIGN(start_mem); 139 start_mem = PAGE_ALIGN(start_mem);
140 max_mapnr = num_physpages = MAP_NR(high_memory); 140 max_mapnr = num_physpages = MAP_NR(high_memory);
141 printk(KERN_INFO "Physical pages: %lx\n", num_physpages); 141 printk(KERN_INFO "Kernel managed physical pages: %lu\n",
142 num_physpages);
142 143
143 /* This will put all memory onto the freelists. */ 144 /* This will put all memory onto the freelists. */
144 totalram_pages = free_all_bootmem(); 145 totalram_pages = free_all_bootmem();
145 146
147 reservedpages = 0;
148 for (tmp = 0; tmp < max_mapnr; tmp++)
149 if (PageReserved(pfn_to_page(tmp)))
150 reservedpages++;
151 freepages = max_mapnr - reservedpages;
152
153 /* do not count in kernel image between _rambase and _ramstart */
154 reservedpages -= (_ramstart - _rambase) >> PAGE_SHIFT;
155#if (defined(CONFIG_BFIN_ICACHE) && ANOMALY_05000263)
156 reservedpages += (_ramend - memory_end - DMA_UNCACHED_REGION) >>
157 PAGE_SHIFT;
158#endif
159
146 codek = (_etext - _stext) >> 10; 160 codek = (_etext - _stext) >> 10;
147 datak = (__bss_stop - __bss_start) >> 10;
148 initk = (__init_end - __init_begin) >> 10; 161 initk = (__init_end - __init_begin) >> 10;
162 datak = ((_ramstart - _rambase) >> 10) - codek - initk;
149 163
150 tmp = nr_free_pages() << PAGE_SHIFT;
151 printk(KERN_INFO 164 printk(KERN_INFO
152 "Memory available: %luk/%uk RAM, (%uk init code, %uk kernel code, %uk data, %uk dma)\n", 165 "Memory available: %luk/%luk RAM, "
153 tmp >> 10, len >> 10, initk, codek, datak, DMA_UNCACHED_REGION >> 10); 166 "(%uk init code, %uk kernel code, "
167 "%uk data, %uk dma, %uk reserved)\n",
168 (unsigned long) freepages << (PAGE_SHIFT-10), _ramend >> 10,
169 initk, codek, datak, DMA_UNCACHED_REGION >> 10,
170 (reservedpages << (PAGE_SHIFT-10)));
154 171
155 /* Initialize the blackfin L1 Memory. */ 172 /* Initialize the blackfin L1 Memory. */
156 l1sram_init(); 173 l1sram_init();