aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/mm/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/mm/init.c')
-rw-r--r--arch/sh/mm/init.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
index 46f84de62469..d0e249100e98 100644
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
@@ -16,7 +16,7 @@
16#include <linux/pagemap.h> 16#include <linux/pagemap.h>
17#include <linux/percpu.h> 17#include <linux/percpu.h>
18#include <linux/io.h> 18#include <linux/io.h>
19#include <linux/lmb.h> 19#include <linux/memblock.h>
20#include <linux/dma-mapping.h> 20#include <linux/dma-mapping.h>
21#include <asm/mmu_context.h> 21#include <asm/mmu_context.h>
22#include <asm/mmzone.h> 22#include <asm/mmzone.h>
@@ -33,7 +33,7 @@ pgd_t swapper_pg_dir[PTRS_PER_PGD];
33 33
34void __init generic_mem_init(void) 34void __init generic_mem_init(void)
35{ 35{
36 lmb_add(__MEMORY_START, __MEMORY_SIZE); 36 memblock_add(__MEMORY_START, __MEMORY_SIZE);
37} 37}
38 38
39void __init __weak plat_mem_setup(void) 39void __init __weak plat_mem_setup(void)
@@ -176,12 +176,12 @@ void __init allocate_pgdat(unsigned int nid)
176 get_pfn_range_for_nid(nid, &start_pfn, &end_pfn); 176 get_pfn_range_for_nid(nid, &start_pfn, &end_pfn);
177 177
178#ifdef CONFIG_NEED_MULTIPLE_NODES 178#ifdef CONFIG_NEED_MULTIPLE_NODES
179 phys = __lmb_alloc_base(sizeof(struct pglist_data), 179 phys = __memblock_alloc_base(sizeof(struct pglist_data),
180 SMP_CACHE_BYTES, end_pfn << PAGE_SHIFT); 180 SMP_CACHE_BYTES, end_pfn << PAGE_SHIFT);
181 /* Retry with all of system memory */ 181 /* Retry with all of system memory */
182 if (!phys) 182 if (!phys)
183 phys = __lmb_alloc_base(sizeof(struct pglist_data), 183 phys = __memblock_alloc_base(sizeof(struct pglist_data),
184 SMP_CACHE_BYTES, lmb_end_of_DRAM()); 184 SMP_CACHE_BYTES, memblock_end_of_DRAM());
185 if (!phys) 185 if (!phys)
186 panic("Can't allocate pgdat for node %d\n", nid); 186 panic("Can't allocate pgdat for node %d\n", nid);
187 187
@@ -212,7 +212,7 @@ static void __init bootmem_init_one_node(unsigned int nid)
212 212
213 total_pages = bootmem_bootmap_pages(p->node_spanned_pages); 213 total_pages = bootmem_bootmap_pages(p->node_spanned_pages);
214 214
215 paddr = lmb_alloc(total_pages << PAGE_SHIFT, PAGE_SIZE); 215 paddr = memblock_alloc(total_pages << PAGE_SHIFT, PAGE_SIZE);
216 if (!paddr) 216 if (!paddr)
217 panic("Can't allocate bootmap for nid[%d]\n", nid); 217 panic("Can't allocate bootmap for nid[%d]\n", nid);
218 218
@@ -227,9 +227,9 @@ static void __init bootmem_init_one_node(unsigned int nid)
227 */ 227 */
228 if (nid == 0) { 228 if (nid == 0) {
229 /* Reserve the sections we're already using. */ 229 /* Reserve the sections we're already using. */
230 for (i = 0; i < lmb.reserved.cnt; i++) 230 for (i = 0; i < memblock.reserved.cnt; i++)
231 reserve_bootmem(lmb.reserved.region[i].base, 231 reserve_bootmem(memblock.reserved.region[i].base,
232 lmb_size_bytes(&lmb.reserved, i), 232 memblock_size_bytes(&memblock.reserved, i),
233 BOOTMEM_DEFAULT); 233 BOOTMEM_DEFAULT);
234 } 234 }
235 235
@@ -241,10 +241,10 @@ static void __init do_init_bootmem(void)
241 int i; 241 int i;
242 242
243 /* Add active regions with valid PFNs. */ 243 /* Add active regions with valid PFNs. */
244 for (i = 0; i < lmb.memory.cnt; i++) { 244 for (i = 0; i < memblock.memory.cnt; i++) {
245 unsigned long start_pfn, end_pfn; 245 unsigned long start_pfn, end_pfn;
246 start_pfn = lmb.memory.region[i].base >> PAGE_SHIFT; 246 start_pfn = memblock.memory.region[i].base >> PAGE_SHIFT;
247 end_pfn = start_pfn + lmb_size_pages(&lmb.memory, i); 247 end_pfn = start_pfn + memblock_size_pages(&memblock.memory, i);
248 __add_active_range(0, start_pfn, end_pfn); 248 __add_active_range(0, start_pfn, end_pfn);
249 } 249 }
250 250
@@ -276,7 +276,7 @@ static void __init early_reserve_mem(void)
276 * this catches the (definitely buggy) case of us accidentally 276 * this catches the (definitely buggy) case of us accidentally
277 * initializing the bootmem allocator with an invalid RAM area. 277 * initializing the bootmem allocator with an invalid RAM area.
278 */ 278 */
279 lmb_reserve(__MEMORY_START + CONFIG_ZERO_PAGE_OFFSET, 279 memblock_reserve(__MEMORY_START + CONFIG_ZERO_PAGE_OFFSET,
280 (PFN_PHYS(start_pfn) + PAGE_SIZE - 1) - 280 (PFN_PHYS(start_pfn) + PAGE_SIZE - 1) -
281 (__MEMORY_START + CONFIG_ZERO_PAGE_OFFSET)); 281 (__MEMORY_START + CONFIG_ZERO_PAGE_OFFSET));
282 282
@@ -284,7 +284,7 @@ static void __init early_reserve_mem(void)
284 * Reserve physical pages below CONFIG_ZERO_PAGE_OFFSET. 284 * Reserve physical pages below CONFIG_ZERO_PAGE_OFFSET.
285 */ 285 */
286 if (CONFIG_ZERO_PAGE_OFFSET != 0) 286 if (CONFIG_ZERO_PAGE_OFFSET != 0)
287 lmb_reserve(__MEMORY_START, CONFIG_ZERO_PAGE_OFFSET); 287 memblock_reserve(__MEMORY_START, CONFIG_ZERO_PAGE_OFFSET);
288 288
289 /* 289 /*
290 * Handle additional early reservations 290 * Handle additional early reservations
@@ -299,27 +299,27 @@ void __init paging_init(void)
299 unsigned long vaddr, end; 299 unsigned long vaddr, end;
300 int nid; 300 int nid;
301 301
302 lmb_init(); 302 memblock_init();
303 303
304 sh_mv.mv_mem_init(); 304 sh_mv.mv_mem_init();
305 305
306 early_reserve_mem(); 306 early_reserve_mem();
307 307
308 lmb_enforce_memory_limit(memory_limit); 308 memblock_enforce_memory_limit(memory_limit);
309 lmb_analyze(); 309 memblock_analyze();
310 310
311 lmb_dump_all(); 311 memblock_dump_all();
312 312
313 /* 313 /*
314 * Determine low and high memory ranges: 314 * Determine low and high memory ranges:
315 */ 315 */
316 max_low_pfn = max_pfn = lmb_end_of_DRAM() >> PAGE_SHIFT; 316 max_low_pfn = max_pfn = memblock_end_of_DRAM() >> PAGE_SHIFT;
317 min_low_pfn = __MEMORY_START >> PAGE_SHIFT; 317 min_low_pfn = __MEMORY_START >> PAGE_SHIFT;
318 318
319 nodes_clear(node_online_map); 319 nodes_clear(node_online_map);
320 320
321 memory_start = (unsigned long)__va(__MEMORY_START); 321 memory_start = (unsigned long)__va(__MEMORY_START);
322 memory_end = memory_start + (memory_limit ?: lmb_phys_mem_size()); 322 memory_end = memory_start + (memory_limit ?: memblock_phys_mem_size());
323 323
324 uncached_init(); 324 uncached_init();
325 pmb_init(); 325 pmb_init();