Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cd3db0c4 authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt
Browse files

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: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent e63075a3
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -2,6 +2,8 @@
#define _ASM_POWERPC_MMU_H_
#ifdef __KERNEL__

#include <linux/types.h>

#include <asm/asm-compat.h>
#include <asm/feature-fixups.h>

@@ -82,6 +84,16 @@ extern unsigned int __start___mmu_ftr_fixup, __stop___mmu_ftr_fixup;
extern void early_init_mmu(void);
extern void early_init_mmu_secondary(void);

extern void setup_initial_memory_limit(phys_addr_t first_memblock_base,
				       phys_addr_t first_memblock_size);

#ifdef CONFIG_PPC64
/* This is our real memory area size on ppc64 server, on embedded, we
 * make it match the size our of bolted TLB area
 */
extern u64 ppc64_rma_size;
#endif /* CONFIG_PPC64 */

#endif /* !__ASSEMBLY__ */

/* The kernel use the constants below to index in the page sizes array.
+1 −5
Original line number Diff line number Diff line
@@ -923,11 +923,7 @@ initial_mmu:
	mtspr	SPRN_PID,r0
	sync

	/* Configure and load two entries into TLB slots 62 and 63.
	 * In case we are pinning TLBs, these are reserved in by the
	 * other TLB functions.  If not reserving, then it doesn't
	 * matter where they are loaded.
	 */
	/* Configure and load one entry into TLB slots 63 */
	clrrwi	r4,r4,10		/* Mask off the real page number */
	ori	r4,r4,(TLB_WR | TLB_EX)	/* Set the write and execute bits */

+1 −1
Original line number Diff line number Diff line
@@ -117,7 +117,7 @@ void __init allocate_pacas(void)
	 * the first segment. On iSeries they must be within the area mapped
	 * by the HV, which is HvPagesToMap * HVPAGESIZE bytes.
	 */
	limit = min(0x10000000ULL, memblock.rmo_size);
	limit = min(0x10000000ULL, ppc64_rma_size);
	if (firmware_has_feature(FW_FEATURE_ISERIES))
		limit = min(limit, HvPagesToMap * HVPAGESIZE);

+8 −21
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@
int __initdata iommu_is_off;
int __initdata iommu_force_on;
unsigned long tce_alloc_start, tce_alloc_end;
u64 ppc64_rma_size;
#endif

static int __init early_parse_mem(char *p)
@@ -492,7 +493,7 @@ static int __init early_init_dt_scan_memory_ppc(unsigned long node,

void __init early_init_dt_add_memory_arch(u64 base, u64 size)
{
#if defined(CONFIG_PPC64)
#ifdef CONFIG_PPC64
	if (iommu_is_off) {
		if (base >= 0x80000000ul)
			return;
@@ -501,9 +502,13 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size)
	}
#endif

	memblock_add(base, size);

	/* First MEMBLOCK added, do some special initializations */
	if (memstart_addr == ~(phys_addr_t)0)
		setup_initial_memory_limit(base, size);
	memstart_addr = min((u64)memstart_addr, base);

	/* Add the chunk to the MEMBLOCK list */
	memblock_add(base, size);
}

u64 __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
@@ -655,22 +660,6 @@ static void __init phyp_dump_reserve_mem(void)
static inline void __init phyp_dump_reserve_mem(void) {}
#endif /* CONFIG_PHYP_DUMP  && CONFIG_PPC_RTAS */

static void set_boot_memory_limit(void)
{
#ifdef CONFIG_PPC32
	/* 601 can only access 16MB at the moment */
	if (PVR_VER(mfspr(SPRN_PVR)) == 1)
		memblock_set_current_limit(0x01000000);
	/* 8xx can only access 8MB at the moment */
	else if (PVR_VER(mfspr(SPRN_PVR)) == 0x50)
		memblock_set_current_limit(0x00800000);
	else
		memblock_set_current_limit(0x10000000);
#else
	memblock_set_current_limit(memblock.rmo_size);
#endif
}

void __init early_init_devtree(void *params)
{
	phys_addr_t limit;
@@ -734,8 +723,6 @@ void __init early_init_devtree(void *params)

	DBG("Phys. mem: %llx\n", memblock_phys_mem_size());

	set_boot_memory_limit();

	/* We may need to relocate the flat tree, do it now.
	 * FIXME .. and the initrd too? */
	move_device_tree();
+1 −1
Original line number Diff line number Diff line
@@ -934,7 +934,7 @@ void __init rtas_initialize(void)
	 */
#ifdef CONFIG_PPC64
	if (machine_is(pseries) && firmware_has_feature(FW_FEATURE_LPAR)) {
		rtas_region = min(memblock.rmo_size, RTAS_INSTANTIATE_MAX);
		rtas_region = min(ppc64_rma_size, RTAS_INSTANTIATE_MAX);
		ibm_suspend_me_token = rtas_token("ibm,suspend-me");
	}
#endif
Loading