summaryrefslogtreecommitdiff
path: root/zephyr
diff options
context:
space:
mode:
Diffstat (limited to 'zephyr')
-rw-r--r--zephyr/Kconfig7
-rw-r--r--zephyr/shim/include/config_chip.h5
-rw-r--r--zephyr/zmake/tests/test_version.py4
-rw-r--r--zephyr/zmake/zmake/version.py7
4 files changed, 23 insertions, 0 deletions
diff --git a/zephyr/Kconfig b/zephyr/Kconfig
index 58961630ce..563fddd737 100644
--- a/zephyr/Kconfig
+++ b/zephyr/Kconfig
@@ -281,6 +281,13 @@ config PLATFORM_EC_CONSOLE_CMD_SHMEM
used and the maximum number of bytes that have been used since
the EC started running.
+config PLATFORM_EC_CROS_FWID_VERSION
+ bool "Include CrOS FWID version"
+ default y
+ help
+ Include Chrome OS FWID in version output. The CrOS FWID will be common
+ across OS, AP firmware and EC firmware when built together.
+
config PLATFORM_EC_DEBUG_ASSERT
bool "Enable assertion failures"
default y
diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h
index 0ab812a5b8..f53e4025b7 100644
--- a/zephyr/shim/include/config_chip.h
+++ b/zephyr/shim/include/config_chip.h
@@ -633,6 +633,11 @@
#define CONFIG_CMD_SHMEM
#endif
+#undef CONFIG_CROS_FWID_VERSION
+#ifdef CONFIG_PLATFORM_EC_CROS_FWID_VERSION
+#define CONFIG_CROS_FWID_VERSION
+#endif
+
#ifdef CONFIG_PLATFORM_EC_TIMER
#define CONFIG_HWTIMER_64BIT
#define CONFIG_HW_SPECIFIC_UDELAY
diff --git a/zephyr/zmake/tests/test_version.py b/zephyr/zmake/tests/test_version.py
index 44997f94da..a238a8ac02 100644
--- a/zephyr/zmake/tests/test_version.py
+++ b/zephyr/zmake/tests/test_version.py
@@ -124,6 +124,8 @@ 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"
EXPECTED_HEADER_STATIC = (
@@ -132,6 +134,8 @@ 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 2d505769f2..47aba6d804 100644
--- a/zephyr/zmake/zmake/version.py
+++ b/zephyr/zmake/zmake/version.py
@@ -144,6 +144,9 @@ def write_version_header(version_str, output_path, static=False):
def add_def(name, value):
output.write("#define {} {}\n".format(name, util.c_str(value)))
+ def add_def_unquoted(name, value):
+ output.write("#define {} {}\n".format(name, value))
+
add_def("VERSION", version_str)
add_def("CROS_EC_VERSION32", version_str[:31])
@@ -154,6 +157,10 @@ 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")
+
contents = output.getvalue()
if not output_path.exists() or output_path.read_text() != contents:
output_path.write_text(contents)