[RFC PATCH 1/7] powerpc: ppc440 remove zero physical memory base assumption

Michal Simek monstr at monstr.eu
Fri Jun 17 00:14:22 EST 2011


From: John Williams <john.williams at petalogix.com>

The macro PHYSICAL_START is available in this context, currently always with
the value zero.  However, that will change in a future patchset.

For now, just remove the zero physical address start assumption in head_44x.S
where we setup the initial TLB, and in the later MMU setup where we map in
the remainder of low mem if required.

Signed-off-by: John Williams <john.williams at petalogix.com>
---
 arch/powerpc/kernel/head_44x.S |    5 +++--
 arch/powerpc/mm/44x_mmu.c      |    2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/kernel/head_44x.S b/arch/powerpc/kernel/head_44x.S
index 18d8a16..d80ce05 100644
--- a/arch/powerpc/kernel/head_44x.S
+++ b/arch/powerpc/kernel/head_44x.S
@@ -135,8 +135,9 @@ skpinv:	addi	r4,r4,1				/* Increment */
 	lis	r3,PAGE_OFFSET at h
 	ori	r3,r3,PAGE_OFFSET at l
 
-	/* Kernel is at the base of RAM */
-	li r4, 0			/* Load the kernel physical address */
+	/* Kernel is at PHYSICAL_START */
+	lis	r4,PHYSICAL_START at h
+	ori	r4,r4,PHYSICAL_START at l
 
 	/* Load the kernel PID = 0 */
 	li	r0,0
diff --git a/arch/powerpc/mm/44x_mmu.c b/arch/powerpc/mm/44x_mmu.c
index 98052ac..4a55061 100644
--- a/arch/powerpc/mm/44x_mmu.c
+++ b/arch/powerpc/mm/44x_mmu.c
@@ -94,7 +94,7 @@ unsigned long __init mmu_mapin_ram(void)
 
 	/* Pin in enough TLBs to cover any lowmem not covered by the
 	 * initial 256M mapping established in head_44x.S */
-	for (addr = PPC_PIN_SIZE; addr < lowmem_end_addr;
+	for (addr = PHYSICAL_START + PPC_PIN_SIZE; addr < lowmem_end_addr;
 	     addr += PPC_PIN_SIZE)
 		ppc44x_pin_tlb(addr + PAGE_OFFSET, addr);
 
-- 
1.5.5.6



More information about the Linuxppc-dev mailing list