summaryrefslogtreecommitdiff
path: root/common/flash.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/flash.c')
-rw-r--r--common/flash.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/common/flash.c b/common/flash.c
index 302dae0f08..6d903eca95 100644
--- a/common/flash.c
+++ b/common/flash.c
@@ -400,17 +400,11 @@ uint32_t flash_get_protect(void)
/* Scan flash protection */
for (i = 0; i < PHYSICAL_BANKS; i++) {
/* Is this bank part of RO */
- int is_ro = (i >= RO_BANK_OFFSET &&
- i < RO_BANK_OFFSET + RO_BANK_COUNT) ? 1 : 0;
- int bank_flag;
-
-#if defined(CONFIG_FLASH_PSTATE) && defined(CONFIG_FLASH_PSTATE_BANK)
- /* PSTATE acts like part of RO; protected at same time */
- if (i >= PSTATE_BANK && i < PSTATE_BANK + PSTATE_BANK_COUNT)
- is_ro = 1;
-#endif
- bank_flag = (is_ro ? EC_FLASH_PROTECT_RO_NOW :
- EC_FLASH_PROTECT_ALL_NOW);
+ int is_ro = (i >= WP_BANK_OFFSET &&
+ i < WP_BANK_OFFSET + WP_BANK_COUNT) ? 1 : 0;
+
+ int bank_flag = (is_ro ? EC_FLASH_PROTECT_RO_NOW :
+ EC_FLASH_PROTECT_ALL_NOW);
if (flash_physical_get_protect(i)) {
/* At least one bank in the region is protected */
@@ -879,11 +873,11 @@ static int flash_command_region_info(struct host_cmd_handler_args *args)
switch (p->region) {
case EC_FLASH_REGION_RO:
- r->offset = CONFIG_RO_MEM_OFF;
+ r->offset = CONFIG_RO_STORAGE_OFF;
r->size = CONFIG_RO_SIZE;
break;
case EC_FLASH_REGION_RW:
- r->offset = CONFIG_RW_MEM_OFF;
+ r->offset = CONFIG_RW_STORAGE_OFF;
r->size = CONFIG_RW_SIZE;
break;
case EC_FLASH_REGION_WP_RO: