-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Refactor CMSIS #19875
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor CMSIS #19875
Changes from all commits
acfb1ff
3943cf0
c9880c9
01d308c
ae05537
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
# | ||
# Copyright (c) 2016 Intel Corporation | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
config HAS_CMSIS | ||
config HAS_CMSIS_CORE | ||
stephanosio marked this conversation as resolved.
Show resolved
Hide resolved
|
||
bool | ||
select HAS_CMSIS_CORE_M if CPU_CORTEX_M | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, wonder if this is better as 'default if CPU_CORTEX_M' instead of a select. @ulfalizer thoughts? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To elaborate, the idea here is that For example, when CMSIS-Core(R) is added in the next PR, it would look something like this:
The rationale for using
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This design solves another problem. Assume a vendor with all Cortex-A, Cortex-M and Cortex-R support. The vendor module will select HAS_CMSIS in the root module Kconfig file, without having to care about the different ARM variants. The right type will be selected based on the actual CPU variant. So I like the solution by proposed here by @stephanosio . Of course, these options must be used somewhere. |
||
|
||
if HAS_CMSIS_CORE | ||
|
||
config HAS_CMSIS_CORE_M | ||
bool | ||
|
||
endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
https://github.com/ARM-software/CMSIS_5/releases/tag/5.5.1 | ||
The current version supported in Zephyr is | ||
https://github.com/ARM-software/CMSIS_5/releases/tag/5.6.0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,4 @@ | |
|
||
config HAS_CYPRESS_DRIVERS | ||
bool | ||
select HAS_CMSIS | ||
select HAS_CMSIS_CORE |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,5 @@ | |
|
||
config HAS_SILABS_GECKO | ||
bool | ||
select HAS_CMSIS | ||
select HAS_CMSIS_CORE | ||
depends on SOC_FAMILY_EXX32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, now, this selects CMSIS_CORE. But CMSIS_CORE is also selected at the module Kconfig.
Can we change this to "implies"? @ulfalizer @galak ?