summaryrefslogtreecommitdiff
path: root/common/fmap.c
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2017-01-12 09:40:10 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-03-16 00:11:41 -0700
commit3c4c83b8c3ec35af3a7ba19116e8467e9a09cc80 (patch)
tree3dc05b0e24a6c7840ce93d3069d4c998eaed08c3 /common/fmap.c
parent2a1cbf87821f311d98dd5d75707877b92b1d6df2 (diff)
downloadchrome-ec-3c4c83b8c3ec35af3a7ba19116e8467e9a09cc80.tar.gz
version: Store image size data in version struct
Store our image size (known at build time) in our version struct (now renamed to image_data). This will allow us to more efficiently determine the size of an image in a follow-up CL. Note that compatibility is broken for old ROs that do not include this CL. BUG=chromium:577915 TEST=Verify on kevin + lars + lars_pd that stored image size matches output of system_get_image_used() for both RO and RW images. BRANCH=None Change-Id: I7b8dc3ac8cf2df3184d0701a0e0ec8032de8d81b Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/450858 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'common/fmap.c')
-rw-r--r--common/fmap.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/common/fmap.c b/common/fmap.c
index f46b29b68e..c86d28b5ca 100644
--- a/common/fmap.c
+++ b/common/fmap.c
@@ -114,9 +114,9 @@ const struct _ec_fmap {
.area_name = "RO_FRID",
.area_offset = CONFIG_EC_PROTECTED_STORAGE_OFF -
FMAP_REGION_START + CONFIG_RO_STORAGE_OFF +
- RELATIVE_RO((uint32_t)__version_struct_offset) +
- offsetof(struct version_struct, version),
- .area_size = sizeof(version_data.version),
+ RELATIVE_RO((uint32_t)__image_data_offset) +
+ offsetof(struct image_data, version),
+ .area_size = sizeof(current_image_data.version),
.area_flags = FMAP_AREA_STATIC | FMAP_AREA_RO,
},
@@ -167,15 +167,15 @@ const struct _ec_fmap {
* RW firmware version ID. Must be NULL terminated
* ASCII, and padded with \0.
* TODO: Get the relative offset of
- * __version_struct_offset within our RW image to
+ * __image_data_offset within our RW image to
* accommodate image asymmetry.
*/
.area_name = "RW_FWID",
.area_offset = CONFIG_EC_WRITABLE_STORAGE_OFF -
FMAP_REGION_START + CONFIG_RW_STORAGE_OFF +
- RELATIVE_RO((uint32_t)__version_struct_offset) +
- offsetof(struct version_struct, version),
- .area_size = sizeof(version_data.version),
+ RELATIVE_RO((uint32_t)__image_data_offset) +
+ offsetof(struct image_data, version),
+ .area_size = sizeof(current_image_data.version),
.area_flags = FMAP_AREA_STATIC,
},
#ifdef CONFIG_RWSIG_TYPE_RWSIG