ARM64: Add Cavium THUNDERX Target
authorAndrew Pinski <apinski@cavium.com>
Tue, 10 Jan 2017 06:27:36 +0000 (11:57 +0530)
committerAshwin Sekhar T K <ashwin.sekhar@cavium.com>
Tue, 10 Jan 2017 09:31:37 +0000 (15:01 +0530)
Makefile.arm64
TargetList.txt
cpuid_arm64.c
getarch.c
kernel/arm64/KERNEL.THUNDERX [new file with mode: 0644]
param.h

index 33e76d0..4379f2a 100644 (file)
@@ -14,3 +14,7 @@ CCOMMON_OPT += -mtune=vulcan -mcpu=vulcan
 FCOMMON_OPT += -mtune=vulcan -mcpu=vulcan
 endif
 
+ifeq ($(CORE), THUNDERX)
+CCOMMON_OPT += -mtune=thunderx -mcpu=thunderx
+FCOMMON_OPT += -mtune=thunderx -mcpu=thunderx
+endif
index 904dbe8..3bbabe3 100644 (file)
@@ -81,4 +81,5 @@ ARMV5
 ARMV8
 CORTEXA57
 VULCAN
+THUNDERX
 
index f074f9b..e36213e 100644 (file)
 #define CPU_ARMV8              1
 #define CPU_CORTEXA57          2
 #define CPU_VULCAN             3
+#define CPU_THUNDERX           4
 
 static char *cpuname[] = {
   "UNKNOWN",
   "ARMV8" ,
-  "CORTEXA57"
-  "VULCAN"
+  "CORTEXA57",
+  "VULCAN",
+  "THUNDERX"
 };
 
 static char *cpuname_lower[] = {
   "unknown",
   "armv8" ,
-  "cortexa57"
-  "vulcan"
+  "cortexa57",
+  "vulcan",
+  "thunderx"
 };
 
 int get_feature(char *search)
@@ -89,9 +92,9 @@ int detect(void)
 
        FILE *infile;
        char buffer[512], *p, *cpu_part, *cpu_implementer;
-       p = (char *) NULL ;
+       p = (char *) NULL ;
 
-       infile = fopen("/proc/cpuinfo", "r");
+       infile = fopen("/proc/cpuinfo", "r");
        while (fgets(buffer, sizeof(buffer), infile)) {
 
                if (!strncmp("CPU part", buffer, 8)) {
@@ -109,6 +112,8 @@ int detect(void)
                        return CPU_CORTEXA57;
                else if (strstr(cpu_part, "0x516") && strstr(cpu_implementer, "0x42"))
                        return CPU_VULCAN;
+               else if (strstr(cpu_part, "0x0a1") && strstr(cpu_implementer, "0x43"))
+                       return CPU_THUNDERX;
        }
 
        p = (char *) NULL ;
@@ -221,6 +226,18 @@ void get_cpuconfig(void)
                        printf("#define DTB_DEFAULT_ENTRIES 64\n");
                        printf("#define DTB_SIZE 4096\n");
                        break;
+
+               case CPU_THUNDERX:
+                       printf("#define ARMV8\n");
+                       printf("#define THUNDERX\n");
+                       printf("#define L1_DATA_SIZE 32768\n");
+                       printf("#define L1_DATA_LINESIZE 128\n");
+                       printf("#define L2_SIZE 16777216\n");
+                       printf("#define L2_LINESIZE 128\n");
+                       printf("#define DTB_DEFAULT_ENTRIES 64\n");
+                       printf("#define DTB_SIZE 4096\n");
+                       printf("#define L2_ASSOCIATIVE 16\n");
+                       break;
        }
 }
 
index 41c181e..336faa6 100644 (file)
--- a/getarch.c
+++ b/getarch.c
@@ -884,7 +884,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #ifdef FORCE_CORTEXA57
 #define FORCE
 #define ARCHITECTURE    "ARM64"
-#define SUBARCHITECTURE "ARMV8"
+#define SUBARCHITECTURE "CORTEXA57"
 #define SUBDIRNAME      "arm64"
 #define ARCHCONFIG   "-DCORTEXA57 " \
        "-DL1_CODE_SIZE=49152 -DL1_CODE_LINESIZE=64 -DL1_CODE_ASSOCIATIVE=3 " \
@@ -900,7 +900,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #ifdef FORCE_VULCAN
 #define FORCE
 #define ARCHITECTURE    "ARM64"
-#define SUBARCHITECTURE "ARMV8"
+#define SUBARCHITECTURE "VULCAN"
 #define SUBDIRNAME      "arm64"
 #define ARCHCONFIG   "-DVULCAN " \
        "-DL1_CODE_SIZE=32768 -DL1_CODE_LINESIZE=64 -DL1_CODE_ASSOCIATIVE=8 " \
@@ -914,6 +914,20 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #else
 #endif
 
+#ifdef FORCE_THUNDERX
+#define FORCE
+#define ARCHITECTURE    "ARM64"
+#define SUBARCHITECTURE "THUNDERX"
+#define SUBDIRNAME      "arm64"
+#define ARCHCONFIG   "-DTHUNDERX " \
+       "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=128 " \
+       "-DL2_SIZE=16777216 -DL2_LINESIZE=128 -DL2_ASSOCIATIVE=16 " \
+       "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 "
+#define LIBNAME   "thunderx"
+#define CORENAME  "THUNDERX"
+#else
+#endif
+
 #ifndef FORCE
 
 #if defined(__powerpc__) || defined(__powerpc) || defined(powerpc) || \
diff --git a/kernel/arm64/KERNEL.THUNDERX b/kernel/arm64/KERNEL.THUNDERX
new file mode 100644 (file)
index 0000000..e3efef1
--- /dev/null
@@ -0,0 +1 @@
+include $(KERNELDIR)/KERNEL.ARMV8
diff --git a/param.h b/param.h
index 3860f43..31388fe 100644 (file)
--- a/param.h
+++ b/param.h
@@ -2423,6 +2423,44 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #define SYMV_P 16
 #endif
 
+#if defined(THUNDERX)
+#define SNUMOPT                2
+#define DNUMOPT                2
+
+#define GEMM_DEFAULT_OFFSET_A 0
+#define GEMM_DEFAULT_OFFSET_B 0
+#define GEMM_DEFAULT_ALIGN 0x03fffUL
+
+#define SGEMM_DEFAULT_UNROLL_M  4
+#define SGEMM_DEFAULT_UNROLL_N  4
+
+#define DGEMM_DEFAULT_UNROLL_M  2
+#define DGEMM_DEFAULT_UNROLL_N  2
+
+#define CGEMM_DEFAULT_UNROLL_M  2
+#define CGEMM_DEFAULT_UNROLL_N  2
+
+#define ZGEMM_DEFAULT_UNROLL_M  2
+#define ZGEMM_DEFAULT_UNROLL_N  2
+
+#define SGEMM_DEFAULT_P        128
+#define DGEMM_DEFAULT_P        128
+#define CGEMM_DEFAULT_P 96
+#define ZGEMM_DEFAULT_P 64
+
+#define SGEMM_DEFAULT_Q 240
+#define DGEMM_DEFAULT_Q 120
+#define CGEMM_DEFAULT_Q 120
+#define ZGEMM_DEFAULT_Q 120
+
+#define SGEMM_DEFAULT_R 12288
+#define DGEMM_DEFAULT_R 8192
+#define CGEMM_DEFAULT_R 4096
+#define ZGEMM_DEFAULT_R 4096
+
+
+#define SYMV_P 16
+#endif
 
 #if defined(ARMV5)
 #define SNUMOPT                2