Module Name:    src
Committed By:   simonb
Date:           Sun Jun 14 08:43:08 UTC 2020

Modified Files:
        src/sys/arch/mips/include: cache_octeon.h

Log Message:
Define Octeon Cavium cache layouts for various cnMIPS cores.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/mips/include/cache_octeon.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/mips/include/cache_octeon.h
diff -u src/sys/arch/mips/include/cache_octeon.h:1.3 src/sys/arch/mips/include/cache_octeon.h:1.4
--- src/sys/arch/mips/include/cache_octeon.h:1.3	Thu Apr 11 09:18:55 2019
+++ src/sys/arch/mips/include/cache_octeon.h	Sun Jun 14 08:43:07 2020
@@ -1,4 +1,7 @@
-/*	$NetBSD: cache_octeon.h,v 1.3 2019/04/11 09:18:55 simonb Exp $	*/
+/*	$NetBSD: cache_octeon.h,v 1.4 2020/06/14 08:43:07 simonb Exp $	*/
+
+#ifndef _MIPS_CACHE_OCTEON_H_
+#define _MIPS_CACHE_OCTEON_H_
 
 #define	CACHE_OCTEON_I			0
 #define	CACHE_OCTEON_D			1
@@ -8,6 +11,31 @@
 #define	CACHEOP_OCTEON_BITMAP_STORE		(3 << 2)	/* I */
 #define	CACHEOP_OCTEON_VIRTUAL_TAG_INV		(4 << 2)	/* D */
 
+#define	OCTEON_CACHELINE_SIZE			128
+
+/*
+ * Note that for the Dcache the 50XX manual says 1 set per way (Config1
+ * register - DS=0 ("... actual is 1"), p173) as does U-boot sources,
+ * however this only adds up to an 8kB Dcache.  The 50XX manual
+ * elsewhere references a 16kB Dcache as does the CN50XX product brief.
+ * The original NetBSD code, current OpenBSD and Linux code all use 2
+ * sets per way. lmbench's "cache" program also detects a 16kB Dcache.
+ * So we assume that all Octeon 1 and Octeon Plus cores have a 16kB
+ * Dcache.
+ */
+#define	OCTEON_I_DCACHE_WAYS			64
+#define	OCTEON_I_DCACHE_SETS			2
+
+#define	OCTEON_II_DCACHE_SETS			8
+#define	OCTEON_II_DCACHE_WAYS			32
+#define	OCTEON_II_ICACHE_SETS			8
+#define	OCTEON_II_ICACHE_WAYS			37
+
+#define	OCTEON_III_DCACHE_SETS			8
+#define	OCTEON_III_DCACHE_WAYS			32
+#define	OCTEON_III_ICACHE_SETS			16
+#define	OCTEON_III_ICACHE_WAYS			39
+
 #if !defined(_LOCORE)
 
 /*
@@ -54,3 +82,4 @@ void octeon_pdcache_inv_range_index(vadd
 void octeon_pdcache_wb_range(register_t va, vsize_t size);
 
 #endif /* !_LOCORE */
+#endif /* _MIPS_CACHE_OCTEON_H_ */

Reply via email to