@@ -45,6 +45,10 @@ size_t length64=sizeof(value64);
45
45
#define CPU_NEOVERSEN1 11
46
46
#define CPU_NEOVERSEV1 16
47
47
#define CPU_NEOVERSEN2 17
48
+ #define CPU_CORTEXX1 18
49
+ #define CPU_CORTEXX2 19
50
+ #define CPU_CORTEXA510 20
51
+ #define CPU_CORTEXA710 21
48
52
// Qualcomm
49
53
#define CPU_FALKOR 6
50
54
// Cavium
@@ -59,6 +63,8 @@ size_t length64=sizeof(value64);
59
63
#define CPU_VORTEX 13
60
64
// Fujitsu
61
65
#define CPU_A64FX 15
66
+ // Phytium
67
+ #define CPU_FT2000 22
62
68
63
69
static char * cpuname [] = {
64
70
"UNKNOWN" ,
@@ -73,12 +79,17 @@ static char *cpuname[] = {
73
79
"TSV110" ,
74
80
"EMAG8180" ,
75
81
"NEOVERSEN1" ,
76
- "NEOVERSEV1"
77
- "NEOVERSEN2"
78
82
"THUNDERX3T110" ,
79
83
"VORTEX" ,
80
84
"CORTEXA55" ,
81
- "A64FX"
85
+ "A64FX" ,
86
+ "NEOVERSEV1" ,
87
+ "NEOVERSEN2" ,
88
+ "CORTEXX1" ,
89
+ "CORTEXX2" ,
90
+ "CORTEXA510" ,
91
+ "CORTEXA710" ,
92
+ "FT2000"
82
93
};
83
94
84
95
static char * cpuname_lower [] = {
@@ -94,12 +105,17 @@ static char *cpuname_lower[] = {
94
105
"tsv110" ,
95
106
"emag8180" ,
96
107
"neoversen1" ,
97
- "neoversev1" ,
98
- "neoversen2" ,
99
108
"thunderx3t110" ,
100
109
"vortex" ,
101
110
"cortexa55" ,
102
- "a64fx"
111
+ "a64fx" ,
112
+ "neoversev1" ,
113
+ "neoversen2" ,
114
+ "cortexx1" ,
115
+ "cortexx2" ,
116
+ "cortexa510" ,
117
+ "cortexa710" ,
118
+ "ft2000"
103
119
};
104
120
105
121
int get_feature (char * search )
@@ -182,6 +198,14 @@ int detect(void)
182
198
return CPU_NEOVERSEN2 ;
183
199
else if (strstr (cpu_part , "0xd05" ))
184
200
return CPU_CORTEXA55 ;
201
+ else if (strstr (cpu_part , "0xd46" ))
202
+ return CPU_CORTEXA510 ;
203
+ else if (strstr (cpu_part , "0xd47" ))
204
+ return CPU_CORTEXA710 ;
205
+ else if (strstr (cpu_part , "0xd44" ))
206
+ return CPU_CORTEXX1 ;
207
+ else if (strstr (cpu_part , "0xd4c" ))
208
+ return CPU_CORTEXX2 ;
185
209
}
186
210
// Qualcomm
187
211
else if (strstr (cpu_implementer , "0x51" ) && strstr (cpu_part , "0xc00" ))
@@ -202,6 +226,13 @@ int detect(void)
202
226
// Fujitsu
203
227
else if (strstr (cpu_implementer , "0x46" ) && strstr (cpu_part , "0x001" ))
204
228
return CPU_A64FX ;
229
+ // Apple
230
+ else if (strstr (cpu_implementer , "0x61" ) && strstr (cpu_part , "0x022" ))
231
+ return CPU_VORTEX ;
232
+ // Phytium
233
+ else if (strstr (cpu_implementer , "0x70" ) && (strstr (cpu_part , "0x660" ) || strstr (cpu_part , "0x661" )
234
+ || strstr (cpu_part , "0x662" ) || strstr (cpu_part , "0x663" )))
235
+ return CPU_FT2000 ;
205
236
}
206
237
207
238
p = (char * ) NULL ;
@@ -382,7 +413,24 @@ void get_cpuconfig(void)
382
413
printf ("#define DTB_DEFAULT_ENTRIES 48\n" );
383
414
printf ("#define DTB_SIZE 4096\n" );
384
415
break ;
385
-
416
+ case CPU_CORTEXA510 :
417
+ case CPU_CORTEXA710 :
418
+ case CPU_CORTEXX1 :
419
+ case CPU_CORTEXX2 :
420
+ printf ("#define ARMV9\n" );
421
+ printf ("#define %s\n" , cpuname [d ]);
422
+ printf ("#define L1_CODE_SIZE 65536\n" );
423
+ printf ("#define L1_CODE_LINESIZE 64\n" );
424
+ printf ("#define L1_CODE_ASSOCIATIVE 4\n" );
425
+ printf ("#define L1_DATA_SIZE 65536\n" );
426
+ printf ("#define L1_DATA_LINESIZE 64\n" );
427
+ printf ("#define L1_DATA_ASSOCIATIVE 4\n" );
428
+ printf ("#define L2_SIZE 1048576\n" );
429
+ printf ("#define L2_LINESIZE 64\n" );
430
+ printf ("#define L2_ASSOCIATIVE 8\n" );
431
+ printf ("#define DTB_DEFAULT_ENTRIES 64\n" );
432
+ printf ("#define DTB_SIZE 4096\n" );
433
+ break ;
386
434
case CPU_FALKOR :
387
435
printf ("#define FALKOR\n" );
388
436
printf ("#define L1_CODE_SIZE 65536\n" );
@@ -469,9 +517,9 @@ void get_cpuconfig(void)
469
517
printf ("#define DTB_DEFAULT_ENTRIES 64 \n" );
470
518
printf ("#define DTB_SIZE 4096 \n" );
471
519
break ;
472
- #ifdef __APPLE__
473
520
case CPU_VORTEX :
474
521
printf ("#define VORTEX \n" );
522
+ #ifdef __APPLE__
475
523
sysctlbyname ("hw.l1icachesize" ,& value64 ,& length64 ,NULL ,0 );
476
524
printf ("#define L1_CODE_SIZE %lld \n" ,value64 );
477
525
sysctlbyname ("hw.cachelinesize" ,& value64 ,& length64 ,NULL ,0 );
@@ -480,10 +528,10 @@ void get_cpuconfig(void)
480
528
printf ("#define L1_DATA_SIZE %lld \n" ,value64 );
481
529
sysctlbyname ("hw.l2cachesize" ,& value64 ,& length64 ,NULL ,0 );
482
530
printf ("#define L2_SIZE %lld \n" ,value64 );
531
+ #endif
483
532
printf ("#define DTB_DEFAULT_ENTRIES 64 \n" );
484
533
printf ("#define DTB_SIZE 4096 \n" );
485
534
break ;
486
- #endif
487
535
case CPU_A64FX :
488
536
printf ("#define A64FX\n" );
489
537
printf ("#define L1_CODE_SIZE 65535\n" );
@@ -494,6 +542,16 @@ void get_cpuconfig(void)
494
542
printf ("#define DTB_DEFAULT_ENTRIES 64\n" );
495
543
printf ("#define DTB_SIZE 4096\n" );
496
544
break ;
545
+ case CPU_FT2000 :
546
+ printf ("#define FT2000\n" );
547
+ printf ("#define L1_CODE_SIZE 32768\n" );
548
+ printf ("#define L1_DATA_SIZE 32768\n" );
549
+ printf ("#define L1_DATA_LINESIZE 64\n" );
550
+ printf ("#define L2_SIZE 33554432\n" );
551
+ printf ("#define L2_LINESIZE 64\n" );
552
+ printf ("#define DTB_DEFAULT_ENTRIES 64\n" );
553
+ printf ("#define DTB_SIZE 4096\n" );
554
+ break ;
497
555
}
498
556
get_cpucount ();
499
557
}
0 commit comments