diff options
author | Tristan Honscheid <honscheid@google.com> | 2022-05-20 11:47:18 -0600 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-06-13 17:34:46 +0000 |
commit | 35bce911748fe8b97b9ad598e996c20e6e5bac57 (patch) | |
tree | df5dd75bd8f4447fe9dd6121ac7327d76b88c35b | |
parent | df2d8989ba52ce25438a57ca3f505413fc64440a (diff) | |
download | chrome-ec-35bce911748fe8b97b9ad598e996c20e6e5bac57.tar.gz |
zephyr: Remove ec_version.h dependency on common/system.c
common/system.c includes ec_version.h to access its definition
of CROS_FWID_MISSING_STR. However, this is just a constant placeholder
for cases when an actual version string is not available. It does not
need to placed into the auto-generated ec_version.h header.
* Remove the code that adds the CROS_FWID_MISSING_STR definition in
zmake
* Place the #define macro into cros_version.h, which is included by
common/system.c already.
* Update zmake unit tests
BRANCH=None
BUG=None
TEST=zmake test test-drivers
Signed-off-by: Tristan Honscheid <honscheid@google.com>
Change-Id: I8bb8406823e7860162157c1baaa21440608f3eea
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3656257
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
-rw-r--r-- | common/system.c | 1 | ||||
-rw-r--r-- | include/cros_version.h | 2 | ||||
-rw-r--r-- | zephyr/zmake/tests/test_version.py | 2 | ||||
-rw-r--r-- | zephyr/zmake/zmake/version.py | 1 |
4 files changed, 2 insertions, 4 deletions
diff --git a/common/system.c b/common/system.c index 9b0e6f25a0..f53d444733 100644 --- a/common/system.c +++ b/common/system.c @@ -12,7 +12,6 @@ #include "console.h" #include "cpu.h" #include "cros_board_info.h" -#include "ec_version.h" #include "dma.h" #include "extpower.h" #include "flash.h" diff --git a/include/cros_version.h b/include/cros_version.h index 585c2c1013..47fa8d1774 100644 --- a/include/cros_version.h +++ b/include/cros_version.h @@ -17,6 +17,8 @@ #define CROS_EC_IMAGE_DATA_COOKIE3_MASK GENMASK(31, 8) #define CROS_EC_IMAGE_DATA_COOKIE3_VERSION GENMASK(7, 0) +#define CROS_FWID_MISSING_STR "CROS_FWID_MISSING" + struct image_data { uint32_t cookie1; char version[32]; diff --git a/zephyr/zmake/tests/test_version.py b/zephyr/zmake/tests/test_version.py index e56e13a519..9e00473752 100644 --- a/zephyr/zmake/tests/test_version.py +++ b/zephyr/zmake/tests/test_version.py @@ -133,7 +133,6 @@ EXPECTED_HEADER = ( '#define CROS_EC_VERSION32 "trogdor_v2.6.1004-cmsis:0dead0,"\n' '#define BUILDER "toukmond@pokey"\n' '#define DATE "2021-06-28 03:18:53"\n' - '#define CROS_FWID_MISSING_STR "CROS_FWID_MISSING"\n' "#define CROS_FWID32 CROS_FWID_MISSING_STR\n" ) HEADER_VERSION_STR_STATIC = "trogdor_v2.6.0-STATIC" @@ -143,7 +142,6 @@ EXPECTED_HEADER_STATIC = ( '#define CROS_EC_VERSION32 "trogdor_v2.6.0-STATIC"\n' '#define BUILDER "reproducible@build"\n' '#define DATE "STATIC_VERSION_DATE"\n' - '#define CROS_FWID_MISSING_STR "CROS_FWID_MISSING"\n' "#define CROS_FWID32 CROS_FWID_MISSING_STR\n" ) diff --git a/zephyr/zmake/zmake/version.py b/zephyr/zmake/zmake/version.py index 2333ad46df..5ac060f23b 100644 --- a/zephyr/zmake/zmake/version.py +++ b/zephyr/zmake/zmake/version.py @@ -162,7 +162,6 @@ def write_version_header(version_str, output_path, static=False): add_def("BUILDER", "{}@{}".format(getpass.getuser(), platform.node())) add_def("DATE", datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")) - add_def("CROS_FWID_MISSING_STR", "CROS_FWID_MISSING") # TODO(b/198475757): Add zmake support for getting CROS_FWID32 add_def_unquoted("CROS_FWID32", "CROS_FWID_MISSING_STR") |