summaryrefslogtreecommitdiff
path: root/common/version.c
diff options
context:
space:
mode:
authorYuval Peress <peress@chromium.org>2021-02-09 13:05:51 -0700
committerCommit Bot <commit-bot@chromium.org>2021-02-10 21:59:33 +0000
commitd6b4ab27daa1e95bcc8939a59e3407ba2574a48b (patch)
treec2e3b280d954b5556d4e6f4be5f3e738241ed7bd /common/version.c
parentbd0a091787d9b3cb57ff88dd37b9895ed5c72f03 (diff)
downloadchrome-ec-d6b4ab27daa1e95bcc8939a59e3407ba2574a48b.tar.gz
zephyr: fix version console command
Fixes the data seen by the version console command. Since the version data structure is suppose to be at the same offset from the start of the image, running `version` in the ec terminal previously did not yield any values for the RW image (the .rodata.ver section was at a different offset for RW vs RO). - Add a new fixed-sections.ld file that adds the .fixed section. - Include it into all our builds at the start of the sections. - Add a new macro in common.h to allow us to specify that a section should be at a fixed location (FIXED_SECTION). - Use that macro to put the version information in that location. Sample output: 21-02-09 12:59:45.531 version 21-02-09 12:59:46.638 Chip: chromeos emu 21-02-09 12:59:46.642 Board: 1 21-02-09 12:59:46.647 RO: _v2.0.7390+2d340147c 21-02-09 12:59:46.672 RW: _v2.0.7390+2d340147c 21-02-09 12:59:46.675 Build: _v2.0.7390+2d340147c 21-02-09 12:59:46.680 2021-02-09 12:58:26 BRANCH=none BUG=b:164421798 TEST=build volteer, flash, run `version` command. TEST=zmake testall Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: Id19a07d16b5e307d81e8a411b933d9e9a674eb27 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2685339 Commit-Queue: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/version.c')
-rw-r--r--common/version.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/version.c b/common/version.c
index c854e2b39f..4b42418835 100644
--- a/common/version.c
+++ b/common/version.c
@@ -18,7 +18,7 @@ BUILD_ASSERT(CONFIG_ROLLBACK_VERSION >= 0);
BUILD_ASSERT(CONFIG_ROLLBACK_VERSION <= INT32_MAX);
const struct image_data __keep current_image_data
- __attribute__((section(".rodata.ver"))) = {
+ FIXED_SECTION("ver") = {
.cookie1 = CROS_EC_IMAGE_DATA_COOKIE1,
.version = CROS_EC_VERSION32,
#ifndef TEST_BUILD