summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2021-02-02 12:20:05 -0700
committerCommit Bot <commit-bot@chromium.org>2021-02-02 22:36:49 +0000
commit691092183bb6338a2e24d4f335761ac0a961535e (patch)
tree516681d92c47d74f1fb0285987ae15c0e10ef941
parent216a7e211b68fc557f5075ab1516ee4832f087a8 (diff)
downloadchrome-ec-691092183bb6338a2e24d4f335761ac0a961535e.tar.gz
npcx: remove VBNVCNTXT storage in bbram
Nothing uses this anymore, we can free up these indexes for future use. BUG=b:178689388 BRANCH=none TEST=buildall Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Id7df3091edc3a8d8d07ebdfb0347a26a51389163 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2668690 Reviewed-by: Edward Hill <ecgh@chromium.org>
-rw-r--r--chip/npcx/system.c17
-rw-r--r--chip/npcx/system_chip.h2
2 files changed, 5 insertions, 14 deletions
diff --git a/chip/npcx/system.c b/chip/npcx/system.c
index e2fb468414..da688c2c42 100644
--- a/chip/npcx/system.c
+++ b/chip/npcx/system.c
@@ -82,13 +82,10 @@ void system_watchdog_reset(void)
/* Return true if index is stored as a single byte in bbram */
static int bbram_is_byte_access(enum bbram_data_index index)
{
- return (index >= BBRM_DATA_INDEX_VBNVCNTXT &&
- index < BBRM_DATA_INDEX_RAMLOG)
- || index == BBRM_DATA_INDEX_PD0
- || index == BBRM_DATA_INDEX_PD1
- || index == BBRM_DATA_INDEX_PD2
- || index == BBRM_DATA_INDEX_PANIC_FLAGS
- ;
+ return index == BBRM_DATA_INDEX_PD0 ||
+ index == BBRM_DATA_INDEX_PD1 ||
+ index == BBRM_DATA_INDEX_PD2 ||
+ index == BBRM_DATA_INDEX_PANIC_FLAGS;
}
/* Check and clear BBRAM status on any reset */
@@ -183,10 +180,6 @@ static int bbram_data_write(enum bbram_data_index index, uint32_t value)
/* Map idx to a returned BBRM_DATA_INDEX_*, or return -1 on invalid idx */
static int bbram_idx_lookup(enum system_bbram_idx idx)
{
- if (idx >= SYSTEM_BBRAM_IDX_VBNVBLOCK0 &&
- idx <= SYSTEM_BBRAM_IDX_VBNVBLOCK15)
- return BBRM_DATA_INDEX_VBNVCNTXT +
- idx - SYSTEM_BBRAM_IDX_VBNVBLOCK0;
if (idx == SYSTEM_BBRAM_IDX_PD0)
return BBRM_DATA_INDEX_PD0;
if (idx == SYSTEM_BBRAM_IDX_PD1)
@@ -1100,8 +1093,6 @@ const char *system_get_chip_revision(void)
return rev;
}
-BUILD_ASSERT(BBRM_DATA_INDEX_VBNVCNTXT + EC_VBNV_BLOCK_SIZE <= NPCX_BBRAM_SIZE);
-
/**
* Set a scratchpad register to the specified value.
*
diff --git a/chip/npcx/system_chip.h b/chip/npcx/system_chip.h
index 5a9533e59f..e3cc2a8865 100644
--- a/chip/npcx/system_chip.h
+++ b/chip/npcx/system_chip.h
@@ -28,7 +28,7 @@ enum bbram_data_index {
BBRM_DATA_INDEX_PD1 = 13, /* USB-PD saved port1 state */
BBRM_DATA_INDEX_TRY_SLOT = 14, /* Vboot EC try slot */
BBRM_DATA_INDEX_PD2 = 15, /* USB-PD saved port2 state */
- BBRM_DATA_INDEX_VBNVCNTXT = 16, /* VbNvContext for ARM arch */
+ /* Index 16-31 available for future use */
BBRM_DATA_INDEX_RAMLOG = 32, /* RAM log for Booter */
BBRM_DATA_INDEX_PANIC_FLAGS = 35, /* Flag to indicate validity of
* panic data starting at index