linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Neuling <mikey@neuling.org>
To: Michael Neuling <mikey@neuling.org>,
	Paul Mackerras <paulus@samba.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@ozlabs.org, Milton Miller <miltonm@bga.com>
Subject: [PATCH 2/2] powerpc: Add 2.06 tlbie mnemonics
Date: Fri, 24 Apr 2009 16:24:31 +1000	[thread overview]
Message-ID: <20090424062431.D3803120E7@localhost.localdomain> (raw)
In-Reply-To: <1240554271.668632.486641775152.qpush@pale>

From: Milton Miller <miltonm@bga.com>

This adds the PowerPC 2.06 tlbie mnemonics and keeps backwards
compatibilty for CPUs before 2.06.

Only useful for bare metal systems.  

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Michael Neuling <mikey@neuling.org>
---
As they say, better out than in....
---

 arch/powerpc/include/asm/cputable.h |    3 ++-
 arch/powerpc/mm/hash_native_64.c    |   13 +++++++++++--
 2 files changed, 13 insertions(+), 3 deletions(-)

Index: linux-2.6-ozlabs/arch/powerpc/include/asm/cputable.h
===================================================================
--- linux-2.6-ozlabs.orig/arch/powerpc/include/asm/cputable.h
+++ linux-2.6-ozlabs/arch/powerpc/include/asm/cputable.h
@@ -195,6 +195,7 @@ extern const char *powerpc_base_platform
 #define CPU_FTR_SAO			LONG_ASM_CONST(0x0020000000000000)
 #define CPU_FTR_CP_USE_DCBTZ		LONG_ASM_CONST(0x0040000000000000)
 #define CPU_FTR_UNALIGNED_LD_STD	LONG_ASM_CONST(0x0080000000000000)
+#define CPU_FTR_TLBIE_206		LONG_ASM_CONST(0x0100000000000000)
 
 #ifndef __ASSEMBLY__
 
@@ -409,7 +410,7 @@ extern const char *powerpc_base_platform
 	    CPU_FTR_MMCRA | CPU_FTR_SMT | \
 	    CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \
 	    CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \
-	    CPU_FTR_DSCR | CPU_FTR_SAO)
+	    CPU_FTR_DSCR | CPU_FTR_SAO | CPU_FTR_TLBIE_206)
 #define CPU_FTRS_CELL	(CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
 	    CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
 	    CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \
Index: linux-2.6-ozlabs/arch/powerpc/mm/hash_native_64.c
===================================================================
--- linux-2.6-ozlabs.orig/arch/powerpc/mm/hash_native_64.c
+++ linux-2.6-ozlabs/arch/powerpc/mm/hash_native_64.c
@@ -38,6 +38,9 @@
 
 static DEFINE_SPINLOCK(native_tlbie_lock);
 
+#define TLBIE(lp,a) \
+	stringify_in_c(.long 0x7c000264 | ((a) << 11) | ((lp) << 21))
+
 static inline void __tlbie(unsigned long va, int psize, int ssize)
 {
 	unsigned int penc;
@@ -49,14 +52,19 @@ static inline void __tlbie(unsigned long
 	case MMU_PAGE_4K:
 		va &= ~0xffful;
 		va |= ssize << 8;
-		asm volatile("tlbie %0,0" : : "r" (va) : "memory");
+ 		asm volatile(ASM_FTR_IFCLR("tlbie %0,0", TLBIE(%1,%0), %2)
+			     : : "r" (va), "r"(0), "i" (CPU_FTR_TLBIE_206)
+			     : "memory");
 		break;
 	default:
 		penc = mmu_psize_defs[psize].penc;
 		va &= ~((1ul << mmu_psize_defs[psize].shift) - 1);
 		va |= penc << 12;
 		va |= ssize << 8;
-		asm volatile("tlbie %0,1" : : "r" (va) : "memory");
+		va |= 1; /* L */
+ 		asm volatile(ASM_FTR_IFCLR("tlbie %0,1", TLBIE(%1,%0), %2)
+			     : : "r" (va), "r"(0), "i" (CPU_FTR_TLBIE_206)
+			     : "memory");
 		break;
 	}
 }
@@ -80,6 +88,7 @@ static inline void __tlbiel(unsigned lon
 		va &= ~((1ul << mmu_psize_defs[psize].shift) - 1);
 		va |= penc << 12;
 		va |= ssize << 8;
+		va |= 1; /* L */
 		asm volatile(".long 0x7c000224 | (%0 << 11) | (1 << 21)"
 			     : : "r"(va) : "memory");
 		break;

  reply	other threads:[~2009-04-24  6:24 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-24  6:24 [PATCH 0/2] powerpc: tlbie implementation PowerPC 2.06 Michael Neuling
2009-04-24  6:24 ` Michael Neuling [this message]
2009-04-27  1:20   ` [PATCH 2/2] powerpc: Add 2.06 tlbie mnemonics Benjamin Herrenschmidt
2009-04-27 19:30   ` Kumar Gala
2009-04-27 19:31   ` Kumar Gala
2009-04-27 19:46     ` Kumar Gala
2009-04-28  5:03       ` [PATCH 0/2] powerpc: tlbie implementation for PowerPC ISA 2.06 Michael Neuling
2009-04-28  5:03         ` [PATCH 1/2] powerpc: Enable MMU feature sections for inline asm Michael Neuling
2009-04-28  5:03         ` [PATCH 2/2] powerpc: Add 2.06 tlbie mnemonics Michael Neuling
2009-04-28 12:05           ` Kumar Gala
2009-04-28 12:40             ` Michael Neuling
2009-04-28 12:45             ` [PATCH 0/2] powerpc: tlbie implementation for PowerPC ISA 2.06 Michael Neuling
2009-04-28 12:45               ` [PATCH 1/2] powerpc: Enable MMU feature sections for inline asm Michael Neuling
2009-04-28 12:45               ` [PATCH 2/2] powerpc: Add 2.06 tlbie mnemonics Michael Neuling
2009-04-28 13:21                 ` Kumar Gala
2009-04-29  0:16                   ` Michael Neuling
2009-04-29  0:26                   ` [PATCH 0/2] powerpc: tlbie implementation for PowerPC ISA 2.06 Michael Neuling
2009-04-29  0:26                     ` [PATCH 1/2] powerpc: Enable MMU feature sections for inline asm Michael Neuling
2009-04-29  0:52                       ` Michael Ellerman
2009-04-29  7:20                         ` [PATCH 0/2] powerpc: Cleanup code in ppc-opcode.h Michael Neuling
2009-04-29  7:20                           ` [PATCH 1/2] powerpc: Cleanup macros " Michael Neuling
2009-04-29  7:20                           ` [PATCH 2/2] powerpc: Move VSX load/stores into ppc-opcode.h Michael Neuling
2009-04-29 12:38                             ` Kumar Gala
2009-04-30  0:24                               ` Michael Neuling
2009-04-30  6:58                                 ` [PATCH 0/4] powerpc: tlbie implementation for PowerPC ISA 2.06 and cleanups for ppc-opcode.h Michael Neuling
2009-04-30  6:58                                   ` [PATCH 1/4] powerpc: Cleanup macros in ppc-opcode.h Michael Neuling
2009-04-30 11:27                                     ` Kumar Gala
2009-04-30  6:58                                   ` [PATCH 2/4] powerpc: Move VSX load/stores into ppc-opcode.h Michael Neuling
2009-04-30 11:28                                     ` Kumar Gala
2009-04-30  6:58                                   ` [PATCH 4/4] powerpc: Add 2.06 tlbie mnemonics Michael Neuling
2009-04-30  6:58                                   ` [PATCH 3/4] powerpc: Enable MMU feature sections for inline asm Michael Neuling
2009-04-29  7:27                           ` [PATCH 0/2] powerpc: tlbie implementation for PowerPC ISA 2.06 Michael Neuling
2009-04-29  7:27                             ` [PATCH 2/2] powerpc: Add 2.06 tlbie mnemonics Michael Neuling
2009-04-29  7:27                             ` [PATCH 1/2] powerpc: Enable MMU feature sections for inline asm Michael Neuling
2009-04-29  0:26                     ` [PATCH 2/2] powerpc: Add 2.06 tlbie mnemonics Michael Neuling
2009-04-24  6:24 ` [PATCH 1/2] powerpc: Enable CPU feature sections for inline asm Michael Neuling

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090424062431.D3803120E7@localhost.localdomain \
    --to=mikey@neuling.org \
    --cc=benh@kernel.crashing.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=miltonm@bga.com \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).