summaryrefslogtreecommitdiff
path: root/zephyr/zmake/zmake/modules.py
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2021-02-17 14:43:01 -0700
committerCommit Bot <commit-bot@chromium.org>2021-02-18 17:23:39 +0000
commit7309b579fa7f6c784e9da2a7c3b489f2d9f4a005 (patch)
tree3160983fe9725c3d7ded981afd2e8ab15c010662 /zephyr/zmake/zmake/modules.py
parent00c766d9a10ad288f3a88840121ac140672fb8da (diff)
downloadchrome-ec-7309b579fa7f6c784e9da2a7c3b489f2d9f4a005.tar.gz
zephyr: zmake: drop version from module location
Drop the version parameter when locating modules in a ChromiumOS checkout, since it's not actually needed. Tools like west do not use separate branches of third-party modules for different kernel versions, so we don't need to implement that. v2.5 (just recently cloned) actually works for Zephyr 2.4 as well, so we hard-code 2.5 as the version for hal_stm32 and cmsis until we change the manifest.xml to not have the version parameter. BUG=b:180531609 BRANCH=none TEST=zmake testall TEST=build, flash, boot AP on volteer Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I40e2c1310aee29bbf0aca64c128462a753058d27 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2702693 Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'zephyr/zmake/zmake/modules.py')
-rw-r--r--zephyr/zmake/zmake/modules.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/zephyr/zmake/zmake/modules.py b/zephyr/zmake/zmake/modules.py
index d9d8d12d0c..8eababbf6c 100644
--- a/zephyr/zmake/zmake/modules.py
+++ b/zephyr/zmake/zmake/modules.py
@@ -10,37 +10,35 @@ import zmake.build_config as build_config
import zmake.util as util
-def third_party_module(name, checkout, version):
+def third_party_module(name, checkout):
"""Common callback in registry for all third_party/zephyr modules.
Args:
name: The name of the module.
checkout: The path to the chromiumos source.
- version: The zephyr version.
Return:
The path to the module module.
"""
- if not version or len(version) < 2:
- return None
- return checkout / 'src' / 'third_party' / 'zephyr' / name / 'v{}.{}'.format(
- version[0], version[1])
+ # TODO(b/180531609): version "v2.5" below is a misnomer, as these
+ # modules are actually compatible with all kernel versions. Drop
+ # v2.5 from the manifest checkout path and remove it from here.
+ return checkout / 'src' / 'third_party' / 'zephyr' / name / 'v2.5'
known_modules = {
'hal_stm32': third_party_module,
'cmsis': third_party_module,
- 'ec-shim': lambda name, checkout, version: (
+ 'ec-shim': lambda name, checkout: (
checkout / 'src' / 'platform' / 'ec'),
}
-def locate_modules(checkout_dir, version, modules=known_modules):
+def locate_modules(checkout_dir, modules=known_modules):
"""Resolve module locations from a known_modules dictionary.
Args:
checkout_dir: The path to the chromiumos source.
- version: The zephyr version, as a two or three tuple of ints.
modules: The known_modules dictionary to use for resolution.
Returns:
@@ -48,7 +46,7 @@ def locate_modules(checkout_dir, version, modules=known_modules):
"""
result = {}
for name, locator in known_modules.items():
- result[name] = locator(name, checkout_dir, version)
+ result[name] = locator(name, checkout_dir)
return result