From ad05b79a89277bb9e384e00a87d9a8e84effb2eb Mon Sep 17 00:00:00 2001 From: Stephanos Ioannidis Date: Thu, 17 Oct 2019 09:37:38 +0900 Subject: [PATCH] ext: hal: cmsis: Add HAS_CMSIS_CORE configuration. The existing implementation used HAS_CMSIS configuration to specify that CMSIS-Core(M) is used; when, in fact, there are other CMSIS variants available such as CMSIS-Core(A) and CMSIS-DSP available. This commit replaces the existing HAS_CMSIS configuration with HAS_CMSIS_CORE to clarify that CMSIS-Core is used. It also introduces the CMSIS-Core variant configuration, HAS_CMSIS_CORE_M, that is automatically selected when HAS_CMSIS_CORE is enabled. For more details, see issue #19717. Signed-off-by: Stephanos Ioannidis --- ext/hal/cmsis/CMakeLists.txt | 12 ++---------- ext/hal/cmsis/Core/CMakeLists.txt | 11 +++++++++++ ext/hal/cmsis/Kconfig | 13 +++++++++---- ext/hal/cmsis/README | 14 +++++++------- 4 files changed, 29 insertions(+), 21 deletions(-) create mode 100644 ext/hal/cmsis/Core/CMakeLists.txt diff --git a/ext/hal/cmsis/CMakeLists.txt b/ext/hal/cmsis/CMakeLists.txt index 80e9cdb2672..e0c61fef0a1 100644 --- a/ext/hal/cmsis/CMakeLists.txt +++ b/ext/hal/cmsis/CMakeLists.txt @@ -1,11 +1,3 @@ -if(CONFIG_HAS_CMSIS) - zephyr_include_directories(Include) -endif() +# SPDX-License-Identifier: Apache-2.0 -# As of CMSIS v5.6.0, __PROGRAM_START is to indicate whether the -# ARM vendor or the OS supplies data/bss init routine, otherwise -# the default data/bss init routine for the selected toolchain is -# added. We set the macro in build-time to guarantee compatibility -# with all existing ARM platforms. - -zephyr_compile_definitions(__PROGRAM_START) +add_subdirectory_ifdef(CONFIG_HAS_CMSIS_CORE_M Core) diff --git a/ext/hal/cmsis/Core/CMakeLists.txt b/ext/hal/cmsis/Core/CMakeLists.txt new file mode 100644 index 00000000000..08d3c9934b0 --- /dev/null +++ b/ext/hal/cmsis/Core/CMakeLists.txt @@ -0,0 +1,11 @@ +# SPDX-License-Identifier: Apache-2.0 + +zephyr_include_directories(Include) + +# As of CMSIS v5.6.0, __PROGRAM_START is to indicate whether the +# ARM vendor or the OS supplies data/bss init routine, otherwise +# the default data/bss init routine for the selected toolchain is +# added. We set the macro in build-time to guarantee compatibility +# with all existing ARM platforms. + +zephyr_compile_definitions(__PROGRAM_START) diff --git a/ext/hal/cmsis/Kconfig b/ext/hal/cmsis/Kconfig index 22bb8b2f28b..0e45d15ba80 100644 --- a/ext/hal/cmsis/Kconfig +++ b/ext/hal/cmsis/Kconfig @@ -1,8 +1,13 @@ -# # Copyright (c) 2016 Intel Corporation -# # SPDX-License-Identifier: Apache-2.0 -# -config HAS_CMSIS +config HAS_CMSIS_CORE bool + select HAS_CMSIS_CORE_M if CPU_CORTEX_M + +if HAS_CMSIS_CORE + +config HAS_CMSIS_CORE_M + bool + +endif diff --git a/ext/hal/cmsis/README b/ext/hal/cmsis/README index 1afa679f128..fad9b144e7d 100644 --- a/ext/hal/cmsis/README +++ b/ext/hal/cmsis/README @@ -1,15 +1,15 @@ The ARM Cortex Microcontroller Software Interface Standard (CMSIS) defines a -set of standard interfaces to ARM Cortex-M SOCs. In particular, the CMSIS-CORE -component standardizes the software interface to core and peripheral registers, -as well as exception names and the system clock frequency. Multiple SOC -vendors, including NXP and Nordic Semiconductor, include the CMSIS-CORE header -files in their SOC header files. These SOC header files are in turn used by -the vendor's peripheral drivers. +set of standard interfaces to ARM Cortex family SOCs. In particular, the +CMSIS-CORE component standardizes the software interface to core and peripheral +registers, as well as exception names and the system clock frequency. Multiple +SOC vendors, including NXP and Nordic Semiconductor, include the CMSIS-CORE +header files in their SOC header files. These SOC header files are in turn used +by the vendor's peripheral drivers. http://www.arm.com/products/processors/cortex-m/cortex-microcontroller-software-interface-standard.php The sources in this directory are imported from https://github.com/ARM-software/CMSIS_5.git -The current version supported in Zephyr is +The current version supported in Zephyr is https://github.com/ARM-software/CMSIS_5/releases/tag/5.5.1