summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2019-10-28 18:26:40 -0700
committerShelley Chen <shchen@chromium.org>2019-11-01 22:16:44 +0000
commit4cb953efdb5413b3ad5a3853fa4e6c70b149901f (patch)
treed8c05b425c324ba274bea7a78114ab53e9368618
parent9577704f30c7e824c0590264df22d95a2c706575 (diff)
downloadchrome-ec-4cb953efdb5413b3ad5a3853fa4e6c70b149901f.tar.gz
fmap: Remove CONFIG_RO_STORAGE_OFF from EC_RO offset
The value CONFIG_RO_STORAGE_OFF was being used to define the area_offset for EC_RO. This means that when flashing EC_RO from the DUT, the bootloader region is not being written. This is causing issues when doing RO updates (like in dogfood programs) as the full data section is not being loaded properly. In the case of npcx, the previous bootloader would be coupled with the new RO image, This CL removes CONFIG_RO_STORAGE_OFF from the area_offset field of EC_RO so that both the header and RO image are written. BUG=b:142907781 BRANCH=None TEST=Tested with a script that mimics auto update by writing an older version of FW to RO, then uses the DUT to flash just the RO with a new version and then compares the RO that was read to what was supposed to be written. This script would always fail before, but with this CL now passes multiple iterations. Change-Id: I3d7af7de0dc1dfd24d6d304a8271290e6c6eb94e Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1885107 Reviewed-by: Shelley Chen <shchen@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Tested-by: Shelley Chen <shchen@chromium.org>
-rw-r--r--common/fmap.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/common/fmap.c b/common/fmap.c
index a78c35b9b2..001f83a184 100644
--- a/common/fmap.c
+++ b/common/fmap.c
@@ -111,14 +111,17 @@ const struct _ec_fmap {
/* RO Firmware */
{
/*
- * Range of RO firmware to be updated. Verified in
- * factory finalization by hash. Should not have
+ * Range of RO firmware to be updated. EC_RO
+ * section includes the bootloader section
+ * because it may need to be updated/paired
+ * with a different RO. Verified in factory
+ * finalization by hash. Should not have
* volatile data (ex, calibration results).
*/
.area_name = "EC_RO",
.area_offset = CONFIG_EC_PROTECTED_STORAGE_OFF -
- FMAP_REGION_START + CONFIG_RO_STORAGE_OFF,
- .area_size = CONFIG_RO_SIZE,
+ FMAP_REGION_START,
+ .area_size = CONFIG_RO_SIZE + CONFIG_RO_STORAGE_OFF,
.area_flags = FMAP_AREA_STATIC | FMAP_AREA_RO,
},
{