@@ -79,6 +79,7 @@ size_t length64=sizeof(value64);
7979#define CPU_TSV110 9
8080// Ampere
8181#define CPU_EMAG8180 10
82+ #define CPU_AMPERE1 25
8283// Apple
8384#define CPU_VORTEX 13
8485// Fujitsu
@@ -111,7 +112,8 @@ static char *cpuname[] = {
111112 "CORTEXA710" ,
112113 "FT2000" ,
113114 "CORTEXA76" ,
114- "NEOVERSEV2"
115+ "NEOVERSEV2" ,
116+ "AMPERE1"
115117};
116118
117119static char * cpuname_lower [] = {
@@ -139,7 +141,9 @@ static char *cpuname_lower[] = {
139141 "cortexa710" ,
140142 "ft2000" ,
141143 "cortexa76" ,
142- "neoversev2"
144+ "neoversev2" ,
145+ "ampere1" ,
146+ "ampere1a"
143147};
144148
145149static int cpulowperf = 0 ;
@@ -334,6 +338,10 @@ int detect(void)
334338 // Ampere
335339 else if (strstr (cpu_implementer , "0x50" ) && strstr (cpu_part , "0x000" ))
336340 return CPU_EMAG8180 ;
341+ else if (strstr (cpu_implementer , "0xc0" )) {
342+ if (strstr (cpu_part , "0xac3" ) || strstr (cpu_part , "0xac4" ))
343+ return CPU_AMPERE1 ;
344+ }
337345 // Fujitsu
338346 else if (strstr (cpu_implementer , "0x46" ) && strstr (cpu_part , "0x001" ))
339347 return CPU_A64FX ;
@@ -684,6 +692,21 @@ void get_cpuconfig(void)
684692 printf ("#define DTB_SIZE 4096\n" );
685693 break ;
686694
695+ case CPU_AMPERE1 :
696+ printf ("#define %s\n" , cpuname [d ]);
697+ printf ("#define L1_CODE_SIZE 16384\n" );
698+ printf ("#define L1_CODE_LINESIZE 64\n" );
699+ printf ("#define L1_CODE_ASSOCIATIVE 4\n" );
700+ printf ("#define L1_DATA_SIZE 65536\n" );
701+ printf ("#define L1_DATA_LINESIZE 64\n" );
702+ printf ("#define L1_DATA_ASSOCIATIVE 4\n" );
703+ printf ("#define L2_SIZE 2097152\n" );
704+ printf ("#define L2_LINESIZE 64\n" );
705+ printf ("#define L2_ASSOCIATIVE 8\n" );
706+ printf ("#define DTB_DEFAULT_ENTRIES 64\n" );
707+ printf ("#define DTB_SIZE 4096\n" );
708+ break ;
709+
687710 case CPU_THUNDERX3T110 :
688711 printf ("#define THUNDERX3T110 \n" );
689712 printf ("#define L1_CODE_SIZE 65536 \n" );
0 commit comments