aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-07-14 20:27:44 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-07-14 20:27:44 -0400
commit6f7dd68b755b215deda5188a2c13c00f4776ea66 (patch)
tree2a63c972ac89d7ae290910d5c6b1c6300ccbafd5 /arch/powerpc/kernel
parentea4c1a7e14051e2ba81fc7dc02e3d55bfb2d7548 (diff)
parent95f72d1ed41a66f1c1c29c24d479de81a0bea36f (diff)
Merge branch 'lmb-to-memblock' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
* 'lmb-to-memblock' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: lmb: rename to memblock
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r--arch/powerpc/kernel/btext.c2
-rw-r--r--arch/powerpc/kernel/crash.c2
-rw-r--r--arch/powerpc/kernel/crash_dump.c4
-rw-r--r--arch/powerpc/kernel/dma-swiotlb.c2
-rw-r--r--arch/powerpc/kernel/dma.c4
-rw-r--r--arch/powerpc/kernel/machine_kexec.c12
-rw-r--r--arch/powerpc/kernel/paca.c8
-rw-r--r--arch/powerpc/kernel/prom.c62
-rw-r--r--arch/powerpc/kernel/rtas.c6
-rw-r--r--arch/powerpc/kernel/setup-common.c2
-rw-r--r--arch/powerpc/kernel/setup_32.c16
-rw-r--r--arch/powerpc/kernel/setup_64.c20
-rw-r--r--arch/powerpc/kernel/vdso.c4
13 files changed, 72 insertions, 72 deletions
diff --git a/arch/powerpc/kernel/btext.c b/arch/powerpc/kernel/btext.c
index 26e58630ed7b..625942ae5585 100644
--- a/arch/powerpc/kernel/btext.c
+++ b/arch/powerpc/kernel/btext.c
@@ -7,7 +7,7 @@
7#include <linux/string.h> 7#include <linux/string.h>
8#include <linux/init.h> 8#include <linux/init.h>
9#include <linux/module.h> 9#include <linux/module.h>
10#include <linux/lmb.h> 10#include <linux/memblock.h>
11 11
12#include <asm/sections.h> 12#include <asm/sections.h>
13#include <asm/prom.h> 13#include <asm/prom.h>
diff --git a/arch/powerpc/kernel/crash.c b/arch/powerpc/kernel/crash.c
index 29df48f2b61a..417f7b05a9ce 100644
--- a/arch/powerpc/kernel/crash.c
+++ b/arch/powerpc/kernel/crash.c
@@ -24,7 +24,7 @@
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/irq.h> 25#include <linux/irq.h>
26#include <linux/types.h> 26#include <linux/types.h>
27#include <linux/lmb.h> 27#include <linux/memblock.h>
28 28
29#include <asm/processor.h> 29#include <asm/processor.h>
30#include <asm/machdep.h> 30#include <asm/machdep.h>
diff --git a/arch/powerpc/kernel/crash_dump.c b/arch/powerpc/kernel/crash_dump.c
index 5fb667a60894..40f524643ba6 100644
--- a/arch/powerpc/kernel/crash_dump.c
+++ b/arch/powerpc/kernel/crash_dump.c
@@ -13,7 +13,7 @@
13 13
14#include <linux/crash_dump.h> 14#include <linux/crash_dump.h>
15#include <linux/bootmem.h> 15#include <linux/bootmem.h>
16#include <linux/lmb.h> 16#include <linux/memblock.h>
17#include <asm/code-patching.h> 17#include <asm/code-patching.h>
18#include <asm/kdump.h> 18#include <asm/kdump.h>
19#include <asm/prom.h> 19#include <asm/prom.h>
@@ -33,7 +33,7 @@ unsigned long long elfcorehdr_addr = ELFCORE_ADDR_MAX;
33#ifndef CONFIG_RELOCATABLE 33#ifndef CONFIG_RELOCATABLE
34void __init reserve_kdump_trampoline(void) 34void __init reserve_kdump_trampoline(void)
35{ 35{
36 lmb_reserve(0, KDUMP_RESERVE_LIMIT); 36 memblock_reserve(0, KDUMP_RESERVE_LIMIT);
37} 37}
38 38
39static void __init create_trampoline(unsigned long addr) 39static void __init create_trampoline(unsigned long addr)
diff --git a/arch/powerpc/kernel/dma-swiotlb.c b/arch/powerpc/kernel/dma-swiotlb.c
index e7fe218b8697..02f724f36753 100644
--- a/arch/powerpc/kernel/dma-swiotlb.c
+++ b/arch/powerpc/kernel/dma-swiotlb.c
@@ -71,7 +71,7 @@ static int ppc_swiotlb_bus_notify(struct notifier_block *nb,
71 sd->max_direct_dma_addr = 0; 71 sd->max_direct_dma_addr = 0;
72 72
73 /* May need to bounce if the device can't address all of DRAM */ 73 /* May need to bounce if the device can't address all of DRAM */
74 if ((dma_get_mask(dev) + 1) < lmb_end_of_DRAM()) 74 if ((dma_get_mask(dev) + 1) < memblock_end_of_DRAM())
75 set_dma_ops(dev, &swiotlb_dma_ops); 75 set_dma_ops(dev, &swiotlb_dma_ops);
76 76
77 return NOTIFY_DONE; 77 return NOTIFY_DONE;
diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c
index 8d1de6f31d5a..84d6367ec003 100644
--- a/arch/powerpc/kernel/dma.c
+++ b/arch/powerpc/kernel/dma.c
@@ -9,7 +9,7 @@
9#include <linux/dma-mapping.h> 9#include <linux/dma-mapping.h>
10#include <linux/dma-debug.h> 10#include <linux/dma-debug.h>
11#include <linux/gfp.h> 11#include <linux/gfp.h>
12#include <linux/lmb.h> 12#include <linux/memblock.h>
13#include <asm/bug.h> 13#include <asm/bug.h>
14#include <asm/abs_addr.h> 14#include <asm/abs_addr.h>
15 15
@@ -89,7 +89,7 @@ static int dma_direct_dma_supported(struct device *dev, u64 mask)
89 /* Could be improved so platforms can set the limit in case 89 /* Could be improved so platforms can set the limit in case
90 * they have limited DMA windows 90 * they have limited DMA windows
91 */ 91 */
92 return mask >= (lmb_end_of_DRAM() - 1); 92 return mask >= (memblock_end_of_DRAM() - 1);
93#else 93#else
94 return 1; 94 return 1;
95#endif 95#endif
diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c
index bb3d893a8353..89f005116aac 100644
--- a/arch/powerpc/kernel/machine_kexec.c
+++ b/arch/powerpc/kernel/machine_kexec.c
@@ -12,7 +12,7 @@
12#include <linux/kexec.h> 12#include <linux/kexec.h>
13#include <linux/reboot.h> 13#include <linux/reboot.h>
14#include <linux/threads.h> 14#include <linux/threads.h>
15#include <linux/lmb.h> 15#include <linux/memblock.h>
16#include <linux/of.h> 16#include <linux/of.h>
17#include <asm/machdep.h> 17#include <asm/machdep.h>
18#include <asm/prom.h> 18#include <asm/prom.h>
@@ -66,11 +66,11 @@ void __init reserve_crashkernel(void)
66 unsigned long long crash_size, crash_base; 66 unsigned long long crash_size, crash_base;
67 int ret; 67 int ret;
68 68
69 /* this is necessary because of lmb_phys_mem_size() */ 69 /* this is necessary because of memblock_phys_mem_size() */
70 lmb_analyze(); 70 memblock_analyze();
71 71
72 /* use common parsing */ 72 /* use common parsing */
73 ret = parse_crashkernel(boot_command_line, lmb_phys_mem_size(), 73 ret = parse_crashkernel(boot_command_line, memblock_phys_mem_size(),
74 &crash_size, &crash_base); 74 &crash_size, &crash_base);
75 if (ret == 0 && crash_size > 0) { 75 if (ret == 0 && crash_size > 0) {
76 crashk_res.start = crash_base; 76 crashk_res.start = crash_base;
@@ -133,9 +133,9 @@ void __init reserve_crashkernel(void)
133 "for crashkernel (System RAM: %ldMB)\n", 133 "for crashkernel (System RAM: %ldMB)\n",
134 (unsigned long)(crash_size >> 20), 134 (unsigned long)(crash_size >> 20),
135 (unsigned long)(crashk_res.start >> 20), 135 (unsigned long)(crashk_res.start >> 20),
136 (unsigned long)(lmb_phys_mem_size() >> 20)); 136 (unsigned long)(memblock_phys_mem_size() >> 20));
137 137
138 lmb_reserve(crashk_res.start, crash_size); 138 memblock_reserve(crashk_res.start, crash_size);
139} 139}
140 140
141int overlaps_crashkernel(unsigned long start, unsigned long size) 141int overlaps_crashkernel(unsigned long start, unsigned long size)
diff --git a/arch/powerpc/kernel/paca.c b/arch/powerpc/kernel/paca.c
index f88acf0218db..139a773853f4 100644
--- a/arch/powerpc/kernel/paca.c
+++ b/arch/powerpc/kernel/paca.c
@@ -9,7 +9,7 @@
9 9
10#include <linux/threads.h> 10#include <linux/threads.h>
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/lmb.h> 12#include <linux/memblock.h>
13 13
14#include <asm/firmware.h> 14#include <asm/firmware.h>
15#include <asm/lppaca.h> 15#include <asm/lppaca.h>
@@ -117,7 +117,7 @@ void __init allocate_pacas(void)
117 * the first segment. On iSeries they must be within the area mapped 117 * the first segment. On iSeries they must be within the area mapped
118 * by the HV, which is HvPagesToMap * HVPAGESIZE bytes. 118 * by the HV, which is HvPagesToMap * HVPAGESIZE bytes.
119 */ 119 */
120 limit = min(0x10000000ULL, lmb.rmo_size); 120 limit = min(0x10000000ULL, memblock.rmo_size);
121 if (firmware_has_feature(FW_FEATURE_ISERIES)) 121 if (firmware_has_feature(FW_FEATURE_ISERIES))
122 limit = min(limit, HvPagesToMap * HVPAGESIZE); 122 limit = min(limit, HvPagesToMap * HVPAGESIZE);
123 123
@@ -128,7 +128,7 @@ void __init allocate_pacas(void)
128 128
129 paca_size = PAGE_ALIGN(sizeof(struct paca_struct) * nr_cpus); 129 paca_size = PAGE_ALIGN(sizeof(struct paca_struct) * nr_cpus);
130 130
131 paca = __va(lmb_alloc_base(paca_size, PAGE_SIZE, limit)); 131 paca = __va(memblock_alloc_base(paca_size, PAGE_SIZE, limit));
132 memset(paca, 0, paca_size); 132 memset(paca, 0, paca_size);
133 133
134 printk(KERN_DEBUG "Allocated %u bytes for %d pacas at %p\n", 134 printk(KERN_DEBUG "Allocated %u bytes for %d pacas at %p\n",
@@ -148,7 +148,7 @@ void __init free_unused_pacas(void)
148 if (new_size >= paca_size) 148 if (new_size >= paca_size)
149 return; 149 return;
150 150
151 lmb_free(__pa(paca) + new_size, paca_size - new_size); 151 memblock_free(__pa(paca) + new_size, paca_size - new_size);
152 152
153 printk(KERN_DEBUG "Freed %u bytes for unused pacas\n", 153 printk(KERN_DEBUG "Freed %u bytes for unused pacas\n",
154 paca_size - new_size); 154 paca_size - new_size);
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 05131d634e73..9d3953983fb7 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -31,7 +31,7 @@
31#include <linux/kexec.h> 31#include <linux/kexec.h>
32#include <linux/debugfs.h> 32#include <linux/debugfs.h>
33#include <linux/irq.h> 33#include <linux/irq.h>
34#include <linux/lmb.h> 34#include <linux/memblock.h>
35 35
36#include <asm/prom.h> 36#include <asm/prom.h>
37#include <asm/rtas.h> 37#include <asm/rtas.h>
@@ -98,7 +98,7 @@ static void __init move_device_tree(void)
98 98
99 if ((memory_limit && (start + size) > memory_limit) || 99 if ((memory_limit && (start + size) > memory_limit) ||
100 overlaps_crashkernel(start, size)) { 100 overlaps_crashkernel(start, size)) {
101 p = __va(lmb_alloc_base(size, PAGE_SIZE, lmb.rmo_size)); 101 p = __va(memblock_alloc_base(size, PAGE_SIZE, memblock.rmo_size));
102 memcpy(p, initial_boot_params, size); 102 memcpy(p, initial_boot_params, size);
103 initial_boot_params = (struct boot_param_header *)p; 103 initial_boot_params = (struct boot_param_header *)p;
104 DBG("Moved device tree to 0x%p\n", p); 104 DBG("Moved device tree to 0x%p\n", p);
@@ -411,13 +411,13 @@ static int __init early_init_dt_scan_drconf_memory(unsigned long node)
411{ 411{
412 __be32 *dm, *ls, *usm; 412 __be32 *dm, *ls, *usm;
413 unsigned long l, n, flags; 413 unsigned long l, n, flags;
414 u64 base, size, lmb_size; 414 u64 base, size, memblock_size;
415 unsigned int is_kexec_kdump = 0, rngs; 415 unsigned int is_kexec_kdump = 0, rngs;
416 416
417 ls = of_get_flat_dt_prop(node, "ibm,lmb-size", &l); 417 ls = of_get_flat_dt_prop(node, "ibm,memblock-size", &l);
418 if (ls == NULL || l < dt_root_size_cells * sizeof(__be32)) 418 if (ls == NULL || l < dt_root_size_cells * sizeof(__be32))
419 return 0; 419 return 0;
420 lmb_size = dt_mem_next_cell(dt_root_size_cells, &ls); 420 memblock_size = dt_mem_next_cell(dt_root_size_cells, &ls);
421 421
422 dm = of_get_flat_dt_prop(node, "ibm,dynamic-memory", &l); 422 dm = of_get_flat_dt_prop(node, "ibm,dynamic-memory", &l);
423 if (dm == NULL || l < sizeof(__be32)) 423 if (dm == NULL || l < sizeof(__be32))
@@ -442,11 +442,11 @@ static int __init early_init_dt_scan_drconf_memory(unsigned long node)
442 or if the block is not assigned to this partition (0x8) */ 442 or if the block is not assigned to this partition (0x8) */
443 if ((flags & 0x80) || !(flags & 0x8)) 443 if ((flags & 0x80) || !(flags & 0x8))
444 continue; 444 continue;
445 size = lmb_size; 445 size = memblock_size;
446 rngs = 1; 446 rngs = 1;
447 if (is_kexec_kdump) { 447 if (is_kexec_kdump) {
448 /* 448 /*
449 * For each lmb in ibm,dynamic-memory, a corresponding 449 * For each memblock in ibm,dynamic-memory, a corresponding
450 * entry in linux,drconf-usable-memory property contains 450 * entry in linux,drconf-usable-memory property contains
451 * a counter 'p' followed by 'p' (base, size) duple. 451 * a counter 'p' followed by 'p' (base, size) duple.
452 * Now read the counter from 452 * Now read the counter from
@@ -469,10 +469,10 @@ static int __init early_init_dt_scan_drconf_memory(unsigned long node)
469 if ((base + size) > 0x80000000ul) 469 if ((base + size) > 0x80000000ul)
470 size = 0x80000000ul - base; 470 size = 0x80000000ul - base;
471 } 471 }
472 lmb_add(base, size); 472 memblock_add(base, size);
473 } while (--rngs); 473 } while (--rngs);
474 } 474 }
475 lmb_dump_all(); 475 memblock_dump_all();
476 return 0; 476 return 0;
477} 477}
478#else 478#else
@@ -501,14 +501,14 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size)
501 } 501 }
502#endif 502#endif
503 503
504 lmb_add(base, size); 504 memblock_add(base, size);
505 505
506 memstart_addr = min((u64)memstart_addr, base); 506 memstart_addr = min((u64)memstart_addr, base);
507} 507}
508 508
509u64 __init early_init_dt_alloc_memory_arch(u64 size, u64 align) 509u64 __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
510{ 510{
511 return lmb_alloc(size, align); 511 return memblock_alloc(size, align);
512} 512}
513 513
514#ifdef CONFIG_BLK_DEV_INITRD 514#ifdef CONFIG_BLK_DEV_INITRD
@@ -534,12 +534,12 @@ static void __init early_reserve_mem(void)
534 /* before we do anything, lets reserve the dt blob */ 534 /* before we do anything, lets reserve the dt blob */
535 self_base = __pa((unsigned long)initial_boot_params); 535 self_base = __pa((unsigned long)initial_boot_params);
536 self_size = initial_boot_params->totalsize; 536 self_size = initial_boot_params->totalsize;
537 lmb_reserve(self_base, self_size); 537 memblock_reserve(self_base, self_size);
538 538
539#ifdef CONFIG_BLK_DEV_INITRD 539#ifdef CONFIG_BLK_DEV_INITRD
540 /* then reserve the initrd, if any */ 540 /* then reserve the initrd, if any */
541 if (initrd_start && (initrd_end > initrd_start)) 541 if (initrd_start && (initrd_end > initrd_start))
542 lmb_reserve(__pa(initrd_start), initrd_end - initrd_start); 542 memblock_reserve(__pa(initrd_start), initrd_end - initrd_start);
543#endif /* CONFIG_BLK_DEV_INITRD */ 543#endif /* CONFIG_BLK_DEV_INITRD */
544 544
545#ifdef CONFIG_PPC32 545#ifdef CONFIG_PPC32
@@ -560,7 +560,7 @@ static void __init early_reserve_mem(void)
560 if (base_32 == self_base && size_32 == self_size) 560 if (base_32 == self_base && size_32 == self_size)
561 continue; 561 continue;
562 DBG("reserving: %x -> %x\n", base_32, size_32); 562 DBG("reserving: %x -> %x\n", base_32, size_32);
563 lmb_reserve(base_32, size_32); 563 memblock_reserve(base_32, size_32);
564 } 564 }
565 return; 565 return;
566 } 566 }
@@ -571,7 +571,7 @@ static void __init early_reserve_mem(void)
571 if (size == 0) 571 if (size == 0)
572 break; 572 break;
573 DBG("reserving: %llx -> %llx\n", base, size); 573 DBG("reserving: %llx -> %llx\n", base, size);
574 lmb_reserve(base, size); 574 memblock_reserve(base, size);
575 } 575 }
576} 576}
577 577
@@ -594,7 +594,7 @@ static inline unsigned long phyp_dump_calculate_reserve_size(void)
594 return phyp_dump_info->reserve_bootvar; 594 return phyp_dump_info->reserve_bootvar;
595 595
596 /* divide by 20 to get 5% of value */ 596 /* divide by 20 to get 5% of value */
597 tmp = lmb_end_of_DRAM(); 597 tmp = memblock_end_of_DRAM();
598 do_div(tmp, 20); 598 do_div(tmp, 20);
599 599
600 /* round it down in multiples of 256 */ 600 /* round it down in multiples of 256 */
@@ -633,11 +633,11 @@ static void __init phyp_dump_reserve_mem(void)
633 if (phyp_dump_info->phyp_dump_is_active) { 633 if (phyp_dump_info->phyp_dump_is_active) {
634 /* Reserve *everything* above RMR.Area freed by userland tools*/ 634 /* Reserve *everything* above RMR.Area freed by userland tools*/
635 base = variable_reserve_size; 635 base = variable_reserve_size;
636 size = lmb_end_of_DRAM() - base; 636 size = memblock_end_of_DRAM() - base;
637 637
638 /* XXX crashed_ram_end is wrong, since it may be beyond 638 /* XXX crashed_ram_end is wrong, since it may be beyond
639 * the memory_limit, it will need to be adjusted. */ 639 * the memory_limit, it will need to be adjusted. */
640 lmb_reserve(base, size); 640 memblock_reserve(base, size);
641 641
642 phyp_dump_info->init_reserve_start = base; 642 phyp_dump_info->init_reserve_start = base;
643 phyp_dump_info->init_reserve_size = size; 643 phyp_dump_info->init_reserve_size = size;
@@ -645,8 +645,8 @@ static void __init phyp_dump_reserve_mem(void)
645 size = phyp_dump_info->cpu_state_size + 645 size = phyp_dump_info->cpu_state_size +
646 phyp_dump_info->hpte_region_size + 646 phyp_dump_info->hpte_region_size +
647 variable_reserve_size; 647 variable_reserve_size;
648 base = lmb_end_of_DRAM() - size; 648 base = memblock_end_of_DRAM() - size;
649 lmb_reserve(base, size); 649 memblock_reserve(base, size);
650 phyp_dump_info->init_reserve_start = base; 650 phyp_dump_info->init_reserve_start = base;
651 phyp_dump_info->init_reserve_size = size; 651 phyp_dump_info->init_reserve_size = size;
652 } 652 }
@@ -681,8 +681,8 @@ void __init early_init_devtree(void *params)
681 */ 681 */
682 of_scan_flat_dt(early_init_dt_scan_chosen, NULL); 682 of_scan_flat_dt(early_init_dt_scan_chosen, NULL);
683 683
684 /* Scan memory nodes and rebuild LMBs */ 684 /* Scan memory nodes and rebuild MEMBLOCKs */
685 lmb_init(); 685 memblock_init();
686 of_scan_flat_dt(early_init_dt_scan_root, NULL); 686 of_scan_flat_dt(early_init_dt_scan_root, NULL);
687 of_scan_flat_dt(early_init_dt_scan_memory_ppc, NULL); 687 of_scan_flat_dt(early_init_dt_scan_memory_ppc, NULL);
688 688
@@ -690,11 +690,11 @@ void __init early_init_devtree(void *params)
690 strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE); 690 strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE);
691 parse_early_param(); 691 parse_early_param();
692 692
693 /* Reserve LMB regions used by kernel, initrd, dt, etc... */ 693 /* Reserve MEMBLOCK regions used by kernel, initrd, dt, etc... */
694 lmb_reserve(PHYSICAL_START, __pa(klimit) - PHYSICAL_START); 694 memblock_reserve(PHYSICAL_START, __pa(klimit) - PHYSICAL_START);
695 /* If relocatable, reserve first 32k for interrupt vectors etc. */ 695 /* If relocatable, reserve first 32k for interrupt vectors etc. */
696 if (PHYSICAL_START > MEMORY_START) 696 if (PHYSICAL_START > MEMORY_START)
697 lmb_reserve(MEMORY_START, 0x8000); 697 memblock_reserve(MEMORY_START, 0x8000);
698 reserve_kdump_trampoline(); 698 reserve_kdump_trampoline();
699 reserve_crashkernel(); 699 reserve_crashkernel();
700 early_reserve_mem(); 700 early_reserve_mem();
@@ -706,17 +706,17 @@ void __init early_init_devtree(void *params)
706 706
707 /* Ensure that total memory size is page-aligned, because 707 /* Ensure that total memory size is page-aligned, because
708 * otherwise mark_bootmem() gets upset. */ 708 * otherwise mark_bootmem() gets upset. */
709 lmb_analyze(); 709 memblock_analyze();
710 memsize = lmb_phys_mem_size(); 710 memsize = memblock_phys_mem_size();
711 if ((memsize & PAGE_MASK) != memsize) 711 if ((memsize & PAGE_MASK) != memsize)
712 limit = memsize & PAGE_MASK; 712 limit = memsize & PAGE_MASK;
713 } 713 }
714 lmb_enforce_memory_limit(limit); 714 memblock_enforce_memory_limit(limit);
715 715
716 lmb_analyze(); 716 memblock_analyze();
717 lmb_dump_all(); 717 memblock_dump_all();
718 718
719 DBG("Phys. mem: %llx\n", lmb_phys_mem_size()); 719 DBG("Phys. mem: %llx\n", memblock_phys_mem_size());
720 720
721 /* We may need to relocate the flat tree, do it now. 721 /* We may need to relocate the flat tree, do it now.
722 * FIXME .. and the initrd too? */ 722 * FIXME .. and the initrd too? */
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index 0e1ec6f746f6..d0516dbee762 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -22,7 +22,7 @@
22#include <linux/smp.h> 22#include <linux/smp.h>
23#include <linux/completion.h> 23#include <linux/completion.h>
24#include <linux/cpumask.h> 24#include <linux/cpumask.h>
25#include <linux/lmb.h> 25#include <linux/memblock.h>
26#include <linux/slab.h> 26#include <linux/slab.h>
27 27
28#include <asm/prom.h> 28#include <asm/prom.h>
@@ -934,11 +934,11 @@ void __init rtas_initialize(void)
934 */ 934 */
935#ifdef CONFIG_PPC64 935#ifdef CONFIG_PPC64
936 if (machine_is(pseries) && firmware_has_feature(FW_FEATURE_LPAR)) { 936 if (machine_is(pseries) && firmware_has_feature(FW_FEATURE_LPAR)) {
937 rtas_region = min(lmb.rmo_size, RTAS_INSTANTIATE_MAX); 937 rtas_region = min(memblock.rmo_size, RTAS_INSTANTIATE_MAX);
938 ibm_suspend_me_token = rtas_token("ibm,suspend-me"); 938 ibm_suspend_me_token = rtas_token("ibm,suspend-me");
939 } 939 }
940#endif 940#endif
941 rtas_rmo_buf = lmb_alloc_base(RTAS_RMOBUF_MAX, PAGE_SIZE, rtas_region); 941 rtas_rmo_buf = memblock_alloc_base(RTAS_RMOBUF_MAX, PAGE_SIZE, rtas_region);
942 942
943#ifdef CONFIG_RTAS_ERROR_LOGGING 943#ifdef CONFIG_RTAS_ERROR_LOGGING
944 rtas_last_error_token = rtas_token("rtas-last-error"); 944 rtas_last_error_token = rtas_token("rtas-last-error");
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 5e4d852f640c..b7e6c7e193ae 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -33,7 +33,7 @@
33#include <linux/serial_8250.h> 33#include <linux/serial_8250.h>
34#include <linux/debugfs.h> 34#include <linux/debugfs.h>
35#include <linux/percpu.h> 35#include <linux/percpu.h>
36#include <linux/lmb.h> 36#include <linux/memblock.h>
37#include <linux/of_platform.h> 37#include <linux/of_platform.h>
38#include <asm/io.h> 38#include <asm/io.h>
39#include <asm/paca.h> 39#include <asm/paca.h>
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index 7d84b210f168..a10ffc85ada7 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -16,7 +16,7 @@
16#include <linux/root_dev.h> 16#include <linux/root_dev.h>
17#include <linux/cpu.h> 17#include <linux/cpu.h>
18#include <linux/console.h> 18#include <linux/console.h>
19#include <linux/lmb.h> 19#include <linux/memblock.h>
20 20
21#include <asm/io.h> 21#include <asm/io.h>
22#include <asm/prom.h> 22#include <asm/prom.h>
@@ -246,12 +246,12 @@ static void __init irqstack_early_init(void)
246 unsigned int i; 246 unsigned int i;
247 247
248 /* interrupt stacks must be in lowmem, we get that for free on ppc32 248 /* interrupt stacks must be in lowmem, we get that for free on ppc32
249 * as the lmb is limited to lowmem by LMB_REAL_LIMIT */ 249 * as the memblock is limited to lowmem by MEMBLOCK_REAL_LIMIT */
250 for_each_possible_cpu(i) { 250 for_each_possible_cpu(i) {
251 softirq_ctx[i] = (struct thread_info *) 251 softirq_ctx[i] = (struct thread_info *)
252 __va(lmb_alloc(THREAD_SIZE, THREAD_SIZE)); 252 __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
253 hardirq_ctx[i] = (struct thread_info *) 253 hardirq_ctx[i] = (struct thread_info *)
254 __va(lmb_alloc(THREAD_SIZE, THREAD_SIZE)); 254 __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
255 } 255 }
256} 256}
257 257
@@ -261,15 +261,15 @@ static void __init exc_lvl_early_init(void)
261 unsigned int i; 261 unsigned int i;
262 262
263 /* interrupt stacks must be in lowmem, we get that for free on ppc32 263 /* interrupt stacks must be in lowmem, we get that for free on ppc32
264 * as the lmb is limited to lowmem by LMB_REAL_LIMIT */ 264 * as the memblock is limited to lowmem by MEMBLOCK_REAL_LIMIT */
265 for_each_possible_cpu(i) { 265 for_each_possible_cpu(i) {
266 critirq_ctx[i] = (struct thread_info *) 266 critirq_ctx[i] = (struct thread_info *)
267 __va(lmb_alloc(THREAD_SIZE, THREAD_SIZE)); 267 __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
268#ifdef CONFIG_BOOKE 268#ifdef CONFIG_BOOKE
269 dbgirq_ctx[i] = (struct thread_info *) 269 dbgirq_ctx[i] = (struct thread_info *)
270 __va(lmb_alloc(THREAD_SIZE, THREAD_SIZE)); 270 __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
271 mcheckirq_ctx[i] = (struct thread_info *) 271 mcheckirq_ctx[i] = (struct thread_info *)
272 __va(lmb_alloc(THREAD_SIZE, THREAD_SIZE)); 272 __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
273#endif 273#endif
274 } 274 }
275} 275}
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 643dcac40fcb..d135f93cb0f6 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -34,7 +34,7 @@
34#include <linux/bootmem.h> 34#include <linux/bootmem.h>
35#include <linux/pci.h> 35#include <linux/pci.h>
36#include <linux/lockdep.h> 36#include <linux/lockdep.h>
37#include <linux/lmb.h> 37#include <linux/memblock.h>
38#include <asm/io.h> 38#include <asm/io.h>
39#include <asm/kdump.h> 39#include <asm/kdump.h>
40#include <asm/prom.h> 40#include <asm/prom.h>
@@ -158,7 +158,7 @@ static void __init setup_paca(struct paca_struct *new_paca)
158 * the CPU that ignores the top 2 bits of the address in real 158 * the CPU that ignores the top 2 bits of the address in real
159 * mode so we can access kernel globals normally provided we 159 * mode so we can access kernel globals normally provided we
160 * only toy with things in the RMO region. From here, we do 160 * only toy with things in the RMO region. From here, we do
161 * some early parsing of the device-tree to setup out LMB 161 * some early parsing of the device-tree to setup out MEMBLOCK
162 * data structures, and allocate & initialize the hash table 162 * data structures, and allocate & initialize the hash table
163 * and segment tables so we can start running with translation 163 * and segment tables so we can start running with translation
164 * enabled. 164 * enabled.
@@ -404,7 +404,7 @@ void __init setup_system(void)
404 404
405 printk("-----------------------------------------------------\n"); 405 printk("-----------------------------------------------------\n");
406 printk("ppc64_pft_size = 0x%llx\n", ppc64_pft_size); 406 printk("ppc64_pft_size = 0x%llx\n", ppc64_pft_size);
407 printk("physicalMemorySize = 0x%llx\n", lmb_phys_mem_size()); 407 printk("physicalMemorySize = 0x%llx\n", memblock_phys_mem_size());
408 if (ppc64_caches.dline_size != 0x80) 408 if (ppc64_caches.dline_size != 0x80)
409 printk("ppc64_caches.dcache_line_size = 0x%x\n", 409 printk("ppc64_caches.dcache_line_size = 0x%x\n",
410 ppc64_caches.dline_size); 410 ppc64_caches.dline_size);
@@ -443,10 +443,10 @@ static void __init irqstack_early_init(void)
443 */ 443 */
444 for_each_possible_cpu(i) { 444 for_each_possible_cpu(i) {
445 softirq_ctx[i] = (struct thread_info *) 445 softirq_ctx[i] = (struct thread_info *)
446 __va(lmb_alloc_base(THREAD_SIZE, 446 __va(memblock_alloc_base(THREAD_SIZE,
447 THREAD_SIZE, limit)); 447 THREAD_SIZE, limit));
448 hardirq_ctx[i] = (struct thread_info *) 448 hardirq_ctx[i] = (struct thread_info *)
449 __va(lmb_alloc_base(THREAD_SIZE, 449 __va(memblock_alloc_base(THREAD_SIZE,
450 THREAD_SIZE, limit)); 450 THREAD_SIZE, limit));
451 } 451 }
452} 452}
@@ -458,11 +458,11 @@ static void __init exc_lvl_early_init(void)
458 458
459 for_each_possible_cpu(i) { 459 for_each_possible_cpu(i) {
460 critirq_ctx[i] = (struct thread_info *) 460 critirq_ctx[i] = (struct thread_info *)
461 __va(lmb_alloc(THREAD_SIZE, THREAD_SIZE)); 461 __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
462 dbgirq_ctx[i] = (struct thread_info *) 462 dbgirq_ctx[i] = (struct thread_info *)
463 __va(lmb_alloc(THREAD_SIZE, THREAD_SIZE)); 463 __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
464 mcheckirq_ctx[i] = (struct thread_info *) 464 mcheckirq_ctx[i] = (struct thread_info *)
465 __va(lmb_alloc(THREAD_SIZE, THREAD_SIZE)); 465 __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
466 } 466 }
467} 467}
468#else 468#else
@@ -487,11 +487,11 @@ static void __init emergency_stack_init(void)
487 * bringup, we need to get at them in real mode. This means they 487 * bringup, we need to get at them in real mode. This means they
488 * must also be within the RMO region. 488 * must also be within the RMO region.
489 */ 489 */
490 limit = min(slb0_limit(), lmb.rmo_size); 490 limit = min(slb0_limit(), memblock.rmo_size);
491 491
492 for_each_possible_cpu(i) { 492 for_each_possible_cpu(i) {
493 unsigned long sp; 493 unsigned long sp;
494 sp = lmb_alloc_base(THREAD_SIZE, THREAD_SIZE, limit); 494 sp = memblock_alloc_base(THREAD_SIZE, THREAD_SIZE, limit);
495 sp += THREAD_SIZE; 495 sp += THREAD_SIZE;
496 paca[i].emergency_sp = __va(sp); 496 paca[i].emergency_sp = __va(sp);
497 } 497 }
diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c
index d84d19224a95..13002fe206e7 100644
--- a/arch/powerpc/kernel/vdso.c
+++ b/arch/powerpc/kernel/vdso.c
@@ -22,7 +22,7 @@
22#include <linux/elf.h> 22#include <linux/elf.h>
23#include <linux/security.h> 23#include <linux/security.h>
24#include <linux/bootmem.h> 24#include <linux/bootmem.h>
25#include <linux/lmb.h> 25#include <linux/memblock.h>
26 26
27#include <asm/pgtable.h> 27#include <asm/pgtable.h>
28#include <asm/system.h> 28#include <asm/system.h>
@@ -734,7 +734,7 @@ static int __init vdso_init(void)
734 vdso_data->platform = machine_is(iseries) ? 0x200 : 0x100; 734 vdso_data->platform = machine_is(iseries) ? 0x200 : 0x100;
735 if (firmware_has_feature(FW_FEATURE_LPAR)) 735 if (firmware_has_feature(FW_FEATURE_LPAR))
736 vdso_data->platform |= 1; 736 vdso_data->platform |= 1;
737 vdso_data->physicalMemorySize = lmb_phys_mem_size(); 737 vdso_data->physicalMemorySize = memblock_phys_mem_size();
738 vdso_data->dcache_size = ppc64_caches.dsize; 738 vdso_data->dcache_size = ppc64_caches.dsize;
739 vdso_data->dcache_line_size = ppc64_caches.dline_size; 739 vdso_data->dcache_line_size = ppc64_caches.dline_size;
740 vdso_data->icache_size = ppc64_caches.isize; 740 vdso_data->icache_size = ppc64_caches.isize;