summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJun Lin <CHLin56@nuvoton.com>2022-05-12 15:54:31 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-05-17 07:18:27 +0000
commit61183ad5910c320e4464557b16aea2ea80a1d7df (patch)
tree2b3e6edd237dff347527ebb13d6e510b0feb6676
parent2d146ce62aa961bed30a14b67da9866b268f8888 (diff)
downloadchrome-ec-61183ad5910c320e4464557b16aea2ea80a1d7df.tar.gz
zephyr: board/arm/npcx9: support multiple chip variants
This commits allows a Zephyr project to select the board with different NPCX9 variants. BRANCH=none BUG=b:217436680 TEST=pass "zmake testall --clobber" TEST=repleace "npcx9m3f" with "npcx9m7f" in zephyr/projects/nissa/BUILD.py;"zmake build nivviks --clobber"; check chip variant change to npcx9m7f in build/zephyr/nivviks. Signed-off-by: Jun Lin <CHLin56@nuvoton.com> Change-Id: I2c6f71a96b508277adde9e3547d41b761cc8e211 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3640833 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Tested-by: CH Lin <chlin56@nuvoton.com> Commit-Queue: CH Lin <chlin56@nuvoton.com>
-rw-r--r--zephyr/boards/arm/npcx9/Kconfig.board2
-rw-r--r--zephyr/boards/arm/npcx9/npcx9.dtsi (renamed from zephyr/boards/arm/npcx9/npcx9.dts)4
-rw-r--r--zephyr/boards/arm/npcx9/npcx9m3f.dts10
-rw-r--r--zephyr/boards/arm/npcx9/npcx9m3f_defconfig (renamed from zephyr/boards/arm/npcx9/npcx9_defconfig)0
-rw-r--r--zephyr/boards/arm/npcx9/npcx9m7f.dts10
-rw-r--r--zephyr/boards/arm/npcx9/npcx9m7f_defconfig48
-rw-r--r--zephyr/projects/brya/BUILD.py2
-rw-r--r--zephyr/projects/corsola/BUILD.py4
-rw-r--r--zephyr/projects/herobrine/BUILD.py2
-rw-r--r--zephyr/projects/intelrvp/BUILD.py8
-rw-r--r--zephyr/projects/nissa/BUILD.py6
-rw-r--r--zephyr/projects/skyrim/BUILD.py2
12 files changed, 81 insertions, 17 deletions
diff --git a/zephyr/boards/arm/npcx9/Kconfig.board b/zephyr/boards/arm/npcx9/Kconfig.board
index e4b184d83e..c469ada39e 100644
--- a/zephyr/boards/arm/npcx9/Kconfig.board
+++ b/zephyr/boards/arm/npcx9/Kconfig.board
@@ -4,7 +4,7 @@
config BOARD_NPCX9
bool "NPCX9 Zephyr Board"
- depends on SOC_NPCX9M3F
+ depends on SOC_NPCX9M3F || SOC_NPCX9M7F
# NPCX doesn't actually have enough ram for coverage, but this will
# allow generating initial 0 line coverage.
select HAS_COVERAGE_SUPPORT
diff --git a/zephyr/boards/arm/npcx9/npcx9.dts b/zephyr/boards/arm/npcx9/npcx9.dtsi
index 5a6a19639d..9b907ce80a 100644
--- a/zephyr/boards/arm/npcx9/npcx9.dts
+++ b/zephyr/boards/arm/npcx9/npcx9.dtsi
@@ -3,11 +3,7 @@
* found in the LICENSE file.
*/
-/dts-v1/;
-
-#include <cros/nuvoton/npcx9.dtsi>
#include <dt-bindings/gpio_defines.h>
-#include <nuvoton/npcx9m3f.dtsi>
/ {
model = "NPCX9";
diff --git a/zephyr/boards/arm/npcx9/npcx9m3f.dts b/zephyr/boards/arm/npcx9/npcx9m3f.dts
new file mode 100644
index 0000000000..1b009dfa0b
--- /dev/null
+++ b/zephyr/boards/arm/npcx9/npcx9m3f.dts
@@ -0,0 +1,10 @@
+/* Copyright 2022 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.
+ */
+
+/dts-v1/;
+
+#include <cros/nuvoton/npcx9.dtsi>
+#include <nuvoton/npcx9m3f.dtsi>
+#include "npcx9.dtsi"
diff --git a/zephyr/boards/arm/npcx9/npcx9_defconfig b/zephyr/boards/arm/npcx9/npcx9m3f_defconfig
index 18790143b0..18790143b0 100644
--- a/zephyr/boards/arm/npcx9/npcx9_defconfig
+++ b/zephyr/boards/arm/npcx9/npcx9m3f_defconfig
diff --git a/zephyr/boards/arm/npcx9/npcx9m7f.dts b/zephyr/boards/arm/npcx9/npcx9m7f.dts
new file mode 100644
index 0000000000..ebb355c877
--- /dev/null
+++ b/zephyr/boards/arm/npcx9/npcx9m7f.dts
@@ -0,0 +1,10 @@
+/* Copyright 2022 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.
+ */
+
+/dts-v1/;
+
+#include <cros/nuvoton/npcx9.dtsi>
+#include <nuvoton/npcx9m7f.dtsi>
+#include "npcx9.dtsi"
diff --git a/zephyr/boards/arm/npcx9/npcx9m7f_defconfig b/zephyr/boards/arm/npcx9/npcx9m7f_defconfig
new file mode 100644
index 0000000000..4fcd8a3f00
--- /dev/null
+++ b/zephyr/boards/arm/npcx9/npcx9m7f_defconfig
@@ -0,0 +1,48 @@
+# Copyright 2022 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.
+
+# Zephyr Kernel Configuration
+CONFIG_SOC_SERIES_NPCX9=y
+CONFIG_SOC_NPCX9M7F=y
+
+# Platform Configuration
+CONFIG_BOARD_NPCX9=y
+
+# Serial Drivers
+CONFIG_SERIAL=y
+CONFIG_UART_INTERRUPT_DRIVEN=y
+
+# Enable console
+CONFIG_CONSOLE=y
+CONFIG_UART_CONSOLE=y
+
+# Pinmux Driver
+CONFIG_PINMUX=y
+
+# GPIO Controller
+CONFIG_GPIO=y
+
+# Clock configuration
+CONFIG_CLOCK_CONTROL=y
+
+# WATCHDOG configuration
+CONFIG_WATCHDOG=y
+
+# Power Management
+CONFIG_PM=y
+CONFIG_PM_DEVICE=y
+CONFIG_PM_POLICY_CUSTOM=y
+CONFIG_UART_CONSOLE_INPUT_EXPIRED=y
+
+# BBRAM
+CONFIG_BBRAM=y
+CONFIG_BBRAM_NPCX=y
+
+# SPI
+CONFIG_SPI=y
+
+# Flash
+CONFIG_FLASH=y
+CONFIG_SPI_NOR=y
+CONFIG_FLASH_JESD216_API=y
diff --git a/zephyr/projects/brya/BUILD.py b/zephyr/projects/brya/BUILD.py
index ead03c459f..2be6734188 100644
--- a/zephyr/projects/brya/BUILD.py
+++ b/zephyr/projects/brya/BUILD.py
@@ -9,7 +9,7 @@ def register_npcx9_variant(project_name, extra_dts_overlays=(), extra_kconfig_fi
"""Register a variant of a brya, even though this is not named as such."""
return register_npcx_project(
project_name=project_name,
- zephyr_board="npcx9",
+ zephyr_board="npcx9m3f",
dts_overlays=[
"adc.dts",
"battery.dts",
diff --git a/zephyr/projects/corsola/BUILD.py b/zephyr/projects/corsola/BUILD.py
index 3aa1a470b8..81368ef2d4 100644
--- a/zephyr/projects/corsola/BUILD.py
+++ b/zephyr/projects/corsola/BUILD.py
@@ -15,7 +15,7 @@ def register_corsola_project(
):
"""Register a variant of corsola."""
register_func = register_binman_project
- if chip.startswith("npcx9"):
+ if chip.startswith("npcx"):
register_func = register_npcx_project
register_func(
@@ -49,7 +49,7 @@ register_corsola_project(
register_corsola_project(
project_name="kingler",
- chip="npcx9",
+ chip="npcx9m3f",
extra_dts_overlays=[
here / "adc_kingler.dts",
here / "battery_kingler.dts",
diff --git a/zephyr/projects/herobrine/BUILD.py b/zephyr/projects/herobrine/BUILD.py
index b339cb215f..764679494f 100644
--- a/zephyr/projects/herobrine/BUILD.py
+++ b/zephyr/projects/herobrine/BUILD.py
@@ -9,7 +9,7 @@ def register_variant(project_name, extra_dts_overlays=(), extra_kconfig_files=()
"""Register a variant of herobrine."""
register_npcx_project(
project_name=project_name,
- zephyr_board="npcx9",
+ zephyr_board="npcx9m3f",
dts_overlays=[
# Common to all projects.
here / "adc.dts",
diff --git a/zephyr/projects/intelrvp/BUILD.py b/zephyr/projects/intelrvp/BUILD.py
index 52a6a8fce1..45e9b87398 100644
--- a/zephyr/projects/intelrvp/BUILD.py
+++ b/zephyr/projects/intelrvp/BUILD.py
@@ -9,13 +9,13 @@
def register_intelrvp_project(
project_name,
- chip="npcx9",
+ chip="npcx9m3f",
extra_dts_overlays=(),
extra_kconfig_files=(),
):
"""Register a variant of intelrvp."""
register_func = register_binman_project
- if chip.startswith("npcx9"):
+ if chip.startswith("npcx"):
register_func = register_npcx_project
kconfig_files = [here / "prj.conf"]
@@ -40,7 +40,7 @@ def register_intelrvp_project(
register_intelrvp_project(
project_name="adlrvp_npcx",
- chip="npcx9",
+ chip="npcx9m3f",
extra_dts_overlays=[
here / "adlrvp/adlrvp_npcx/adlrvp_npcx.dts",
here / "adlrvp/adlrvp_npcx/bb_retimer.dts",
@@ -60,7 +60,7 @@ register_intelrvp_project(
register_intelrvp_project(
project_name="mtlrvpp_npcx",
- chip="npcx9",
+ chip="npcx9m3f",
extra_dts_overlays=[
here / "adlrvp/adlrvp_npcx/cbi_eeprom.dts",
here / "mtlrvp/mtlrvpp_npcx/fan.dts",
diff --git a/zephyr/projects/nissa/BUILD.py b/zephyr/projects/nissa/BUILD.py
index 1af33723eb..abd43231d1 100644
--- a/zephyr/projects/nissa/BUILD.py
+++ b/zephyr/projects/nissa/BUILD.py
@@ -15,7 +15,7 @@ def register_nissa_project(
):
"""Register a variant of nissa."""
register_func = register_binman_project
- if chip.startswith("npcx9"):
+ if chip.startswith("npcx"):
register_func = register_npcx_project
register_func(
@@ -28,7 +28,7 @@ def register_nissa_project(
register_nissa_project(
project_name="nivviks",
- chip="npcx9",
+ chip="npcx9m3f",
extra_dts_overlays=[
here / "nivviks_generated.dts",
here / "nivviks_overlay.dts",
@@ -56,7 +56,7 @@ register_nissa_project(
register_nissa_project(
project_name="craask",
- chip="npcx9",
+ chip="npcx9m3f",
extra_dts_overlays=[
here / "craask_generated.dts",
here / "craask_overlay.dts",
diff --git a/zephyr/projects/skyrim/BUILD.py b/zephyr/projects/skyrim/BUILD.py
index 708109590d..28d8d8617a 100644
--- a/zephyr/projects/skyrim/BUILD.py
+++ b/zephyr/projects/skyrim/BUILD.py
@@ -9,7 +9,7 @@ def register_variant(project_name):
"""Register a variant of skyrim."""
register_npcx_project(
project_name=project_name,
- zephyr_board="npcx9",
+ zephyr_board="npcx9m3f",
dts_overlays=[
# Common to all projects.
here / "adc.dts",