diff mbox

[U-Boot,07/31] Add e6500 L2 replacement policy selection

Message ID 1363973369-26110-7-git-send-email-yorksun@freescale.com
State Superseded
Headers show

Commit Message

York Sun March 22, 2013, 5:29 p.m. UTC
From: James Yang <James.Yang@freescale.com>

Add e6500 L2 replacement policy selection.  This is compile-time config.

Signed-off-by: James Yang <James.Yang@freescale.com>
---
 arch/powerpc/cpu/mpc85xx/cpu_init.c  |    2 +-
 arch/powerpc/cpu/mpc85xx/start.S     |    1 +
 arch/powerpc/include/asm/processor.h |    9 +++++++++
 3 files changed, 11 insertions(+), 1 deletion(-)

Comments

Wolfgang Denk March 22, 2013, 9 p.m. UTC | #1
Dear York Sun,

In message <1363973369-26110-7-git-send-email-yorksun@freescale.com> you wrote:
> From: James Yang <James.Yang@freescale.com>
> 
> Add e6500 L2 replacement policy selection.  This is compile-time config.
> 
> Signed-off-by: James Yang <James.Yang@freescale.com>
> ---
>  arch/powerpc/cpu/mpc85xx/cpu_init.c  |    2 +-
>  arch/powerpc/cpu/mpc85xx/start.S     |    1 +
>  arch/powerpc/include/asm/processor.h |    9 +++++++++
>  3 files changed, 11 insertions(+), 1 deletion(-)

WARNING: line over 80 characters
#125: FILE: arch/powerpc/cpu/mpc85xx/cpu_init.c:340:
+                       out_be32(&l2cache->l2csr0, L2CSR0_L2E|L2CSR0_L2PE|L2CSR0_L2REP_MODE);

WARNING: line over 80 characters
#151: FILE: arch/powerpc/include/asm/processor.h:512:
+#define   L2CSR0_L2REP_SPLRUAGE        0x00000000      /* L2REP Streaming PLRU with Aging */


Best regards,

Wolfgang Denk
diff mbox

Patch

diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init.c b/arch/powerpc/cpu/mpc85xx/cpu_init.c
index 7b1ab26..4d307c8 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu_init.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu_init.c
@@ -337,7 +337,7 @@  int enable_cluster_l2(void)
 			while ((in_be32(&l2cache->l2csr0)
 				& (L2CSR0_L2FI|L2CSR0_L2LFC)) != 0)
 					;
-			out_be32(&l2cache->l2csr0, L2CSR0_L2E|L2CSR0_L2PE);
+			out_be32(&l2cache->l2csr0, L2CSR0_L2E|L2CSR0_L2PE|L2CSR0_L2REP_MODE);
 		}
 		i++;
 	} while (!(cluster & TP_CLUSTER_EOC));
diff --git a/arch/powerpc/cpu/mpc85xx/start.S b/arch/powerpc/cpu/mpc85xx/start.S
index 87168e2..e413e4a 100644
--- a/arch/powerpc/cpu/mpc85xx/start.S
+++ b/arch/powerpc/cpu/mpc85xx/start.S
@@ -735,6 +735,7 @@  enable_l2_cluster_l2:
 	and.	r1, r0, r4
 	bne	1b
 	lis	r4, (L2CSR0_L2E|L2CSR0_L2PE)@h
+	ori	r4, r4, (L2CSR0_L2REP_MODE)@l
 	sync
 	stw	r4, 0(r3)	/* enable L2 */
 delete_ccsr_l2_tlb:
diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h
index 5c0c438..1760aa1 100644
--- a/arch/powerpc/include/asm/processor.h
+++ b/arch/powerpc/include/asm/processor.h
@@ -507,6 +507,15 @@ 
 #define   L2CSR0_L2IO		0x00100000	/* L2 Cache Instruction Only */
 #define   L2CSR0_L2DO		0x00010000	/* L2 Cache Data Only */
 #define   L2CSR0_L2REP		0x00003000	/* L2 Line Replacement Algo */
+
+/* e6500 */
+#define   L2CSR0_L2REP_SPLRUAGE	0x00000000	/* L2REP Streaming PLRU with Aging */
+#define   L2CSR0_L2REP_FIFO	0x00001000	/* L2REP FIFO */
+#define   L2CSR0_L2REP_SPLRU	0x00002000	/* L2REP Streaming PLRU */
+#define   L2CSR0_L2REP_PLRU	0x00003000	/* L2REP PLRU */
+
+#define   L2CSR0_L2REP_MODE	L2CSR0_L2REP_SPLRUAGE
+
 #define   L2CSR0_L2FL		0x00000800	/* L2 Cache Flush */
 #define   L2CSR0_L2LFC		0x00000400	/* L2 Cache Lock Flash Clear */
 #define   L2CSR0_L2LOA		0x00000080	/* L2 Cache Lock Overflow Allocate */