aboutsummaryrefslogtreecommitdiff
path: root/tools/build_system
diff options
context:
space:
mode:
authorNicolas Royer <nroyer@baylibre.com>2020-09-27 16:44:13 +0200
committernicola-mazzucato-arm <42373140+nicola-mazzucato-arm@users.noreply.github.com>2020-10-15 17:45:38 +0100
commitdb2d011984a280afbfdcde930ba1965db0d2b8d5 (patch)
treeb3ce0004618a9369109791b2c5c3eccdf7df9786 /tools/build_system
parent3ed98096b99953d02bf1a27006c7e4c49935a007 (diff)
arch: add armv8-a support
Change-Id: I4ba1332eeea2fd19d2ae60281e0894a1c262ea58 Signed-off-by: Tsutomu Muroya <tsutomu.muroya.jy@bp.renesas.com> Signed-off-by: Nicolas Royer <nroyer@baylibre.com>
Diffstat (limited to 'tools/build_system')
-rw-r--r--tools/build_system/cpu.mk10
-rw-r--r--tools/build_system/rules.mk26
2 files changed, 31 insertions, 5 deletions
diff --git a/tools/build_system/cpu.mk b/tools/build_system/cpu.mk
index 51810293..3ad53e13 100644
--- a/tools/build_system/cpu.mk
+++ b/tools/build_system/cpu.mk
@@ -15,6 +15,9 @@ BS_ARCH_CPU := $(BS_FIRMWARE_CPU)
# Supported ARMv7-M CPUs
ARMV7M_CPUS := cortex-m3 cortex-m7
+# Supported ARMv8-A CPUs
+ARMV8A_CPUS := cortex-a53 cortex-a57 cortex-a57.cortex-a53
+
ifneq ($(findstring $(BS_FIRMWARE_CPU),$(ARMV7M_CPUS)),)
BS_ARCH_VENDOR := arm
BS_ARCH_ARCH := armv7-m
@@ -25,6 +28,13 @@ ifneq ($(findstring $(BS_FIRMWARE_CPU),$(ARMV7M_CPUS)),)
CFLAGS_CLANG += --target=arm-arm-none-eabi
CFLAGS += -mfloat-abi=soft # No hardware floating point support
+else ifneq ($(findstring $(BS_FIRMWARE_CPU),$(ARMV8A_CPUS)),)
+ BS_ARCH_VENDOR := arm
+ BS_ARCH_ARCH := armv8-a
+
+ CFLAGS += -fno-builtin -mstrict-align
+ DEP_CFLAGS_GCC += -DAARCH64
+ DEP_ASFLAGS_GCC += -D__ASSEMBLY__
else ifeq ($(BS_FIRMWARE_CPU),host)
BS_ARCH_VENDOR := none
BS_ARCH_ARCH := host
diff --git a/tools/build_system/rules.mk b/tools/build_system/rules.mk
index c8354a68..c3bbcacd 100644
--- a/tools/build_system/rules.mk
+++ b/tools/build_system/rules.mk
@@ -13,7 +13,9 @@ include $(BS_DIR)/cpu.mk
ifeq ($(BUILD_HAS_MULTITHREADING),yes)
# Add the OS directory to the main INCLUDES list
- INCLUDES += $(OS_DIR)/Include
+ ifeq ($(findstring $(BS_FIRMWARE_CPU),$(ARMV8A_CPUS)),)
+ INCLUDES += $(OS_DIR)/Include
+ endif
DEFINES += BUILD_HAS_MULTITHREADING
endif
@@ -148,7 +150,11 @@ LDFLAGS_GCC += -Wl,--cref
LDFLAGS_GCC += -Wl,--undefined=arch_exceptions
LDFLAGS_ARM += -Wl,--undefined=arch_exceptions
-BUILTIN_LIBS_GCC := -lc -lgcc
+ifneq ($(BS_ARCH_ARCH),armv8-a)
+ BUILTIN_LIBS_GCC := -lc -lgcc
+else
+ BUILTIN_LIBS_GCC := -nostdlib
+endif
ifeq ($(MODE),release)
O ?= $(DEFAULT_OPT_GCC_RELEASE)
@@ -177,15 +183,24 @@ INCLUDES += $(ARCH_DIR)/include
INCLUDES += $(ARCH_DIR)/$(BS_ARCH_VENDOR)/include
INCLUDES += $(ARCH_DIR)/$(BS_ARCH_VENDOR)/$(BS_ARCH_ARCH)/include
+ifeq ($(BS_ARCH_ARCH),armv8-a)
+ INCLUDES += $(ARCH_DIR)/$(BS_ARCH_VENDOR)/$(BS_ARCH_ARCH)/include/common
+ INCLUDES += $(ARCH_DIR)/$(BS_ARCH_VENDOR)/$(BS_ARCH_ARCH)/include/lib
+ INCLUDES += $(ARCH_DIR)/$(BS_ARCH_VENDOR)/$(BS_ARCH_ARCH)/include/lib/libc
+ INCLUDES += $(ARCH_DIR)/$(BS_ARCH_VENDOR)/$(BS_ARCH_ARCH)/include/lib/libc/aarch64
+endif
+
#
# Always include the framework library
#
INCLUDES += $(FWK_DIR)/include
#
-# Always include CMSIS
+# CMSIS library
#
-INCLUDES += $(CMSIS_DIR)/Include
+ifneq ($(BS_ARCH_ARCH),armv8-a)
+ INCLUDES += $(CMSIS_DIR)/Include
+endif
#
# Toolchain-independent flags
@@ -201,6 +216,7 @@ ASFLAGS += $(ASFLAGS_GCC)
ARFLAGS = $(ARFLAGS_GCC)
LDFLAGS += $(LDFLAGS_$(BS_LINKER))
DEP_CFLAGS = $(DEP_CFLAGS_GCC)
+DEP_ASFLAGS = $(DEP_ASFLAGS_GCC)
BUILTIN_LIBS = $(BUILTIN_LIBS_$(BS_LINKER))
CFLAGS += $(CFLAGS_$(BS_COMPILER))
@@ -255,7 +271,7 @@ $(OBJ_DIR)/%.o: %.s | $$(@D)/
$(OBJ_DIR)/%.o: %.S | $$(@D)/
$(call show-action,AS,$<)
- $(AS) -c $(CFLAGS) $(DEP_CFLAGS) $< -o $@
+ $(AS) -c $(CFLAGS) $(DEP_CFLAGS) $(DEP_ASFLAGS) $< -o $@
$(BUILD_PATH)%/:
$(call show-action,MD,$@)