aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/prom.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2010-07-06 18:39:02 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2010-08-04 22:56:08 -0400
commitcd3db0c4ca3d237e7ad20f7107216e575705d2b0 (patch)
tree03be7c14bd68a568a6e2f6df2db9fbbdf11c1483 /arch/powerpc/kernel/prom.c
parente63075a3c9377536d085bc013cd3fe6323162449 (diff)
memblock: Remove rmo_size, burry it in arch/powerpc where it belongs
The RMA (RMO is a misnomer) is a concept specific to ppc64 (in fact server ppc64 though I hijack it on embedded ppc64 for similar purposes) and represents the area of memory that can be accessed in real mode (aka with MMU off), or on embedded, from the exception vectors (which is bolted in the TLB) which pretty much boils down to the same thing. We take that out of the generic MEMBLOCK data structure and move it into arch/powerpc where it belongs, renaming it to "RMA" while at it. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/prom.c')
-rw-r--r--arch/powerpc/kernel/prom.c29
1 files changed, 8 insertions, 21 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 3aec0b980f6a..c3c6a8857544 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -66,6 +66,7 @@
66int __initdata iommu_is_off; 66int __initdata iommu_is_off;
67int __initdata iommu_force_on; 67int __initdata iommu_force_on;
68unsigned long tce_alloc_start, tce_alloc_end; 68unsigned long tce_alloc_start, tce_alloc_end;
69u64 ppc64_rma_size;
69#endif 70#endif
70 71
71static int __init early_parse_mem(char *p) 72static int __init early_parse_mem(char *p)
@@ -492,7 +493,7 @@ static int __init early_init_dt_scan_memory_ppc(unsigned long node,
492 493
493void __init early_init_dt_add_memory_arch(u64 base, u64 size) 494void __init early_init_dt_add_memory_arch(u64 base, u64 size)
494{ 495{
495#if defined(CONFIG_PPC64) 496#ifdef CONFIG_PPC64
496 if (iommu_is_off) { 497 if (iommu_is_off) {
497 if (base >= 0x80000000ul) 498 if (base >= 0x80000000ul)
498 return; 499 return;
@@ -501,9 +502,13 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size)
501 } 502 }
502#endif 503#endif
503 504
504 memblock_add(base, size); 505 /* First MEMBLOCK added, do some special initializations */
505 506 if (memstart_addr == ~(phys_addr_t)0)
507 setup_initial_memory_limit(base, size);
506 memstart_addr = min((u64)memstart_addr, base); 508 memstart_addr = min((u64)memstart_addr, base);
509
510 /* Add the chunk to the MEMBLOCK list */
511 memblock_add(base, size);
507} 512}
508 513
509u64 __init early_init_dt_alloc_memory_arch(u64 size, u64 align) 514u64 __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
@@ -655,22 +660,6 @@ static void __init phyp_dump_reserve_mem(void)
655static inline void __init phyp_dump_reserve_mem(void) {} 660static inline void __init phyp_dump_reserve_mem(void) {}
656#endif /* CONFIG_PHYP_DUMP && CONFIG_PPC_RTAS */ 661#endif /* CONFIG_PHYP_DUMP && CONFIG_PPC_RTAS */
657 662
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}
673
674void __init early_init_devtree(void *params) 663void __init early_init_devtree(void *params)
675{ 664{
676 phys_addr_t limit; 665 phys_addr_t limit;
@@ -734,8 +723,6 @@ void __init early_init_devtree(void *params)
734 723
735 DBG("Phys. mem: %llx\n", memblock_phys_mem_size()); 724 DBG("Phys. mem: %llx\n", memblock_phys_mem_size());
736 725
737 set_boot_memory_limit();
738
739 /* We may need to relocate the flat tree, do it now. 726 /* We may need to relocate the flat tree, do it now.
740 * FIXME .. and the initrd too? */ 727 * FIXME .. and the initrd too? */
741 move_device_tree(); 728 move_device_tree();