-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
ARM: SoC MPU definition cleanup #21227
ARM: SoC MPU definition cleanup #21227
Conversation
We move the configuration of the fixed MPU regions for ARM Cortex-M SoCs in a common place under soc/arm/common/cortex-m, instead of having this configuration present in each ARM SoC or SoC Series definition. The rationale behind this is that for all SoCs the fixed MPU regions configured at SoC definition are only used for enforcing default Flash and SRAM access policies, and currently, this is common to all ARM SoCs with MPU support. We also simplify the Flash and SRAM MPU region definition, aiming at using a single MPU region index to program each of them. We still support the possibility for ARM SoCs to opt-out and, instead, define their own custom fixed MPU regions at SoC definition. We do it using a Kconfig option, introduced explicitly for this purpose. Signed-off-by: Ioannis Glaropoulos <[email protected]>
We remove the custom fixed MPU region definition from Nordic nRF SoC definition, as the common fixed MPU region definition is now used. Signed-off-by: Ioannis Glaropoulos <[email protected]>
We remove the custom fixed MPU region definition from Atmel SAM SoC definition, as the common fixed MPU region definition is now used. Signed-off-by: Ioannis Glaropoulos <[email protected]>
We remove the custom fixed MPU region definition from NXP IMX RT, Kinetis, and LPC SoC definitions, as the common fixed MPU region definition is now used. Signed-off-by: Ioannis Glaropoulos <[email protected]>
For the NXP Kinetis SoCs with the NXP MPU regions, we keep the confiruation of the fixed SoC MPU regions at each SoC definition. Signed-off-by: Ioannis Glaropoulos <[email protected]>
We remove the custom fixed MPU region definition from Silicon Labs exx32 SoC definitions, as the common fixed MPU region definition is now used. Signed-off-by: Ioannis Glaropoulos <[email protected]>
We remove the custom fixed MPU region definition from ARM - Beetle - Musca_a - Musca_b1 - MPS2 (an385 and an521) SoC definitions, as the common fixed MPU region definition is now used. Signed-off-by: Ioannis Glaropoulos <[email protected]>
We remove the custom fixed MPU region definition from ST STM32 SoC definitions, as the common fixed MPU region definition is now used. Signed-off-by: Ioannis Glaropoulos <[email protected]>
All checks passed. checkpatch (informational only, not a failure)
Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages. |
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.
Looks okay, removes redundant code.
CPU_HAS_CUSTOM_FIXED_SOC_MPU_REGIONS may be used in the future to split multi-core and secure/non-secure partitioning, not just kinetis devices.
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.
Not sure about the Kconfig name (CONFIG_CPU_HAS_CUSTOM_FIXED_SOC_MPU_REGIONS
seems a bit too long and complex to understand), but the change looks good to me. Thanks for working on this.
A clean-up patch.
We move the definition of the fixed (Flash and SRAM) MPU region definition for ARM Cortex-M platforms in a common place, and remove all duplicate definitions in each SoC / SoC series.
For backwards compatibility we keep the ability for SoCs to define their own fixed regions, with a Kconfig defined for this purpose. We exercise this for the Kinetis SoCs with the NXP MPU.