Recognize Ampere EMAG8180
authorMartin Kroeker <martin@ruby.chemie.uni-freiburg.de>
Wed, 19 Feb 2020 17:49:13 +0000 (18:49 +0100)
committerGitHub <noreply@github.com>
Wed, 19 Feb 2020 17:49:13 +0000 (18:49 +0100)
cpuid_arm64.c

index 9e019fe..5868af7 100644 (file)
@@ -41,6 +41,8 @@
 #define CPU_THUNDERX2T99  8
 //Hisilicon
 #define CPU_TSV110        9
+// Ampere
+#define CPU_EMAG8180    10
 
 static char *cpuname[] = {
   "UNKNOWN",
@@ -52,7 +54,8 @@ static char *cpuname[] = {
   "FALKOR",
   "THUNDERX",
   "THUNDERX2T99",
-  "TSV110"
+  "TSV110",
+  "EMAG8180"
 };
 
 static char *cpuname_lower[] = {
@@ -65,7 +68,8 @@ static char *cpuname_lower[] = {
   "falkor",
   "thunderx",
   "thunderx2t99",
-  "tsv110"
+  "tsv110",
+  "emag8180"
 };
 
 int get_feature(char *search)
@@ -152,6 +156,9 @@ int detect(void)
     // HiSilicon
     else if (strstr(cpu_implementer, "0x48") && strstr(cpu_part, "0xd01"))
                         return CPU_TSV110;
+    // Ampere
+    else if (strstr(cpu_implementer, "0x50") && strstr(cpu_part, "0x000"))
+                        return CPU_EMAG8180;
        }
 
        p = (char *) NULL ;
@@ -335,6 +342,18 @@ void get_cpuconfig(void)
                        printf("#define DTB_DEFAULT_ENTRIES  64       \n");
                        printf("#define DTB_SIZE             4096     \n");
                        break;  
+
+               case CPU_EMAG8180:
+      // Minimum parameters for ARMv8 (based on A53)
+       printf("#define EMAG8180\n");
+       printf("#define L1_CODE_SIZE 32768\n");
+       printf("#define L1_DATA_SIZE 32768\n");
+       printf("#define L1_DATA_LINESIZE 64\n");
+       printf("#define L2_SIZE 262144\n");
+       printf("#define L2_LINESIZE 64\n");
+       printf("#define DTB_DEFAULT_ENTRIES 64\n");
+       printf("#define DTB_SIZE 4096\n");
+
        }
        get_cpucount();
 }