aboutsummaryrefslogtreecommitdiffstats
path: root/arch/microblaze/mm/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/microblaze/mm/init.c')
-rw-r--r--arch/microblaze/mm/init.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c
index cca3579d4268..db5934989926 100644
--- a/arch/microblaze/mm/init.c
+++ b/arch/microblaze/mm/init.c
@@ -10,7 +10,7 @@
10#include <linux/bootmem.h> 10#include <linux/bootmem.h>
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/lmb.h> 13#include <linux/memblock.h>
14#include <linux/mm.h> /* mem_init */ 14#include <linux/mm.h> /* mem_init */
15#include <linux/initrd.h> 15#include <linux/initrd.h>
16#include <linux/pagemap.h> 16#include <linux/pagemap.h>
@@ -76,10 +76,10 @@ void __init setup_memory(void)
76 u32 kernel_align_start, kernel_align_size; 76 u32 kernel_align_start, kernel_align_size;
77 77
78 /* Find main memory where is the kernel */ 78 /* Find main memory where is the kernel */
79 for (i = 0; i < lmb.memory.cnt; i++) { 79 for (i = 0; i < memblock.memory.cnt; i++) {
80 memory_start = (u32) lmb.memory.region[i].base; 80 memory_start = (u32) memblock.memory.region[i].base;
81 memory_end = (u32) lmb.memory.region[i].base 81 memory_end = (u32) memblock.memory.region[i].base
82 + (u32) lmb.memory.region[i].size; 82 + (u32) memblock.memory.region[i].size;
83 if ((memory_start <= (u32)_text) && 83 if ((memory_start <= (u32)_text) &&
84 ((u32)_text <= memory_end)) { 84 ((u32)_text <= memory_end)) {
85 memory_size = memory_end - memory_start; 85 memory_size = memory_end - memory_start;
@@ -100,7 +100,7 @@ void __init setup_memory(void)
100 kernel_align_start = PAGE_DOWN((u32)_text); 100 kernel_align_start = PAGE_DOWN((u32)_text);
101 /* ALIGN can be remove because _end in vmlinux.lds.S is align */ 101 /* ALIGN can be remove because _end in vmlinux.lds.S is align */
102 kernel_align_size = PAGE_UP((u32)klimit) - kernel_align_start; 102 kernel_align_size = PAGE_UP((u32)klimit) - kernel_align_start;
103 lmb_reserve(kernel_align_start, kernel_align_size); 103 memblock_reserve(kernel_align_start, kernel_align_size);
104 printk(KERN_INFO "%s: kernel addr=0x%08x-0x%08x size=0x%08x\n", 104 printk(KERN_INFO "%s: kernel addr=0x%08x-0x%08x size=0x%08x\n",
105 __func__, kernel_align_start, kernel_align_start 105 __func__, kernel_align_start, kernel_align_start
106 + kernel_align_size, kernel_align_size); 106 + kernel_align_size, kernel_align_size);
@@ -141,18 +141,18 @@ void __init setup_memory(void)
141 map_size = init_bootmem_node(&contig_page_data, 141 map_size = init_bootmem_node(&contig_page_data,
142 PFN_UP(TOPHYS((u32)klimit)), min_low_pfn, max_low_pfn); 142 PFN_UP(TOPHYS((u32)klimit)), min_low_pfn, max_low_pfn);
143#endif 143#endif
144 lmb_reserve(PFN_UP(TOPHYS((u32)klimit)) << PAGE_SHIFT, map_size); 144 memblock_reserve(PFN_UP(TOPHYS((u32)klimit)) << PAGE_SHIFT, map_size);
145 145
146 /* free bootmem is whole main memory */ 146 /* free bootmem is whole main memory */
147 free_bootmem(memory_start, memory_size); 147 free_bootmem(memory_start, memory_size);
148 148
149 /* reserve allocate blocks */ 149 /* reserve allocate blocks */
150 for (i = 0; i < lmb.reserved.cnt; i++) { 150 for (i = 0; i < memblock.reserved.cnt; i++) {
151 pr_debug("reserved %d - 0x%08x-0x%08x\n", i, 151 pr_debug("reserved %d - 0x%08x-0x%08x\n", i,
152 (u32) lmb.reserved.region[i].base, 152 (u32) memblock.reserved.region[i].base,
153 (u32) lmb_size_bytes(&lmb.reserved, i)); 153 (u32) memblock_size_bytes(&memblock.reserved, i));
154 reserve_bootmem(lmb.reserved.region[i].base, 154 reserve_bootmem(memblock.reserved.region[i].base,
155 lmb_size_bytes(&lmb.reserved, i) - 1, BOOTMEM_DEFAULT); 155 memblock_size_bytes(&memblock.reserved, i) - 1, BOOTMEM_DEFAULT);
156 } 156 }
157#ifdef CONFIG_MMU 157#ifdef CONFIG_MMU
158 init_bootmem_done = 1; 158 init_bootmem_done = 1;
@@ -235,7 +235,7 @@ static void mm_cmdline_setup(void)
235 if (maxmem && memory_size > maxmem) { 235 if (maxmem && memory_size > maxmem) {
236 memory_size = maxmem; 236 memory_size = maxmem;
237 memory_end = memory_start + memory_size; 237 memory_end = memory_start + memory_size;
238 lmb.memory.region[0].size = memory_size; 238 memblock.memory.region[0].size = memory_size;
239 } 239 }
240 } 240 }
241} 241}
@@ -273,19 +273,19 @@ asmlinkage void __init mmu_init(void)
273{ 273{
274 unsigned int kstart, ksize; 274 unsigned int kstart, ksize;
275 275
276 if (!lmb.reserved.cnt) { 276 if (!memblock.reserved.cnt) {
277 printk(KERN_EMERG "Error memory count\n"); 277 printk(KERN_EMERG "Error memory count\n");
278 machine_restart(NULL); 278 machine_restart(NULL);
279 } 279 }
280 280
281 if ((u32) lmb.memory.region[0].size < 0x1000000) { 281 if ((u32) memblock.memory.region[0].size < 0x1000000) {
282 printk(KERN_EMERG "Memory must be greater than 16MB\n"); 282 printk(KERN_EMERG "Memory must be greater than 16MB\n");
283 machine_restart(NULL); 283 machine_restart(NULL);
284 } 284 }
285 /* Find main memory where the kernel is */ 285 /* Find main memory where the kernel is */
286 memory_start = (u32) lmb.memory.region[0].base; 286 memory_start = (u32) memblock.memory.region[0].base;
287 memory_end = (u32) lmb.memory.region[0].base + 287 memory_end = (u32) memblock.memory.region[0].base +
288 (u32) lmb.memory.region[0].size; 288 (u32) memblock.memory.region[0].size;
289 memory_size = memory_end - memory_start; 289 memory_size = memory_end - memory_start;
290 290
291 mm_cmdline_setup(); /* FIXME parse args from command line - not used */ 291 mm_cmdline_setup(); /* FIXME parse args from command line - not used */
@@ -297,7 +297,7 @@ asmlinkage void __init mmu_init(void)
297 kstart = __pa(CONFIG_KERNEL_START); /* kernel start */ 297 kstart = __pa(CONFIG_KERNEL_START); /* kernel start */
298 /* kernel size */ 298 /* kernel size */
299 ksize = PAGE_ALIGN(((u32)_end - (u32)CONFIG_KERNEL_START)); 299 ksize = PAGE_ALIGN(((u32)_end - (u32)CONFIG_KERNEL_START));
300 lmb_reserve(kstart, ksize); 300 memblock_reserve(kstart, ksize);
301 301
302#if defined(CONFIG_BLK_DEV_INITRD) 302#if defined(CONFIG_BLK_DEV_INITRD)
303 /* Remove the init RAM disk from the available memory. */ 303 /* Remove the init RAM disk from the available memory. */
@@ -335,7 +335,7 @@ void __init *early_get_page(void)
335 * Mem start + 32MB -> here is limit 335 * Mem start + 32MB -> here is limit
336 * because of mem mapping from head.S 336 * because of mem mapping from head.S
337 */ 337 */
338 p = __va(lmb_alloc_base(PAGE_SIZE, PAGE_SIZE, 338 p = __va(memblock_alloc_base(PAGE_SIZE, PAGE_SIZE,
339 memory_start + 0x2000000)); 339 memory_start + 0x2000000));
340 } 340 }
341 return p; 341 return p;