summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2015-01-22 14:21:32 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-01-23 19:56:17 +0000
commit3df8bd8772cff174ab5490b9c2f2f6673b36e05e (patch)
treea0e94c50701fac98ebdaa2da3b870cf5c801cd99
parent4a8ce9ac348916f25f8bed5bcfc5c1432ea3c4d1 (diff)
downloadchrome-ec-3df8bd8772cff174ab5490b9c2f2f6673b36e05e.tar.gz
cortex-m: allow to lock/unlock empty MPU region
When the MPU region to modify is empty (size == 0) returns EC_SUCCESS rather than EC_ERROR_INVAL, so we are not failing MPU activation on systems without anything in the .iram.text section. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=all BUG=chrome-os-partner:35774 TEST=on Samus, with WP, try "sysjump disable" on the EC command line and see "RAM locked. Exclusion 20006ee0-20006ee0" message. Change-Id: I0103e0f7aa81ee64a70dd47ffb1c50067ce5a6ee Reviewed-on: https://chromium-review.googlesource.com/242690 Trybot-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--core/cortex-m/mpu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/cortex-m/mpu.c b/core/cortex-m/mpu.c
index 8513f972bd..9082f545c3 100644
--- a/core/cortex-m/mpu.c
+++ b/core/cortex-m/mpu.c
@@ -64,7 +64,7 @@ static int mpu_config_region(uint8_t region, uint32_t addr, uint32_t size,
int size_bit = 0;
if (!size)
- return -EC_ERROR_INVAL;
+ return EC_SUCCESS;
while (!(size & 1)) {
size_bit++;
size >>= 1;