armv7-a-cpus.mk 1.8 KB

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