forked from FrameworkComputer/EmbeddedController
-
Notifications
You must be signed in to change notification settings - Fork 1
/
configlib.py
58 lines (42 loc) · 2.05 KB
/
configlib.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Copyright 2021 The ChromiumOS Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This module defines helpers accessible to all BUILD.py files."""
import zmake.output_packers
def _register_project(**kwargs):
kwargs.setdefault(
"project_dir", here # noqa: F821 pylint: disable=undefined-variable
)
return register_project(
**kwargs
) # noqa: F821 pylint: disable=undefined-variable
def register_host_project(**kwargs):
"""Register a project that runs on a posix host."""
kwargs.setdefault("zephyr_board", "native_posix")
kwargs.setdefault("supported_toolchains", ["llvm", "host"])
kwargs.setdefault("output_packer", zmake.output_packers.ElfPacker)
return _register_project(**kwargs)
def register_raw_project(**kwargs):
"""Register a project that uses RawBinPacker."""
kwargs.setdefault("supported_toolchains", ["coreboot-sdk", "zephyr"])
kwargs.setdefault("output_packer", zmake.output_packers.RawBinPacker)
return _register_project(**kwargs)
def register_binman_project(**kwargs):
"""Register a project that uses BinmanPacker."""
kwargs.setdefault("output_packer", zmake.output_packers.BinmanPacker)
return register_raw_project(**kwargs)
def register_npcx_project(**kwargs):
"""Register a project that uses NpcxPacker."""
kwargs.setdefault("output_packer", zmake.output_packers.NpcxPacker)
kwargs.setdefault("modules", ["ec", "cmsis"])
return register_binman_project(**kwargs)
def register_mchp_project(**kwargs):
kwargs.setdefault("output_packer", zmake.output_packers.MchpPacker)
kwargs.setdefault("modules", ["ec", "cmsis"])
return register_binman_project(**kwargs)
def register_ish_project(**kwargs):
"""Register a project that uses IshBinPacker."""
kwargs.setdefault("supported_toolchains", ["coreboot-sdk", "zephyr"])
kwargs.setdefault("output_packer", zmake.output_packers.IshBinPacker)
kwargs.setdefault("modules", ["ec", "ish", "cmsis", "hal_intel"])
return _register_project(**kwargs)