Merge pull request #2816 from martin-frbg/silicon

Add basic support for Apple Vortex (ARM64) cpu
This commit is contained in:
Martin Kroeker 2020-09-05 19:17:59 +02:00 committed by GitHub
commit ed0f2d3dd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 39 additions and 3 deletions

View File

@ -66,6 +66,11 @@ FCOMMON_OPT += -march=armv8.1-a -mtune=thunderx2t99
endif
endif
ifeq ($(CORE), VORTEX)
CCOMMON_OPT += -march=armv8.3-a
FCOMMON_OPT += -march=armv8.3-a
endif
ifeq ($(GCCVERSIONGTEQ9), 1)
ifeq ($(CORE), TSV110)
CCOMMON_OPT += -march=armv8.2-a -mtune=tsv110

View File

@ -98,6 +98,7 @@ THUNDERX
THUNDERX2T99
TSV110
THUNDERX3T110
VORTEX
9.System Z:
ZARCH_GENERIC

View File

@ -26,6 +26,11 @@
*****************************************************************************/
#include <string.h>
#ifdef OS_DARWIN
#include <sys/sysctl.h>
int32_t value;
size_t length=sizeof(value);
#endif
#define CPU_UNKNOWN 0
#define CPU_ARMV8 1
@ -45,6 +50,8 @@
#define CPU_TSV110 9
// Ampere
#define CPU_EMAG8180 10
// Apple
#define CPU_VORTEX 13
static char *cpuname[] = {
"UNKNOWN",
@ -59,7 +66,8 @@ static char *cpuname[] = {
"TSV110",
"EMAG8180",
"NEOVERSEN1",
"THUNDERX3T110"
"THUNDERX3T110",
"VORTEX"
};
static char *cpuname_lower[] = {
@ -75,7 +83,8 @@ static char *cpuname_lower[] = {
"tsv110",
"emag8180",
"neoversen1",
"thunderx3t110"
"thunderx3t110",
"vortex"
};
int get_feature(char *search)
@ -198,6 +207,10 @@ int detect(void)
}
#else
#ifdef DARWIN
sysctlbyname("hw.cpufamily",&value,&length,NULL,0);
if (value ==131287967) return CPU_VORTEX;
#endif
return CPU_ARMV8;
#endif
@ -247,7 +260,10 @@ int n=0;
printf("#define NUM_CORES %d\n",n);
#endif
#ifdef DARWIN
sysctlbyname("hw.physicalcpu_max",&value,&length,NULL,0);
printf("#define NUM_CORES %d\n",value);
#endif
}
@ -398,6 +414,19 @@ void get_cpuconfig(void)
printf("#define DTB_DEFAULT_ENTRIES 64 \n");
printf("#define DTB_SIZE 4096 \n");
break;
#ifdef DARWIN
case CPU_VORTEX:
printf("#define VORTEX \n");
sysctlbyname("hw.l1icachesize",&value,&length,NULL,0);
printf("#define L1_CODE_SIZE %d \n",value);
sysctlbyname("hw.cachelinesize",&value,&length,NULL,0);
printf("#define L1_CODE_LINESIZE %d \n",value);
sysctlbyname("hw.l1dcachesize",&value,&length,NULL,0);
printf("#define L1_DATA_SIZE %d \n",value);
sysctlbyname("hw.l2dcachesize",&value,&length,NULL,0);
printf("#define L2_DATA_SIZE %d \n",value);
break;
#endif
}
get_cpucount();
}

View File

@ -0,0 +1 @@
include $(KERNELDIR)/KERNEL.ARMV8