stm32:Support CONFIG_MPU_RESET and CONFIG_ARM_MPU_EARLY_RESET

This commit is contained in:
David Sidrane 2021-09-22 10:48:00 -07:00 committed by Xiang Xiao
parent 9d8f7126f6
commit fd2c1cb216
3 changed files with 10 additions and 1 deletions

View File

@ -53,7 +53,7 @@ ifeq ($(CONFIG_ARCH_RAMVECTORS),y)
CMN_CSRCS += arm_ramvec_initialize.c arm_ramvec_attach.c
endif
ifeq ($(CONFIG_ARM_MPU),y)
ifneq ($(filter y,$(CONFIG_ARM_MPU) $(CONFIG_ARM_MPU_EARLY_RESET)),)
CMN_CSRCS += arm_mpu.c
endif

View File

@ -78,6 +78,10 @@ void stm32_mpuinitialize(void)
mpu_showtype();
/* Reset MPU if enabled */
mpu_reset();
/* Configure user flash and SRAM space */
mpu_user_flash(USERSPACE->us_textstart,

View File

@ -33,6 +33,7 @@
#include "arm_arch.h"
#include "arm_internal.h"
#include "nvic.h"
#include "mpu.h"
#include "stm32.h"
#include "stm32_gpio.h"
@ -217,6 +218,10 @@ void __start(void)
"r"(CONFIG_IDLETHREAD_STACKSIZE - 64) :);
#endif
/* If enabled reset the MPU */
mpu_early_reset();
/* Configure the UART so that we can get debug output as soon as possible */
stm32_clockconfig();