Skip to contentSkip to conversation

powerpc: prpmc2800 - Don't trust documented memory size

PATCH In review Mark A. Greer 1 participant 2 messages Nov 6, 2007 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: prpmc2800 - Don't trust documented memory size

It turns out that the firmware on some PrPMC2800 processor modules initializes the memory controller for 512 MB even when there is more memory. As a simple work around, set the amount of memory in the device tree passed to the kernel to the lesser of what the memory controller is set up for and the actual amount of memory.

---
 arch/powerpc/boot/prpmc2800.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
arch/powerpc/boot/prpmc2800.c +4 -1
index 9614e1d..559c45e 100644
@@ -405,7 +405,10 @@ static void prpmc2800_fixups(void)
 
 	bip = prpmc2800_get_bip(); /* Get board info based on VPD */
 
-	mem_size = (bip) ? bip->mem_size : mv64x60_get_mem_size(bridge_base);
+	mem_size = mv64x60_get_mem_size(bridge_base);
+	if (bip)
+		mem_size = min(mem_size, bip->mem_size);
+
 	prpmc2800_bridge_setup(mem_size); /* Do necessary bridge setup */
 
 	/* If the VPD doesn't match what we know about, just use the
#1 lore raw
Quoted 8 lines · Mark A. Greer

It turns out that the firmware on some PrPMC2800 processor modules initializes the memory controller for 512 MB even when there is more memory. As a simple work around, set the amount of memory in the device tree passed to the kernel to the lesser of what the memory controller is set up for and the actual amount of memory.

---

Paul, please ignore this patch. There is still something wrong.

Sorry for the noise.

Mark