mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Merge pull request #13391 from kaspar030/mpu_feature
cpu/cortex-m: turn MPU support into a feature
This commit is contained in:
commit
68ec8b2c2b
@ -26,6 +26,10 @@ ifneq (,$(filter ssp,$(USEMODULE)))
|
||||
FEATURES_REQUIRED += ssp
|
||||
endif
|
||||
|
||||
ifneq (,$(filter mpu_stack_guard,$(USEMODULE)))
|
||||
FEATURES_REQUIRED += cortexm_mpu
|
||||
endif
|
||||
|
||||
ifneq (,$(filter csma_sender,$(USEMODULE)))
|
||||
USEMODULE += random
|
||||
USEMODULE += xtimer
|
||||
|
@ -4,6 +4,8 @@ FEATURES_PROVIDED += periph_cpuid
|
||||
FEATURES_PROVIDED += periph_gpio periph_gpio_irq
|
||||
FEATURES_PROVIDED += periph_hwrng
|
||||
FEATURES_PROVIDED += periph_uart_modecfg
|
||||
|
||||
FEATURES_PROVIDED += cortexm_mpu
|
||||
FEATURES_PROVIDED += puf_sram
|
||||
|
||||
-include $(RIOTCPU)/cortexm_common/Makefile.features
|
||||
|
@ -1,3 +1,5 @@
|
||||
CPU_ARCH = cortex-m3
|
||||
|
||||
FEATURES_PROVIDED += cortexm_mpu
|
||||
|
||||
-include $(RIOTCPU)/cc26xx_cc13xx/Makefile.features
|
||||
|
@ -1,3 +1,5 @@
|
||||
CPU_ARCH = cortex-m4f
|
||||
|
||||
FEATURES_PROVIDED += cortexm_mpu
|
||||
|
||||
-include $(RIOTCPU)/cc26xx_cc13xx/Makefile.features
|
||||
|
@ -4,6 +4,7 @@ include $(RIOTCPU)/efm32/efm32-features.mk
|
||||
CPU_ARCH = $(EFM32_ARCHITECTURE)
|
||||
|
||||
FEATURES_PROVIDED += arch_efm32
|
||||
FEATURES_PROVIDED += cortexm_mpu
|
||||
FEATURES_PROVIDED += periph_cpuid
|
||||
FEATURES_PROVIDED += periph_flashpage
|
||||
FEATURES_PROVIDED += periph_flashpage_raw
|
||||
|
@ -1,5 +1,6 @@
|
||||
CPU_ARCH = cortex-m4f
|
||||
|
||||
FEATURES_PROVIDED += cortexm_mpu
|
||||
FEATURES_PROVIDED += periph_cpuid
|
||||
FEATURES_PROVIDED += periph_gpio periph_gpio_irq
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
CPU_ARCH = cortex-m4f
|
||||
|
||||
FEATURES_PROVIDED += cortexm_mpu
|
||||
|
||||
-include $(RIOTCPU)/cortexm_common/Makefile.features
|
||||
|
@ -2,6 +2,7 @@ CPU_ARCH = cortex-m3
|
||||
# This CPU only implements one CPU_MODEL with the same name
|
||||
CPU_MODEL = lpc1768
|
||||
|
||||
FEATURES_PROVIDED += cortexm_mpu
|
||||
FEATURES_PROVIDED += periph_cpuid
|
||||
FEATURES_PROVIDED += periph_pm
|
||||
|
||||
|
@ -8,4 +8,7 @@ FEATURES_PROVIDED += periph_adc
|
||||
# feature to mark this
|
||||
FEATURES_PROVIDED += ble_nimble_netif
|
||||
|
||||
# all nrf52 have an MPU
|
||||
FEATURES_PROVIDED += cortexm_mpu
|
||||
|
||||
-include $(RIOTCPU)/nrf5x_common/Makefile.features
|
||||
|
@ -1,6 +1,7 @@
|
||||
CPU_ARCH = cortex-m3
|
||||
CPU_FAM = sam3
|
||||
|
||||
FEATURES_PROVIDED += cortexm_mpu
|
||||
FEATURES_PROVIDED += periph_cpuid
|
||||
FEATURES_PROVIDED += periph_hwrng
|
||||
|
||||
|
@ -3,5 +3,6 @@ CPU_FAM = samd5x
|
||||
|
||||
FEATURES_PROVIDED += periph_hwrng
|
||||
FEATURES_PROVIDED += backup_ram
|
||||
FEATURES_PROVIDED += cortexm_mpu
|
||||
|
||||
include $(RIOTCPU)/sam0_common/Makefile.features
|
||||
|
@ -1,6 +1,7 @@
|
||||
CPU_ARCH = cortex-m23
|
||||
CPU_FAM = saml1x
|
||||
|
||||
FEATURES_PROVIDED += cortexm_mpu
|
||||
FEATURES_PROVIDED += periph_hwrng
|
||||
|
||||
include $(RIOTCPU)/sam0_common/Makefile.features
|
||||
|
@ -2,5 +2,6 @@ CPU_ARCH = cortex-m3
|
||||
CPU_FAM = stm32f2
|
||||
|
||||
FEATURES_PROVIDED += periph_hwrng
|
||||
FEATURES_PROVIDED += cortexm_mpu
|
||||
|
||||
-include $(RIOTCPU)/stm32_common/Makefile.features
|
||||
|
@ -4,4 +4,10 @@ CPU_FAM = stm32f3
|
||||
FEATURES_PROVIDED += periph_flashpage
|
||||
FEATURES_PROVIDED += periph_flashpage_raw
|
||||
|
||||
# only some stm32f3 have an MPU
|
||||
STM32F3_WITH_MPU += stm32f303re stm32f303vc stm32f303ze
|
||||
ifneq (, $(filter $(CPU_MODEL), $(STM32F3_WITH_MPU)))
|
||||
FEATURES_PROVIDED += cortexm_mpu
|
||||
endif
|
||||
|
||||
-include $(RIOTCPU)/stm32_common/Makefile.features
|
||||
|
@ -1,6 +1,7 @@
|
||||
CPU_ARCH = cortex-m4f
|
||||
CPU_FAM = stm32f4
|
||||
|
||||
FEATURES_PROVIDED += cortexm_mpu
|
||||
FEATURES_PROVIDED += periph_hwrng
|
||||
|
||||
# the granularity of provided feature definition for STMs is currently by CPU
|
||||
|
@ -1,5 +1,6 @@
|
||||
CPU_ARCH = cortex-m7
|
||||
CPU_FAM = stm32f7
|
||||
|
||||
FEATURES_PROVIDED += cortexm_mpu
|
||||
FEATURES_PROVIDED += periph_hwrng
|
||||
-include $(RIOTCPU)/stm32_common/Makefile.features
|
||||
|
@ -8,4 +8,10 @@ FEATURES_PROVIDED += periph_hwrng
|
||||
|
||||
BOARDS_WITHOUT_HWRNG += nucleo-l031k6
|
||||
|
||||
# only some stm32l0 have an MPU
|
||||
STM32L0_WITH_MPU += stm32l052t8
|
||||
ifneq (, $(filter $(CPU_MODEL), $(STM32L0_WITH_MPU)))
|
||||
FEATURES_PROVIDED += cortexm_mpu
|
||||
endif
|
||||
|
||||
-include $(RIOTCPU)/stm32_common/Makefile.features
|
||||
|
@ -1,6 +1,7 @@
|
||||
CPU_ARCH = cortex-m3
|
||||
CPU_FAM = stm32l1
|
||||
|
||||
FEATURES_PROVIDED += cortexm_mpu
|
||||
FEATURES_PROVIDED += periph_eeprom
|
||||
FEATURES_PROVIDED += periph_flashpage
|
||||
FEATURES_PROVIDED += periph_flashpage_raw
|
||||
|
@ -1,6 +1,7 @@
|
||||
CPU_ARCH = cortex-m4f
|
||||
CPU_FAM = stm32l4
|
||||
|
||||
FEATURES_PROVIDED += cortexm_mpu
|
||||
FEATURES_PROVIDED += periph_flashpage
|
||||
FEATURES_PROVIDED += periph_flashpage_raw
|
||||
FEATURES_PROVIDED += periph_hwrng
|
||||
|
@ -1,44 +1,6 @@
|
||||
BOARD ?= samr21-xpro
|
||||
include ../Makefile.tests_common
|
||||
|
||||
BOARD_WHITELIST += arduino-due # cortex-m3
|
||||
BOARD_WHITELIST += arduino-zero # cortex-m0plus
|
||||
BOARD_WHITELIST += cc2538dk # cortex-m3
|
||||
BOARD_WHITELIST += cc2650stk # cortex-m3
|
||||
BOARD_WHITELIST += ek-lm4f120xl # cortex-m4f
|
||||
BOARD_WHITELIST += f4vi1 # cortex-m4f
|
||||
BOARD_WHITELIST += fox # cortex-m3
|
||||
BOARD_WHITELIST += frdm-k64f # cortex-m4
|
||||
BOARD_WHITELIST += ikea-tradfri # cortex-m4f
|
||||
BOARD_WHITELIST += iotlab-a8-m3 # cortex-m3
|
||||
BOARD_WHITELIST += iotlab-m3 # cortex-m3
|
||||
BOARD_WHITELIST += limifrog-v1 # cortex-m3
|
||||
BOARD_WHITELIST += maple-mini # cortex-m3
|
||||
BOARD_WHITELIST += mbed_lpc1768 # cortex-m3
|
||||
BOARD_WHITELIST += msbiot # cortex-m4f
|
||||
BOARD_WHITELIST += mulle # cortex-m4
|
||||
BOARD_WHITELIST += nrf52dk # cortex-m4f
|
||||
BOARD_WHITELIST += nucleo-f103rb # cortex-m3
|
||||
BOARD_WHITELIST += nucleo-f207zg # cortex-m3
|
||||
BOARD_WHITELIST += nucleo-f303re # cortex-m4f
|
||||
BOARD_WHITELIST += nucleo-f334r8 # cortex-m4f
|
||||
BOARD_WHITELIST += nucleo-f401re # cortex-m4f
|
||||
BOARD_WHITELIST += nucleo-f446re # cortex-m4f
|
||||
BOARD_WHITELIST += nucleo-l152re # cortex-m3
|
||||
BOARD_WHITELIST += openmote-cc2538 # cortex-m3
|
||||
BOARD_WHITELIST += pba-d-01-kw2x # cortex-m4
|
||||
BOARD_WHITELIST += remote # cortex-m3
|
||||
BOARD_WHITELIST += samd21-xpro # cortex-m0plus
|
||||
BOARD_WHITELIST += saml21-xpro # cortex-m0plus
|
||||
BOARD_WHITELIST += samr21-xpro # cortex-m0plus
|
||||
BOARD_WHITELIST += sltb001a # cortex-m4f
|
||||
BOARD_WHITELIST += slwstk6220a # cortex-m4f
|
||||
BOARD_WHITELIST += sodaq-autonomo # cortex-m0plus
|
||||
BOARD_WHITELIST += spark-core # cortex-m3
|
||||
BOARD_WHITELIST += stm32f3discovery # cortex-m4f
|
||||
BOARD_WHITELIST += stm32f4discovery # cortex-m4f
|
||||
BOARD_WHITELIST += udoo # cortex-m3
|
||||
|
||||
USEMODULE += mpu_stack_guard
|
||||
|
||||
include $(RIOTBASE)/Makefile.include
|
||||
|
@ -1,3 +0,0 @@
|
||||
BOARD_INSUFFICIENT_MEMORY := \
|
||||
stm32f030f4-demo \
|
||||
#
|
@ -22,6 +22,14 @@
|
||||
|
||||
#include "cpu.h"
|
||||
#include "thread.h"
|
||||
#include "mpu.h"
|
||||
|
||||
/* RIOT's MPU headers gracefully fail when no MPU is present.
|
||||
* Use this to catch if RIOT's features are correctly gating MPU use.
|
||||
*/
|
||||
#if !__MPU_PRESENT
|
||||
#error "(!__MPU_PRESENT)"
|
||||
#endif
|
||||
|
||||
#define CANARY_VALUE 0xdeadbeef
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user