aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/prom.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/prom.c')
-rw-r--r--arch/powerpc/kernel/prom.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index fed9bf6187d1..3aec0b980f6a 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -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(memblock_alloc_base(size, PAGE_SIZE, memblock.rmo_size)); 101 p = __va(memblock_alloc(size, PAGE_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);
@@ -655,6 +655,21 @@ static void __init phyp_dump_reserve_mem(void)
655static inline void __init phyp_dump_reserve_mem(void) {} 655static inline void __init phyp_dump_reserve_mem(void) {}
656#endif /* CONFIG_PHYP_DUMP && CONFIG_PPC_RTAS */ 656#endif /* CONFIG_PHYP_DUMP && CONFIG_PPC_RTAS */
657 657
658static void set_boot_memory_limit(void)
659{
660#ifdef CONFIG_PPC32
661 /* 601 can only access 16MB at the moment */
662 if (PVR_VER(mfspr(SPRN_PVR)) == 1)
663 memblock_set_current_limit(0x01000000);
664 /* 8xx can only access 8MB at the moment */
665 else if (PVR_VER(mfspr(SPRN_PVR)) == 0x50)
666 memblock_set_current_limit(0x00800000);
667 else
668 memblock_set_current_limit(0x10000000);
669#else
670 memblock_set_current_limit(memblock.rmo_size);
671#endif
672}
658 673
659void __init early_init_devtree(void *params) 674void __init early_init_devtree(void *params)
660{ 675{
@@ -683,6 +698,7 @@ void __init early_init_devtree(void *params)
683 698
684 /* Scan memory nodes and rebuild MEMBLOCKs */ 699 /* Scan memory nodes and rebuild MEMBLOCKs */
685 memblock_init(); 700 memblock_init();
701
686 of_scan_flat_dt(early_init_dt_scan_root, NULL); 702 of_scan_flat_dt(early_init_dt_scan_root, NULL);
687 of_scan_flat_dt(early_init_dt_scan_memory_ppc, NULL); 703 of_scan_flat_dt(early_init_dt_scan_memory_ppc, NULL);
688 704
@@ -718,6 +734,8 @@ void __init early_init_devtree(void *params)
718 734
719 DBG("Phys. mem: %llx\n", memblock_phys_mem_size()); 735 DBG("Phys. mem: %llx\n", memblock_phys_mem_size());
720 736
737 set_boot_memory_limit();
738
721 /* We may need to relocate the flat tree, do it now. 739 /* We may need to relocate the flat tree, do it now.
722 * FIXME .. and the initrd too? */ 740 * FIXME .. and the initrd too? */
723 move_device_tree(); 741 move_device_tree();