summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2015-05-11 14:23:31 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-05-15 06:42:30 +0000
commite3dce49334a2b44e337744bc719a27c63261f35e (patch)
tree3ee485350fafffaf53206036a3a19184068feeb5 /test
parentcba37a13d2342e4c81b0be3c84010baf3d846162 (diff)
downloadchrome-ec-e3dce49334a2b44e337744bc719a27c63261f35e.tar.gz
cleanup: Use appropriate image geometry CONFIGs
- Use CONFIG_*_MEM when dealing with images in program memory. - Use CONFIG_*_STORAGE when dealing with images on storage. - Use CONFIG_WP when dealing with the entire WP RO region. BUG=chrome-os-partner:39741,chrome-os-partner:23796 TEST=Manual on Cyan with subsequent commit. Verify that FMAP matches actual layout of image. Verify flashrom succeeds flashing + verifying EC image using host command interface. BRANCH=None Change-Id: Iadc02daa89fe3bf07b083ed0f7be2e60702a1867 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/270269
Diffstat (limited to 'test')
-rw-r--r--test/flash.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/test/flash.c b/test/flash.c
index ab99272ff2..3f7676d0f1 100644
--- a/test/flash.c
+++ b/test/flash.c
@@ -286,10 +286,10 @@ static int test_overwrite_current(void)
/* Test that we cannot overwrite current image */
if (system_get_image_copy() == SYSTEM_IMAGE_RO) {
- offset = CONFIG_RO_MEM_OFF;
+ offset = CONFIG_RO_STORAGE_OFF;
size = CONFIG_RO_SIZE;
} else {
- offset = CONFIG_RW_MEM_OFF;
+ offset = CONFIG_RW_STORAGE_OFF;
size = CONFIG_RW_SIZE;
}
@@ -312,10 +312,10 @@ static int test_overwrite_other(void)
/* Test that we can overwrite the other image */
if (system_get_image_copy() == SYSTEM_IMAGE_RW) {
- offset = CONFIG_RO_MEM_OFF;
+ offset = CONFIG_RO_STORAGE_OFF;
size = CONFIG_RO_SIZE;
} else {
- offset = CONFIG_RW_MEM_OFF;
+ offset = CONFIG_RW_STORAGE_OFF;
size = CONFIG_RW_SIZE;
}
@@ -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_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);
+ VERIFY_NO_WRITE(CONFIG_RO_STORAGE_OFF, sizeof(testdata), testdata);
+ VERIFY_NO_WRITE(CONFIG_RW_STORAGE_OFF, sizeof(testdata), testdata);
+ VERIFY_NO_ERASE(CONFIG_RO_STORAGE_OFF, CONFIG_FLASH_ERASE_SIZE);
+ VERIFY_NO_ERASE(CONFIG_RW_STORAGE_OFF, CONFIG_FLASH_ERASE_SIZE);
mock_flash_op_fail = EC_SUCCESS;
return EC_SUCCESS;
@@ -360,9 +360,9 @@ static int test_flash_info(void)
static int test_region_info(void)
{
VERIFY_REGION_INFO(EC_FLASH_REGION_RO,
- CONFIG_RO_MEM_OFF, CONFIG_RO_SIZE);
+ CONFIG_RO_STORAGE_OFF, CONFIG_RO_SIZE);
VERIFY_REGION_INFO(EC_FLASH_REGION_RW,
- CONFIG_RW_MEM_OFF, CONFIG_RW_SIZE);
+ CONFIG_RW_STORAGE_OFF, CONFIG_RW_SIZE);
VERIFY_REGION_INFO(EC_FLASH_REGION_WP_RO,
CONFIG_WP_OFF, CONFIG_WP_SIZE);
@@ -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_RO_MEM_OFF,
+ TEST_ASSERT(flash_physical_erase(CONFIG_RO_STORAGE_OFF,
CONFIG_FLASH_ERASE_SIZE) != EC_SUCCESS);
- TEST_ASSERT(flash_physical_erase(CONFIG_RW_MEM_OFF,
+ TEST_ASSERT(flash_physical_erase(CONFIG_RW_STORAGE_OFF,
CONFIG_FLASH_ERASE_SIZE) != EC_SUCCESS);
/* We should not even try to write/erase */
- 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);
+ VERIFY_NO_ERASE(CONFIG_RO_STORAGE_OFF, CONFIG_FLASH_ERASE_SIZE);
+ VERIFY_NO_ERASE(CONFIG_RW_STORAGE_OFF, CONFIG_FLASH_ERASE_SIZE);
+ VERIFY_NO_WRITE(CONFIG_RO_STORAGE_OFF, sizeof(testdata), testdata);
+ VERIFY_NO_WRITE(CONFIG_RW_STORAGE_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_RO_MEM_OFF,
+ TEST_ASSERT(flash_physical_erase(CONFIG_RO_STORAGE_OFF,
CONFIG_FLASH_ERASE_SIZE) != EC_SUCCESS);
return EC_SUCCESS;