diff options
author | Shawn Nematbakhsh <shawnn@chromium.org> | 2017-01-12 09:40:10 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-03-16 00:11:41 -0700 |
commit | 3c4c83b8c3ec35af3a7ba19116e8467e9a09cc80 (patch) | |
tree | 3dc05b0e24a6c7840ce93d3069d4c998eaed08c3 /chip/mec1322 | |
parent | 2a1cbf87821f311d98dd5d75707877b92b1d6df2 (diff) | |
download | chrome-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 'chip/mec1322')
-rw-r--r-- | chip/mec1322/lfw/ec_lfw.c | 2 | ||||
-rw-r--r-- | chip/mec1322/lfw/ec_lfw.ld | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/chip/mec1322/lfw/ec_lfw.c b/chip/mec1322/lfw/ec_lfw.c index 6824d10686..b99d33d011 100644 --- a/chip/mec1322/lfw/ec_lfw.c +++ b/chip/mec1322/lfw/ec_lfw.c @@ -256,7 +256,7 @@ void lfw_main() spi_enable(CONFIG_SPI_FLASH_PORT, 1); uart_puts("littlefw "); - uart_puts(version_data.version); + uart_puts(current_image_data.version); uart_puts("\n"); switch (system_get_image_copy()) { diff --git a/chip/mec1322/lfw/ec_lfw.ld b/chip/mec1322/lfw/ec_lfw.ld index 55b5fda390..adb8b30bba 100644 --- a/chip/mec1322/lfw/ec_lfw.ld +++ b/chip/mec1322/lfw/ec_lfw.ld @@ -53,4 +53,6 @@ SECTIONS . = ORIGIN(SRAM) + LENGTH(SRAM) - 1; BYTE(0xFF); /* emit at least a byte to make linker happy */ } + + __image_size = LOADADDR(.text) + SIZEOF(.text) - ORIGIN(VECTOR); } |