[RFC/PATCH 11/12] powerpc: Use FW_FEATURE_ISERIES in slb_initialize()

Michael Ellerman michael at ellerman.id.au
Tue Jan 17 14:22:46 EST 2006


Use a firmware feature test in slb_initialize().

 arch/powerpc/mm/slb.c |   46 +++++++++++++++++++++++-----------------------
 1 files changed, 23 insertions(+), 23 deletions(-)

Index: linux/arch/powerpc/mm/slb.c
===================================================================
--- linux.orig/arch/powerpc/mm/slb.c
+++ linux/arch/powerpc/mm/slb.c
@@ -23,6 +23,7 @@
 #include <asm/paca.h>
 #include <asm/cputable.h>
 #include <asm/cacheflush.h>
+#include <asm/firmware.h>
 
 #ifdef DEBUG
 #define DBG(fmt...) udbg_printf(fmt)
@@ -202,29 +203,28 @@ void slb_initialize(void)
 
 	/* On iSeries the bolted entries have already been set up by
 	 * the hypervisor from the lparMap data in head.S */
-#ifndef CONFIG_PPC_ISERIES
- {
-	unsigned long lflags, vflags;
-
-	lflags = SLB_VSID_KERNEL | linear_llp;
-	vflags = SLB_VSID_KERNEL | virtual_llp;
-
-	/* Invalidate the entire SLB (even slot 0) & all the ERATS */
-	asm volatile("isync":::"memory");
-	asm volatile("slbmte  %0,%0"::"r" (0) : "memory");
-	asm volatile("isync; slbia; isync":::"memory");
-	create_slbe(PAGE_OFFSET, lflags, 0);
-
-	/* VMALLOC space has 4K pages always for now */
-	create_slbe(VMALLOC_START, vflags, 1);
-
-	/* We don't bolt the stack for the time being - we're in boot,
-	 * so the stack is in the bolted segment.  By the time it goes
-	 * elsewhere, we'll call _switch() which will bolt in the new
-	 * one. */
-	asm volatile("isync":::"memory");
- }
-#endif /* CONFIG_PPC_ISERIES */
+	if (!firmware_has_feature(FW_FEATURE_ISERIES))
+	{
+		unsigned long lflags, vflags;
+
+		lflags = SLB_VSID_KERNEL | linear_llp;
+		vflags = SLB_VSID_KERNEL | virtual_llp;
+
+		/* Invalidate the entire SLB (even slot 0) & all the ERATS */
+		asm volatile("isync":::"memory");
+		asm volatile("slbmte  %0,%0"::"r" (0) : "memory");
+		asm volatile("isync; slbia; isync":::"memory");
+		create_slbe(PAGE_OFFSET, lflags, 0);
+
+		/* VMALLOC space has 4K pages always for now */
+		create_slbe(VMALLOC_START, vflags, 1);
+
+		/* We don't bolt the stack for the time being - we're in boot,
+		 * so the stack is in the bolted segment.  By the time it goes
+		 * elsewhere, we'll call _switch() which will bolt in the new
+		 * one. */
+		asm volatile("isync":::"memory");
+	}
 
 	get_paca()->stab_rr = SLB_NUM_BOLTED;
 }



More information about the Linuxppc64-dev mailing list