Skip to contentSkip to conversation

ppc: 4xx: Fix TLB 0 problem with CONFIG_SERIAL_TEXT_DEBUG

PATCH New Stefan Roese 1 participant 1 message Nov 20, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ppc: 4xx: Fix TLB 0 problem with CONFIG_SERIAL_TEXT_DEBUG

Right now TLB entry 0 ist used as UART0 mapping for the early debug output (via CONFIG_SERIAL_TEXT_DEBUG). This causes problems when many TLB's get used upon Linux bootup (e.g. while PCIe scanning behind bridges and/or switches on 440SPe platforms). This will overwrite the TLB 0 entry and further debug output's may crash/hang the system.

This patch moves the early debug UART0 TLB entry from 0 to 62 as done in arch/powerpc. This way it is in the "pinned" area and will not get overwritten. Also the arch/ppc/mm/44x_mmu.c code is now synced with the newer code from arch/powerpc.

---
 arch/ppc/kernel/head_44x.S |    2 +-
 arch/ppc/mm/44x_mmu.c      |   51 +++++++++++++------------------------------
 include/asm-ppc/mmu.h      |    6 +++++
 3 files changed, 23 insertions(+), 36 deletions(-)
arch/ppc/kernel/head_44x.S +1 -1
index 75bbc93..ebb5a40 100644
@@ -195,7 +195,7 @@ skpinv:	addi	r4,r4,1				/* Increment */
 	li	r5,0
 	ori	r5,r5,(PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_I | PPC44x_TLB_G)
 
-        li      r0,0                    /* TLB slot 0 */
+	li	r0,62			/* TLB slot 62 */
 
 	tlbwe	r3,r0,PPC44x_TLB_PAGEID	/* Load the pageid fields */
 	tlbwe	r4,r0,PPC44x_TLB_XLAT	/* Load the translation fields */
arch/ppc/mm/44x_mmu.c +16 -35

76 lines not on this page · raw message

include/asm-ppc/mmu.h +6 -0
index 14584e5..d46b57b 100644
@@ -383,6 +383,12 @@ typedef struct _P601_BAT {
 #define BOOKE_PAGESZ_256GB	14
 #define BOOKE_PAGESZ_1TB	15
 
+#ifndef CONFIG_SERIAL_TEXT_DEBUG
+#define PPC44x_EARLY_TLBS	1
+#else
+#define PPC44x_EARLY_TLBS	2
+#endif
+
 /*
  * Freescale Book-E MMU support
  */
Signature · 1 line
1.5.3.5.788.gea559