From 059952c8e185994c4cb166ce8f6b07c68f2028f3 Mon Sep 17 00:00:00 2001 From: Ioannis Glaropoulos Date: Fri, 29 Jun 2018 11:41:28 +0200 Subject: [PATCH] arch: arm: update compile options for DSP This commit updates the compile options in cmake to distinguish between ARMv8-M Mainline MCUs with or withouth the optional DSP extension. A new Kconfig option: ARMV8_M_DSP, is introduced, to signify the use of an ARMv8-M MCU with DSP support. Signed-off-by: Ioannis Glaropoulos --- arch/arm/CMakeLists.txt | 13 +++++++------ arch/arm/core/cortex_m/Kconfig | 8 ++++++++ cmake/gcc-m-cpu.cmake | 6 +++++- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/arch/arm/CMakeLists.txt b/arch/arm/CMakeLists.txt index ed20e40320c..8fc468bfece 100644 --- a/arch/arm/CMakeLists.txt +++ b/arch/arm/CMakeLists.txt @@ -1,11 +1,12 @@ zephyr_cc_option_ifdef(CONFIG_LTO -flto) -set(ARCH_FOR_cortex-m0 armv6-m ) -set(ARCH_FOR_cortex-m0plus armv6-m ) -set(ARCH_FOR_cortex-m3 armv7-m ) -set(ARCH_FOR_cortex-m4 armv7e-m ) -set(ARCH_FOR_cortex-m23 armv8-m.base) -set(ARCH_FOR_cortex-m33 armv8-m.main) +set(ARCH_FOR_cortex-m0 armv6-m ) +set(ARCH_FOR_cortex-m0plus armv6-m ) +set(ARCH_FOR_cortex-m3 armv7-m ) +set(ARCH_FOR_cortex-m4 armv7e-m ) +set(ARCH_FOR_cortex-m23 armv8-m.base ) +set(ARCH_FOR_cortex-m33 armv8-m.main+dsp) +set(ARCH_FOR_cortex-m33+nodsp armv8-m.main ) set_property(GLOBAL PROPERTY E_KERNEL_ENTRY -e${CONFIG_KERNEL_ENTRY}) diff --git a/arch/arm/core/cortex_m/Kconfig b/arch/arm/core/cortex_m/Kconfig index c4075db4687..2e06a14d298 100644 --- a/arch/arm/core/cortex_m/Kconfig +++ b/arch/arm/core/cortex_m/Kconfig @@ -252,6 +252,14 @@ config ARMV7_M_ARMV8_M_FP implementation, or the use of an ARMv8-M processor implementation supporting the Floating-Point Extension. +config ARMV8_M_DSP + bool + # Omit prompt to signify "hidden" option + depends on ARMV8_M_MAINLINE + help + This option signifies the use of an ARMv8-M processor + implementation supporting the DSP Extension. + menu "ARM Cortex-M options" depends on CPU_CORTEX_M diff --git a/cmake/gcc-m-cpu.cmake b/cmake/gcc-m-cpu.cmake index 270ea4d83f9..cabd8dbd2c0 100644 --- a/cmake/gcc-m-cpu.cmake +++ b/cmake/gcc-m-cpu.cmake @@ -15,7 +15,11 @@ if("${ARCH}" STREQUAL "arm") elseif(CONFIG_CPU_CORTEX_M23) set(GCC_M_CPU cortex-m23) elseif(CONFIG_CPU_CORTEX_M33) - set(GCC_M_CPU cortex-m33) + if (CONFIG_ARMV8_M_DSP) + set(GCC_M_CPU cortex-m33) + else() + set(GCC_M_CPU cortex-m33+nodsp) + endif() else() message(FATAL_ERROR "Expected CONFIG_CPU_CORTEX_x to be defined") endif()