diff options
author | Jack Rosenthal <jrosenth@chromium.org> | 2021-02-17 14:43:01 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-02-18 17:23:39 +0000 |
commit | 7309b579fa7f6c784e9da2a7c3b489f2d9f4a005 (patch) | |
tree | 3160983fe9725c3d7ded981afd2e8ab15c010662 | |
parent | 00c766d9a10ad288f3a88840121ac140672fb8da (diff) | |
download | chrome-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>
-rw-r--r-- | zephyr/zmake/zmake/modules.py | 18 | ||||
-rw-r--r-- | zephyr/zmake/zmake/zmake.py | 7 |
2 files changed, 11 insertions, 14 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 diff --git a/zephyr/zmake/zmake/zmake.py b/zephyr/zmake/zmake/zmake.py index 217e66bae6..92b9f5e293 100644 --- a/zephyr/zmake/zmake/zmake.py +++ b/zephyr/zmake/zmake/zmake.py @@ -81,7 +81,7 @@ class Zmake: zephyr_base = zephyr_base.resolve() if not module_paths: - module_paths = zmake.modules.locate_modules(self.checkout, version) + module_paths = zmake.modules.locate_modules(self.checkout) # Resolve build_dir if needed. build_dir = util.resolve_build_dir( @@ -284,7 +284,7 @@ class Zmake: def testall(self, fail_fast=False): """Test all the valid test targets""" - modules = zmake.modules.locate_modules(self.checkout, version=None) + modules = zmake.modules.locate_modules(self.checkout) root_dirs = [modules['ec-shim'] / 'zephyr'] project_dirs = [] for root_dir in root_dirs: @@ -320,5 +320,4 @@ class Zmake: @property def platform_ec_dir(self): return zmake.modules.locate_modules( - checkout_dir=self.checkout, - version=None)['ec-shim'] + checkout_dir=self.checkout)['ec-shim'] |