# Copyright 2021 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.


def register_variant(project_name, extra_dts_overlays=(), extra_kconfig_files=()):
    register_npcx_project(
        project_name=project_name,
        zephyr_board="npcx9",
        dts_overlays=[
            # Common to all projects.
            here / "adc.dts",
            here / "battery.dts",
            here / "gpio.dts",
            here / "common.dts",
            here / "i2c.dts",
            here / "interrupts.dts",
            here / "motionsense.dts",
            here / "pwm.dts",
            here / "switchcap.dts",
            here / "usbc.dts",
            # Project-specific DTS customization.
            *extra_dts_overlays,
        ],
        kconfig_files=[
            # Common to all projects.
            here / "prj.conf",
            # Project-specific KConfig customization.
            *extra_kconfig_files,
        ],
    )


register_variant(
    project_name="herobrine_npcx9",
)


register_variant(
    project_name="hoglin",
    extra_kconfig_files=[here / "prj_hoglin.conf"],
)

# Copyright 2021 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.


def register_variant(project_name, extra_dts_overlays=(), extra_kconfig_files=()):
    register_npcx_project(
        project_name=project_name,
        zephyr_board="npcx9",
        dts_overlays=[
            # Common to all projects.
            here / "adc.dts",
            here / "battery.dts",
            here / "gpio.dts",
            here / "common.dts",
            here / "i2c.dts",
            here / "interrupts.dts",
            here / "motionsense.dts",
            here / "pwm.dts",
            here / "switchcap.dts",
            here / "usbc.dts",
            # Project-specific DTS customization.
            *extra_dts_overlays,
        ],
        kconfig_files=[
            # Common to all projects.
            here / "prj.conf",
            # Project-specific KConfig customization.
            *extra_kconfig_files,
        ],
    )


register_variant(
    project_name="herobrine_npcx9",
    extra_kconfig_files=[here / "prj_herobrine_npcx9.conf"],
)


register_variant(
    project_name="hoglin",
    extra_kconfig_files=[here / "prj_hoglin.conf"],
)

Include the missing project config
herobrine: Include the missing project config

Need to include the project config prj_herobrine_npcx9.conf to
the build. It defines CONFIG_BOARD_HEROBRINE_NPCX9=y. The board
specific alternative component code (alt_dev_replacement.c)
requires this Kconfig option.

BRANCH=None
BUG=b:216836197
TEST=Booted the herobrine_npcx9 image. No PPC access error and
PD message loop.

Change-Id: I73a9987ff49a4dfb346ebe7c994418278817c03b
Signed-off-by: Wai-Hong Tam <04b587fdf5845741a0c5a8b9cd59ca72d73ef8fc@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3422771
Reviewed-by: Keith Short <f6d578f97033c25f1206cb57d52f358974c82954@chromium.org>
