summaryrefslogtreecommitdiff
path: root/test/flash.c
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2015-05-11 10:16:41 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-05-12 20:54:37 +0000
commit39bd18b890bb708e79e9ba50dd3b5bf3d35e9ff1 (patch)
tree69b9331013e942bcbae05c10f863ad0ae9bc4f3b /test/flash.c
parent3a36c29e6756231f2fb1fdd26447d519cbd5b26a (diff)
downloadchrome-ec-39bd18b890bb708e79e9ba50dd3b5bf3d35e9ff1.tar.gz
cleanup: Rename image geometry CONFIGs
Rename image geometry configs with a uniform naming scheme to make their purposes more clear. CONFIG_RO_MEM_OFF (was CONFIG_FW_RO_OFF) - RO image offset in program memory CONFIG_RO_STORAGE_OFF (was CONFIG_RO_SPI_OFF) - RO image offset on storage CONFIG_RO_SIZE (was CONFIG_FW_RO_SIZE) - Size of RO image CONFIG_RW_MEM_OFF (was CONFIG_FW_RW_OFF) - RW image offset in program memory CONFIG_RW_STORAGE_OFF (was CONFIG_RW_SPI_OFF) - RW image offset on storage CONFIG_RW_SIZE (was CONFIG_FW_RW_SIZE) - Size of RW image CONFIG_WP_OFF (was CONFIG_FW_WP_RO_OFF) - Offset of WP region on storage CONFIG_WP_SIZE (was CONFIG_FW_WP_RO_SIZE) - Size of WP region on storage BUG=chrome-os-partner:39741,chrome-os-partner:23796 TEST=Set date / version strings to constants then `make buildall -j`. Verify that each ec.bin image is identical pre- and post-change. BRANCH=None Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: I6ea0a4e456dae71c266fa917a309b9f6fa4b50cd Reviewed-on: https://chromium-review.googlesource.com/270189 Reviewed-by: Anton Staaf <robotboy@chromium.org>
Diffstat (limited to 'test/flash.c')
-rw-r--r--test/flash.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/test/flash.c b/test/flash.c
index 2b3114854c..ab99272ff2 100644
--- a/test/flash.c
+++ b/test/flash.c
@@ -286,11 +286,11 @@ static int test_overwrite_current(void)
/* Test that we cannot overwrite current image */
if (system_get_image_copy() == SYSTEM_IMAGE_RO) {
- offset = CONFIG_FW_RO_OFF;
- size = CONFIG_FW_RO_SIZE;
+ offset = CONFIG_RO_MEM_OFF;
+ size = CONFIG_RO_SIZE;
} else {
- offset = CONFIG_FW_RW_OFF;
- size = CONFIG_FW_RW_SIZE;
+ offset = CONFIG_RW_MEM_OFF;
+ size = CONFIG_RW_SIZE;
}
#ifdef EMU_BUILD
@@ -312,11 +312,11 @@ static int test_overwrite_other(void)
/* Test that we can overwrite the other image */
if (system_get_image_copy() == SYSTEM_IMAGE_RW) {
- offset = CONFIG_FW_RO_OFF;
- size = CONFIG_FW_RO_SIZE;
+ offset = CONFIG_RO_MEM_OFF;
+ size = CONFIG_RO_SIZE;
} else {
- offset = CONFIG_FW_RW_OFF;
- size = CONFIG_FW_RW_SIZE;
+ offset = CONFIG_RW_MEM_OFF;
+ size = CONFIG_RW_SIZE;
}
#ifdef EMU_BUILD
@@ -335,10 +335,10 @@ static int test_overwrite_other(void)
static int test_op_failure(void)
{
mock_flash_op_fail = EC_ERROR_UNKNOWN;
- VERIFY_NO_WRITE(CONFIG_FW_RO_OFF, sizeof(testdata), testdata);
- VERIFY_NO_WRITE(CONFIG_FW_RW_OFF, sizeof(testdata), testdata);
- VERIFY_NO_ERASE(CONFIG_FW_RO_OFF, CONFIG_FLASH_ERASE_SIZE);
- VERIFY_NO_ERASE(CONFIG_FW_RW_OFF, CONFIG_FLASH_ERASE_SIZE);
+ VERIFY_NO_WRITE(CONFIG_RO_MEM_OFF, sizeof(testdata), testdata);
+ VERIFY_NO_WRITE(CONFIG_RW_MEM_OFF, sizeof(testdata), testdata);
+ VERIFY_NO_ERASE(CONFIG_RO_MEM_OFF, CONFIG_FLASH_ERASE_SIZE);
+ VERIFY_NO_ERASE(CONFIG_RW_MEM_OFF, CONFIG_FLASH_ERASE_SIZE);
mock_flash_op_fail = EC_SUCCESS;
return EC_SUCCESS;
@@ -360,11 +360,11 @@ static int test_flash_info(void)
static int test_region_info(void)
{
VERIFY_REGION_INFO(EC_FLASH_REGION_RO,
- CONFIG_FW_RO_OFF, CONFIG_FW_RO_SIZE);
+ CONFIG_RO_MEM_OFF, CONFIG_RO_SIZE);
VERIFY_REGION_INFO(EC_FLASH_REGION_RW,
- CONFIG_FW_RW_OFF, CONFIG_FW_RW_SIZE);
+ CONFIG_RW_MEM_OFF, CONFIG_RW_SIZE);
VERIFY_REGION_INFO(EC_FLASH_REGION_WP_RO,
- CONFIG_FW_WP_RO_OFF, CONFIG_FW_WP_RO_SIZE);
+ CONFIG_WP_OFF, CONFIG_WP_SIZE);
return EC_SUCCESS;
}
@@ -391,16 +391,16 @@ static int test_write_protect(void)
ASSERT_WP_FLAGS(EC_FLASH_PROTECT_ALL_NOW | EC_FLASH_PROTECT_RO_AT_BOOT);
/* Check we cannot erase anything */
- TEST_ASSERT(flash_physical_erase(CONFIG_FW_RO_OFF,
+ TEST_ASSERT(flash_physical_erase(CONFIG_RO_MEM_OFF,
CONFIG_FLASH_ERASE_SIZE) != EC_SUCCESS);
- TEST_ASSERT(flash_physical_erase(CONFIG_FW_RW_OFF,
+ TEST_ASSERT(flash_physical_erase(CONFIG_RW_MEM_OFF,
CONFIG_FLASH_ERASE_SIZE) != EC_SUCCESS);
/* We should not even try to write/erase */
- VERIFY_NO_ERASE(CONFIG_FW_RO_OFF, CONFIG_FLASH_ERASE_SIZE);
- VERIFY_NO_ERASE(CONFIG_FW_RW_OFF, CONFIG_FLASH_ERASE_SIZE);
- VERIFY_NO_WRITE(CONFIG_FW_RO_OFF, sizeof(testdata), testdata);
- VERIFY_NO_WRITE(CONFIG_FW_RW_OFF, sizeof(testdata), testdata);
+ VERIFY_NO_ERASE(CONFIG_RO_MEM_OFF, CONFIG_FLASH_ERASE_SIZE);
+ VERIFY_NO_ERASE(CONFIG_RW_MEM_OFF, CONFIG_FLASH_ERASE_SIZE);
+ VERIFY_NO_WRITE(CONFIG_RO_MEM_OFF, sizeof(testdata), testdata);
+ VERIFY_NO_WRITE(CONFIG_RW_MEM_OFF, sizeof(testdata), testdata);
return EC_SUCCESS;
}
@@ -409,7 +409,7 @@ static int test_boot_write_protect(void)
{
/* Check write protect state persists through reboot */
ASSERT_WP_FLAGS(EC_FLASH_PROTECT_RO_NOW | EC_FLASH_PROTECT_RO_AT_BOOT);
- TEST_ASSERT(flash_physical_erase(CONFIG_FW_RO_OFF,
+ TEST_ASSERT(flash_physical_erase(CONFIG_RO_MEM_OFF,
CONFIG_FLASH_ERASE_SIZE) != EC_SUCCESS);
return EC_SUCCESS;