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 <root@stephanos.io>
diff --git a/ext/hal/cmsis/CMakeLists.txt b/ext/hal/cmsis/CMakeLists.txt
index 80e9cdb..e0c61fe 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 0000000..08d3c99
--- /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 22bb8b2..0e45d15 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 1afa679..fad9b14 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