summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Short <keithshort@chromium.org>2022-07-21 13:32:06 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-08-01 22:30:01 +0000
commit5d0edcf6d2db6a8d7701c8bcfc59c5bb58326e5f (patch)
treed56230d98bf3f35315cfebd4a29ffb2fce052e46
parent86db909517f1493b4bde2ad939c0ee248921995c (diff)
downloadchrome-ec-5d0edcf6d2db6a8d7701c8bcfc59c5bb58326e5f.tar.gz
zephyr: Delete CONFIG_PLATFORM_EC_MPU
CONFIG_PLATFORM_EC_MPU is redundant with the Zephyr Kconfig option, CONFIG_MPU. Use the Zephyr option directly. BUG=none BRANCH=none TEST=zmake testall --static; compare binaries Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Iff92c7e9fe3a003366d153e618d2450b367fd169 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3791660 Reviewed-by: Aaron Massey <aaronmassey@google.com>
-rw-r--r--Makefile.rules1
-rw-r--r--util/config_allowed.txt1
-rw-r--r--zephyr/Kconfig17
-rw-r--r--zephyr/app/ec/chip/arm/microchip_xec/Kconfig.xec4
-rw-r--r--zephyr/app/ec/chip/arm/nuvoton_npcx/Kconfig.npcx4
-rw-r--r--zephyr/linker/iram_text.ld2
-rw-r--r--zephyr/shim/core/cortex-m/CMakeLists.txt2
-rw-r--r--zephyr/shim/include/config_chip.h5
8 files changed, 12 insertions, 24 deletions
diff --git a/Makefile.rules b/Makefile.rules
index 0cf0580c88..8577a4bb04 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -255,6 +255,7 @@ conflicting_options := \
EEPROM \
I2C_BITBANG \
INA219 \
+ MPU \
PECI \
PS2 \
SPI \
diff --git a/util/config_allowed.txt b/util/config_allowed.txt
index 1df21511a1..368722e6a4 100644
--- a/util/config_allowed.txt
+++ b/util/config_allowed.txt
@@ -674,6 +674,7 @@ CONFIG_MOTION_MIN_SENSE_WAIT_TIME
CONFIG_MOTION_SENSE_RESUME_DELAY_US
CONFIG_MOTION_SENSE_SUSPEND_DELAY_US
CONFIG_MP4245
+CONFIG_MPU
CONFIG_NAME
CONFIG_NB7V904M_LPM_OVERRIDE
CONFIG_NO_PINHOLD
diff --git a/zephyr/Kconfig b/zephyr/Kconfig
index 601af45022..bec5e63c9d 100644
--- a/zephyr/Kconfig
+++ b/zephyr/Kconfig
@@ -491,23 +491,6 @@ config PLATFORM_EC_MKBP_HOST_EVENT_WAKEUP_MASK
HOST_EVENT_AC_CONNECTED)>;
The host events are defined in dt-bindings/wake_mask_event_defines.h
-config PLATFORM_EC_MPU
- bool "Support Memory-Protection Unit (MPU)"
- depends on CPU_CORTEX_M
- select ARM_MPU
- default y
- help
- This enables support a Memory-Protection Unit which can limit access
- to certain areas of memory. This can be used to protect code or data
- from being written to improve security or to find bugs.
-
- It causes any code in the iram.text section to be protected when
- system jump is disabled (see system_disable_jump()). It also stops
- execution of the image that is not currently being executed (read-only
- or read-write). If internal storage is used, this is achieved by not
- allowing code execution in that area. For external storage, it
- disallows loading any code into RAM.
-
config PLATFORM_EC_PANIC
bool "Panic output"
default y
diff --git a/zephyr/app/ec/chip/arm/microchip_xec/Kconfig.xec b/zephyr/app/ec/chip/arm/microchip_xec/Kconfig.xec
index d05ad020e7..6a78792733 100644
--- a/zephyr/app/ec/chip/arm/microchip_xec/Kconfig.xec
+++ b/zephyr/app/ec/chip/arm/microchip_xec/Kconfig.xec
@@ -8,6 +8,10 @@
if SOC_FAMILY_MEC
+# Enable MPU for ARM targets
+config ARM_MPU
+ default y
+
# ADC
config PLATFORM_EC_ADC_RESOLUTION
default 10
diff --git a/zephyr/app/ec/chip/arm/nuvoton_npcx/Kconfig.npcx b/zephyr/app/ec/chip/arm/nuvoton_npcx/Kconfig.npcx
index 2da9252775..2e3d3c95a0 100644
--- a/zephyr/app/ec/chip/arm/nuvoton_npcx/Kconfig.npcx
+++ b/zephyr/app/ec/chip/arm/nuvoton_npcx/Kconfig.npcx
@@ -8,6 +8,10 @@
if SOC_FAMILY_NPCX
+# Enable MPU for ARM targets
+config ARM_MPU
+ default y
+
# Enable NPCX firmware header generator
config NPCX_HEADER
default y
diff --git a/zephyr/linker/iram_text.ld b/zephyr/linker/iram_text.ld
index 3ea3f4db7e..9ad484459a 100644
--- a/zephyr/linker/iram_text.ld
+++ b/zephyr/linker/iram_text.ld
@@ -7,7 +7,7 @@
/* This code taken from core/cortex-m/ec.lds.S */
-#if defined(CONFIG_PLATFORM_EC_MPU)
+#if defined(CONFIG_MPU)
/* MPU regions must be aligned to a 32-byte boundary */
#define _IRAM_ALIGN 32
#else
diff --git a/zephyr/shim/core/cortex-m/CMakeLists.txt b/zephyr/shim/core/cortex-m/CMakeLists.txt
index dd975787dc..90617d75cf 100644
--- a/zephyr/shim/core/cortex-m/CMakeLists.txt
+++ b/zephyr/shim/core/cortex-m/CMakeLists.txt
@@ -3,4 +3,4 @@
# found in the LICENSE file.
zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_CONSOLE_CMD_IRQ irq_command.c)
-zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_MPU mpu.c)
+zephyr_library_sources_ifdef(CONFIG_MPU mpu.c)
diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h
index 10281f4b91..3221968a6c 100644
--- a/zephyr/shim/include/config_chip.h
+++ b/zephyr/shim/include/config_chip.h
@@ -2189,11 +2189,6 @@ extern struct jump_data mock_jump_data;
#define CONFIG_DEBUG_ASSERT_REBOOTS
#endif
-#undef CONFIG_MPU
-#ifdef CONFIG_PLATFORM_EC_MPU
-#define CONFIG_MPU
-#endif
-
#undef CONFIG_CMD_SYSINFO
#ifdef CONFIG_PLATFORM_EC_CONSOLE_CMD_SYSINFO
#define CONFIG_CMD_SYSINFO