summaryrefslogtreecommitdiff
path: root/common/vboot_hash.c
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2015-09-17 11:34:16 -0700
committerchrome-bot <chrome-bot@chromium.org>2015-09-21 11:23:31 -0700
commitb03f92fbccb4cd07edee75b6eea654692f3dbdf9 (patch)
tree33e62ce7e8ec3ed3813f9c9477abc1042fc61a39 /common/vboot_hash.c
parent85110d5bcbf1223f171df905ecff2af3fde56724 (diff)
downloadchrome-ec-b03f92fbccb4cd07edee75b6eea654692f3dbdf9.tar.gz
cleanup: Fix mapped storage accesses
1. Don't assume that images are present in program memory, just because storage is mapped (npcx case). 2. Use CONFIG_MAPPED_STORAGE_BASE correctly, rather than PROGRAM_MEMORY_BASE. BUG=chrome-os-partner:23796 TEST=make buildall -j BRANCH=none Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: I99c2b382def2a211241d401bbdc39a88ceedca5b Reviewed-on: https://chromium-review.googlesource.com/300254 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Mulin Chao <mlchao@nuvoton.com> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'common/vboot_hash.c')
-rw-r--r--common/vboot_hash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/vboot_hash.c b/common/vboot_hash.c
index e90fe50b07..42d1a0f11c 100644
--- a/common/vboot_hash.c
+++ b/common/vboot_hash.c
@@ -112,7 +112,7 @@ static void vboot_hash_next_chunk(void)
size = MIN(CHUNK_SIZE, data_size - curr_pos);
#ifdef CONFIG_MAPPED_STORAGE
- SHA256_update(&ctx, (const uint8_t *)(CONFIG_PROGRAM_MEMORY_BASE +
+ SHA256_update(&ctx, (const uint8_t *)(CONFIG_MAPPED_STORAGE_BASE +
data_offset + curr_pos), size);
#else
if (read_and_hash_chunk(data_offset + curr_pos, size) != EC_SUCCESS)