diff options
author | Mary Ruthven <mruthven@chromium.org> | 2021-11-09 19:50:39 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-11-18 04:53:04 +0000 |
commit | 4076cecbaf563e010610a20b9fe2870754996f03 (patch) | |
tree | 15536e4cbf8ccf9b2ac2bfc4c0f676d5ef2b2296 | |
parent | b69596420685c5038e7df15732ac402e5d21839a (diff) | |
download | chrome-ec-4076cecbaf563e010610a20b9fe2870754996f03.tar.gz |
Revert "Treat SYSTEM_IMAGE_RW_B also as RW copy"
This reverts commit 5da63f4ea2c93e6b059d8c50ff01dbe53a13dec2.
BUG=b:200823466
TEST=make buildall -j
Change-Id: Id035f3e4a107c00407c16cc878bd88da63f9de7f
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273451
Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
-rw-r--r-- | common/flash.c | 2 | ||||
-rw-r--r-- | common/system.c | 14 | ||||
-rw-r--r-- | include/system.h | 7 | ||||
-rw-r--r-- | test/flash.c | 2 |
4 files changed, 4 insertions, 21 deletions
diff --git a/common/flash.c b/common/flash.c index 10dfc6062e..f2ab3dcd27 100644 --- a/common/flash.c +++ b/common/flash.c @@ -374,7 +374,7 @@ static const uintptr_t get_pstate_addr(void) uintptr_t addr = (uintptr_t)&pstate_data; /* Always use the pstate data in RO, even if we're RW */ - if (system_is_in_rw()) + if (system_get_image_copy() == SYSTEM_IMAGE_RW) addr += CONFIG_RO_MEM_OFF - CONFIG_RW_MEM_OFF; return addr; diff --git a/common/system.c b/common/system.c index 6016bfaef9..1d4586a8ce 100644 --- a/common/system.c +++ b/common/system.c @@ -467,16 +467,6 @@ static void jump_to_image(uintptr_t init_addr) resetvec(); } -static int is_rw_image(enum system_image_copy_t copy) -{ - return copy == SYSTEM_IMAGE_RW || copy == SYSTEM_IMAGE_RW_B; -} - -int system_is_in_rw(void) -{ - return is_rw_image(system_get_image_copy()); -} - test_mockable int system_run_image_copy(enum system_image_copy_t copy) { uintptr_t base; @@ -495,7 +485,7 @@ test_mockable int system_run_image_copy(enum system_image_copy_t copy) return EC_ERROR_ACCESS_DENIED; /* Target image must be RW image */ - if (!is_rw_image(copy)) + if (copy != SYSTEM_IMAGE_RW) return EC_ERROR_ACCESS_DENIED; /* Jumping must still be enabled */ @@ -568,7 +558,7 @@ static const struct image_data *system_get_image_data( * Read the version information from the proper location * on storage. */ - addr += (is_rw_image(copy)) ? + addr += (copy == SYSTEM_IMAGE_RW) ? CONFIG_EC_WRITABLE_STORAGE_OFF + CONFIG_RW_STORAGE_OFF : CONFIG_EC_PROTECTED_STORAGE_OFF + CONFIG_RO_STORAGE_OFF; diff --git a/include/system.h b/include/system.h index eefbff1d7e..27f6810f02 100644 --- a/include/system.h +++ b/include/system.h @@ -28,13 +28,6 @@ enum system_image_copy_t { }; /** - * Checks if running image is RW or not - * - * @return True if system is running in a RW image or false otherwise. - */ -int system_is_in_rw(void); - -/** * Pre-initializes the module. This occurs before clocks or tasks are * set up. */ diff --git a/test/flash.c b/test/flash.c index 7ca1e43c3a..b23af5e05f 100644 --- a/test/flash.c +++ b/test/flash.c @@ -313,7 +313,7 @@ static int test_overwrite_other(void) uint32_t offset, size; /* Test that we can overwrite the other image */ - if (system_is_in_rw()) { + if (system_get_image_copy() == SYSTEM_IMAGE_RW) { offset = CONFIG_RO_STORAGE_OFF; size = CONFIG_RO_SIZE; } else { |