From af1da08a314b7bdf6bfa8044d19aa80f471ec3fb Mon Sep 17 00:00:00 2001 From: Wai-Hong Tam Date: Tue, 18 Jan 2022 14:03:30 -0800 Subject: herobrine: Move the common EC nodes from board to project Make the board independent from the hardware project. Move several common EC nodes to the project directory. BRANCH=None BUG=b:214613810 TEST=Built the herobrine_npcx9 project and checked generated source.dts unchanged. Change-Id: Icc89a5fbf53cc26dd5f06c4919c4ec416d6a91be Signed-off-by: Wai-Hong Tam Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3400545 Reviewed-by: Keith Short --- .../boards/arm/herobrine_npcx9/herobrine_npcx9.dts | 28 ---------------- zephyr/projects/herobrine/BUILD.py | 1 + zephyr/projects/herobrine/common.dts | 37 ++++++++++++++++++++++ 3 files changed, 38 insertions(+), 28 deletions(-) create mode 100644 zephyr/projects/herobrine/common.dts diff --git a/zephyr/boards/arm/herobrine_npcx9/herobrine_npcx9.dts b/zephyr/boards/arm/herobrine_npcx9/herobrine_npcx9.dts index 913bdbb98b..d2ea7a2975 100644 --- a/zephyr/boards/arm/herobrine_npcx9/herobrine_npcx9.dts +++ b/zephyr/boards/arm/herobrine_npcx9/herobrine_npcx9.dts @@ -19,35 +19,7 @@ zephyr,shell-uart = &uart1; zephyr,flash = &flash0; zephyr,flash-controller = &int_flash; - cros,rtc = &pcf85063a; }; - - ec-console { - compatible = "ec-console"; - - disabled = "hostcmd"; - }; - - ec-mkbp-host-event-wakeup-mask { - compatible = "ec-wake-mask-event"; - wakeup-mask = <( - HOST_EVENT_MASK(HOST_EVENT_LID_OPEN) | - HOST_EVENT_MASK(HOST_EVENT_POWER_BUTTON) | - HOST_EVENT_MASK(HOST_EVENT_AC_CONNECTED) | - HOST_EVENT_MASK(HOST_EVENT_AC_DISCONNECTED) | - HOST_EVENT_MASK(HOST_EVENT_HANG_DETECT) | - HOST_EVENT_MASK(HOST_EVENT_RTC) | - HOST_EVENT_MASK(HOST_EVENT_MODE_CHANGE) | - HOST_EVENT_MASK(HOST_EVENT_DEVICE))>; - }; - - ec-mkbp-event-wakeup-mask { - compatible = "ec-wake-mask-event"; - wakeup-mask = <(MKBP_EVENT_KEY_MATRIX | \ - MKBP_EVENT_HOST_EVENT | \ - MKBP_EVENT_SENSOR_FIFO)>; - }; - }; &uart1 { diff --git a/zephyr/projects/herobrine/BUILD.py b/zephyr/projects/herobrine/BUILD.py index 05498ddc20..6d4fba5eef 100644 --- a/zephyr/projects/herobrine/BUILD.py +++ b/zephyr/projects/herobrine/BUILD.py @@ -12,6 +12,7 @@ def register_variant(project_name, extra_dts_overlays=(), extra_kconfig_files=() here / "adc.dts", here / "battery.dts", here / "gpio.dts", + here / "common.dts", here / "i2c.dts", here / "motionsense.dts", here / "pwm.dts", diff --git a/zephyr/projects/herobrine/common.dts b/zephyr/projects/herobrine/common.dts new file mode 100644 index 0000000000..cc75e8e89b --- /dev/null +++ b/zephyr/projects/herobrine/common.dts @@ -0,0 +1,37 @@ +/* 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. + */ + +#include + +/ { + chosen { + cros,rtc = &pcf85063a; + }; + + ec-console { + compatible = "ec-console"; + disabled = "hostcmd"; + }; + + ec-mkbp-host-event-wakeup-mask { + compatible = "ec-wake-mask-event"; + wakeup-mask = <( + HOST_EVENT_MASK(HOST_EVENT_LID_OPEN) | + HOST_EVENT_MASK(HOST_EVENT_POWER_BUTTON) | + HOST_EVENT_MASK(HOST_EVENT_AC_CONNECTED) | + HOST_EVENT_MASK(HOST_EVENT_AC_DISCONNECTED) | + HOST_EVENT_MASK(HOST_EVENT_HANG_DETECT) | + HOST_EVENT_MASK(HOST_EVENT_RTC) | + HOST_EVENT_MASK(HOST_EVENT_MODE_CHANGE) | + HOST_EVENT_MASK(HOST_EVENT_DEVICE))>; + }; + + ec-mkbp-event-wakeup-mask { + compatible = "ec-wake-mask-event"; + wakeup-mask = <(MKBP_EVENT_KEY_MATRIX | \ + MKBP_EVENT_HOST_EVENT | \ + MKBP_EVENT_SENSOR_FIFO)>; + }; +}; -- cgit v1.2.1