aboutsummaryrefslogtreecommitdiff
path: root/tools/build_system/cpu.mk
blob: 3ad53e1381ea0a6927971b97fd3fa0eef8715dec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#
# Arm SCP/MCP Software
# Copyright (c) 2015-2020, Arm Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#

ifndef BS_CPU_MK
BS_CPU_MK := 1

include $(BS_DIR)/defs.mk

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
    BS_ARCH_MODE := thumb

    LDFLAGS_GCC += --specs=nano.specs
    LDFLAGS_ARM += --target=arm-arm-none-eabi
    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
else
    $(erro "$(BS_FIRMWARE_CPU) is not a supported CPU. Aborting...")
endif

endif