Merge pull request #2816 from martin-frbg/silicon
Add basic support for Apple Vortex (ARM64) cpu
This commit is contained in:
commit
ed0f2d3dd7
|
@ -66,6 +66,11 @@ FCOMMON_OPT += -march=armv8.1-a -mtune=thunderx2t99
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CORE), VORTEX)
|
||||||
|
CCOMMON_OPT += -march=armv8.3-a
|
||||||
|
FCOMMON_OPT += -march=armv8.3-a
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(GCCVERSIONGTEQ9), 1)
|
ifeq ($(GCCVERSIONGTEQ9), 1)
|
||||||
ifeq ($(CORE), TSV110)
|
ifeq ($(CORE), TSV110)
|
||||||
CCOMMON_OPT += -march=armv8.2-a -mtune=tsv110
|
CCOMMON_OPT += -march=armv8.2-a -mtune=tsv110
|
||||||
|
|
|
@ -98,6 +98,7 @@ THUNDERX
|
||||||
THUNDERX2T99
|
THUNDERX2T99
|
||||||
TSV110
|
TSV110
|
||||||
THUNDERX3T110
|
THUNDERX3T110
|
||||||
|
VORTEX
|
||||||
|
|
||||||
9.System Z:
|
9.System Z:
|
||||||
ZARCH_GENERIC
|
ZARCH_GENERIC
|
||||||
|
|
|
@ -26,6 +26,11 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include <string.h>
|
#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_UNKNOWN 0
|
||||||
#define CPU_ARMV8 1
|
#define CPU_ARMV8 1
|
||||||
|
@ -45,6 +50,8 @@
|
||||||
#define CPU_TSV110 9
|
#define CPU_TSV110 9
|
||||||
// Ampere
|
// Ampere
|
||||||
#define CPU_EMAG8180 10
|
#define CPU_EMAG8180 10
|
||||||
|
// Apple
|
||||||
|
#define CPU_VORTEX 13
|
||||||
|
|
||||||
static char *cpuname[] = {
|
static char *cpuname[] = {
|
||||||
"UNKNOWN",
|
"UNKNOWN",
|
||||||
|
@ -59,7 +66,8 @@ static char *cpuname[] = {
|
||||||
"TSV110",
|
"TSV110",
|
||||||
"EMAG8180",
|
"EMAG8180",
|
||||||
"NEOVERSEN1",
|
"NEOVERSEN1",
|
||||||
"THUNDERX3T110"
|
"THUNDERX3T110",
|
||||||
|
"VORTEX"
|
||||||
};
|
};
|
||||||
|
|
||||||
static char *cpuname_lower[] = {
|
static char *cpuname_lower[] = {
|
||||||
|
@ -75,7 +83,8 @@ static char *cpuname_lower[] = {
|
||||||
"tsv110",
|
"tsv110",
|
||||||
"emag8180",
|
"emag8180",
|
||||||
"neoversen1",
|
"neoversen1",
|
||||||
"thunderx3t110"
|
"thunderx3t110",
|
||||||
|
"vortex"
|
||||||
};
|
};
|
||||||
|
|
||||||
int get_feature(char *search)
|
int get_feature(char *search)
|
||||||
|
@ -198,6 +207,10 @@ int detect(void)
|
||||||
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
#ifdef DARWIN
|
||||||
|
sysctlbyname("hw.cpufamily",&value,&length,NULL,0);
|
||||||
|
if (value ==131287967) return CPU_VORTEX;
|
||||||
|
#endif
|
||||||
return CPU_ARMV8;
|
return CPU_ARMV8;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -247,7 +260,10 @@ int n=0;
|
||||||
|
|
||||||
printf("#define NUM_CORES %d\n",n);
|
printf("#define NUM_CORES %d\n",n);
|
||||||
#endif
|
#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_DEFAULT_ENTRIES 64 \n");
|
||||||
printf("#define DTB_SIZE 4096 \n");
|
printf("#define DTB_SIZE 4096 \n");
|
||||||
break;
|
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();
|
get_cpucount();
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
include $(KERNELDIR)/KERNEL.ARMV8
|
Loading…
Reference in New Issue