config: add eMAG
authorJerry Hao OS <jerryhao@os.amperecomputing.com>
Mon, 14 Oct 2019 09:34:18 +0000 (17:34 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 20 Nov 2019 23:30:39 +0000 (00:30 +0100)
Add the make and meson based build infrastructure for the eMAG platform
from Ampere Computing corp., which is a 64-bit ARM processor with 32
Armv8 64-bit CPU cores. For more information, refer to:
https://amperecomputing.com/product/

Signed-off-by: Jerry Hao OS <jerryhao@os.amperecomputing.com>
Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
config/arm/arm64_emag_linux_gcc [new file with mode: 0644]
config/arm/meson.build
config/defconfig_arm64-emag-linux-gcc [new symlink]
config/defconfig_arm64-emag-linuxapp-gcc [new file with mode: 0644]
mk/machine/emag/rte.vars.mk [new file with mode: 0644]

diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
new file mode 100644 (file)
index 0000000..bcb147a
--- /dev/null
@@ -0,0 +1,15 @@
+[binaries]
+c = 'aarch64-linux-gnu-gcc'
+cpp = 'aarch64-linux-gnu-cpp'
+ar = 'aarch64-linux-gnu-gcc-ar'
+strip = 'aarch64-linux-gnu-strip'
+pcap-config = ''
+
+[host_machine]
+system = 'linux'
+cpu_family = 'aarch64'
+cpu = 'armv8-a'
+endian = 'little'
+
+[properties]
+implementor_id = '0x50'
index b23dac1..60f7b05 100644 (file)
@@ -50,6 +50,11 @@ flags_dpaa = [
        ['RTE_MAX_NUMA_NODES', 1],
        ['RTE_MAX_LCORE', 16],
        ['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]]
+flags_emag = [
+       ['RTE_MACHINE', '"emag"'],
+       ['RTE_CACHE_LINE_SIZE', 64],
+       ['RTE_MAX_NUMA_NODES', 1],
+       ['RTE_MAX_LCORE', 32]]
 flags_armada = [
        ['RTE_MACHINE', '"armv8a"'],
        ['RTE_CACHE_LINE_SIZE', 64],
@@ -102,6 +107,10 @@ machine_args_cavium = [
        ['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_thunderx2_extra],
        ['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_octeontx2_extra]]
 
+machine_args_emag = [
+       ['default', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
+       ['native', ['-march=native']]]
+
 ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
 impl_generic = ['Generic armv8', flags_generic, machine_args_generic]
 impl_0x41 = ['Arm', flags_arm, machine_args_generic]
@@ -111,7 +120,7 @@ impl_0x44 = ['DEC', flags_generic, machine_args_generic]
 impl_0x49 = ['Infineon', flags_generic, machine_args_generic]
 impl_0x4d = ['Motorola', flags_generic, machine_args_generic]
 impl_0x4e = ['NVIDIA', flags_generic, machine_args_generic]
-impl_0x50 = ['AppliedMicro', flags_generic, machine_args_generic]
+impl_0x50 = ['Ampere Computing', flags_emag, machine_args_emag]
 impl_0x51 = ['Qualcomm', flags_generic, machine_args_generic]
 impl_0x53 = ['Samsung', flags_generic, machine_args_generic]
 impl_0x56 = ['Marvell ARMADA', flags_armada, machine_args_generic]
diff --git a/config/defconfig_arm64-emag-linux-gcc b/config/defconfig_arm64-emag-linux-gcc
new file mode 120000 (symlink)
index 0000000..21894a3
--- /dev/null
@@ -0,0 +1 @@
+defconfig_arm64-emag-linuxapp-gcc
\ No newline at end of file
diff --git a/config/defconfig_arm64-emag-linuxapp-gcc b/config/defconfig_arm64-emag-linuxapp-gcc
new file mode 100644 (file)
index 0000000..496c39d
--- /dev/null
@@ -0,0 +1,12 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2019 Ampere Computing
+#
+
+#include "defconfig_arm64-armv8a-linux-gcc"
+
+CONFIG_RTE_MACHINE="emag"
+
+CONFIG_RTE_CACHE_LINE_SIZE=64
+CONFIG_RTE_MAX_NUMA_NODES=1
+CONFIG_RTE_MAX_LCORE=32
+
diff --git a/mk/machine/emag/rte.vars.mk b/mk/machine/emag/rte.vars.mk
new file mode 100644 (file)
index 0000000..50342df
--- /dev/null
@@ -0,0 +1,32 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2019 Ampere Computing
+#
+
+#
+# machine:
+#
+#   - can define ARCH variable (overridden by cmdline value)
+#   - can define CROSS variable (overridden by cmdline value)
+#   - define MACHINE_CFLAGS variable (overridden by cmdline value)
+#   - define MACHINE_LDFLAGS variable (overridden by cmdline value)
+#   - define MACHINE_ASFLAGS variable (overridden by cmdline value)
+#   - can define CPU_CFLAGS variable (overridden by cmdline value) that
+#     overrides the one defined in arch.
+#   - can define CPU_LDFLAGS variable (overridden by cmdline value) that
+#     overrides the one defined in arch.
+#   - can define CPU_ASFLAGS variable (overridden by cmdline value) that
+#     overrides the one defined in arch.
+#   - may override any previously defined variable
+#
+
+# ARCH =
+# CROSS =
+# MACHINE_CFLAGS =
+# MACHINE_LDFLAGS =
+# MACHINE_ASFLAGS =
+# CPU_CFLAGS =
+# CPU_LDFLAGS =
+# CPU_ASFLAGS =
+
+MACHINE_CFLAGS += -march=armv8-a+crc+crypto
+MACHINE_CFLAGS += $(call rte_cc_has_argument, -mtune=emag)