summaryrefslogtreecommitdiff
path: root/zephyr/projects/intelrvp/BUILD.py
blob: f129b3d2d2cf52dae4a46104fd3dc26fef4f7a5f (plain)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# Copyright 2022 The ChromiumOS Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

"""Define zmake projects for intelrvp."""

# intelrvp has adlrvp_npcx, adlrvpp_ite, adlrvpp_mchp etc


def register_intelrvp_project(
    project_name,
    chip="npcx9m3f",
    extra_dts_overlays=(),
    extra_kconfig_files=(),
):
    """Register a variant of intelrvp."""
    register_func = register_binman_project
    if chip.startswith("mec1727"):
        register_func = register_mchp_project
    elif chip.startswith("npcx"):
        register_func = register_npcx_project

    kconfig_files = [here / "prj.conf"]
    dts_overlays = []
    if project_name.startswith("adlrvp"):
        kconfig_files.append(here / "adlrvp/prj.conf")
        dts_overlays.append(here / "adlrvp/battery.dts")
        dts_overlays.append(here / "adlrvp/ioex.dts")
    if project_name.startswith("mtlrvp"):
        kconfig_files.append(here / "mtlrvp/prj.conf")
        dts_overlays.append(here / "adlrvp/battery.dts")
    kconfig_files.extend(extra_kconfig_files)
    dts_overlays.extend(extra_dts_overlays)

    register_func(
        project_name=project_name,
        zephyr_board=chip,
        dts_overlays=dts_overlays,
        kconfig_files=kconfig_files,
    )


register_intelrvp_project(
    project_name="adlrvp_mchp",
    chip="mec1727",
    extra_dts_overlays=[
        here / "adlrvp/adlrvp_mchp/adlrvp_mchp.dts",
        here / "adlrvp/adlrvp_mchp/gpio.dts",
        here / "adlrvp/adlrvp_mchp/interrupts.dts",
        here / "adlrvp/adlrvp_mchp/keyboard.dts",
        here / "adlrvp/adlrvp_mchp/usbc.dts",
    ],
    extra_kconfig_files=[
        here / "legacy_ec_pwrseq.conf",
        here / "adlrvp/adlrvp_mchp/prj.conf",
    ],
)


register_intelrvp_project(
    project_name="adlrvp_npcx",
    chip="npcx9m7f",
    extra_dts_overlays=[
        here / "adlrvp/adlrvp_npcx/adlrvp_npcx.dts",
        here / "adlrvp/adlrvp_npcx/fan.dts",
        here / "adlrvp/adlrvp_npcx/gpio.dts",
        here / "adlrvp/adlrvp_npcx/interrupts.dts",
        here / "adlrvp/adlrvp_npcx/keyboard.dts",
        here / "adlrvp/adlrvp_npcx/temp_sensor.dts",
        here / "adlrvp/adlrvp_npcx/usbc.dts",
        here / "adlrvp/adlrvp_npcx/pwm_leds.dts",
    ],
    extra_kconfig_files=[
        here / "legacy_ec_pwrseq.conf",
        here / "adlrvp/adlrvp_npcx/prj.conf",
    ],
)


register_intelrvp_project(
    project_name="mtlrvpp_npcx",
    chip="npcx9m3f",
    extra_dts_overlays=[
        here / "mtlrvp/mtlrvpp_npcx/fan.dts",
        here / "mtlrvp/mtlrvpp_npcx/gpio.dts",
        here / "mtlrvp/mtlrvpp_npcx/keyboard.dts",
        here / "mtlrvp/mtlrvpp_npcx/interrupts.dts",
        here / "mtlrvp/ioex.dts",
        here / "mtlrvp/mtlrvpp_npcx/mtlrvp_npcx.dts",
        here / "mtlrvp/mtlrvpp_npcx/mtlrvp_npcx_power_signals.dts",
        here / "adlrvp/adlrvp_npcx/temp_sensor.dts",
        here / "mtlrvp/usbc.dts",
    ],
    extra_kconfig_files=[
        here / "zephyr_ap_pwrseq.conf",
        here / "mtlrvp/mtlrvpp_npcx/prj.conf",
    ],
)