Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Makefile.arm64
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions TargetList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ THUNDERX
THUNDERX2T99
TSV110
THUNDERX3T110
VORTEX

9.System Z:
ZARCH_GENERIC
Expand Down
35 changes: 32 additions & 3 deletions cpuid_arm64.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -45,6 +50,8 @@
#define CPU_TSV110 9
// Ampere
#define CPU_EMAG8180 10
// Apple
#define CPU_VORTEX 13

static char *cpuname[] = {
"UNKNOWN",
Expand All @@ -59,7 +66,8 @@ static char *cpuname[] = {
"TSV110",
"EMAG8180",
"NEOVERSEN1",
"THUNDERX3T110"
"THUNDERX3T110",
"VORTEX"
};

static char *cpuname_lower[] = {
Expand All @@ -75,7 +83,8 @@ static char *cpuname_lower[] = {
"tsv110",
"emag8180",
"neoversen1",
"thunderx3t110"
"thunderx3t110",
"vortex"
};

int get_feature(char *search)
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
}


Expand Down Expand Up @@ -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();
}
Expand Down
1 change: 1 addition & 0 deletions kernel/arm64/KERNEL.VORTEX
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include $(KERNELDIR)/KERNEL.ARMV8