summaryrefslogtreecommitdiff
path: root/zephyr/linker
diff options
context:
space:
mode:
authorFabio Baltieri <fabiobaltieri@google.com>2021-07-07 14:47:57 +0000
committerCommit Bot <commit-bot@chromium.org>2021-08-10 21:53:26 +0000
commite3ded643c83a1fd87d800b37dc4b7a7f7f3f137f (patch)
tree2074753a8276194bf0a999bdaeb011d37e1af61c /zephyr/linker
parentd89284053e21cd21ebd5f5853d0de81709c72f08 (diff)
downloadchrome-ec-e3ded643c83a1fd87d800b37dc4b7a7f7f3f137f.tar.gz
zephyr: shim: reimplement host commands using iterables
Rewrite the host command shim using Zephyr iterable sections. This allows initializing the HC structure statically and gets rid of the runtime init code entirely. BRANCH=none BUG=b:195521227 TEST=build and run on volteer Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I94a55f8eb3e1d58de6a1d93c31b6170a5541a1fc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3010284 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'zephyr/linker')
-rw-r--r--zephyr/linker/CMakeLists.txt2
-rw-r--r--zephyr/linker/iterables-rom.ld3
2 files changed, 5 insertions, 0 deletions
diff --git a/zephyr/linker/CMakeLists.txt b/zephyr/linker/CMakeLists.txt
index 27b028d22c..316dcc71be 100644
--- a/zephyr/linker/CMakeLists.txt
+++ b/zephyr/linker/CMakeLists.txt
@@ -14,3 +14,5 @@ zephyr_linker_sources(RAM_SECTIONS image_size.ld)
# Little FW with specific purposes used by NPCX EC
zephyr_linker_sources_ifdef(CONFIG_SOC_FAMILY_NPCX ROM_START SORT_KEY 1
npcx-lfw.ld)
+
+zephyr_linker_sources(SECTIONS iterables-rom.ld)
diff --git a/zephyr/linker/iterables-rom.ld b/zephyr/linker/iterables-rom.ld
new file mode 100644
index 0000000000..dea5731465
--- /dev/null
+++ b/zephyr/linker/iterables-rom.ld
@@ -0,0 +1,3 @@
+#ifdef CONFIG_PLATFORM_EC_HOSTCMD
+ITERABLE_SECTION_ROM(host_command, 4)
+#endif