126e63c44SEtienne Carriere# 226e63c44SEtienne Carriere# Copyright (c) 2017, ARM Limited and Contributors. All rights reserved. 326e63c44SEtienne Carriere# 426e63c44SEtienne Carriere# SPDX-License-Identifier: BSD-3-Clause 526e63c44SEtienne Carriere# 626e63c44SEtienne Carriere 726e63c44SEtienne Carriereifneq (${ARCH},aarch32) 826e63c44SEtienne Carriere$(error ARM_ARCH_MAJOR=7 mandates ARCH=aarch32) 926e63c44SEtienne Carriereendif 1026e63c44SEtienne Carriere 1126e63c44SEtienne Carriere# For ARMv7, set march32 from platform directive ARMV7_CORTEX_Ax=yes 1226e63c44SEtienne Carriere# and ARM_WITH_NEON=yes/no. 1326e63c44SEtienne Carriere# 1426e63c44SEtienne Carriere# GCC and Clang require -march=armv7-a for C-A9 and -march=armv7ve for C-A15. 1526e63c44SEtienne Carriere# armClang requires -march=armv7-a for all ARMv7 Cortex-A. To comply with 1626e63c44SEtienne Carriere# all, just drop -march and supply only -mcpu. 1726e63c44SEtienne Carriere 18*d4089fb8SGovindraj Raja# Platform can override march-directive through MARCH_DIRECTIVE 19*d4089fb8SGovindraj Rajaifdef MARCH_DIRECTIVE 20*d4089fb8SGovindraj Rajamarch-directive := $(MARCH_DIRECTIVE) 2126e63c44SEtienne Carriereelse 2226e63c44SEtienne Carrieremarch32-set-${ARM_CORTEX_A5} := -mcpu=cortex-a5 2326e63c44SEtienne Carrieremarch32-set-${ARM_CORTEX_A7} := -mcpu=cortex-a7 2426e63c44SEtienne Carrieremarch32-set-${ARM_CORTEX_A9} := -mcpu=cortex-a9 2526e63c44SEtienne Carrieremarch32-set-${ARM_CORTEX_A12} := -mcpu=cortex-a12 2626e63c44SEtienne Carrieremarch32-set-${ARM_CORTEX_A15} := -mcpu=cortex-a15 2726e63c44SEtienne Carrieremarch32-set-${ARM_CORTEX_A17} := -mcpu=cortex-a17 2826e63c44SEtienne Carrieremarch32-neon-$(ARM_WITH_NEON) := -mfpu=neon 2926e63c44SEtienne Carriere 3026e63c44SEtienne Carriere# default to -march=armv7-a as target directive 3126e63c44SEtienne Carrieremarch32-set-yes ?= -march=armv7-a 32*d4089fb8SGovindraj Rajamarch-directive := ${march32-set-yes} ${march32-neon-yes} 3326e63c44SEtienne Carriereendif 3451b992ecSEtienne Carriere 3551b992ecSEtienne Carriere# Platform may override these extension support directives: 3651b992ecSEtienne Carriere# 3751b992ecSEtienne Carriere# ARMV7_SUPPORTS_LARGE_PAGE_ADDRESSING 3851b992ecSEtienne Carriere# Defined if core supports the Large Page Addressing extension. 3964cc6e91SEtienne Carriere# 4064cc6e91SEtienne Carriere# ARMV7_SUPPORTS_VIRTUALIZATION 4164cc6e91SEtienne Carriere# Defined if ARMv7 core supports the Virtualization extension. 4286e26835SEtienne Carriere# 4386e26835SEtienne Carriere# ARMV7_SUPPORTS_GENERIC_TIMER 4486e26835SEtienne Carriere# Defined if ARMv7 core supports the Generic Timer extension. 4551b992ecSEtienne Carriere 4651b992ecSEtienne Carriereifeq ($(filter yes,$(ARM_CORTEX_A7) $(ARM_CORTEX_A12) $(ARM_CORTEX_A15) $(ARM_CORTEX_A17)),yes) 47327131c4SLeonardo Sandoval$(eval $(call add_defines,\ 48327131c4SLeonardo Sandoval $(sort \ 49327131c4SLeonardo Sandoval ARMV7_SUPPORTS_LARGE_PAGE_ADDRESSING \ 50327131c4SLeonardo Sandoval ARMV7_SUPPORTS_VIRTUALIZATION \ 51327131c4SLeonardo Sandoval ARMV7_SUPPORTS_GENERIC_TIMER \ 52327131c4SLeonardo Sandoval ARMV7_SUPPORTS_VFP \ 53327131c4SLeonardo Sandoval))) 548f73663bSUsama Arifendif 558f73663bSUsama Arif 568f73663bSUsama Arififeq ($(ARM_CORTEX_A5),yes) 578f73663bSUsama Arif$(eval $(call add_define,ARM_CORTEX_A5)) 5851b992ecSEtienne Carriereendif 59