Skip to content

Commit aa90ab4

Browse files
author
davidz-ampere
committed
Add support for Ampere AmpereOne processors
1 parent 8473006 commit aa90ab4

File tree

5 files changed

+7
-40
lines changed

5 files changed

+7
-40
lines changed

Makefile.arm64

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -191,22 +191,12 @@ endif
191191
endif
192192
endif
193193

194-
# Detect Ampere AmpereOne(ampere1) processors.
194+
# Detect Ampere AmpereOne(ampere1,ampere1a) processors.
195195
ifeq ($(CORE), AMPERE1)
196196
ifeq (1, $(filter 1,$(GCCVERSIONGTEQ12) $(ISCLANG)))
197-
CCOMMON_OPT += -march=armv8.6-a -mtune=ampere1
197+
CCOMMON_OPT += -march=armv8.6-a+crypto+crc+fp16+sha3+rng
198198
ifneq ($(F_COMPILER), NAG)
199-
FCOMMON_OPT += -march=armv8.6-a -mtune=ampere1
200-
endif
201-
endif
202-
endif
203-
204-
# Detect Ampere AmpereOne(ampere1a) processors.
205-
ifeq ($(CORE), AMPERE1A)
206-
ifeq (1, $(filter 1,$(GCCVERSIONGTEQ13) $(ISCLANG)))
207-
CCOMMON_OPT += -march=armv8.6-a -mtune=ampere1a
208-
ifneq ($(F_COMPILER), NAG)
209-
FCOMMON_OPT += -march=armv8.6-a -mtune=ampere1a
199+
FCOMMON_OPT += -march=armv8.6-a+crypto+crc+fp16+sha3+rng
210200
endif
211201
endif
212202
endif

cpuid_arm64.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ size_t length64=sizeof(value64);
8080
// Ampere
8181
#define CPU_EMAG8180 10
8282
#define CPU_AMPERE1 25
83-
#define CPU_AMPERE1A 26
8483
// Apple
8584
#define CPU_VORTEX 13
8685
// Fujitsu
@@ -114,8 +113,7 @@ static char *cpuname[] = {
114113
"FT2000",
115114
"CORTEXA76",
116115
"NEOVERSEV2",
117-
"AMPERE1",
118-
"AMPERE1A"
116+
"AMPERE1"
119117
};
120118

121119
static char *cpuname_lower[] = {
@@ -341,10 +339,8 @@ int detect(void)
341339
else if (strstr(cpu_implementer, "0x50") && strstr(cpu_part, "0x000"))
342340
return CPU_EMAG8180;
343341
else if (strstr(cpu_implementer, "0xc0")) {
344-
if (strstr(cpu_part, "0xac3"))
342+
if (strstr(cpu_part, "0xac3") || strstr(cpu_part, "0xac4"))
345343
return CPU_AMPERE1;
346-
else if (strstr(cpu_part, "0xac4"))
347-
return CPU_AMPERE1A;
348344
}
349345
// Fujitsu
350346
else if (strstr(cpu_implementer, "0x46") && strstr(cpu_part, "0x001"))
@@ -697,7 +693,6 @@ void get_cpuconfig(void)
697693
break;
698694

699695
case CPU_AMPERE1:
700-
case CPU_AMPERE1A:
701696
printf("#define %s\n", cpuname[d]);
702697
printf("#define L1_CODE_SIZE 16384\n");
703698
printf("#define L1_CODE_LINESIZE 64\n");

getarch.c

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
159159
/* #define FORCE_CK860FV */
160160
/* #define FORCE_GENERIC */
161161
/* #define FORCE_AMPERE1 */
162-
/* #define FORCE_AMPERE1A */
163162

164163
#ifdef FORCE_P2
165164
#define FORCE
@@ -1603,27 +1602,11 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16031602
"-DL2_SIZE=2097152 -DL2_LINESIZE=64 -DL2_ASSOCIATIVE=16 " \
16041603
"-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
16051604
"-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DARMV8 " \
1606-
"-march=armv8.6-a -mtune=ampere1"
1605+
"-march=armv8.6-a+crypto+crc+fp16+sha3+rng"
16071606
#define LIBNAME "ampere1"
16081607
#define CORENAME "AMPERE1"
16091608
#endif
16101609

1611-
#ifdef FORCE_AMPERE1A
1612-
#define FORCE
1613-
#define ARCHITECTURE "ARM64"
1614-
#define SUBARCHITECTURE "AMPERE1A"
1615-
#define SUBDIRNAME "arm64"
1616-
#define ARCHCONFIG "-DAMPERE1A " \
1617-
"-DL1_CODE_SIZE=16384 -DL1_CODE_LINESIZE=64 -DL1_CODE_ASSOCIATIVE=4 " \
1618-
"-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=64 -DL1_DATA_ASSOCIATIVE=4 " \
1619-
"-DL2_SIZE=2097152 -DL2_LINESIZE=64 -DL2_ASSOCIATIVE=16 " \
1620-
"-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
1621-
"-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DARMV8 " \
1622-
"-march=armv8.6-a -mtune=ampere1a"
1623-
#define LIBNAME "ampere1a"
1624-
#define CORENAME "AMPERE1A"
1625-
#endif
1626-
16271610
#ifdef FORCE_THUNDERX3T110
16281611
#define ARMV8
16291612
#define FORCE

kernel/arm64/KERNEL.AMPERE1A

Lines changed: 0 additions & 1 deletion
This file was deleted.

param.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3635,7 +3635,7 @@ is a big desktop or server with abundant cache rather than a phone or embedded d
36353635
#define CGEMM_DEFAULT_R 4096
36363636
#define ZGEMM_DEFAULT_R 4096
36373637

3638-
#elif defined(AMPERE1) || defined(AMPERE1A)
3638+
#elif defined(AMPERE1)
36393639

36403640
#if defined(XDOUBLE) || defined(DOUBLE)
36413641
#define SWITCH_RATIO 8

0 commit comments

Comments
 (0)