xref: /rk3399_ARM-atf/make_helpers/armv7-a-cpus.mk (revision 8f73663b5963ff10ec946b1faa92b4311f28cbd9)
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
1826e63c44SEtienne Carriere# Platform can override march32-directive through MARCH32_DIRECTIVE
1926e63c44SEtienne Carriereifdef MARCH32_DIRECTIVE
2026e63c44SEtienne Carrieremarch32-directive		:= $(MARCH32_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
3226e63c44SEtienne Carrieremarch32-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)
4751b992ecSEtienne Carriere$(eval $(call add_define,ARMV7_SUPPORTS_LARGE_PAGE_ADDRESSING))
4864cc6e91SEtienne Carriere$(eval $(call add_define,ARMV7_SUPPORTS_VIRTUALIZATION))
4986e26835SEtienne Carriere$(eval $(call add_define,ARMV7_SUPPORTS_GENERIC_TIMER))
50*8f73663bSUsama Arif$(eval $(call add_define,ARMV7_SUPPORTS_VFP))
51*8f73663bSUsama Arifendif
52*8f73663bSUsama Arif
53*8f73663bSUsama Arififeq ($(ARM_CORTEX_A5),yes)
54*8f73663bSUsama Arif$(eval $(call add_define,ARM_CORTEX_A5))
5551b992ecSEtienne Carriereendif
56