Etienne Carriere | 1374fcb | 2017-11-08 13:48:40 +0100 | [diff] [blame] | 1 | # |
| 2 | # Copyright (c) 2017, ARM Limited and Contributors. All rights reserved. |
| 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | |
| 7 | ifneq (${ARCH},aarch32) |
| 8 | $(error ARM_ARCH_MAJOR=7 mandates ARCH=aarch32) |
| 9 | endif |
| 10 | |
| 11 | # For ARMv7, set march32 from platform directive ARMV7_CORTEX_Ax=yes |
| 12 | # and ARM_WITH_NEON=yes/no. |
| 13 | # |
| 14 | # GCC and Clang require -march=armv7-a for C-A9 and -march=armv7ve for C-A15. |
| 15 | # armClang requires -march=armv7-a for all ARMv7 Cortex-A. To comply with |
| 16 | # all, just drop -march and supply only -mcpu. |
| 17 | |
| 18 | # Platform can override march32-directive through MARCH32_DIRECTIVE |
| 19 | ifdef MARCH32_DIRECTIVE |
| 20 | march32-directive := $(MARCH32_DIRECTIVE) |
| 21 | else |
| 22 | march32-set-${ARM_CORTEX_A5} := -mcpu=cortex-a5 |
| 23 | march32-set-${ARM_CORTEX_A7} := -mcpu=cortex-a7 |
| 24 | march32-set-${ARM_CORTEX_A9} := -mcpu=cortex-a9 |
| 25 | march32-set-${ARM_CORTEX_A12} := -mcpu=cortex-a12 |
| 26 | march32-set-${ARM_CORTEX_A15} := -mcpu=cortex-a15 |
| 27 | march32-set-${ARM_CORTEX_A17} := -mcpu=cortex-a17 |
| 28 | march32-neon-$(ARM_WITH_NEON) := -mfpu=neon |
| 29 | |
| 30 | # default to -march=armv7-a as target directive |
| 31 | march32-set-yes ?= -march=armv7-a |
| 32 | march32-directive := ${march32-set-yes} ${march32-neon-yes} |
| 33 | endif |
Etienne Carriere | 0af78b6 | 2017-11-08 13:53:47 +0100 | [diff] [blame] | 34 | |
| 35 | # Platform may override these extension support directives: |
| 36 | # |
| 37 | # ARMV7_SUPPORTS_LARGE_PAGE_ADDRESSING |
| 38 | # Defined if core supports the Large Page Addressing extension. |
Etienne Carriere | 4cce835 | 2017-11-08 14:38:33 +0100 | [diff] [blame] | 39 | # |
| 40 | # ARMV7_SUPPORTS_VIRTUALIZATION |
| 41 | # Defined if ARMv7 core supports the Virtualization extension. |
Etienne Carriere | e259fa7 | 2017-11-08 14:41:47 +0100 | [diff] [blame] | 42 | # |
| 43 | # ARMV7_SUPPORTS_GENERIC_TIMER |
| 44 | # Defined if ARMv7 core supports the Generic Timer extension. |
Etienne Carriere | 0af78b6 | 2017-11-08 13:53:47 +0100 | [diff] [blame] | 45 | |
| 46 | ifeq ($(filter yes,$(ARM_CORTEX_A7) $(ARM_CORTEX_A12) $(ARM_CORTEX_A15) $(ARM_CORTEX_A17)),yes) |
Leonardo Sandoval | 65fca7c | 2020-09-10 12:18:27 -0500 | [diff] [blame] | 47 | $(eval $(call add_defines,\ |
| 48 | $(sort \ |
| 49 | ARMV7_SUPPORTS_LARGE_PAGE_ADDRESSING \ |
| 50 | ARMV7_SUPPORTS_VIRTUALIZATION \ |
| 51 | ARMV7_SUPPORTS_GENERIC_TIMER \ |
| 52 | ARMV7_SUPPORTS_VFP \ |
| 53 | ))) |
Usama Arif | 078e66f | 2018-12-12 17:14:29 +0000 | [diff] [blame] | 54 | endif |
| 55 | |
| 56 | ifeq ($(ARM_CORTEX_A5),yes) |
| 57 | $(eval $(call add_define,ARM_CORTEX_A5)) |
Etienne Carriere | 0af78b6 | 2017-11-08 13:53:47 +0100 | [diff] [blame] | 58 | endif |