summaryrefslogtreecommitdiff
path: root/zephyr/projects/herobrine
diff options
context:
space:
mode:
Diffstat (limited to 'zephyr/projects/herobrine')
-rw-r--r--zephyr/projects/herobrine/BUILD.py124
-rw-r--r--zephyr/projects/herobrine/CMakeLists.txt37
-rw-r--r--zephyr/projects/herobrine/Kconfig41
-rw-r--r--zephyr/projects/herobrine/adc.dts47
-rw-r--r--zephyr/projects/herobrine/battery_evoker.dts15
-rw-r--r--zephyr/projects/herobrine/battery_herobrine.dts12
-rw-r--r--zephyr/projects/herobrine/battery_hoglin.dts12
-rw-r--r--zephyr/projects/herobrine/battery_villager.dts15
-rw-r--r--zephyr/projects/herobrine/battery_zombie.dts15
-rw-r--r--zephyr/projects/herobrine/common.dts44
-rw-r--r--zephyr/projects/herobrine/default_gpio_pinctrl.dts44
-rw-r--r--zephyr/projects/herobrine/display.dts18
-rw-r--r--zephyr/projects/herobrine/gpio.dts329
-rw-r--r--zephyr/projects/herobrine/gpio_evoker.dts329
-rw-r--r--zephyr/projects/herobrine/gpio_hoglin.dts327
-rw-r--r--zephyr/projects/herobrine/gpio_villager.dts323
-rw-r--r--zephyr/projects/herobrine/gpio_zombie.dts323
-rw-r--r--zephyr/projects/herobrine/i2c_common.dtsi157
-rw-r--r--zephyr/projects/herobrine/i2c_evoker.dts46
-rw-r--r--zephyr/projects/herobrine/i2c_herobrine.dts39
-rw-r--r--zephyr/projects/herobrine/i2c_hoglin.dts34
-rw-r--r--zephyr/projects/herobrine/i2c_villager.dts34
-rw-r--r--zephyr/projects/herobrine/i2c_zombie.dts34
-rw-r--r--zephyr/projects/herobrine/include/board_chipset.h11
-rw-r--r--zephyr/projects/herobrine/interrupts.dts115
-rw-r--r--zephyr/projects/herobrine/keyboard.dts46
-rw-r--r--zephyr/projects/herobrine/led_pins_evoker.dts54
-rw-r--r--zephyr/projects/herobrine/led_pins_herobrine.dts56
-rw-r--r--zephyr/projects/herobrine/led_pins_hoglin.dts33
-rw-r--r--zephyr/projects/herobrine/led_pins_villager.dts33
-rw-r--r--zephyr/projects/herobrine/led_pins_zombie.dts33
-rw-r--r--zephyr/projects/herobrine/led_policy_evoker.dts86
-rw-r--r--zephyr/projects/herobrine/led_policy_herobrine.dts202
-rw-r--r--zephyr/projects/herobrine/led_policy_hoglin.dts95
-rw-r--r--zephyr/projects/herobrine/led_policy_villager.dts95
-rw-r--r--zephyr/projects/herobrine/led_policy_zombie.dts95
-rw-r--r--zephyr/projects/herobrine/motionsense.dts241
-rw-r--r--zephyr/projects/herobrine/motionsense_evoker.dts148
-rw-r--r--zephyr/projects/herobrine/motionsense_hoglin.dts241
-rw-r--r--zephyr/projects/herobrine/motionsense_villager.dts148
-rw-r--r--zephyr/projects/herobrine/motionsense_zombie.dts148
-rw-r--r--zephyr/projects/herobrine/prj.conf160
-rw-r--r--zephyr/projects/herobrine/prj_evoker.conf16
-rw-r--r--zephyr/projects/herobrine/prj_herobrine.conf13
-rw-r--r--zephyr/projects/herobrine/prj_hoglin.conf15
-rw-r--r--zephyr/projects/herobrine/prj_villager.conf8
-rw-r--r--zephyr/projects/herobrine/prj_zoglin.conf15
-rw-r--r--zephyr/projects/herobrine/prj_zombie.conf8
-rw-r--r--zephyr/projects/herobrine/src/board_chipset.c83
-rw-r--r--zephyr/projects/herobrine/src/herobrine/alt_dev_replacement.c36
-rw-r--r--zephyr/projects/herobrine/src/i2c.c17
-rw-r--r--zephyr/projects/herobrine/src/usb_pd_policy.c254
-rw-r--r--zephyr/projects/herobrine/src/usbc_config.c278
-rw-r--r--zephyr/projects/herobrine/switchcap.dts12
-rw-r--r--zephyr/projects/herobrine/switchcap_hoglin.dts12
-rw-r--r--zephyr/projects/herobrine/usbc_evoker.dts42
-rw-r--r--zephyr/projects/herobrine/usbc_herobrine.dts43
-rw-r--r--zephyr/projects/herobrine/usbc_hoglin.dts42
-rw-r--r--zephyr/projects/herobrine/usbc_villager.dts42
-rw-r--r--zephyr/projects/herobrine/usbc_zombie.dts42
60 files changed, 5417 insertions, 0 deletions
diff --git a/zephyr/projects/herobrine/BUILD.py b/zephyr/projects/herobrine/BUILD.py
new file mode 100644
index 0000000000..d38803deb7
--- /dev/null
+++ b/zephyr/projects/herobrine/BUILD.py
@@ -0,0 +1,124 @@
+# 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.
+
+"""Define zmake projects for herobrine."""
+
+
+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="npcx9m3f",
+ dts_overlays=[
+ # Common to all projects.
+ here / "adc.dts",
+ here / "common.dts",
+ here / "interrupts.dts",
+ here / "keyboard.dts",
+ here / "default_gpio_pinctrl.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="evoker",
+ extra_dts_overlays=[
+ here / "display.dts",
+ here / "battery_evoker.dts",
+ here / "gpio_evoker.dts",
+ here / "i2c_evoker.dts",
+ here / "led_pins_evoker.dts",
+ here / "led_policy_evoker.dts",
+ here / "motionsense_evoker.dts",
+ here / "switchcap.dts",
+ here / "usbc_evoker.dts",
+ ],
+ extra_kconfig_files=[here / "prj_evoker.conf"],
+)
+
+register_variant(
+ project_name="herobrine",
+ extra_dts_overlays=[
+ here / "display.dts",
+ here / "battery_herobrine.dts",
+ here / "gpio.dts",
+ here / "i2c_herobrine.dts",
+ here / "led_pins_herobrine.dts",
+ here / "led_policy_herobrine.dts",
+ here / "motionsense.dts",
+ here / "switchcap.dts",
+ here / "usbc_herobrine.dts",
+ ],
+ extra_kconfig_files=[here / "prj_herobrine.conf"],
+)
+
+register_variant(
+ project_name="hoglin",
+ extra_dts_overlays=[
+ here / "battery_hoglin.dts",
+ here / "gpio_hoglin.dts",
+ here / "i2c_hoglin.dts",
+ here / "led_pins_hoglin.dts",
+ here / "led_policy_hoglin.dts",
+ here / "motionsense_hoglin.dts",
+ here / "switchcap_hoglin.dts",
+ here / "usbc_hoglin.dts",
+ ],
+ extra_kconfig_files=[here / "prj_hoglin.conf"],
+)
+
+register_variant(
+ project_name="villager",
+ extra_dts_overlays=[
+ here / "battery_villager.dts",
+ here / "gpio_villager.dts",
+ here / "i2c_villager.dts",
+ here / "led_pins_villager.dts",
+ here / "led_policy_villager.dts",
+ here / "motionsense_villager.dts",
+ here / "switchcap.dts",
+ here / "usbc_villager.dts",
+ ],
+ extra_kconfig_files=[here / "prj_villager.conf"],
+)
+
+register_variant(
+ project_name="zoglin",
+ extra_dts_overlays=[
+ here / "battery_hoglin.dts",
+ here / "gpio_hoglin.dts",
+ here / "i2c_hoglin.dts",
+ here / "led_pins_hoglin.dts",
+ here / "led_policy_hoglin.dts",
+ here / "motionsense_hoglin.dts",
+ here / "switchcap_hoglin.dts",
+ here / "usbc_hoglin.dts",
+ ],
+ extra_kconfig_files=[here / "prj_zoglin.conf"],
+)
+
+register_variant(
+ project_name="zombie",
+ extra_dts_overlays=[
+ here / "battery_zombie.dts",
+ here / "gpio_zombie.dts",
+ here / "i2c_zombie.dts",
+ here / "led_pins_zombie.dts",
+ here / "led_policy_zombie.dts",
+ here / "motionsense_zombie.dts",
+ here / "switchcap.dts",
+ here / "usbc_zombie.dts",
+ ],
+ extra_kconfig_files=[here / "prj_zombie.conf"],
+)
diff --git a/zephyr/projects/herobrine/CMakeLists.txt b/zephyr/projects/herobrine/CMakeLists.txt
new file mode 100644
index 0000000000..a7e2fc6cf6
--- /dev/null
+++ b/zephyr/projects/herobrine/CMakeLists.txt
@@ -0,0 +1,37 @@
+# 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.
+
+cmake_minimum_required(VERSION 3.13.1)
+
+find_package(Zephyr REQUIRED HINTS "${ZEPHYR_BASE}")
+
+cros_ec_library_include_directories(include)
+
+# Common Herobrine implementation
+zephyr_library_sources(
+ "src/board_chipset.c"
+)
+
+# Board specific implementation
+zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_USBC
+ "src/usbc_config.c"
+ "src/usb_pd_policy.c")
+zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_I2C
+ "src/i2c.c")
+
+if(DEFINED CONFIG_BOARD_EVOKER)
+ project(evoker)
+elseif(DEFINED CONFIG_BOARD_HEROBRINE)
+ project(herobrine)
+ zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_USBC
+ "src/herobrine/alt_dev_replacement.c")
+elseif(DEFINED CONFIG_BOARD_HOGLIN)
+ project(hoglin)
+elseif(DEFINED CONFIG_BOARD_VILLAGER)
+ project(villager)
+elseif(DEFINED CONFIG_BOARD_ZOGLIN)
+ project(zoglin)
+elseif(DEFINED CONFIG_BOARD_ZOMBIE)
+ project(zombie)
+endif()
diff --git a/zephyr/projects/herobrine/Kconfig b/zephyr/projects/herobrine/Kconfig
new file mode 100644
index 0000000000..d0056288d5
--- /dev/null
+++ b/zephyr/projects/herobrine/Kconfig
@@ -0,0 +1,41 @@
+# 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.
+
+config BOARD_EVOKER
+ bool "Evoker Board"
+ help
+ Build the Evoker board. The board is based on the Herobrine
+ reference design.
+
+config BOARD_HEROBRINE
+ bool "Google Herobrine Baseboard"
+ help
+ Build Google Herobrine reference board. The board uses Nuvoton
+ NPCX9 chip as the EC.
+
+config BOARD_HOGLIN
+ bool "Qualcomm Hoglin Baseboard"
+ help
+ Build Qualcomm Hoglin reference board. The board uses Nuvoton
+ NPCX9 chip as the EC.
+
+config BOARD_VILLAGER
+ bool "Villager Board"
+ help
+ Build the Villager board. The board is based on the Herobrine
+ reference design.
+
+config BOARD_ZOGLIN
+ bool "Qualcomm Zoglin Baseboard"
+ help
+ Build Qualcomm Zoglin reference board. The board uses Nuvoton
+ NPCX9 chip as the EC.
+
+config BOARD_ZOMBIE
+ bool "Zombie Board"
+ help
+ Build the Zombie board. The board is based on the Herobrine
+ reference design.
+
+source "Kconfig.zephyr"
diff --git a/zephyr/projects/herobrine/adc.dts b/zephyr/projects/herobrine/adc.dts
new file mode 100644
index 0000000000..16a5434e9d
--- /dev/null
+++ b/zephyr/projects/herobrine/adc.dts
@@ -0,0 +1,47 @@
+/* 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.
+ */
+
+#include <zephyr/dt-bindings/adc/adc.h>
+
+/ {
+ named-adc-channels {
+ compatible = "named-adc-channels";
+
+ vbus {
+ enum-name = "ADC_VBUS";
+ io-channels = <&adc0 1>;
+ /* Measure VBUS through a 1/10 voltage divider */
+ mul = <10>;
+ };
+ amon_bmon {
+ enum-name = "ADC_AMON_BMON";
+ io-channels = <&adc0 2>;
+ /*
+ * Adapter current output or battery charging/
+ * discharging current (uV) 18x amplification on
+ * charger side.
+ */
+ mul = <1000>;
+ div = <18>;
+ };
+ psys {
+ enum-name = "ADC_PSYS";
+ io-channels = <&adc0 3>;
+ /*
+ * ISL9238 PSYS output is 1.44 uA/W over 5.6K resistor,
+ * to read 0.8V @ 99 W, i.e. 124000 uW/mV.
+ */
+ mul = <124000>;
+ };
+ };
+};
+
+&adc0 {
+ status = "okay";
+ pinctrl-0 = <&adc0_chan1_gp44
+ &adc0_chan2_gp43
+ &adc0_chan3_gp42>;
+ pinctrl-names = "default";
+};
diff --git a/zephyr/projects/herobrine/battery_evoker.dts b/zephyr/projects/herobrine/battery_evoker.dts
new file mode 100644
index 0000000000..0e09616c1d
--- /dev/null
+++ b/zephyr/projects/herobrine/battery_evoker.dts
@@ -0,0 +1,15 @@
+/* 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.
+ */
+
+/ {
+ batteries {
+ default_battery: pc_vp_bp153 {
+ compatible = "smp,pc-vp-bp153", "battery-smart";
+ };
+ ap16l5j {
+ compatible = "panasonic,ap16l5j", "battery-smart";
+ };
+ };
+};
diff --git a/zephyr/projects/herobrine/battery_herobrine.dts b/zephyr/projects/herobrine/battery_herobrine.dts
new file mode 100644
index 0000000000..b347ec4c3c
--- /dev/null
+++ b/zephyr/projects/herobrine/battery_herobrine.dts
@@ -0,0 +1,12 @@
+/* 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.
+ */
+
+/ {
+ batteries {
+ default_battery: ap16l5j {
+ compatible = "panasonic,ap16l5j", "battery-smart";
+ };
+ };
+};
diff --git a/zephyr/projects/herobrine/battery_hoglin.dts b/zephyr/projects/herobrine/battery_hoglin.dts
new file mode 100644
index 0000000000..11180c3988
--- /dev/null
+++ b/zephyr/projects/herobrine/battery_hoglin.dts
@@ -0,0 +1,12 @@
+/* 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.
+ */
+
+/ {
+ batteries {
+ default_battery: 7c01 {
+ compatible = "ganfeng,7c01", "battery-smart";
+ };
+ };
+};
diff --git a/zephyr/projects/herobrine/battery_villager.dts b/zephyr/projects/herobrine/battery_villager.dts
new file mode 100644
index 0000000000..dafd473a6e
--- /dev/null
+++ b/zephyr/projects/herobrine/battery_villager.dts
@@ -0,0 +1,15 @@
+/* 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.
+ */
+
+/ {
+ batteries {
+ default_battery: ap19a5k {
+ compatible = "panasonic,ap19a5k", "battery-smart";
+ };
+ ap19a8k {
+ compatible = "lgc,ap19a8k", "battery-smart";
+ };
+ };
+};
diff --git a/zephyr/projects/herobrine/battery_zombie.dts b/zephyr/projects/herobrine/battery_zombie.dts
new file mode 100644
index 0000000000..dafd473a6e
--- /dev/null
+++ b/zephyr/projects/herobrine/battery_zombie.dts
@@ -0,0 +1,15 @@
+/* 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.
+ */
+
+/ {
+ batteries {
+ default_battery: ap19a5k {
+ compatible = "panasonic,ap19a5k", "battery-smart";
+ };
+ ap19a8k {
+ compatible = "lgc,ap19a8k", "battery-smart";
+ };
+ };
+};
diff --git a/zephyr/projects/herobrine/common.dts b/zephyr/projects/herobrine/common.dts
new file mode 100644
index 0000000000..a722f1dfa2
--- /dev/null
+++ b/zephyr/projects/herobrine/common.dts
@@ -0,0 +1,44 @@
+/* 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.
+ */
+
+#include <dt-bindings/wake_mask_event_defines.h>
+
+/ {
+ 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_LID_OPEN |
+ HOST_EVENT_POWER_BUTTON |
+ HOST_EVENT_AC_CONNECTED |
+ HOST_EVENT_AC_DISCONNECTED |
+ HOST_EVENT_HANG_DETECT |
+ HOST_EVENT_RTC |
+ HOST_EVENT_MODE_CHANGE |
+ 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)>;
+ };
+};
+
+&shi {
+ status = "okay";
+ pinctrl-0 = <&shi_gp46_47_53_55>;
+ pinctrl-1 = <&shi_gpio_gp46_47_53_55>;
+ pinctrl-names = "default", "sleep";
+};
diff --git a/zephyr/projects/herobrine/default_gpio_pinctrl.dts b/zephyr/projects/herobrine/default_gpio_pinctrl.dts
new file mode 100644
index 0000000000..604658a145
--- /dev/null
+++ b/zephyr/projects/herobrine/default_gpio_pinctrl.dts
@@ -0,0 +1,44 @@
+/* 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.
+ */
+
+/* Adds the &alt1_no_lpc_espi setting over the NPCX9 default setting. */
+&{/def-io-conf-list} {
+ pinmux = <&alt0_gpio_no_spip
+ &alt0_gpio_no_fpip
+ &alt1_no_pwrgd
+ &alt1_no_lpc_espi
+ &alta_no_peci_en
+ &altd_npsl_in1_sl
+ &altd_npsl_in2_sl
+ &altd_psl_in3_sl
+ &altd_psl_in4_sl
+ &alt7_no_ksi0_sl
+ &alt7_no_ksi1_sl
+ &alt7_no_ksi2_sl
+ &alt7_no_ksi3_sl
+ &alt7_no_ksi4_sl
+ &alt7_no_ksi5_sl
+ &alt7_no_ksi6_sl
+ &alt7_no_ksi7_sl
+ &alt8_no_kso00_sl
+ &alt8_no_kso01_sl
+ &alt8_no_kso02_sl
+ &alt8_no_kso03_sl
+ &alt8_no_kso04_sl
+ &alt8_no_kso05_sl
+ &alt8_no_kso06_sl
+ &alt8_no_kso07_sl
+ &alt9_no_kso08_sl
+ &alt9_no_kso09_sl
+ &alt9_no_kso10_sl
+ &alt9_no_kso11_sl
+ &alt9_no_kso12_sl
+ &alt9_no_kso13_sl
+ &alt9_no_kso14_sl
+ &alt9_no_kso15_sl
+ &alta_no_kso16_sl
+ &alta_no_kso17_sl
+ &altg_psl_gpo_sl>;
+};
diff --git a/zephyr/projects/herobrine/display.dts b/zephyr/projects/herobrine/display.dts
new file mode 100644
index 0000000000..65d3a2d91b
--- /dev/null
+++ b/zephyr/projects/herobrine/display.dts
@@ -0,0 +1,18 @@
+/* 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.
+ */
+
+/ {
+ displight {
+ compatible = "cros-ec,displight";
+ pwms = <&pwm5 0 PWM_HZ(4800) PWM_POLARITY_NORMAL>;
+ generic-pwm-channel = <1>;
+ };
+};
+
+&pwm5 {
+ status = "okay";
+ pinctrl-0 = <&pwm5_gpb7>;
+ pinctrl-names = "default";
+};
diff --git a/zephyr/projects/herobrine/gpio.dts b/zephyr/projects/herobrine/gpio.dts
new file mode 100644
index 0000000000..a355aaf099
--- /dev/null
+++ b/zephyr/projects/herobrine/gpio.dts
@@ -0,0 +1,329 @@
+/* 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.
+ */
+
+/ {
+ aliases {
+ gpio-wp = &gpio_ec_wp_odl;
+ gpio-kbd-kso2 = &gpio_ec_kso_02_inv;
+ };
+
+ named-gpios {
+ compatible = "named-gpios";
+
+ gpio_usb_c0_pd_int_odl: usb_c0_pd_int_odl {
+ gpios = <&gpioe 0 GPIO_INPUT>;
+ enum-name = "GPIO_USB_C0_PD_INT_ODL";
+ };
+ gpio_usb_c1_pd_int_odl: usb_c1_pd_int_odl {
+ gpios = <&gpiof 5 GPIO_INPUT>;
+ enum-name = "GPIO_USB_C1_PD_INT_ODL";
+ };
+ gpio_usb_c0_swctl_int_odl: usb_c0_swctl_int_odl {
+ gpios = <&gpio0 3 GPIO_INPUT>;
+ enum-name = "GPIO_USB_C0_SWCTL_INT_ODL";
+ };
+ gpio_usb_c1_swctl_int_odl: usb_c1_swctl_int_odl {
+ gpios = <&gpio4 0 GPIO_INPUT>;
+ enum-name = "GPIO_USB_C1_SWCTL_INT_ODL";
+ };
+ gpio_usb_c0_bc12_int_l: usb_c0_bc12_int_l {
+ gpios = <&gpio6 1 GPIO_INPUT_PULL_UP>;
+ };
+ gpio_usb_c1_bc12_int_l: usb_c1_bc12_int_l {
+ gpios = <&gpio8 2 GPIO_INPUT_PULL_UP>;
+ };
+ gpio_usb_a0_oc_odl: usb_a0_oc_odl {
+ gpios = <&gpiof 4 GPIO_INPUT_PULL_UP>;
+ };
+ gpio_chg_acok_od: chg_acok_od {
+ gpios = <&gpiod 2 GPIO_INPUT>;
+ enum-name = "GPIO_AC_PRESENT";
+ };
+ gpio_ec_pwr_btn_odl: ec_pwr_btn_odl {
+ gpios = <&gpio0 0 GPIO_INPUT>;
+ enum-name = "GPIO_POWER_BUTTON_L";
+ };
+ gpio_ec_voldn_btn_odl: ec_voldn_btn_odl {
+ gpios = <&gpio6 2 GPIO_INPUT_PULL_UP>;
+ enum-name = "GPIO_VOLUME_DOWN_L";
+ };
+ gpio_ec_volup_btn_odl: ec_volup_btn_odl {
+ gpios = <&gpioc 2 GPIO_INPUT_PULL_UP>;
+ enum-name = "GPIO_VOLUME_UP_L";
+ };
+ gpio_ec_wp_odl: ec_wp_odl {
+ gpios = <&gpiod 3 (GPIO_INPUT | GPIO_ACTIVE_LOW)>;
+ };
+ gpio_lid_open_ec: lid_open_ec {
+ gpios = <&gpio0 1 GPIO_INPUT>;
+ enum-name = "GPIO_LID_OPEN";
+ };
+ gpio_ap_rst_l: ap_rst_l {
+ gpios = <&gpio5 1 GPIO_INPUT>;
+ enum-name = "GPIO_AP_RST_L";
+ };
+ gpio_ps_hold: ps_hold {
+ gpios = <&gpioa 6 GPIO_INPUT_PULL_DOWN>;
+ enum-name = "GPIO_PS_HOLD";
+ };
+ gpio_ap_suspend: ap_suspend {
+ gpios = <&gpio5 7 GPIO_INPUT>;
+ enum-name = "GPIO_AP_SUSPEND";
+ };
+ gpio_mb_power_good: mb_power_good {
+ gpios = <&gpio3 7 GPIO_INPUT_PULL_DOWN>;
+ enum-name = "GPIO_POWER_GOOD";
+ };
+ gpio_warm_reset_l: warm_reset_l {
+ gpios = <&gpiob 0 GPIO_INPUT>;
+ enum-name = "GPIO_WARM_RESET_L";
+ };
+ ap_ec_spi_cs_l {
+ gpios = <&gpio5 3 GPIO_INPUT_PULL_DOWN>;
+ };
+ gpio_tablet_mode_l: tablet_mode_l {
+ gpios = <&gpioc 6 GPIO_INPUT>;
+ enum-name = "GPIO_TABLET_MODE_L";
+ };
+ gpio_accel_gyro_int_l: accel_gyro_int_l {
+ gpios = <&gpioa 3 GPIO_INPUT>;
+ };
+ gpio_rtc_ec_wake_odl: rtc_ec_wake_odl {
+ gpios = <&gpio0 2 GPIO_INPUT>;
+ };
+ ec_entering_rw {
+ gpios = <&gpio7 2 GPIO_OUTPUT_LOW>;
+ enum-name = "GPIO_ENTERING_RW";
+ };
+ ccd_mode_odl {
+ gpios = <&gpio6 3 GPIO_INPUT>;
+ enum-name = "GPIO_CCD_MODE_ODL";
+ };
+ ec_batt_pres_odl {
+ gpios = <&gpioe 5 GPIO_INPUT>;
+ enum-name = "GPIO_BATT_PRES_ODL";
+ };
+ ec_gsc_packet_mode {
+ gpios = <&gpio8 3 GPIO_OUTPUT_LOW>;
+ enum-name = "GPIO_PACKET_MODE_EN";
+ };
+ pmic_resin_l {
+ gpios = <&gpioa 0 GPIO_ODR_HIGH>;
+ enum-name = "GPIO_PMIC_RESIN_L";
+ };
+ pmic_kpd_pwr_odl {
+ gpios = <&gpioa 2 GPIO_ODR_HIGH>;
+ enum-name = "GPIO_PMIC_KPD_PWR_ODL";
+ };
+ ap_ec_int_l {
+ gpios = <&gpio5 6 GPIO_ODR_HIGH>;
+ enum-name = "GPIO_EC_INT_L";
+ };
+ gpio_switchcap_on: switchcap_on {
+ gpios = <&gpiod 5 GPIO_OUTPUT_LOW>;
+ enum-name = "GPIO_SWITCHCAP_ON";
+ };
+ gpio_en_pp5000_s5: en_pp5000_s5 {
+ gpios = <&gpio7 3 GPIO_OUTPUT_HIGH>;
+ enum-name = "GPIO_EN_PP5000";
+ };
+ ec_bl_disable_l {
+ /* The PMIC controls backlight enable and this pin must
+ * be HiZ for normal operation. But the backlight can
+ * be enabled by setting this pin low and configuring it
+ * as an output.
+ */
+ gpios = <&gpiob 6 GPIO_INPUT>;
+ enum-name = "GPIO_ENABLE_BACKLIGHT";
+ };
+ lid_accel_int_l {
+ gpios = <&gpioa 1 GPIO_INPUT>;
+ };
+ tp_int_gate {
+ gpios = <&gpio7 4 GPIO_OUTPUT_LOW>;
+ };
+ gpio_usb_c0_pd_rst_l: usb_c0_pd_rst_l {
+ gpios = <&gpiof 1 GPIO_OUTPUT_HIGH>;
+ };
+ gpio_usb_c1_pd_rst_l: usb_c1_pd_rst_l {
+ gpios = <&gpioe 4 GPIO_OUTPUT_HIGH>;
+ };
+ gpio_dp_mux_oe_l: dp_mux_oe_l {
+ gpios = <&gpiob 1 GPIO_ODR_HIGH>;
+ };
+ gpio_dp_mux_sel: dp_mux_sel {
+ gpios = <&gpio4 5 GPIO_OUTPUT_LOW>;
+ };
+ gpio_dp_hot_plug_det_r: dp_hot_plug_det_r {
+ gpios = <&gpio9 5 GPIO_OUTPUT_LOW>;
+ };
+ gpio_en_usb_a_5v: en_usb_a_5v {
+ gpios = <&gpiof 0 GPIO_OUTPUT_LOW>;
+ enum-name = "GPIO_EN_USB_A_5V";
+ };
+ usb_a_cdp_ilim_en_l {
+ gpios = <&gpio7 5 GPIO_OUTPUT_HIGH>;
+ };
+ gpio_usb_c0_frs_en: usb_c0_frs_en {
+ gpios = <&gpioc 5 GPIO_OUTPUT_LOW>;
+ enum-name = "GPIO_USB_C0_FRS_EN";
+ };
+ gpio_usb_c1_frs_en: usb_c1_frs_en {
+ gpios = <&gpioc 1 GPIO_OUTPUT_LOW>;
+ enum-name = "GPIO_USB_C1_FRS_EN";
+ };
+ gpio_ec_chg_led_y_c0: ec_chg_led_y_c0 {
+ #led-pin-cells = <1>;
+ gpios = <&gpio6 0 GPIO_OUTPUT_LOW>;
+ };
+ gpio_ec_chg_led_w_c0: ec_chg_led_w_c0 {
+ #led-pin-cells = <1>;
+ gpios = <&gpioc 0 GPIO_OUTPUT_LOW>;
+ };
+ gpio_ec_chg_led_y_c1: ec_chg_led_y_c1 {
+ #led-pin-cells = <1>;
+ gpios = <&gpioc 3 GPIO_OUTPUT_LOW>;
+ };
+ gpio_ec_chg_led_w_c1: ec_chg_led_w_c1 {
+ #led-pin-cells = <1>;
+ gpios = <&gpioc 4 GPIO_OUTPUT_LOW>;
+ };
+ ap_ec_spi_mosi {
+ gpios = <&gpio4 6 GPIO_INPUT_PULL_DOWN>;
+ };
+ ap_ec_spi_miso {
+ gpios = <&gpio4 7 GPIO_INPUT_PULL_DOWN>;
+ };
+ ap_ec_spi_clk {
+ gpios = <&gpio5 5 GPIO_INPUT_PULL_DOWN>;
+ };
+ gpio_brd_id0: brd_id0 {
+ gpios = <&gpio9 4 GPIO_INPUT>;
+ enum-name = "GPIO_BOARD_VERSION1";
+ };
+ gpio_brd_id1: brd_id1 {
+ gpios = <&gpio9 7 GPIO_INPUT>;
+ enum-name = "GPIO_BOARD_VERSION2";
+ };
+ gpio_brd_id2: brd_id2 {
+ gpios = <&gpioa 5 GPIO_INPUT>;
+ enum-name = "GPIO_BOARD_VERSION3";
+ };
+ gpio_sku_id0: sku_id0 {
+ gpios = <&gpio6 7 GPIO_INPUT>;
+ };
+ gpio_sku_id1: sku_id1 {
+ gpios = <&gpio7 0 GPIO_INPUT>;
+ };
+ gpio_sku_id2: sku_id2 {
+ gpios = <&gpioe 1 GPIO_INPUT>;
+ };
+ gpio_switchcap_pg: src_vph_pwr_pg {
+ gpios = <&gpioe 2 GPIO_INPUT_PULL_DOWN>;
+ enum-name = "GPIO_SWITCHCAP_PG";
+ };
+ arm_x86 {
+ gpios = <&gpio6 6 GPIO_OUTPUT_LOW>;
+ };
+ ec-i2c-sensor-scl {
+ gpios = <&gpiob 3 (GPIO_INPUT | GPIO_VOLTAGE_1P8)>;
+ };
+ ec-i2c-sensor-sda {
+ gpios = <&gpiob 2 (GPIO_INPUT | GPIO_VOLTAGE_1P8)>;
+ };
+ gpio_ec_kso_02_inv: ec_kso_02_inv {
+ gpios = <&gpio1 7 (GPIO_OUTPUT_LOW | GPIO_ACTIVE_LOW)>;
+ };
+ };
+
+ usba-port-enable-list {
+ compatible = "cros-ec,usba-port-enable-pins";
+ enable-pins = <&gpio_en_usb_a_5v>;
+ };
+
+ sku {
+ compatible = "cros-ec,gpio-id";
+
+ bits = <
+ &gpio_sku_id0
+ &gpio_sku_id1
+ &gpio_sku_id2
+ >;
+
+ system = "ternary";
+ };
+
+ board {
+ compatible = "cros-ec,gpio-id";
+
+ bits = <
+ &gpio_brd_id0
+ &gpio_brd_id1
+ &gpio_brd_id2
+ >;
+
+ system = "ternary";
+ };
+
+ unused-pins {
+ compatible = "unused-gpios";
+ unused-gpios =
+ <&gpio5 2 0>,
+ <&gpio5 4 0>,
+ <&gpio7 6 0>,
+ <&gpiod 1 0>,
+ <&gpiod 0 0>,
+ <&gpioe 3 0>,
+ <&gpio0 4 0>,
+ <&gpiod 6 0>,
+ <&gpio3 2 0>,
+ <&gpio3 5 0>,
+ <&gpiod 7 0>,
+ <&gpio8 6 0>,
+ <&gpiod 4 0>,
+ <&gpio4 1 0>,
+ <&gpio3 4 0>,
+ <&gpioc 7 0>,
+ <&gpioa 4 0>,
+ <&gpio9 6 0>,
+ <&gpio9 3 0>,
+ <&gpioa 7 0>,
+ <&gpio5 0 0>,
+ <&gpio8 1 0>,
+ <&gpiob 7 0>;
+ };
+};
+
+/* Power switch logic input pads */
+&psl_in1_gpd2 {
+ /* ACOK_OD */
+ psl-in-mode = "edge";
+ psl-in-pol = "high-rising";
+};
+
+&psl_in2_gp00 {
+ /* EC_PWR_BTN_ODL */
+ psl-in-mode = "edge";
+ psl-in-pol = "low-falling";
+};
+
+&psl_in3_gp01 {
+ /* LID_OPEN_EC */
+ psl-in-mode = "edge";
+ psl-in-pol = "high-rising";
+};
+
+&psl_in4_gp02 {
+ /* RTC_EC_WAKE_ODL */
+ psl-in-mode = "edge";
+ psl-in-pol = "low-falling";
+};
+
+/* Power domain device controlled by PSL (Power Switch Logic) IO pads */
+&power_ctrl_psl {
+ status = "okay";
+ pinctrl-names = "sleep";
+ pinctrl-0 = <&psl_in1_gpd2 &psl_in2_gp00 &psl_in3_gp01 &psl_in4_gp02>;
+}; \ No newline at end of file
diff --git a/zephyr/projects/herobrine/gpio_evoker.dts b/zephyr/projects/herobrine/gpio_evoker.dts
new file mode 100644
index 0000000000..d60fdf93c7
--- /dev/null
+++ b/zephyr/projects/herobrine/gpio_evoker.dts
@@ -0,0 +1,329 @@
+/* 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.
+ */
+
+/ {
+ aliases {
+ gpio-wp = &gpio_ec_wp_odl;
+ gpio-kbd-kso2 = &gpio_ec_kso_02_inv;
+ };
+
+ named-gpios {
+ compatible = "named-gpios";
+
+ gpio_usb_c0_pd_int_odl: usb_c0_pd_int_odl {
+ gpios = <&gpioe 0 GPIO_INPUT>;
+ enum-name = "GPIO_USB_C0_PD_INT_ODL";
+ };
+ gpio_usb_c1_pd_int_odl: usb_c1_pd_int_odl {
+ gpios = <&gpiof 5 GPIO_INPUT>;
+ enum-name = "GPIO_USB_C1_PD_INT_ODL";
+ };
+ gpio_usb_c0_swctl_int_odl: usb_c0_swctl_int_odl {
+ gpios = <&gpio0 3 GPIO_INPUT>;
+ enum-name = "GPIO_USB_C0_SWCTL_INT_ODL";
+ };
+ gpio_usb_c1_swctl_int_odl: usb_c1_swctl_int_odl {
+ gpios = <&gpio4 0 GPIO_INPUT>;
+ enum-name = "GPIO_USB_C1_SWCTL_INT_ODL";
+ };
+ gpio_usb_c0_bc12_int_l: usb_c0_bc12_int_l {
+ gpios = <&gpio6 1 GPIO_INPUT_PULL_UP>;
+ };
+ gpio_usb_c1_bc12_int_l: usb_c1_bc12_int_l {
+ gpios = <&gpio8 2 GPIO_INPUT_PULL_UP>;
+ };
+ gpio_usb_a0_oc_odl: usb_a0_oc_odl {
+ gpios = <&gpiof 4 GPIO_INPUT_PULL_UP>;
+ };
+ gpio_chg_acok_od: chg_acok_od {
+ gpios = <&gpiod 2 GPIO_INPUT>;
+ enum-name = "GPIO_AC_PRESENT";
+ };
+ gpio_ec_pwr_btn_odl: ec_pwr_btn_odl {
+ gpios = <&gpio0 0 GPIO_INPUT>;
+ enum-name = "GPIO_POWER_BUTTON_L";
+ };
+ gpio_ec_voldn_btn_odl: ec_voldn_btn_odl {
+ gpios = <&gpio6 2 GPIO_INPUT_PULL_UP>;
+ enum-name = "GPIO_VOLUME_DOWN_L";
+ };
+ gpio_ec_volup_btn_odl: ec_volup_btn_odl {
+ gpios = <&gpioc 2 GPIO_INPUT_PULL_UP>;
+ enum-name = "GPIO_VOLUME_UP_L";
+ };
+ gpio_ec_wp_odl: ec_wp_odl {
+ gpios = <&gpiod 3 (GPIO_INPUT | GPIO_ACTIVE_LOW)>;
+ };
+ gpio_lid_open_ec: lid_open_ec {
+ gpios = <&gpio0 1 GPIO_INPUT>;
+ enum-name = "GPIO_LID_OPEN";
+ };
+ gpio_ap_rst_l: ap_rst_l {
+ gpios = <&gpio5 1 GPIO_INPUT>;
+ enum-name = "GPIO_AP_RST_L";
+ };
+ gpio_ps_hold: ps_hold {
+ gpios = <&gpioa 6 GPIO_INPUT_PULL_DOWN>;
+ enum-name = "GPIO_PS_HOLD";
+ };
+ gpio_ap_suspend: ap_suspend {
+ gpios = <&gpio5 7 GPIO_INPUT>;
+ enum-name = "GPIO_AP_SUSPEND";
+ };
+ gpio_mb_power_good: mb_power_good {
+ gpios = <&gpio3 7 GPIO_INPUT_PULL_DOWN>;
+ enum-name = "GPIO_POWER_GOOD";
+ };
+ gpio_warm_reset_l: warm_reset_l {
+ gpios = <&gpiob 0 GPIO_INPUT>;
+ enum-name = "GPIO_WARM_RESET_L";
+ };
+ ap_ec_spi_cs_l {
+ gpios = <&gpio5 3 GPIO_INPUT_PULL_DOWN>;
+ };
+ gpio_tablet_mode_l: tablet_mode_l {
+ gpios = <&gpioc 6 GPIO_INPUT>;
+ enum-name = "GPIO_TABLET_MODE_L";
+ };
+ gpio_accel_gyro_int_l: accel_gyro_int_l {
+ gpios = <&gpioa 3 GPIO_INPUT>;
+ };
+ gpio_rtc_ec_wake_odl: rtc_ec_wake_odl {
+ gpios = <&gpio0 2 GPIO_INPUT>;
+ };
+ ec_entering_rw {
+ gpios = <&gpio7 2 GPIO_OUTPUT_LOW>;
+ enum-name = "GPIO_ENTERING_RW";
+ };
+ ccd_mode_odl {
+ gpios = <&gpio6 3 GPIO_INPUT>;
+ enum-name = "GPIO_CCD_MODE_ODL";
+ };
+ ec_batt_pres_odl {
+ gpios = <&gpioe 5 GPIO_INPUT>;
+ enum-name = "GPIO_BATT_PRES_ODL";
+ };
+ ec_gsc_packet_mode {
+ gpios = <&gpio8 3 GPIO_OUTPUT_LOW>;
+ enum-name = "GPIO_PACKET_MODE_EN";
+ };
+ pmic_resin_l {
+ gpios = <&gpioa 0 GPIO_ODR_HIGH>;
+ enum-name = "GPIO_PMIC_RESIN_L";
+ };
+ pmic_kpd_pwr_odl {
+ gpios = <&gpioa 2 GPIO_ODR_HIGH>;
+ enum-name = "GPIO_PMIC_KPD_PWR_ODL";
+ };
+ ap_ec_int_l {
+ gpios = <&gpio5 6 GPIO_ODR_HIGH>;
+ enum-name = "GPIO_EC_INT_L";
+ };
+ gpio_switchcap_on: switchcap_on {
+ gpios = <&gpiod 5 GPIO_OUTPUT_LOW>;
+ enum-name = "GPIO_SWITCHCAP_ON";
+ };
+ gpio_en_pp5000_s5: en_pp5000_s5 {
+ gpios = <&gpio7 3 GPIO_OUTPUT_HIGH>;
+ enum-name = "GPIO_EN_PP5000";
+ };
+ ec_bl_disable_l {
+ /* The PMIC controls backlight enable and this pin must
+ * be HiZ for normal operation. But the backlight can
+ * be enabled by setting this pin low and configuring it
+ * as an output.
+ */
+ gpios = <&gpiob 6 GPIO_INPUT>;
+ enum-name = "GPIO_ENABLE_BACKLIGHT";
+ };
+ lid_accel_int_l {
+ gpios = <&gpioa 1 GPIO_INPUT>;
+ };
+ tp_int_gate {
+ gpios = <&gpio7 4 GPIO_OUTPUT_LOW>;
+ };
+ gpio_usb_c0_pd_rst_l: usb_c0_pd_rst_l {
+ gpios = <&gpiof 1 GPIO_OUTPUT_HIGH>;
+ };
+ gpio_usb_c1_pd_rst_l: usb_c1_pd_rst_l {
+ gpios = <&gpioe 4 GPIO_OUTPUT_HIGH>;
+ };
+ gpio_dp_mux_oe_l: dp_mux_oe_l {
+ gpios = <&gpiob 1 GPIO_ODR_HIGH>;
+ };
+ gpio_dp_mux_sel: dp_mux_sel {
+ gpios = <&gpio4 5 GPIO_OUTPUT_LOW>;
+ };
+ gpio_dp_hot_plug_det_r: dp_hot_plug_det_r {
+ gpios = <&gpio9 5 GPIO_OUTPUT_LOW>;
+ };
+ gpio_en_usb_a_5v: en_usb_a_5v {
+ gpios = <&gpiof 0 GPIO_OUTPUT_LOW>;
+ enum-name = "GPIO_EN_USB_A_5V";
+ };
+ usb_a_cdp_ilim_en_l {
+ gpios = <&gpio7 5 GPIO_OUTPUT_HIGH>;
+ };
+ gpio_usb_c0_frs_en: usb_c0_frs_en {
+ gpios = <&gpioc 5 GPIO_OUTPUT_LOW>;
+ enum-name = "GPIO_USB_C0_FRS_EN";
+ };
+ gpio_usb_c1_frs_en: usb_c1_frs_en {
+ gpios = <&gpioc 1 GPIO_OUTPUT_LOW>;
+ enum-name = "GPIO_USB_C1_FRS_EN";
+ };
+ gpio_ec_chg_led_y_c0: ec_chg_led_y_c0 {
+ #led-pin-cells = <1>;
+ gpios = <&gpio6 0 GPIO_OUTPUT_LOW>;
+ };
+ gpio_ec_chg_led_w_c0: ec_chg_led_w_c0 {
+ #led-pin-cells = <1>;
+ gpios = <&gpioc 0 GPIO_OUTPUT_LOW>;
+ };
+ gpio_ec_chg_led_w_c1: ec_chg_led_w_c1 {
+ #led-pin-cells = <1>;
+ gpios = <&gpioc 3 GPIO_OUTPUT_LOW>;
+ };
+ gpio_ec_chg_led_r_c0: ec_chg_led_r_c0 {
+ #led-pin-cells = <1>;
+ gpios = <&gpioc 4 GPIO_OUTPUT_LOW>;
+ };
+ ap_ec_spi_mosi {
+ gpios = <&gpio4 6 GPIO_INPUT_PULL_DOWN>;
+ };
+ ap_ec_spi_miso {
+ gpios = <&gpio4 7 GPIO_INPUT_PULL_DOWN>;
+ };
+ ap_ec_spi_clk {
+ gpios = <&gpio5 5 GPIO_INPUT_PULL_DOWN>;
+ };
+ gpio_brd_id0: brd_id0 {
+ gpios = <&gpio9 4 GPIO_INPUT>;
+ enum-name = "GPIO_BOARD_VERSION1";
+ };
+ gpio_brd_id1: brd_id1 {
+ gpios = <&gpio9 7 GPIO_INPUT>;
+ enum-name = "GPIO_BOARD_VERSION2";
+ };
+ gpio_brd_id2: brd_id2 {
+ gpios = <&gpioa 5 GPIO_INPUT>;
+ enum-name = "GPIO_BOARD_VERSION3";
+ };
+ gpio_sku_id0: sku_id0 {
+ gpios = <&gpio6 7 GPIO_INPUT>;
+ };
+ gpio_sku_id1: sku_id1 {
+ gpios = <&gpio7 0 GPIO_INPUT>;
+ };
+ gpio_sku_id2: sku_id2 {
+ gpios = <&gpioe 1 GPIO_INPUT>;
+ };
+ gpio_switchcap_pg: src_vph_pwr_pg {
+ gpios = <&gpioe 2 GPIO_INPUT_PULL_DOWN>;
+ enum-name = "GPIO_SWITCHCAP_PG";
+ };
+ arm_x86 {
+ gpios = <&gpio6 6 GPIO_OUTPUT_LOW>;
+ };
+ ec-i2c-sensor-scl {
+ gpios = <&gpiob 3 (GPIO_INPUT | GPIO_VOLTAGE_1P8)>;
+ };
+ ec-i2c-sensor-sda {
+ gpios = <&gpiob 2 (GPIO_INPUT | GPIO_VOLTAGE_1P8)>;
+ };
+ gpio_ec_kso_02_inv: ec_kso_02_inv {
+ gpios = <&gpio1 7 (GPIO_OUTPUT_LOW | GPIO_ACTIVE_LOW)>;
+ };
+ };
+
+ usba-port-enable-list {
+ compatible = "cros-ec,usba-port-enable-pins";
+ enable-pins = <&gpio_en_usb_a_5v>;
+ };
+
+ sku {
+ compatible = "cros-ec,gpio-id";
+
+ bits = <
+ &gpio_sku_id0
+ &gpio_sku_id1
+ &gpio_sku_id2
+ >;
+
+ system = "ternary";
+ };
+
+ board {
+ compatible = "cros-ec,gpio-id";
+
+ bits = <
+ &gpio_brd_id0
+ &gpio_brd_id1
+ &gpio_brd_id2
+ >;
+
+ system = "ternary";
+ };
+
+ unused-pins {
+ compatible = "unused-gpios";
+ unused-gpios =
+ <&gpio5 2 0>,
+ <&gpio5 4 0>,
+ <&gpio7 6 0>,
+ <&gpiod 1 0>,
+ <&gpiod 0 0>,
+ <&gpioe 3 0>,
+ <&gpio0 4 0>,
+ <&gpiod 6 0>,
+ <&gpio3 2 0>,
+ <&gpio3 5 0>,
+ <&gpiod 7 0>,
+ <&gpio8 6 0>,
+ <&gpiod 4 0>,
+ <&gpio4 1 0>,
+ <&gpio3 4 0>,
+ <&gpioc 7 0>,
+ <&gpioa 4 0>,
+ <&gpio9 6 0>,
+ <&gpio9 3 0>,
+ <&gpioa 7 0>,
+ <&gpio5 0 0>,
+ <&gpio8 1 0>,
+ <&gpiob 7 0>;
+ };
+};
+
+/* Power switch logic input pads */
+&psl_in1_gpd2 {
+ /* ACOK_OD */
+ psl-in-mode = "edge";
+ psl-in-pol = "high-rising";
+};
+
+&psl_in2_gp00 {
+ /* EC_PWR_BTN_ODL */
+ psl-in-mode = "edge";
+ psl-in-pol = "low-falling";
+};
+
+&psl_in3_gp01 {
+ /* LID_OPEN_EC */
+ psl-in-mode = "edge";
+ psl-in-pol = "high-rising";
+};
+
+&psl_in4_gp02 {
+ /* RTC_EC_WAKE_ODL */
+ psl-in-mode = "edge";
+ psl-in-pol = "low-falling";
+};
+
+/* Power domain device controlled by PSL (Power Switch Logic) IO pads */
+&power_ctrl_psl {
+ status = "okay";
+ pinctrl-names = "sleep";
+ pinctrl-0 = <&psl_in1_gpd2 &psl_in2_gp00 &psl_in3_gp01 &psl_in4_gp02>;
+};
diff --git a/zephyr/projects/herobrine/gpio_hoglin.dts b/zephyr/projects/herobrine/gpio_hoglin.dts
new file mode 100644
index 0000000000..cb7babc9cf
--- /dev/null
+++ b/zephyr/projects/herobrine/gpio_hoglin.dts
@@ -0,0 +1,327 @@
+/* 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.
+ */
+
+/ {
+ aliases {
+ gpio-wp = &gpio_ec_wp_odl;
+ gpio-kbd-kso2 = &gpio_ec_kso_02_inv;
+ };
+
+ named-gpios {
+ compatible = "named-gpios";
+
+ gpio_usb_c0_pd_int_odl: usb_c0_pd_int_odl {
+ gpios = <&gpioe 0 GPIO_INPUT>;
+ enum-name = "GPIO_USB_C0_PD_INT_ODL";
+ };
+ gpio_usb_c1_pd_int_odl: usb_c1_pd_int_odl {
+ gpios = <&gpiof 5 GPIO_INPUT>;
+ enum-name = "GPIO_USB_C1_PD_INT_ODL";
+ };
+ gpio_usb_c0_swctl_int_odl: usb_c0_swctl_int_odl {
+ gpios = <&gpio0 3 GPIO_INPUT>;
+ enum-name = "GPIO_USB_C0_SWCTL_INT_ODL";
+ };
+ gpio_usb_c1_swctl_int_odl: usb_c1_swctl_int_odl {
+ gpios = <&gpio4 0 GPIO_INPUT>;
+ enum-name = "GPIO_USB_C1_SWCTL_INT_ODL";
+ };
+ gpio_usb_c0_bc12_int_l: usb_c0_bc12_int_l {
+ gpios = <&gpio6 1 GPIO_INPUT_PULL_UP>;
+ };
+ gpio_usb_c1_bc12_int_l: usb_c1_bc12_int_l {
+ gpios = <&gpio8 2 GPIO_INPUT_PULL_UP>;
+ };
+ gpio_usb_a0_oc_odl: usb_a0_oc_odl {
+ gpios = <&gpiof 4 GPIO_INPUT_PULL_UP>;
+ };
+ gpio_chg_acok_od: chg_acok_od {
+ gpios = <&gpiod 2 GPIO_INPUT>;
+ enum-name = "GPIO_AC_PRESENT";
+ };
+ gpio_ec_pwr_btn_odl: ec_pwr_btn_odl {
+ gpios = <&gpio0 0 GPIO_INPUT>;
+ enum-name = "GPIO_POWER_BUTTON_L";
+ };
+ gpio_ec_voldn_btn_odl: ec_voldn_btn_odl {
+ gpios = <&gpio6 2 GPIO_INPUT_PULL_UP>;
+ enum-name = "GPIO_VOLUME_DOWN_L";
+ };
+ gpio_ec_volup_btn_odl: ec_volup_btn_odl {
+ gpios = <&gpioc 2 GPIO_INPUT_PULL_UP>;
+ enum-name = "GPIO_VOLUME_UP_L";
+ };
+ gpio_ec_wp_odl: ec_wp_odl {
+ gpios = <&gpiod 3 (GPIO_INPUT | GPIO_ACTIVE_LOW)>;
+ };
+ gpio_lid_open_ec: lid_open_ec {
+ gpios = <&gpio0 1 GPIO_INPUT>;
+ enum-name = "GPIO_LID_OPEN";
+ };
+ gpio_ap_rst_l: ap_rst_l {
+ gpios = <&gpio5 1 GPIO_INPUT>;
+ enum-name = "GPIO_AP_RST_L";
+ };
+ gpio_ps_hold: ps_hold {
+ gpios = <&gpioa 6 GPIO_INPUT_PULL_DOWN>;
+ enum-name = "GPIO_PS_HOLD";
+ };
+ gpio_ap_suspend: ap_suspend {
+ gpios = <&gpio5 7 GPIO_INPUT>;
+ enum-name = "GPIO_AP_SUSPEND";
+ };
+ gpio_mb_power_good: mb_power_good {
+ gpios = <&gpio3 7 GPIO_INPUT_PULL_DOWN>;
+ enum-name = "GPIO_POWER_GOOD";
+ };
+ gpio_warm_reset_l: warm_reset_l {
+ gpios = <&gpiob 0 GPIO_INPUT>;
+ enum-name = "GPIO_WARM_RESET_L";
+ };
+ ap_ec_spi_cs_l {
+ gpios = <&gpio5 3 GPIO_INPUT_PULL_DOWN>;
+ };
+ gpio_tablet_mode_l: tablet_mode_l {
+ gpios = <&gpioc 6 GPIO_INPUT>;
+ enum-name = "GPIO_TABLET_MODE_L";
+ };
+ gpio_accel_gyro_int_l: accel_gyro_int_l {
+ gpios = <&gpioa 3 GPIO_INPUT>;
+ };
+ gpio_rtc_ec_wake_odl: rtc_ec_wake_odl {
+ gpios = <&gpio0 2 GPIO_INPUT>;
+ };
+ ec_entering_rw {
+ gpios = <&gpio7 2 GPIO_OUTPUT_LOW>;
+ enum-name = "GPIO_ENTERING_RW";
+ };
+ ccd_mode_odl {
+ gpios = <&gpio6 3 GPIO_INPUT>;
+ enum-name = "GPIO_CCD_MODE_ODL";
+ };
+ ec_batt_pres_odl {
+ gpios = <&gpioe 5 GPIO_INPUT>;
+ enum-name = "GPIO_BATT_PRES_ODL";
+ };
+ ec_gsc_packet_mode {
+ gpios = <&gpio8 3 GPIO_OUTPUT_LOW>;
+ enum-name = "GPIO_PACKET_MODE_EN";
+ };
+ pmic_resin_l {
+ gpios = <&gpioa 0 GPIO_ODR_HIGH>;
+ enum-name = "GPIO_PMIC_RESIN_L";
+ };
+ pmic_kpd_pwr_odl {
+ gpios = <&gpioa 2 GPIO_ODR_HIGH>;
+ enum-name = "GPIO_PMIC_KPD_PWR_ODL";
+ };
+ ap_ec_int_l {
+ gpios = <&gpio5 6 GPIO_ODR_HIGH>;
+ enum-name = "GPIO_EC_INT_L";
+ };
+ gpio_switchcap_on: switchcap_on {
+ gpios = <&gpio5 0 GPIO_OUTPUT_LOW>;
+ enum-name = "GPIO_SWITCHCAP_ON";
+ };
+ gpio_en_pp5000_s5: en_pp5000_s5 {
+ gpios = <&gpio7 3 GPIO_OUTPUT_HIGH>;
+ enum-name = "GPIO_EN_PP5000";
+ };
+ ec_bl_disable_l {
+ /* The PMIC controls backlight enable and this pin must
+ * be HiZ for normal operation. But the backlight can
+ * be enabled by setting this pin low and configuring it
+ * as an output.
+ */
+ gpios = <&gpiob 6 GPIO_INPUT>;
+ enum-name = "GPIO_ENABLE_BACKLIGHT";
+ };
+ lid_accel_int_l {
+ gpios = <&gpioa 1 GPIO_INPUT>;
+ };
+ tp_int_gate {
+ gpios = <&gpio7 4 GPIO_OUTPUT_LOW>;
+ };
+ gpio_usb_c0_pd_rst_l: usb_c0_pd_rst_l {
+ gpios = <&gpiof 1 GPIO_OUTPUT_HIGH>;
+ };
+ gpio_usb_c1_pd_rst_l: usb_c1_pd_rst_l {
+ gpios = <&gpioe 4 GPIO_OUTPUT_HIGH>;
+ };
+ gpio_dp_mux_oe_l: dp_mux_oe_l {
+ gpios = <&gpiob 1 GPIO_ODR_HIGH>;
+ };
+ gpio_dp_mux_sel: dp_mux_sel {
+ gpios = <&gpio4 5 GPIO_OUTPUT_LOW>;
+ };
+ gpio_dp_hot_plug_det_r: dp_hot_plug_det_r {
+ gpios = <&gpio9 5 GPIO_OUTPUT_LOW>;
+ };
+ gpio_en_usb_a_5v: en_usb_a_5v {
+ gpios = <&gpiof 0 GPIO_OUTPUT_LOW>;
+ enum-name = "GPIO_EN_USB_A_5V";
+ };
+ usb_a_cdp_ilim_en_l {
+ gpios = <&gpio7 5 GPIO_OUTPUT_HIGH>;
+ };
+ gpio_usb_c0_frs_en: usb_c0_frs_en {
+ gpios = <&gpioc 5 GPIO_OUTPUT_LOW>;
+ enum-name = "GPIO_USB_C0_FRS_EN";
+ };
+ gpio_usb_c1_frs_en: usb_c1_frs_en {
+ gpios = <&gpioc 1 GPIO_OUTPUT_LOW>;
+ enum-name = "GPIO_USB_C1_FRS_EN";
+ };
+ gpio_ec_chg_led_b_c0: ec_chg_led_b_c0 {
+ #led-pin-cells = <1>;
+ gpios = <&gpio6 0 GPIO_OUTPUT_LOW>;
+ };
+ gpio_ec_chg_led_r_c0: ec_chg_led_r_c0 {
+ #led-pin-cells = <1>;
+ gpios = <&gpioc 0 GPIO_OUTPUT_LOW>;
+ };
+ gpio_ec_chg_led_y_c1: ec_chg_led_b_c1 {
+ gpios = <&gpioc 3 GPIO_OUTPUT_LOW>;
+ };
+ gpio_ec_chg_led_w_c1: ec_chg_led_r_c1 {
+ gpios = <&gpioc 4 GPIO_OUTPUT_LOW>;
+ };
+ ap_ec_spi_mosi {
+ gpios = <&gpio4 6 GPIO_INPUT_PULL_DOWN>;
+ };
+ ap_ec_spi_miso {
+ gpios = <&gpio4 7 GPIO_INPUT_PULL_DOWN>;
+ };
+ ap_ec_spi_clk {
+ gpios = <&gpio5 5 GPIO_INPUT_PULL_DOWN>;
+ };
+ gpio_brd_id0: brd_id0 {
+ gpios = <&gpio9 4 GPIO_INPUT>;
+ enum-name = "GPIO_BOARD_VERSION1";
+ };
+ gpio_brd_id1: brd_id1 {
+ gpios = <&gpio9 7 GPIO_INPUT>;
+ enum-name = "GPIO_BOARD_VERSION2";
+ };
+ gpio_brd_id2: brd_id2 {
+ gpios = <&gpioa 5 GPIO_INPUT>;
+ enum-name = "GPIO_BOARD_VERSION3";
+ };
+ gpio_sku_id0: sku_id0 {
+ gpios = <&gpio6 7 GPIO_INPUT>;
+ };
+ gpio_sku_id1: sku_id1 {
+ gpios = <&gpio7 0 GPIO_INPUT>;
+ };
+ gpio_sku_id2: sku_id2 {
+ gpios = <&gpioe 1 GPIO_INPUT>;
+ };
+ gpio_switchcap_pg: src_vph_pwr_pg {
+ gpios = <&gpioe 2 GPIO_INPUT_PULL_DOWN>;
+ enum-name = "GPIO_SWITCHCAP_PG";
+ };
+ arm_x86 {
+ gpios = <&gpio6 6 GPIO_OUTPUT_LOW>;
+ };
+ ec-i2c-sensor-scl {
+ gpios = <&gpiob 3 (GPIO_INPUT | GPIO_VOLTAGE_1P8)>;
+ };
+ ec-i2c-sensor-sda {
+ gpios = <&gpiob 2 (GPIO_INPUT | GPIO_VOLTAGE_1P8)>;
+ };
+ gpio_ec_kso_02_inv: ec_kso_02_inv {
+ gpios = <&gpio1 7 (GPIO_OUTPUT_LOW | GPIO_ACTIVE_LOW)>;
+ };
+ };
+
+ usba-port-enable-list {
+ compatible = "cros-ec,usba-port-enable-pins";
+ enable-pins = <&gpio_en_usb_a_5v>;
+ };
+
+ sku {
+ compatible = "cros-ec,gpio-id";
+
+ bits = <
+ &gpio_sku_id0
+ &gpio_sku_id1
+ &gpio_sku_id2
+ >;
+
+ system = "ternary";
+ };
+
+ board {
+ compatible = "cros-ec,gpio-id";
+
+ bits = <
+ &gpio_brd_id0
+ &gpio_brd_id1
+ &gpio_brd_id2
+ >;
+
+ system = "ternary";
+ };
+
+ unused-pins {
+ compatible = "unused-gpios";
+ unused-gpios =
+ <&gpio5 2 0>,
+ <&gpio5 4 0>,
+ <&gpio7 6 0>,
+ <&gpiod 1 0>,
+ <&gpiod 0 0>,
+ <&gpioe 3 0>,
+ <&gpio0 4 0>,
+ <&gpiod 6 0>,
+ <&gpio3 2 0>,
+ <&gpio3 5 0>,
+ <&gpiod 7 0>,
+ <&gpio8 6 0>,
+ <&gpiod 4 0>,
+ <&gpio4 1 0>,
+ <&gpio3 4 0>,
+ <&gpioc 7 0>,
+ <&gpioa 4 0>,
+ <&gpio9 6 0>,
+ <&gpio9 3 0>,
+ <&gpioa 7 0>,
+ <&gpiod 5 0>,
+ <&gpio8 1 0>,
+ <&gpiob 7 0>;
+ };
+};
+
+/* Power switch logic input pads */
+&psl_in1_gpd2 {
+ /* ACOK_OD */
+ psl-in-mode = "edge";
+ psl-in-pol = "high-rising";
+};
+
+&psl_in2_gp00 {
+ /* EC_PWR_BTN_ODL */
+ psl-in-mode = "edge";
+ psl-in-pol = "low-falling";
+};
+
+&psl_in3_gp01 {
+ /* LID_OPEN_EC */
+ psl-in-mode = "edge";
+ psl-in-pol = "high-rising";
+};
+
+&psl_in4_gp02 {
+ /* RTC_EC_WAKE_ODL */
+ psl-in-mode = "edge";
+ psl-in-pol = "low-falling";
+};
+
+/* Power domain device controlled by PSL (Power Switch Logic) IO pads */
+&power_ctrl_psl {
+ status = "okay";
+ pinctrl-names = "sleep";
+ pinctrl-0 = <&psl_in1_gpd2 &psl_in2_gp00 &psl_in3_gp01 &psl_in4_gp02>;
+};
diff --git a/zephyr/projects/herobrine/gpio_villager.dts b/zephyr/projects/herobrine/gpio_villager.dts
new file mode 100644
index 0000000000..1e7625ff6a
--- /dev/null
+++ b/zephyr/projects/herobrine/gpio_villager.dts
@@ -0,0 +1,323 @@
+/* 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.
+ */
+
+/ {
+ aliases {
+ gpio-wp = &gpio_ec_wp_odl;
+ gpio-kbd-kso2 = &gpio_ec_kso_02_inv;
+ };
+
+ named-gpios {
+ compatible = "named-gpios";
+
+ gpio_usb_c0_pd_int_odl: usb_c0_pd_int_odl {
+ gpios = <&gpioe 0 GPIO_INPUT>;
+ enum-name = "GPIO_USB_C0_PD_INT_ODL";
+ };
+ gpio_usb_c1_pd_int_odl: usb_c1_pd_int_odl {
+ gpios = <&gpiof 5 GPIO_INPUT>;
+ enum-name = "GPIO_USB_C1_PD_INT_ODL";
+ };
+ gpio_usb_c0_swctl_int_odl: usb_c0_swctl_int_odl {
+ gpios = <&gpio0 3 GPIO_INPUT>;
+ enum-name = "GPIO_USB_C0_SWCTL_INT_ODL";
+ };
+ gpio_usb_c1_swctl_int_odl: usb_c1_swctl_int_odl {
+ gpios = <&gpio4 0 GPIO_INPUT>;
+ enum-name = "GPIO_USB_C1_SWCTL_INT_ODL";
+ };
+ gpio_usb_c0_bc12_int_l: usb_c0_bc12_int_l {
+ gpios = <&gpio6 1 GPIO_INPUT_PULL_UP>;
+ };
+ gpio_usb_c1_bc12_int_l: usb_c1_bc12_int_l {
+ gpios = <&gpio8 2 GPIO_INPUT_PULL_UP>;
+ };
+ gpio_usb_a0_oc_odl: usb_a0_oc_odl {
+ gpios = <&gpiof 4 GPIO_INPUT_PULL_UP>;
+ };
+ gpio_chg_acok_od: chg_acok_od {
+ gpios = <&gpiod 2 GPIO_INPUT>;
+ enum-name = "GPIO_AC_PRESENT";
+ };
+ gpio_ec_pwr_btn_odl: ec_pwr_btn_odl {
+ gpios = <&gpio0 0 GPIO_INPUT>;
+ enum-name = "GPIO_POWER_BUTTON_L";
+ };
+ gpio_ec_voldn_btn_odl: ec_voldn_btn_odl {
+ gpios = <&gpio6 2 GPIO_INPUT_PULL_UP>;
+ enum-name = "GPIO_VOLUME_DOWN_L";
+ };
+ gpio_ec_volup_btn_odl: ec_volup_btn_odl {
+ gpios = <&gpioc 2 GPIO_INPUT_PULL_UP>;
+ enum-name = "GPIO_VOLUME_UP_L";
+ };
+ gpio_ec_wp_odl: ec_wp_odl {
+ gpios = <&gpiod 3 (GPIO_INPUT | GPIO_ACTIVE_LOW)>;
+ };
+ gpio_lid_open_ec: lid_open_ec {
+ gpios = <&gpio0 1 GPIO_INPUT>;
+ enum-name = "GPIO_LID_OPEN";
+ };
+ gpio_ap_rst_l: ap_rst_l {
+ gpios = <&gpio5 1 GPIO_INPUT>;
+ enum-name = "GPIO_AP_RST_L";
+ };
+ gpio_ps_hold: ps_hold {
+ gpios = <&gpioa 6 GPIO_INPUT_PULL_DOWN>;
+ enum-name = "GPIO_PS_HOLD";
+ };
+ gpio_ap_suspend: ap_suspend {
+ gpios = <&gpio5 7 GPIO_INPUT>;
+ enum-name = "GPIO_AP_SUSPEND";
+ };
+ gpio_mb_power_good: mb_power_good {
+ gpios = <&gpio3 7 GPIO_INPUT_PULL_DOWN>;
+ enum-name = "GPIO_POWER_GOOD";
+ };
+ gpio_warm_reset_l: warm_reset_l {
+ gpios = <&gpiob 0 GPIO_INPUT>;
+ enum-name = "GPIO_WARM_RESET_L";
+ };
+ ap_ec_spi_cs_l {
+ gpios = <&gpio5 3 GPIO_INPUT_PULL_DOWN>;
+ };
+ gpio_tablet_mode_l: tablet_mode_l {
+ gpios = <&gpioc 6 GPIO_INPUT>;
+ enum-name = "GPIO_TABLET_MODE_L";
+ };
+ gpio_accel_gyro_int_l: accel_gyro_int_l {
+ gpios = <&gpioa 3 GPIO_INPUT>;
+ };
+ gpio_rtc_ec_wake_odl: rtc_ec_wake_odl {
+ gpios = <&gpio0 2 GPIO_INPUT>;
+ };
+ ec_entering_rw {
+ gpios = <&gpio7 2 GPIO_OUTPUT_LOW>;
+ enum-name = "GPIO_ENTERING_RW";
+ };
+ ccd_mode_odl {
+ gpios = <&gpio6 3 GPIO_INPUT>;
+ enum-name = "GPIO_CCD_MODE_ODL";
+ };
+ ec_batt_pres_odl {
+ gpios = <&gpioe 5 GPIO_INPUT>;
+ enum-name = "GPIO_BATT_PRES_ODL";
+ };
+ ec_gsc_packet_mode {
+ gpios = <&gpio8 3 GPIO_OUTPUT_LOW>;
+ enum-name = "GPIO_PACKET_MODE_EN";
+ };
+ pmic_resin_l {
+ gpios = <&gpioa 0 GPIO_ODR_HIGH>;
+ enum-name = "GPIO_PMIC_RESIN_L";
+ };
+ pmic_kpd_pwr_odl {
+ gpios = <&gpioa 2 GPIO_ODR_HIGH>;
+ enum-name = "GPIO_PMIC_KPD_PWR_ODL";
+ };
+ ap_ec_int_l {
+ gpios = <&gpio5 6 GPIO_ODR_HIGH>;
+ enum-name = "GPIO_EC_INT_L";
+ };
+ gpio_switchcap_on: switchcap_on {
+ gpios = <&gpiod 5 GPIO_OUTPUT_LOW>;
+ enum-name = "GPIO_SWITCHCAP_ON";
+ };
+ gpio_en_pp5000_s5: en_pp5000_s5 {
+ gpios = <&gpio7 3 GPIO_OUTPUT_HIGH>;
+ enum-name = "GPIO_EN_PP5000";
+ };
+ ec_bl_disable_l {
+ /* The PMIC controls backlight enable and this pin must
+ * be HiZ for normal operation. But the backlight can
+ * be enabled by setting this pin low and configuring it
+ * as an output.
+ */
+ gpios = <&gpiob 6 GPIO_INPUT>;
+ enum-name = "GPIO_ENABLE_BACKLIGHT";
+ };
+ lid_accel_int_l {
+ gpios = <&gpioa 1 GPIO_INPUT>;
+ };
+ tp_int_gate {
+ gpios = <&gpio7 4 GPIO_OUTPUT_LOW>;
+ };
+ gpio_usb_c0_pd_rst_l: usb_c0_pd_rst_l {
+ gpios = <&gpiof 1 GPIO_OUTPUT_HIGH>;
+ };
+ gpio_usb_c1_pd_rst_l: usb_c1_pd_rst_l {
+ gpios = <&gpioe 4 GPIO_OUTPUT_HIGH>;
+ };
+ gpio_dp_mux_oe_l: dp_mux_oe_l {
+ gpios = <&gpiob 1 GPIO_ODR_HIGH>;
+ };
+ gpio_dp_mux_sel: dp_mux_sel {
+ gpios = <&gpio4 5 GPIO_OUTPUT_LOW>;
+ };
+ gpio_dp_hot_plug_det_r: dp_hot_plug_det_r {
+ gpios = <&gpio9 5 GPIO_OUTPUT_LOW>;
+ };
+ gpio_en_usb_a_5v: en_usb_a_5v {
+ gpios = <&gpiof 0 GPIO_OUTPUT_LOW>;
+ enum-name = "GPIO_EN_USB_A_5V";
+ };
+ usb_a_cdp_ilim_en_l {
+ gpios = <&gpio7 5 GPIO_OUTPUT_HIGH>;
+ };
+ gpio_usb_c0_frs_en: usb_c0_frs_en {
+ gpios = <&gpioc 5 GPIO_OUTPUT_LOW>;
+ enum-name = "GPIO_USB_C0_FRS_EN";
+ };
+ gpio_usb_c1_frs_en: usb_c1_frs_en {
+ gpios = <&gpioc 1 GPIO_OUTPUT_LOW>;
+ enum-name = "GPIO_USB_C1_FRS_EN";
+ };
+ gpio_ec_chg_led_y_c0: ec_chg_led_y_c0 {
+ #led-pin-cells = <1>;
+ gpios = <&gpio6 0 GPIO_OUTPUT_LOW>;
+ };
+ gpio_ec_chg_led_b_c0: ec_chg_led_b_c0 {
+ #led-pin-cells = <1>;
+ gpios = <&gpioc 0 GPIO_OUTPUT_LOW>;
+ };
+ ap_ec_spi_mosi {
+ gpios = <&gpio4 6 GPIO_INPUT_PULL_DOWN>;
+ };
+ ap_ec_spi_miso {
+ gpios = <&gpio4 7 GPIO_INPUT_PULL_DOWN>;
+ };
+ ap_ec_spi_clk {
+ gpios = <&gpio5 5 GPIO_INPUT_PULL_DOWN>;
+ };
+ gpio_brd_id0: brd_id0 {
+ gpios = <&gpio9 4 GPIO_INPUT>;
+ enum-name = "GPIO_BOARD_VERSION1";
+ };
+ gpio_brd_id1: brd_id1 {
+ gpios = <&gpio9 7 GPIO_INPUT>;
+ enum-name = "GPIO_BOARD_VERSION2";
+ };
+ gpio_brd_id2: brd_id2 {
+ gpios = <&gpioa 5 GPIO_INPUT>;
+ enum-name = "GPIO_BOARD_VERSION3";
+ };
+ gpio_sku_id0: sku_id0 {
+ gpios = <&gpio6 7 GPIO_INPUT>;
+ };
+ gpio_sku_id1: sku_id1 {
+ gpios = <&gpio7 0 GPIO_INPUT>;
+ };
+ gpio_sku_id2: sku_id2 {
+ gpios = <&gpioe 1 GPIO_INPUT>;
+ };
+ gpio_switchcap_pg: src_vph_pwr_pg {
+ gpios = <&gpioe 2 GPIO_INPUT_PULL_DOWN>;
+ enum-name = "GPIO_SWITCHCAP_PG";
+ };
+ arm_x86 {
+ gpios = <&gpio6 6 GPIO_OUTPUT_LOW>;
+ };
+ ec-i2c-sensor-scl {
+ gpios = <&gpiob 3 (GPIO_INPUT | GPIO_VOLTAGE_1P8)>;
+ };
+ ec-i2c-sensor-sda {
+ gpios = <&gpiob 2 (GPIO_INPUT | GPIO_VOLTAGE_1P8)>;
+ };
+ gpio_ec_kso_02_inv: ec_kso_02_inv {
+ gpios = <&gpio1 7 (GPIO_OUTPUT_LOW | GPIO_ACTIVE_LOW)>;
+ };
+ };
+
+ usba-port-enable-list {
+ compatible = "cros-ec,usba-port-enable-pins";
+ enable-pins = <&gpio_en_usb_a_5v>;
+ };
+
+ sku {
+ compatible = "cros-ec,gpio-id";
+
+ bits = <
+ &gpio_sku_id0
+ &gpio_sku_id1
+ &gpio_sku_id2
+ >;
+
+ system = "ternary";
+ };
+
+ board {
+ compatible = "cros-ec,gpio-id";
+
+ bits = <
+ &gpio_brd_id0
+ &gpio_brd_id1
+ &gpio_brd_id2
+ >;
+
+ system = "ternary";
+ };
+
+ unused-pins {
+ compatible = "unused-gpios";
+ unused-gpios =
+ <&gpio5 2 0>,
+ <&gpio5 4 0>,
+ <&gpio7 6 0>,
+ <&gpiod 1 0>,
+ <&gpiod 0 0>,
+ <&gpioe 3 0>,
+ <&gpio0 4 0>,
+ <&gpiod 6 0>,
+ <&gpio3 2 0>,
+ <&gpio3 5 0>,
+ <&gpiod 7 0>,
+ <&gpio8 6 0>,
+ <&gpiod 4 0>,
+ <&gpio4 1 0>,
+ <&gpio3 4 0>,
+ <&gpioc 3 0>,
+ <&gpioc 4 0>,
+ <&gpioc 7 0>,
+ <&gpioa 4 0>,
+ <&gpio9 6 0>,
+ <&gpio9 3 0>,
+ <&gpioa 7 0>,
+ <&gpio5 0 0>,
+ <&gpio8 1 0>,
+ <&gpiob 7 0>;
+ };
+};
+
+/* Power switch logic input pads */
+&psl_in1_gpd2 {
+ /* ACOK_OD */
+ psl-in-mode = "edge";
+ psl-in-pol = "high-rising";
+};
+
+&psl_in2_gp00 {
+ /* EC_PWR_BTN_ODL */
+ psl-in-mode = "edge";
+ psl-in-pol = "low-falling";
+};
+
+&psl_in3_gp01 {
+ /* LID_OPEN_EC */
+ psl-in-mode = "edge";
+ psl-in-pol = "high-rising";
+};
+
+&psl_in4_gp02 {
+ /* RTC_EC_WAKE_ODL */
+ psl-in-mode = "edge";
+ psl-in-pol = "low-falling";
+};
+
+/* Power domain device controlled by PSL (Power Switch Logic) IO pads */
+&power_ctrl_psl {
+ status = "okay";
+ pinctrl-names = "sleep";
+ pinctrl-0 = <&psl_in1_gpd2 &psl_in2_gp00 &psl_in3_gp01 &psl_in4_gp02>;
+};
diff --git a/zephyr/projects/herobrine/gpio_zombie.dts b/zephyr/projects/herobrine/gpio_zombie.dts
new file mode 100644
index 0000000000..14ed1f54d6
--- /dev/null
+++ b/zephyr/projects/herobrine/gpio_zombie.dts
@@ -0,0 +1,323 @@
+/* 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.
+ */
+
+/ {
+ aliases {
+ gpio-wp = &gpio_ec_wp_odl;
+ gpio-kbd-kso2 = &gpio_ec_kso_02_inv;
+ };
+
+ named-gpios {
+ compatible = "named-gpios";
+
+ gpio_usb_c0_pd_int_odl: usb_c0_pd_int_odl {
+ gpios = <&gpioe 0 GPIO_INPUT>;
+ enum-name = "GPIO_USB_C0_PD_INT_ODL";
+ };
+ gpio_usb_c1_pd_int_odl: usb_c1_pd_int_odl {
+ gpios = <&gpiof 5 GPIO_INPUT>;
+ enum-name = "GPIO_USB_C1_PD_INT_ODL";
+ };
+ gpio_usb_c0_swctl_int_odl: usb_c0_swctl_int_odl {
+ gpios = <&gpio0 3 GPIO_INPUT>;
+ enum-name = "GPIO_USB_C0_SWCTL_INT_ODL";
+ };
+ gpio_usb_c1_swctl_int_odl: usb_c1_swctl_int_odl {
+ gpios = <&gpio4 0 GPIO_INPUT>;
+ enum-name = "GPIO_USB_C1_SWCTL_INT_ODL";
+ };
+ gpio_usb_c0_bc12_int_l: usb_c0_bc12_int_l {
+ gpios = <&gpio6 1 GPIO_INPUT_PULL_UP>;
+ };
+ gpio_usb_c1_bc12_int_l: usb_c1_bc12_int_l {
+ gpios = <&gpio8 2 GPIO_INPUT_PULL_UP>;
+ };
+ gpio_usb_a0_oc_odl: usb_a0_oc_odl {
+ gpios = <&gpiof 4 GPIO_INPUT_PULL_UP>;
+ };
+ gpio_chg_acok_od: chg_acok_od {
+ gpios = <&gpiod 2 GPIO_INPUT>;
+ enum-name = "GPIO_AC_PRESENT";
+ };
+ gpio_ec_pwr_btn_odl: ec_pwr_btn_odl {
+ gpios = <&gpio0 0 GPIO_INPUT>;
+ enum-name = "GPIO_POWER_BUTTON_L";
+ };
+ gpio_ec_voldn_btn_odl: ec_voldn_btn_odl {
+ gpios = <&gpio6 2 GPIO_INPUT_PULL_UP>;
+ enum-name = "GPIO_VOLUME_DOWN_L";
+ };
+ gpio_ec_volup_btn_odl: ec_volup_btn_odl {
+ gpios = <&gpioc 2 GPIO_INPUT_PULL_UP>;
+ enum-name = "GPIO_VOLUME_UP_L";
+ };
+ gpio_ec_wp_odl: ec_wp_odl {
+ gpios = <&gpiod 3 (GPIO_INPUT | GPIO_ACTIVE_LOW)>;
+ };
+ gpio_lid_open_ec: lid_open_ec {
+ gpios = <&gpio0 1 GPIO_INPUT>;
+ enum-name = "GPIO_LID_OPEN";
+ };
+ gpio_ap_rst_l: ap_rst_l {
+ gpios = <&gpio5 1 GPIO_INPUT>;
+ enum-name = "GPIO_AP_RST_L";
+ };
+ gpio_ps_hold: ps_hold {
+ gpios = <&gpioa 6 GPIO_INPUT_PULL_DOWN>;
+ enum-name = "GPIO_PS_HOLD";
+ };
+ gpio_ap_suspend: ap_suspend {
+ gpios = <&gpio5 7 GPIO_INPUT>;
+ enum-name = "GPIO_AP_SUSPEND";
+ };
+ gpio_mb_power_good: mb_power_good {
+ gpios = <&gpio3 7 GPIO_INPUT_PULL_DOWN>;
+ enum-name = "GPIO_POWER_GOOD";
+ };
+ gpio_warm_reset_l: warm_reset_l {
+ gpios = <&gpiob 0 GPIO_INPUT>;
+ enum-name = "GPIO_WARM_RESET_L";
+ };
+ ap_ec_spi_cs_l {
+ gpios = <&gpio5 3 GPIO_INPUT_PULL_DOWN>;
+ };
+ gpio_tablet_mode_l: tablet_mode_l {
+ gpios = <&gpioc 6 GPIO_INPUT>;
+ enum-name = "GPIO_TABLET_MODE_L";
+ };
+ gpio_accel_gyro_int_l: accel_gyro_int_l {
+ gpios = <&gpioa 3 GPIO_INPUT>;
+ };
+ gpio_rtc_ec_wake_odl: rtc_ec_wake_odl {
+ gpios = <&gpio0 2 GPIO_INPUT>;
+ };
+ ec_entering_rw {
+ gpios = <&gpio7 2 GPIO_OUTPUT_LOW>;
+ enum-name = "GPIO_ENTERING_RW";
+ };
+ ccd_mode_odl {
+ gpios = <&gpio6 3 GPIO_INPUT>;
+ enum-name = "GPIO_CCD_MODE_ODL";
+ };
+ ec_batt_pres_odl {
+ gpios = <&gpioe 5 GPIO_INPUT>;
+ enum-name = "GPIO_BATT_PRES_ODL";
+ };
+ ec_gsc_packet_mode {
+ gpios = <&gpio8 3 GPIO_OUTPUT_LOW>;
+ enum-name = "GPIO_PACKET_MODE_EN";
+ };
+ pmic_resin_l {
+ gpios = <&gpioa 0 GPIO_ODR_HIGH>;
+ enum-name = "GPIO_PMIC_RESIN_L";
+ };
+ pmic_kpd_pwr_odl {
+ gpios = <&gpioa 2 GPIO_ODR_HIGH>;
+ enum-name = "GPIO_PMIC_KPD_PWR_ODL";
+ };
+ ap_ec_int_l {
+ gpios = <&gpio5 6 GPIO_ODR_HIGH>;
+ enum-name = "GPIO_EC_INT_L";
+ };
+ gpio_switchcap_on: switchcap_on {
+ gpios = <&gpiod 5 GPIO_OUTPUT_LOW>;
+ enum-name = "GPIO_SWITCHCAP_ON";
+ };
+ gpio_en_pp5000_s5: en_pp5000_s5 {
+ gpios = <&gpio7 3 GPIO_OUTPUT_HIGH>;
+ enum-name = "GPIO_EN_PP5000";
+ };
+ ec_bl_disable_l {
+ /* The PMIC controls backlight enable and this pin must
+ * be HiZ for normal operation. But the backlight can
+ * be enabled by setting this pin low and configuring it
+ * as an output.
+ */
+ gpios = <&gpiob 6 GPIO_INPUT>;
+ enum-name = "GPIO_ENABLE_BACKLIGHT";
+ };
+ lid_accel_int_l {
+ gpios = <&gpioa 1 GPIO_INPUT>;
+ };
+ tp_int_gate {
+ gpios = <&gpio7 4 GPIO_OUTPUT_LOW>;
+ };
+ gpio_usb_c0_pd_rst_l: usb_c0_pd_rst_l {
+ gpios = <&gpiof 1 GPIO_OUTPUT_HIGH>;
+ };
+ gpio_usb_c1_pd_rst_l: usb_c1_pd_rst_l {
+ gpios = <&gpioe 4 GPIO_OUTPUT_HIGH>;
+ };
+ gpio_dp_mux_oe_l: dp_mux_oe_l {
+ gpios = <&gpiob 1 GPIO_ODR_HIGH>;
+ };
+ gpio_dp_mux_sel: dp_mux_sel {
+ gpios = <&gpio4 5 GPIO_OUTPUT_LOW>;
+ };
+ gpio_dp_hot_plug_det_r: dp_hot_plug_det_r {
+ gpios = <&gpio9 5 GPIO_OUTPUT_LOW>;
+ };
+ gpio_en_usb_a_5v: en_usb_a_5v {
+ gpios = <&gpiof 0 GPIO_OUTPUT_LOW>;
+ enum-name = "GPIO_EN_USB_A_5V";
+ };
+ usb_a_cdp_ilim_en_l {
+ gpios = <&gpio7 5 GPIO_OUTPUT_HIGH>;
+ };
+ gpio_usb_c0_frs_en: usb_c0_frs_en {
+ gpios = <&gpioc 5 GPIO_OUTPUT_LOW>;
+ enum-name = "GPIO_USB_C0_FRS_EN";
+ };
+ gpio_usb_c1_frs_en: usb_c1_frs_en {
+ gpios = <&gpioc 1 GPIO_OUTPUT_LOW>;
+ enum-name = "GPIO_USB_C1_FRS_EN";
+ };
+ gpio_ec_chg_led_y_c0: ec_chg_led_y_c0 {
+ #led-pin-cells = <1>;
+ gpios = <&gpio6 0 GPIO_OUTPUT_LOW>;
+ };
+ gpio_ec_chg_led_b_c0: ec_chg_led_b_c0 {
+ #led-pin-cells = <1>;
+ gpios = <&gpioc 0 GPIO_OUTPUT_LOW>;
+ };
+ ap_ec_spi_mosi {
+ gpios = <&gpio4 6 GPIO_INPUT_PULL_DOWN>;
+ };
+ ap_ec_spi_miso {
+ gpios = <&gpio4 7 GPIO_INPUT_PULL_DOWN>;
+ };
+ ap_ec_spi_clk {
+ gpios = <&gpio5 5 GPIO_INPUT_PULL_DOWN>;
+ };
+ gpio_brd_id0: brd_id0 {
+ gpios = <&gpio9 4 GPIO_INPUT>;
+ enum-name = "GPIO_BOARD_VERSION1";
+ };
+ gpio_brd_id1: brd_id1 {
+ gpios = <&gpio9 7 GPIO_INPUT>;
+ enum-name = "GPIO_BOARD_VERSION2";
+ };
+ gpio_brd_id2: brd_id2 {
+ gpios = <&gpioa 5 GPIO_INPUT>;
+ enum-name = "GPIO_BOARD_VERSION3";
+ };
+ gpio_sku_id0: sku_id0 {
+ gpios = <&gpio6 7 GPIO_INPUT>;
+ };
+ gpio_sku_id1: sku_id1 {
+ gpios = <&gpio7 0 GPIO_INPUT>;
+ };
+ gpio_sku_id2: sku_id2 {
+ gpios = <&gpioe 1 GPIO_INPUT>;
+ };
+ gpio_switchcap_pg: src_vph_pwr_pg {
+ gpios = <&gpioe 2 GPIO_INPUT_PULL_DOWN>;
+ enum-name = "GPIO_SWITCHCAP_PG";
+ };
+ arm_x86 {
+ gpios = <&gpio6 6 GPIO_OUTPUT_LOW>;
+ };
+ ec-i2c-sensor-scl {
+ gpios = <&gpiob 3 (GPIO_INPUT | GPIO_VOLTAGE_1P8)>;
+ };
+ ec-i2c-sensor-sda {
+ gpios = <&gpiob 2 (GPIO_INPUT | GPIO_VOLTAGE_1P8)>;
+ };
+ gpio_ec_kso_02_inv: ec_kso_02_inv {
+ gpios = <&gpio1 7 (GPIO_OUTPUT_LOW | GPIO_ACTIVE_LOW)>;
+ };
+ };
+
+ usba-port-enable-list {
+ compatible = "cros-ec,usba-port-enable-pins";
+ enable-pins = <&gpio_en_usb_a_5v>;
+ };
+
+ sku {
+ compatible = "cros-ec,gpio-id";
+
+ bits = <
+ &gpio_sku_id0
+ &gpio_sku_id1
+ &gpio_sku_id2
+ >;
+
+ system = "ternary";
+ };
+
+ board {
+ compatible = "cros-ec,gpio-id";
+
+ bits = <
+ &gpio_brd_id0
+ &gpio_brd_id1
+ &gpio_brd_id2
+ >;
+
+ system = "ternary";
+ };
+
+ unused-pins {
+ compatible = "unused-gpios";
+ unused-gpios =
+ <&gpio5 2 0>,
+ <&gpio5 4 0>,
+ <&gpio7 6 0>,
+ <&gpiod 1 0>,
+ <&gpiod 0 0>,
+ <&gpioe 3 0>,
+ <&gpio0 4 0>,
+ <&gpiod 6 0>,
+ <&gpio3 2 0>,
+ <&gpio3 5 0>,
+ <&gpiod 7 0>,
+ <&gpio8 6 0>,
+ <&gpiod 4 0>,
+ <&gpio4 1 0>,
+ <&gpio3 4 0>,
+ <&gpioc 3 0>,
+ <&gpioc 4 0>,
+ <&gpioc 7 0>,
+ <&gpioa 4 0>,
+ <&gpio9 6 0>,
+ <&gpio9 3 0>,
+ <&gpioa 7 0>,
+ <&gpio5 0 0>,
+ <&gpio8 1 0>,
+ <&gpiob 7 0>;
+ };
+};
+
+/* Power switch logic input pads */
+&psl_in1_gpd2 {
+ /* ACOK_OD */
+ psl-in-mode = "edge";
+ psl-in-pol = "high-rising";
+};
+
+&psl_in2_gp00 {
+ /* EC_PWR_BTN_ODL */
+ psl-in-mode = "edge";
+ psl-in-pol = "low-falling";
+};
+
+&psl_in3_gp01 {
+ /* LID_OPEN_EC */
+ psl-in-mode = "edge";
+ psl-in-pol = "high-rising";
+};
+
+&psl_in4_gp02 {
+ /* RTC_EC_WAKE_ODL */
+ psl-in-mode = "edge";
+ psl-in-pol = "low-falling";
+};
+
+/* Power domain device controlled by PSL (Power Switch Logic) IO pads */
+&power_ctrl_psl {
+ status = "okay";
+ pinctrl-names = "sleep";
+ pinctrl-0 = <&psl_in1_gpd2 &psl_in2_gp00 &psl_in3_gp01 &psl_in4_gp02>;
+};
diff --git a/zephyr/projects/herobrine/i2c_common.dtsi b/zephyr/projects/herobrine/i2c_common.dtsi
new file mode 100644
index 0000000000..b1ed0242c0
--- /dev/null
+++ b/zephyr/projects/herobrine/i2c_common.dtsi
@@ -0,0 +1,157 @@
+/* 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.
+ */
+
+/ {
+ aliases {
+ i2c-0 = &i2c0_0;
+ i2c-1 = &i2c1_0;
+ i2c-2 = &i2c2_0;
+ i2c-3 = &i2c3_0;
+ i2c-4 = &i2c4_1;
+ i2c-5 = &i2c5_0;
+ i2c-7 = &i2c7_0;
+ };
+
+ named-i2c-ports {
+ compatible = "named-i2c-ports";
+
+ i2c_power: power {
+ i2c-port = <&i2c0_0>;
+ remote-port = <0>;
+ enum-names = "I2C_PORT_POWER",
+ "I2C_PORT_BATTERY",
+ "I2C_PORT_VIRTUAL_BATTERY",
+ "I2C_PORT_CHARGER";
+ };
+ i2c_tcpc0: tcpc0 {
+ i2c-port = <&i2c1_0>;
+ dynamic-speed;
+ enum-names = "I2C_PORT_TCPC0";
+ };
+ i2c_tcpc1: tcpc1 {
+ i2c-port = <&i2c2_0>;
+ dynamic-speed;
+ enum-names = "I2C_PORT_TCPC1";
+ };
+ rtc {
+ i2c-port = <&i2c4_1>;
+ enum-names = "I2C_PORT_RTC";
+ };
+ i2c_eeprom: eeprom {
+ i2c-port = <&i2c5_0>;
+ enum-names = "I2C_PORT_EEPROM";
+ };
+ i2c_sensor: sensor {
+ i2c-port = <&i2c7_0>;
+ enum-names = "I2C_PORT_SENSOR",
+ "I2C_PORT_ACCEL";
+ };
+ };
+
+
+};
+
+&i2c0_0 {
+ label = "I2C_POWER";
+ status = "okay";
+ clock-frequency = <I2C_BITRATE_STANDARD>;
+ pinctrl-0 = <&i2c0_0_sda_scl_gpb4_b5>;
+ pinctrl-names = "default";
+
+ bc12_port0: pi3usb9201@5f {
+ compatible = "pericom,pi3usb9201";
+ status = "okay";
+ reg = <0x5f>;
+ irq = <&int_usb_c0_bc12>;
+ };
+
+ charger: isl923x@9 {
+ compatible = "intersil,isl923x";
+ status = "okay";
+ reg = <0x9>;
+ };
+};
+
+&i2c_ctrl0 {
+ status = "okay";
+};
+
+&i2c1_0 {
+ label = "I2C_USB_C0_PD";
+ status = "okay";
+ clock-frequency = <I2C_BITRATE_FAST_PLUS>;
+ pinctrl-0 = <&i2c1_0_sda_scl_gp87_90>;
+ pinctrl-names = "default";
+};
+
+&i2c_ctrl1 {
+ status = "okay";
+};
+
+&i2c2_0 {
+ label = "I2C_USB_C1_PD";
+ status = "okay";
+ clock-frequency = <I2C_BITRATE_FAST_PLUS>;
+ pinctrl-0 = <&i2c2_0_sda_scl_gp91_92>;
+ pinctrl-names = "default";
+};
+
+&i2c_ctrl2 {
+ status = "okay";
+};
+
+&i2c3_0 {
+ /* Not used as no WLC connected */
+ clock-frequency = <I2C_BITRATE_FAST>;
+};
+
+&i2c4_1 {
+ label = "I2C_RTC";
+ status = "okay";
+ clock-frequency = <I2C_BITRATE_FAST>;
+ pinctrl-0 = <&i2c4_1_sda_scl_gpf2_f3>;
+ pinctrl-names = "default";
+
+ pcf85063a: pcf85063a@51 {
+ compatible = "nxp,rtc-pcf85063a";
+ reg = <0x51>;
+ int-pin = <&gpio_rtc_ec_wake_odl>;
+ };
+};
+
+&i2c_ctrl4 {
+ status = "okay";
+};
+
+&i2c5_0 {
+ label = "I2C_EEPROM";
+ status = "okay";
+ clock-frequency = <I2C_BITRATE_FAST>;
+ pinctrl-0 = <&i2c5_0_sda_scl_gp33_36>;
+ pinctrl-names = "default";
+
+ bc12_port1: pi3usb9201@5f {
+ compatible = "pericom,pi3usb9201";
+ status = "okay";
+ reg = <0x5f>;
+ irq = <&int_usb_c1_bc12>;
+ };
+};
+
+&i2c_ctrl5 {
+ status = "okay";
+};
+
+&i2c7_0 {
+ label = "I2C_SENSOR";
+ status = "okay";
+ clock-frequency = <I2C_BITRATE_FAST>;
+ pinctrl-0 = <&i2c7_0_sda_scl_gpb2_b3>;
+ pinctrl-names = "default";
+};
+
+&i2c_ctrl7 {
+ status = "okay";
+};
diff --git a/zephyr/projects/herobrine/i2c_evoker.dts b/zephyr/projects/herobrine/i2c_evoker.dts
new file mode 100644
index 0000000000..7023d08c8d
--- /dev/null
+++ b/zephyr/projects/herobrine/i2c_evoker.dts
@@ -0,0 +1,46 @@
+/* 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.
+ */
+
+#include "i2c_common.dtsi"
+
+&i2c1_0 {
+ ppc_port0: syv682x@41 {
+ compatible = "silergy,syv682x";
+ status = "okay";
+ reg = <0x41>;
+ frs_en_gpio = <&gpio_usb_c0_frs_en>;
+ };
+
+ ppc_port0_alt: sn5s330@40 {
+ compatible = "ti,sn5s330";
+ status = "okay";
+ reg = <0x40>;
+ };
+
+ tcpc_port0: ps8xxx@b {
+ compatible = "parade,ps8xxx";
+ reg = <0xb>;
+ };
+};
+
+&i2c2_0 {
+ ppc_port1: syv682x@41 {
+ compatible = "silergy,syv682x";
+ status = "okay";
+ reg = <0x41>;
+ frs_en_gpio = <&gpio_usb_c1_frs_en>;
+ };
+
+ ppc_port1_alt: sn5s330@40 {
+ compatible = "ti,sn5s330";
+ status = "okay";
+ reg = <0x40>;
+ };
+
+ tcpc_port1: ps8xxx@b {
+ compatible = "parade,ps8xxx";
+ reg = <0xb>;
+ };
+};
diff --git a/zephyr/projects/herobrine/i2c_herobrine.dts b/zephyr/projects/herobrine/i2c_herobrine.dts
new file mode 100644
index 0000000000..92c68f4215
--- /dev/null
+++ b/zephyr/projects/herobrine/i2c_herobrine.dts
@@ -0,0 +1,39 @@
+/* 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.
+ */
+
+#include "i2c_common.dtsi"
+
+&i2c1_0 {
+ ppc_port0: sn5s330@40 {
+ compatible = "ti,sn5s330";
+ status = "okay";
+ reg = <0x40>;
+ };
+
+ ppc_port0_alt: syv682x@41 {
+ compatible = "silergy,syv682x";
+ status = "okay";
+ reg = <0x41>;
+ frs_en_gpio = <&gpio_usb_c0_frs_en>;
+ };
+
+ tcpc_port0: ps8xxx@b {
+ compatible = "parade,ps8xxx";
+ reg = <0xb>;
+ };
+};
+
+&i2c2_0 {
+ ppc_port1: sn5s330@40 {
+ compatible = "ti,sn5s330";
+ status = "okay";
+ reg = <0x40>;
+ };
+
+ tcpc_port1: ps8xxx@b {
+ compatible = "parade,ps8xxx";
+ reg = <0xb>;
+ };
+};
diff --git a/zephyr/projects/herobrine/i2c_hoglin.dts b/zephyr/projects/herobrine/i2c_hoglin.dts
new file mode 100644
index 0000000000..504dbb9248
--- /dev/null
+++ b/zephyr/projects/herobrine/i2c_hoglin.dts
@@ -0,0 +1,34 @@
+/* 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.
+ */
+
+#include "i2c_common.dtsi"
+
+&i2c1_0 {
+ ppc_port0: syv682x@41 {
+ compatible = "silergy,syv682x";
+ status = "okay";
+ reg = <0x41>;
+ frs_en_gpio = <&gpio_usb_c0_frs_en>;
+ };
+
+ tcpc_port0: ps8xxx@1b {
+ compatible = "parade,ps8xxx";
+ reg = <0x1b>;
+ };
+};
+
+&i2c2_0 {
+ ppc_port1: syv682x@41 {
+ compatible = "silergy,syv682x";
+ status = "okay";
+ reg = <0x41>;
+ frs_en_gpio = <&gpio_usb_c1_frs_en>;
+ };
+
+ tcpc_port1: ps8xxx@1b {
+ compatible = "parade,ps8xxx";
+ reg = <0x1b>;
+ };
+};
diff --git a/zephyr/projects/herobrine/i2c_villager.dts b/zephyr/projects/herobrine/i2c_villager.dts
new file mode 100644
index 0000000000..efdf88ac38
--- /dev/null
+++ b/zephyr/projects/herobrine/i2c_villager.dts
@@ -0,0 +1,34 @@
+/* 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.
+ */
+
+#include "i2c_common.dtsi"
+
+&i2c1_0 {
+ ppc_port0: syv682x@41 {
+ compatible = "silergy,syv682x";
+ status = "okay";
+ reg = <0x41>;
+ frs_en_gpio = <&gpio_usb_c0_frs_en>;
+ };
+
+ tcpc_port0: ps8xxx@b {
+ compatible = "parade,ps8xxx";
+ reg = <0xb>;
+ };
+};
+
+&i2c2_0 {
+ ppc_port1: syv682x@41 {
+ compatible = "silergy,syv682x";
+ status = "okay";
+ reg = <0x41>;
+ frs_en_gpio = <&gpio_usb_c1_frs_en>;
+ };
+
+ tcpc_port1: ps8xxx@b {
+ compatible = "parade,ps8xxx";
+ reg = <0xb>;
+ };
+};
diff --git a/zephyr/projects/herobrine/i2c_zombie.dts b/zephyr/projects/herobrine/i2c_zombie.dts
new file mode 100644
index 0000000000..efdf88ac38
--- /dev/null
+++ b/zephyr/projects/herobrine/i2c_zombie.dts
@@ -0,0 +1,34 @@
+/* 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.
+ */
+
+#include "i2c_common.dtsi"
+
+&i2c1_0 {
+ ppc_port0: syv682x@41 {
+ compatible = "silergy,syv682x";
+ status = "okay";
+ reg = <0x41>;
+ frs_en_gpio = <&gpio_usb_c0_frs_en>;
+ };
+
+ tcpc_port0: ps8xxx@b {
+ compatible = "parade,ps8xxx";
+ reg = <0xb>;
+ };
+};
+
+&i2c2_0 {
+ ppc_port1: syv682x@41 {
+ compatible = "silergy,syv682x";
+ status = "okay";
+ reg = <0x41>;
+ frs_en_gpio = <&gpio_usb_c1_frs_en>;
+ };
+
+ tcpc_port1: ps8xxx@b {
+ compatible = "parade,ps8xxx";
+ reg = <0xb>;
+ };
+};
diff --git a/zephyr/projects/herobrine/include/board_chipset.h b/zephyr/projects/herobrine/include/board_chipset.h
new file mode 100644
index 0000000000..81c0dd1a40
--- /dev/null
+++ b/zephyr/projects/herobrine/include/board_chipset.h
@@ -0,0 +1,11 @@
+/* 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.
+ */
+
+#ifndef __CROS_EC_HEROBRINE_BOARD_CHIPSET_H
+#define __CROS_EC_HEROBRINE_BOARD_CHIPSET_H
+
+__test_only void reset_pp5000_inited(void);
+
+#endif /* __CROS_EC_HEROBRINE_BOARD_CHIPSET_H */
diff --git a/zephyr/projects/herobrine/interrupts.dts b/zephyr/projects/herobrine/interrupts.dts
new file mode 100644
index 0000000000..82650bfc51
--- /dev/null
+++ b/zephyr/projects/herobrine/interrupts.dts
@@ -0,0 +1,115 @@
+/* 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.
+ */
+
+/ {
+ aliases {
+ int-wp = &int_wp_l;
+ };
+
+ gpio-interrupts {
+ compatible = "cros-ec,gpio-interrupts";
+
+ int_ac_present: ac_present {
+ irq-pin = <&gpio_chg_acok_od>;
+ flags = <GPIO_INT_EDGE_BOTH>;
+ handler = "extpower_interrupt";
+ };
+ int_lid_open: lid_open {
+ irq-pin = <&gpio_lid_open_ec>;
+ flags = <GPIO_INT_EDGE_BOTH>;
+ handler = "lid_interrupt";
+ };
+ int_wp_l: wp_l {
+ irq-pin = <&gpio_ec_wp_odl>;
+ flags = <GPIO_INT_EDGE_BOTH>;
+ handler = "switch_interrupt";
+ };
+ int_power_button: power_button {
+ irq-pin = <&gpio_ec_pwr_btn_odl>;
+ flags = <GPIO_INT_EDGE_BOTH>;
+ handler = "power_button_interrupt";
+ };
+ int_volume_up: volume_up {
+ irq-pin = <&gpio_ec_volup_btn_odl>;
+ flags = <GPIO_INT_EDGE_BOTH>;
+ handler = "button_interrupt";
+ };
+ int_volume_down: volume_down {
+ irq-pin = <&gpio_ec_voldn_btn_odl>;
+ flags = <GPIO_INT_EDGE_BOTH>;
+ handler = "button_interrupt";
+ };
+ int_ap_rst: ap_rst {
+ irq-pin = <&gpio_ap_rst_l>;
+ flags = <GPIO_INT_EDGE_BOTH>;
+ handler = "chipset_ap_rst_interrupt";
+ };
+ int_ap_suspend: ap_suspend {
+ irq-pin = <&gpio_ap_suspend>;
+ flags = <GPIO_INT_EDGE_BOTH>;
+ handler = "power_signal_interrupt";
+ };
+ int_power_good: power_good {
+ irq-pin = <&gpio_mb_power_good>;
+ flags = <GPIO_INT_EDGE_BOTH>;
+ handler = "power_signal_interrupt";
+ };
+ int_ps_hold: ps_hold {
+ irq-pin = <&gpio_ps_hold>;
+ flags = <GPIO_INT_EDGE_BOTH>;
+ handler = "power_signal_interrupt";
+ };
+ int_warm_reset: warm_reset {
+ irq-pin = <&gpio_warm_reset_l>;
+ flags = <GPIO_INT_EDGE_BOTH>;
+ handler = "power_signal_interrupt";
+ };
+ int_usb_c0_pd: usb_c0_pd {
+ irq-pin = <&gpio_usb_c0_pd_int_odl>;
+ flags = <GPIO_INT_EDGE_FALLING>;
+ handler = "tcpc_alert_event";
+ };
+ int_usb_c1_pd: usb_c1_pd {
+ irq-pin = <&gpio_usb_c1_pd_int_odl>;
+ flags = <GPIO_INT_EDGE_FALLING>;
+ handler = "tcpc_alert_event";
+ };
+ int_usb_c0_swctl: usb_c0_swctl {
+ irq-pin = <&gpio_usb_c0_swctl_int_odl>;
+ flags = <GPIO_INT_EDGE_FALLING>;
+ handler = "ppc_interrupt";
+ };
+ int_usb_c1_swctl: usb_c1_swctl {
+ irq-pin = <&gpio_usb_c1_swctl_int_odl>;
+ flags = <GPIO_INT_EDGE_FALLING>;
+ handler = "ppc_interrupt";
+ };
+ int_usb_c0_bc12: usb_c0_bc12 {
+ irq-pin = <&gpio_usb_c0_bc12_int_l>;
+ flags = <GPIO_INT_EDGE_FALLING>;
+ handler = "usb0_evt";
+ };
+ int_usb_c1_bc12: usb_c1_bc12 {
+ irq-pin = <&gpio_usb_c1_bc12_int_l>;
+ flags = <GPIO_INT_EDGE_FALLING>;
+ handler = "usb1_evt";
+ };
+ int_usb_a0_oc: usb_a0_oc {
+ irq-pin = <&gpio_usb_a0_oc_odl>;
+ flags = <GPIO_INT_EDGE_BOTH>;
+ handler = "usba_oc_interrupt";
+ };
+ int_accel_gyro: accel_gyro {
+ irq-pin = <&gpio_accel_gyro_int_l>;
+ flags = <GPIO_INT_EDGE_FALLING>;
+ handler = "bmi260_interrupt";
+ };
+ int_tablet_mode: tablet_mode {
+ irq-pin = <&gpio_tablet_mode_l>;
+ flags = <GPIO_INT_EDGE_BOTH>;
+ handler = "gmr_tablet_switch_isr";
+ };
+ };
+};
diff --git a/zephyr/projects/herobrine/keyboard.dts b/zephyr/projects/herobrine/keyboard.dts
new file mode 100644
index 0000000000..3b7e830f2f
--- /dev/null
+++ b/zephyr/projects/herobrine/keyboard.dts
@@ -0,0 +1,46 @@
+/* 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.
+ */
+
+/ {
+ kblight {
+ compatible = "cros-ec,kblight-pwm";
+ pwms = <&pwm3 0 PWM_KHZ(10) PWM_POLARITY_NORMAL>;
+ generic-pwm-channel = <0>;
+ };
+};
+
+&pwm3 {
+ status = "okay";
+ pinctrl-0 = <&pwm3_gp80>;
+ pinctrl-names = "default";
+};
+
+&cros_kb_raw {
+ status = "okay";
+ /* No KSO2 (it's inverted and implemented by GPIO) */
+ pinctrl-0 = <
+ &ksi0_gp31
+ &ksi1_gp30
+ &ksi2_gp27
+ &ksi3_gp26
+ &ksi4_gp25
+ &ksi5_gp24
+ &ksi6_gp23
+ &ksi7_gp22
+ &kso00_gp21
+ &kso01_gp20
+ &kso03_gp16
+ &kso04_gp15
+ &kso05_gp14
+ &kso06_gp13
+ &kso07_gp12
+ &kso08_gp11
+ &kso09_gp10
+ &kso10_gp07
+ &kso11_gp06
+ &kso12_gp05
+ >;
+ pinctrl-names = "default";
+};
diff --git a/zephyr/projects/herobrine/led_pins_evoker.dts b/zephyr/projects/herobrine/led_pins_evoker.dts
new file mode 100644
index 0000000000..ff2dc0e36c
--- /dev/null
+++ b/zephyr/projects/herobrine/led_pins_evoker.dts
@@ -0,0 +1,54 @@
+/* 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.
+ */
+
+/ {
+ gpio-led-pins {
+ compatible = "cros-ec,gpio-led-pins";
+
+ color_power_off: color-power-off {
+ led-color = "LED_OFF";
+ led-id = "EC_LED_ID_POWER_LED";
+ led-pins = <&gpio_ec_chg_led_w_c1 0>;
+ };
+
+ color_power_white: color-power-white {
+ led-color = "LED_WHITE";
+ led-id = "EC_LED_ID_POWER_LED";
+ led-pins = <&gpio_ec_chg_led_w_c1 1>;
+ };
+
+ color_battery_off: color-battery-off {
+ led-color = "LED_OFF";
+ led-id = "EC_LED_ID_BATTERY_LED";
+ led-pins = <&gpio_ec_chg_led_y_c0 0>,
+ <&gpio_ec_chg_led_w_c0 0>,
+ <&gpio_ec_chg_led_r_c0 0>;
+ };
+
+ color_battery_amber: color-battery-amber {
+ led-color = "LED_AMBER";
+ led-id = "EC_LED_ID_BATTERY_LED";
+ led-pins = <&gpio_ec_chg_led_y_c0 1>,
+ <&gpio_ec_chg_led_w_c0 0>,
+ <&gpio_ec_chg_led_r_c0 0>;
+ };
+
+ color_battery_white: color-battery-white {
+ led-color = "LED_WHITE";
+ led-id = "EC_LED_ID_BATTERY_LED";
+ led-pins = <&gpio_ec_chg_led_y_c0 0>,
+ <&gpio_ec_chg_led_w_c0 1>,
+ <&gpio_ec_chg_led_r_c0 0>;
+ };
+
+ color_battery_red: color-battery-red {
+ led-color = "LED_RED";
+ led-id = "EC_LED_ID_BATTERY_LED";
+ led-pins = <&gpio_ec_chg_led_y_c0 0>,
+ <&gpio_ec_chg_led_w_c0 0>,
+ <&gpio_ec_chg_led_r_c0 1>;
+ };
+ };
+};
diff --git a/zephyr/projects/herobrine/led_pins_herobrine.dts b/zephyr/projects/herobrine/led_pins_herobrine.dts
new file mode 100644
index 0000000000..c509ab1a64
--- /dev/null
+++ b/zephyr/projects/herobrine/led_pins_herobrine.dts
@@ -0,0 +1,56 @@
+/* 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.
+ */
+
+/ {
+ gpio-led-pins {
+ compatible = "cros-ec,gpio-led-pins";
+
+ color_off_left: color-off-left {
+ led-color = "LED_OFF";
+ led-id = "EC_LED_ID_LEFT_LED";
+ led-pins = <&gpio_ec_chg_led_y_c1 0>,
+ <&gpio_ec_chg_led_w_c1 0>;
+ };
+
+ color_off_right: color-off-right {
+ led-color = "LED_OFF";
+ led-id = "EC_LED_ID_RIGHT_LED";
+ led-pins = <&gpio_ec_chg_led_y_c0 0>,
+ <&gpio_ec_chg_led_w_c0 0>;
+ };
+
+ color_amber_left: color-amber-left {
+ led-color = "LED_AMBER";
+ led-id = "EC_LED_ID_LEFT_LED";
+ br-color = "EC_LED_COLOR_AMBER";
+ led-pins = <&gpio_ec_chg_led_y_c1 1>,
+ <&gpio_ec_chg_led_w_c1 0>;
+ };
+
+ color_amber_right: color-amber-right {
+ led-color = "LED_AMBER";
+ led-id = "EC_LED_ID_RIGHT_LED";
+ br-color = "EC_LED_COLOR_AMBER";
+ led-pins = <&gpio_ec_chg_led_y_c0 1>,
+ <&gpio_ec_chg_led_w_c0 0>;
+ };
+
+ color_white_left: color-white-left {
+ led-color = "LED_WHITE";
+ led-id = "EC_LED_ID_LEFT_LED";
+ br-color = "EC_LED_COLOR_WHITE";
+ led-pins = <&gpio_ec_chg_led_y_c1 0>,
+ <&gpio_ec_chg_led_w_c1 1>;
+ };
+
+ color_white_right: color-white-right {
+ led-color = "LED_WHITE";
+ led-id = "EC_LED_ID_RIGHT_LED";
+ br-color = "EC_LED_COLOR_WHITE";
+ led-pins = <&gpio_ec_chg_led_y_c0 0>,
+ <&gpio_ec_chg_led_w_c0 1>;
+ };
+ };
+};
diff --git a/zephyr/projects/herobrine/led_pins_hoglin.dts b/zephyr/projects/herobrine/led_pins_hoglin.dts
new file mode 100644
index 0000000000..7b125c5cac
--- /dev/null
+++ b/zephyr/projects/herobrine/led_pins_hoglin.dts
@@ -0,0 +1,33 @@
+/* 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.
+ */
+
+/ {
+ gpio-led-pins {
+ compatible = "cros-ec,gpio-led-pins";
+
+ color_off: color-off {
+ led-color = "LED_OFF";
+ led-id = "EC_LED_ID_BATTERY_LED";
+ led-pins = <&gpio_ec_chg_led_b_c0 0>,
+ <&gpio_ec_chg_led_r_c0 0>;
+ };
+
+ color_blue: color-blue {
+ led-color = "LED_BLUE";
+ led-id = "EC_LED_ID_BATTERY_LED";
+ br-color = "EC_LED_COLOR_BLUE";
+ led-pins = <&gpio_ec_chg_led_b_c0 1>,
+ <&gpio_ec_chg_led_r_c0 0>;
+ };
+
+ color_red: color-red {
+ led-color = "LED_RED";
+ led-id = "EC_LED_ID_BATTERY_LED";
+ br-color = "EC_LED_COLOR_RED";
+ led-pins = <&gpio_ec_chg_led_b_c0 0>,
+ <&gpio_ec_chg_led_r_c0 1>;
+ };
+ };
+};
diff --git a/zephyr/projects/herobrine/led_pins_villager.dts b/zephyr/projects/herobrine/led_pins_villager.dts
new file mode 100644
index 0000000000..b0913cdbce
--- /dev/null
+++ b/zephyr/projects/herobrine/led_pins_villager.dts
@@ -0,0 +1,33 @@
+/* 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.
+ */
+
+/ {
+ gpio-led-pins {
+ compatible = "cros-ec,gpio-led-pins";
+
+ color_off: color-off {
+ led-color = "LED_OFF";
+ led-id = "EC_LED_ID_BATTERY_LED";
+ led-pins = <&gpio_ec_chg_led_y_c0 0>,
+ <&gpio_ec_chg_led_b_c0 0>;
+ };
+
+ color_amber: color-amber {
+ led-color = "LED_AMBER";
+ led-id = "EC_LED_ID_BATTERY_LED";
+ br-color = "EC_LED_COLOR_AMBER";
+ led-pins = <&gpio_ec_chg_led_y_c0 1>,
+ <&gpio_ec_chg_led_b_c0 0>;
+ };
+
+ color_blue: color-blue {
+ led-color = "LED_BLUE";
+ led-id = "EC_LED_ID_BATTERY_LED";
+ br-color = "EC_LED_COLOR_BLUE";
+ led-pins = <&gpio_ec_chg_led_y_c0 0>,
+ <&gpio_ec_chg_led_b_c0 1>;
+ };
+ };
+};
diff --git a/zephyr/projects/herobrine/led_pins_zombie.dts b/zephyr/projects/herobrine/led_pins_zombie.dts
new file mode 100644
index 0000000000..b0913cdbce
--- /dev/null
+++ b/zephyr/projects/herobrine/led_pins_zombie.dts
@@ -0,0 +1,33 @@
+/* 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.
+ */
+
+/ {
+ gpio-led-pins {
+ compatible = "cros-ec,gpio-led-pins";
+
+ color_off: color-off {
+ led-color = "LED_OFF";
+ led-id = "EC_LED_ID_BATTERY_LED";
+ led-pins = <&gpio_ec_chg_led_y_c0 0>,
+ <&gpio_ec_chg_led_b_c0 0>;
+ };
+
+ color_amber: color-amber {
+ led-color = "LED_AMBER";
+ led-id = "EC_LED_ID_BATTERY_LED";
+ br-color = "EC_LED_COLOR_AMBER";
+ led-pins = <&gpio_ec_chg_led_y_c0 1>,
+ <&gpio_ec_chg_led_b_c0 0>;
+ };
+
+ color_blue: color-blue {
+ led-color = "LED_BLUE";
+ led-id = "EC_LED_ID_BATTERY_LED";
+ br-color = "EC_LED_COLOR_BLUE";
+ led-pins = <&gpio_ec_chg_led_y_c0 0>,
+ <&gpio_ec_chg_led_b_c0 1>;
+ };
+ };
+};
diff --git a/zephyr/projects/herobrine/led_policy_evoker.dts b/zephyr/projects/herobrine/led_policy_evoker.dts
new file mode 100644
index 0000000000..fc17755ede
--- /dev/null
+++ b/zephyr/projects/herobrine/led_policy_evoker.dts
@@ -0,0 +1,86 @@
+#include <dt-bindings/battery.h>
+
+/ {
+ led-colors {
+ compatible = "cros-ec,led-policy";
+
+ battery-state-charge {
+ charge-state = "PWR_STATE_CHARGE";
+
+ color-0 {
+ led-color = <&color_battery_amber>;
+ };
+ };
+
+ battery-state-near-full {
+ charge-state = "PWR_STATE_CHARGE_NEAR_FULL";
+
+ color-0 {
+ led-color = <&color_battery_white>;
+ };
+ };
+
+ battery-state-discharge {
+ charge-state = "PWR_STATE_DISCHARGE";
+
+ color-0 {
+ led-color = <&color_battery_off>;
+ };
+ };
+
+ battery-state-error {
+ charge-state = "PWR_STATE_ERROR";
+
+ color-0 {
+ led-color = <&color_battery_red>;
+ };
+ };
+
+ /* force idle mode */
+ battery-state-forced-idle {
+ charge-state = "PWR_STATE_FORCED_IDLE";
+
+ /* Red 1 sec, White 1 sec */
+ color-0 {
+ led-color = <&color_battery_red>;
+ period-ms = <1000>;
+ };
+
+ color-1 {
+ led-color = <&color_battery_white>;
+ period-ms = <1000>;
+ };
+ };
+
+ pwr-power-state-s0 {
+ chipset-state = "POWER_S0";
+
+ color-0 {
+ led-color = <&color_power_white>;
+ };
+ };
+
+ power-state-s3 {
+ chipset-state = "POWER_S3";
+
+ /* white LED - on 1 sec, off 1 sec */
+ color-0 {
+ led-color = <&color_power_white>;
+ period-ms = <1000>;
+ };
+
+ color-1 {
+ led-color = <&color_power_off>;
+ period-ms = <1000>;
+ };
+ };
+
+ power-state-s5 {
+ chipset-state = "POWER_S5";
+
+ color-0 {
+ led-color = <&color_power_off>;
+ };
+ };
+ };
+};
diff --git a/zephyr/projects/herobrine/led_policy_herobrine.dts b/zephyr/projects/herobrine/led_policy_herobrine.dts
new file mode 100644
index 0000000000..13e5306deb
--- /dev/null
+++ b/zephyr/projects/herobrine/led_policy_herobrine.dts
@@ -0,0 +1,202 @@
+#include <dt-bindings/battery.h>
+
+/ {
+ led-colors {
+ compatible = "cros-ec,led-policy";
+
+ power-state-charge-left {
+ charge-state = "PWR_STATE_CHARGE";
+ charge-port = <1>; /* Left port */
+
+ /* Turn off the right LED */
+ color-0 {
+ led-color = <&color_off_right>;
+ };
+ /* Left LED to Amber */
+ color-1 {
+ led-color = <&color_amber_left>;
+ };
+ };
+
+ power-state-charge-right {
+ charge-state = "PWR_STATE_CHARGE";
+ charge-port = <0>; /* Right port */
+
+ /* Turn off the left LED */
+ color-0 {
+ led-color = <&color_off_left>;
+ };
+ /* Right LED to Amber */
+ color-1 {
+ led-color = <&color_amber_right>;
+ };
+ };
+
+ power-state-discharge-right-low {
+ charge-state = "PWR_STATE_DISCHARGE";
+ /* Battery percent range (>= Empty, <= Low) */
+ batt-lvl = <BATTERY_LEVEL_EMPTY BATTERY_LEVEL_LOW>;
+
+ /* Turn off the left LED */
+ color-0 {
+ led-color = <&color_off_left>;
+ };
+ /* Right LED - White 1 sec, off 3 sec */
+ color-1 {
+ led-color = <&color_white_right>;
+ period-ms = <1000>;
+ };
+ color-2 {
+ led-color = <&color_off_right>;
+ period-ms = <3000>;
+ };
+ };
+
+ power-state-discharge-right {
+ charge-state = "PWR_STATE_DISCHARGE";
+ /* Battery percent range (> Low, <= Full) */
+ batt-lvl = <(BATTERY_LEVEL_LOW + 1) BATTERY_LEVEL_FULL>;
+
+ /* Turn off the left LED */
+ color-0 {
+ led-color = <&color_off_left>;
+ };
+ /* Turn off the right LED */
+ color-1 {
+ led-color = <&color_off_right>;
+ };
+ };
+
+ power-state-error-left {
+ charge-state = "PWR_STATE_ERROR";
+ charge-port = <1>; /* Left port */
+
+ /* Turn off the right LED */
+ color-0 {
+ led-color = <&color_off_right>;
+ };
+ /* Left LED - White 2 sec, off 2 sec */
+ color-1 {
+ led-color = <&color_white_left>;
+ period-ms = <2000>;
+ };
+ color-2 {
+ led-color = <&color_off_right>;
+ period-ms = <2000>;
+ };
+ };
+
+ power-state-error-right {
+ charge-state = "PWR_STATE_ERROR";
+ charge-port = <0>; /* Right port */
+
+ /* Turn off the left LED */
+ color-0 {
+ led-color = <&color_off_left>;
+ };
+ /* Right LED - White 2 sec, off 2 sec */
+ color-1 {
+ led-color = <&color_white_right>;
+ period-ms = <2000>;
+ };
+ color-2 {
+ led-color = <&color_off_right>;
+ period-ms = <2000>;
+ };
+ };
+
+ power-state-near-full-left {
+ charge-state = "PWR_STATE_CHARGE_NEAR_FULL";
+ charge-port = <1>; /* Left port */
+
+ /* Turn off the right LED */
+ color-0 {
+ led-color = <&color_off_right>;
+ };
+ /* Left LED to White */
+ color-1 {
+ led-color = <&color_white_left>;
+ };
+ };
+
+ power-state-near-full-right {
+ charge-state = "PWR_STATE_CHARGE_NEAR_FULL";
+ charge-port = <0>; /* Right port */
+
+ /* Turn off the left LED */
+ color-0 {
+ led-color = <&color_off_left>;
+ };
+ /* Right LED to White */
+ color-1 {
+ led-color = <&color_white_right>;
+ };
+ };
+
+ power-state-forced-idle-left {
+ charge-state = "PWR_STATE_FORCED_IDLE";
+ charge-port = <1>; /* Left port */
+
+ /* Turn off the right LED */
+ color-0 {
+ led-color = <&color_off_right>;
+ };
+ /* Left LED - Amber 3 sec, Off 1 sec */
+ color-1 {
+ led-color = <&color_amber_left>;
+ period-ms = <3000>;
+ };
+ color-2 {
+ led-color = <&color_off_left>;
+ period-ms = <1000>;
+ };
+ };
+
+ power-state-forced-idle-right {
+ charge-state = "PWR_STATE_FORCED_IDLE";
+ charge-port = <0>; /* Right port */
+
+ /* Turn off the left LED */
+ color-0 {
+ led-color = <&color_off_left>;
+ };
+ /* Right LED - Amber 3 sec, Off 1 sec */
+ color-1 {
+ led-color = <&color_amber_right>;
+ period-ms = <3000>;
+ };
+ color-2 {
+ led-color = <&color_off_right>;
+ period-ms = <1000>;
+ };
+ };
+
+ power-state-idle-left {
+ charge-state = "PWR_STATE_IDLE";
+ charge-port = <1>; /* Left port */
+
+ /* Turn off the right LED */
+ color-0 {
+ led-color = <&color_off_right>;
+ };
+ /* Left LED to White */
+ color-1 {
+ led-color = <&color_white_left>;
+ };
+ };
+
+ power-state-idle-right {
+ charge-state = "PWR_STATE_IDLE";
+ charge-port = <0>; /* Right port */
+
+ /* Turn off the left LED */
+ color-0 {
+ led-color = <&color_off_left>;
+ };
+ /* Right LED to White */
+ color-1 {
+ led-color = <&color_white_right>;
+ };
+ };
+ };
+};
diff --git a/zephyr/projects/herobrine/led_policy_hoglin.dts b/zephyr/projects/herobrine/led_policy_hoglin.dts
new file mode 100644
index 0000000000..043dfbcaa5
--- /dev/null
+++ b/zephyr/projects/herobrine/led_policy_hoglin.dts
@@ -0,0 +1,95 @@
+/* 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.
+ */
+
+/ {
+ led-colors {
+ compatible = "cros-ec,led-policy";
+
+ power-state-charge {
+ charge-state = "PWR_STATE_CHARGE";
+
+ color-0 {
+ led-color = <&color_blue>;
+ };
+ };
+
+ power-state-discharge-s0 {
+ charge-state = "PWR_STATE_DISCHARGE";
+ chipset-state = "POWER_S0";
+
+ color-0 {
+ led-color = <&color_off>;
+ };
+ };
+
+ power-state-discharge-s3 {
+ charge-state = "PWR_STATE_DISCHARGE";
+ chipset-state = "POWER_S3";
+
+ /* Blue 1 sec, off 3 sec */
+ color-0 {
+ led-color = <&color_blue>;
+ period-ms = <1000>;
+ };
+ color-1 {
+ led-color = <&color_off>;
+ period-ms = <3000>;
+ };
+ };
+
+ power-state-discharge-s5 {
+ charge-state = "PWR_STATE_DISCHARGE";
+ chipset-state = "POWER_S5";
+
+ color-0 {
+ led-color = <&color_off>;
+ };
+ };
+
+ power-state-error {
+ charge-state = "PWR_STATE_ERROR";
+
+ /* Red 1 sec, off 1 sec */
+ color-0 {
+ led-color = <&color_red>;
+ period-ms = <1000>;
+ };
+ color-1 {
+ led-color = <&color_off>;
+ period-ms = <1000>;
+ };
+ };
+
+ power-state-near-full {
+ charge-state = "PWR_STATE_CHARGE_NEAR_FULL";
+
+ color-0 {
+ led-color = <&color_red>;
+ };
+ };
+
+ power-state-forced-idle {
+ charge-state = "PWR_STATE_FORCED_IDLE";
+
+ /* Red 2 sec, Blue 2 sec */
+ color-0 {
+ led-color = <&color_red>;
+ period-ms = <2000>;
+ };
+ color-1 {
+ led-color = <&color_blue>;
+ period-ms = <2000>;
+ };
+ };
+
+ power-state-idle-default {
+ charge-state = "PWR_STATE_IDLE";
+
+ color-0 {
+ led-color = <&color_red>;
+ };
+ };
+ };
+};
diff --git a/zephyr/projects/herobrine/led_policy_villager.dts b/zephyr/projects/herobrine/led_policy_villager.dts
new file mode 100644
index 0000000000..f8996a3f4b
--- /dev/null
+++ b/zephyr/projects/herobrine/led_policy_villager.dts
@@ -0,0 +1,95 @@
+/* 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.
+ */
+
+/ {
+ led-colors {
+ compatible = "cros-ec,led-policy";
+
+ power-state-charge {
+ charge-state = "PWR_STATE_CHARGE";
+
+ color-0 {
+ led-color = <&color_amber>;
+ };
+ };
+
+ power-state-discharge-s0 {
+ charge-state = "PWR_STATE_DISCHARGE";
+ chipset-state = "POWER_S0";
+
+ color-0 {
+ led-color = <&color_blue>;
+ };
+ };
+
+ power-state-discharge-s3 {
+ charge-state = "PWR_STATE_DISCHARGE";
+ chipset-state = "POWER_S3";
+
+ /* Amber 1 sec, off 3 sec */
+ color-0 {
+ led-color = <&color_amber>;
+ period-ms = <1000>;
+ };
+ color-1 {
+ led-color = <&color_off>;
+ period-ms = <3000>;
+ };
+ };
+
+ power-state-discharge-s5 {
+ charge-state = "PWR_STATE_DISCHARGE";
+ chipset-state = "POWER_S5";
+
+ color-0 {
+ led-color = <&color_off>;
+ };
+ };
+
+ power-state-error {
+ charge-state = "PWR_STATE_ERROR";
+
+ /* Amber 1 sec, off 1 sec */
+ color-0 {
+ led-color = <&color_amber>;
+ period-ms = <1000>;
+ };
+ color-1 {
+ led-color = <&color_off>;
+ period-ms = <1000>;
+ };
+ };
+
+ power-state-near-full {
+ charge-state = "PWR_STATE_CHARGE_NEAR_FULL";
+
+ color-0 {
+ led-color = <&color_blue>;
+ };
+ };
+
+ power-state-forced-idle {
+ charge-state = "PWR_STATE_FORCED_IDLE";
+
+ /* Blue 2 sec, Amber 2 sec */
+ color-0 {
+ led-color = <&color_blue>;
+ period-ms = <2000>;
+ };
+ color-1 {
+ led-color = <&color_amber>;
+ period-ms = <2000>;
+ };
+ };
+
+ power-state-idle {
+ charge-state = "PWR_STATE_IDLE";
+
+ color-0 {
+ led-color = <&color_blue>;
+ };
+ };
+ };
+};
diff --git a/zephyr/projects/herobrine/led_policy_zombie.dts b/zephyr/projects/herobrine/led_policy_zombie.dts
new file mode 100644
index 0000000000..f8996a3f4b
--- /dev/null
+++ b/zephyr/projects/herobrine/led_policy_zombie.dts
@@ -0,0 +1,95 @@
+/* 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.
+ */
+
+/ {
+ led-colors {
+ compatible = "cros-ec,led-policy";
+
+ power-state-charge {
+ charge-state = "PWR_STATE_CHARGE";
+
+ color-0 {
+ led-color = <&color_amber>;
+ };
+ };
+
+ power-state-discharge-s0 {
+ charge-state = "PWR_STATE_DISCHARGE";
+ chipset-state = "POWER_S0";
+
+ color-0 {
+ led-color = <&color_blue>;
+ };
+ };
+
+ power-state-discharge-s3 {
+ charge-state = "PWR_STATE_DISCHARGE";
+ chipset-state = "POWER_S3";
+
+ /* Amber 1 sec, off 3 sec */
+ color-0 {
+ led-color = <&color_amber>;
+ period-ms = <1000>;
+ };
+ color-1 {
+ led-color = <&color_off>;
+ period-ms = <3000>;
+ };
+ };
+
+ power-state-discharge-s5 {
+ charge-state = "PWR_STATE_DISCHARGE";
+ chipset-state = "POWER_S5";
+
+ color-0 {
+ led-color = <&color_off>;
+ };
+ };
+
+ power-state-error {
+ charge-state = "PWR_STATE_ERROR";
+
+ /* Amber 1 sec, off 1 sec */
+ color-0 {
+ led-color = <&color_amber>;
+ period-ms = <1000>;
+ };
+ color-1 {
+ led-color = <&color_off>;
+ period-ms = <1000>;
+ };
+ };
+
+ power-state-near-full {
+ charge-state = "PWR_STATE_CHARGE_NEAR_FULL";
+
+ color-0 {
+ led-color = <&color_blue>;
+ };
+ };
+
+ power-state-forced-idle {
+ charge-state = "PWR_STATE_FORCED_IDLE";
+
+ /* Blue 2 sec, Amber 2 sec */
+ color-0 {
+ led-color = <&color_blue>;
+ period-ms = <2000>;
+ };
+ color-1 {
+ led-color = <&color_amber>;
+ period-ms = <2000>;
+ };
+ };
+
+ power-state-idle {
+ charge-state = "PWR_STATE_IDLE";
+
+ color-0 {
+ led-color = <&color_blue>;
+ };
+ };
+ };
+};
diff --git a/zephyr/projects/herobrine/motionsense.dts b/zephyr/projects/herobrine/motionsense.dts
new file mode 100644
index 0000000000..1955f43284
--- /dev/null
+++ b/zephyr/projects/herobrine/motionsense.dts
@@ -0,0 +1,241 @@
+/* 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.
+ */
+
+#include <dt-bindings/motionsense/utils.h>
+
+
+/ {
+ aliases {
+ /*
+ * motion sense's <>_INT_EVENT is handled
+ * by alias. Using the alias, each driver creates
+ * its own <>_INT_EVENT.
+ */
+ bmi260-int = &base_accel;
+ tcs3400-int = &als_clear;
+ };
+
+ /*
+ * Declare mutexes used by sensor drivers.
+ * A mutex node is used to create an instance of mutex_t.
+ * A mutex node is referenced by a sensor node if the
+ * corresponding sensor driver needs to use the
+ * instance of the mutex.
+ */
+ motionsense-mutex {
+ compatible = "cros-ec,motionsense-mutex";
+ lid_mutex: lid-mutex {
+ };
+
+ mutex_bmi260: bmi260-mutex {
+ };
+ };
+
+ /* Rotation matrix used by drivers. */
+ motionsense-rotation-ref {
+ compatible = "cros-ec,motionsense-rotation-ref";
+ lid_rot_ref: lid-rotation-ref {
+ mat33 = <0 1 0
+ 1 0 0
+ 0 0 (-1)>;
+ };
+
+ base_rot_ref: base-rotation-ref {
+ mat33 = <1 0 0
+ 0 (-1) 0
+ 0 0 (-1)>;
+ };
+ };
+
+ /*
+ * Driver specific data. A driver-specific data can be shared with
+ * different motion sensors while they are using the same driver.
+ *
+ * If a node's compatible starts with "cros-ec,accelgyro-", it is for
+ * a common structure defined in accelgyro.h.
+ * e.g) compatible = "cros-ec,accelgyro-als-drv-data" is for
+ * "struct als_drv_data_t" in accelgyro.h
+ */
+ motionsense-sensor-data {
+ bma255_data: bma255-drv-data {
+ compatible = "cros-ec,drvdata-bma255";
+ status = "okay";
+ };
+
+ bmi260_data: bmi260-drv-data {
+ compatible = "cros-ec,drvdata-bmi260";
+ status = "okay";
+ };
+
+ tcs_clear_data: tcs3400-clear-drv-data {
+ compatible = "cros-ec,drvdata-tcs3400-clear";
+ status = "okay";
+
+ als-drv-data {
+ compatible = "cros-ec,accelgyro-als-drv-data";
+ als-cal {
+ scale = <1>;
+ uscale = <0>;
+ offset = <0>;
+ als-channel-scale {
+ compatible = "cros-ec,accelgyro-als-channel-scale";
+ k-channel-scale = <1>;
+ cover-scale = <1>;
+ };
+ };
+ };
+ };
+
+ tcs_rgb_data: tcs3400-rgb-drv-data {
+ compatible = "cros-ec,drvdata-tcs3400-rgb";
+ status = "okay";
+
+ /* node for rgb_calibration_t defined in accelgyro.h */
+ rgb_calibration {
+ compatible =
+ "cros-ec,accelgyro-rgb-calibration";
+
+ irt = <1>;
+
+ rgb-cal-x {
+ offset = <0>;
+ coeff = <0 0 0 1>;
+ als-channel-scale {
+ compatible = "cros-ec,accelgyro-als-channel-scale";
+ k-channel-scale = <1>;
+ cover-scale = <1>;
+ };
+ };
+ rgb-cal-y {
+ offset = <0>;
+ coeff = <0 0 0 1>;
+ als-channel-scale {
+ compatible = "cros-ec,accelgyro-als-channel-scale";
+ k-channel-scale = <1>;
+ cover-scale = <1>;
+ };
+ };
+ rgb-cal-z {
+ offset = <0>;
+ coeff = <0 0 0 1>;
+ als-channel-scale {
+ compatible = "cros-ec,accelgyro-als-channel-scale";
+ k-channel-scale = <1>;
+ cover-scale = <1>;
+ };
+ };
+ };
+ };
+ };
+
+ /*
+ * List of motion sensors that creates motion_sensors array.
+ * The nodelabel "lid_accel" and "base_accel" are used to indicate
+ * motion sensor IDs for lid angle calculation.
+ */
+ motionsense-sensor {
+ lid_accel: lid-accel {
+ compatible = "cros-ec,bma255";
+ status = "okay";
+
+ active-mask = "SENSOR_ACTIVE_S0_S3";
+ location = "MOTIONSENSE_LOC_LID";
+ mutex = <&lid_mutex>;
+ port = <&i2c_sensor>;
+ rot-standard-ref = <&lid_rot_ref>;
+ default-range = <2>;
+ drv-data = <&bma255_data>;
+ i2c-spi-addr-flags = "BMA2x2_I2C_ADDR1_FLAGS";
+ configs {
+ compatible =
+ "cros-ec,motionsense-sensor-config";
+ ec-s0 {
+ odr = <(10000 | ROUND_UP_FLAG)>;
+ };
+ ec-s3 {
+ odr = <(10000 | ROUND_UP_FLAG)>;
+ };
+ };
+ };
+
+ base_accel: base-accel {
+ compatible = "cros-ec,bmi260-accel";
+ status = "okay";
+
+ active-mask = "SENSOR_ACTIVE_S0_S3";
+ location = "MOTIONSENSE_LOC_BASE";
+ mutex = <&mutex_bmi260>;
+ port = <&i2c_sensor>;
+ rot-standard-ref = <&base_rot_ref>;
+ drv-data = <&bmi260_data>;
+ configs {
+ compatible =
+ "cros-ec,motionsense-sensor-config";
+ ec-s0 {
+ odr = <(10000 | ROUND_UP_FLAG)>;
+ };
+ ec-s3 {
+ odr = <(10000 | ROUND_UP_FLAG)>;
+ };
+ };
+ };
+
+ base-gyro {
+ compatible = "cros-ec,bmi260-gyro";
+ status = "okay";
+
+ active-mask = "SENSOR_ACTIVE_S0_S3";
+ location = "MOTIONSENSE_LOC_BASE";
+ mutex = <&mutex_bmi260>;
+ port = <&i2c_sensor>;
+ rot-standard-ref = <&base_rot_ref>;
+ drv-data = <&bmi260_data>;
+ };
+
+ als_clear: base-als-clear {
+ compatible = "cros-ec,tcs3400-clear";
+ status = "okay";
+
+ active-mask = "SENSOR_ACTIVE_S0_S3";
+ location = "MOTIONSENSE_LOC_CAMERA";
+ port = <&i2c_sensor>;
+ default-range = <0x10000>;
+ drv-data = <&tcs_clear_data>;
+ i2c-spi-addr-flags = "TCS3400_I2C_ADDR_FLAGS";
+ configs {
+ compatible =
+ "cros-ec,motionsense-sensor-config";
+ ec-s0 {
+ /* Run ALS sensor in S0 */
+ odr = <1000>;
+ };
+ };
+ };
+
+ base-als-rgb {
+ compatible = "cros-ec,tcs3400-rgb";
+ status = "okay";
+
+ active-mask = "SENSOR_ACTIVE_S0_S3";
+ location = "MOTIONSENSE_LOC_CAMERA";
+ default-range = <0x10000>; /* scale = 1x, uscale = 0 */
+ drv-data = <&tcs_rgb_data>;
+ };
+ };
+
+ motionsense-sensor-info {
+ compatible = "cros-ec,motionsense-sensor-info";
+
+ /* list of entries for motion_als_sensors */
+ als-sensors = <&als_clear>;
+ /*
+ * list of GPIO interrupts that have to
+ * be enabled at initial stage
+ */
+ sensor-irqs = <&int_accel_gyro>;
+ /* list of sensors in force mode */
+ accel-force-mode-sensors = <&lid_accel &als_clear>;
+ };
+};
diff --git a/zephyr/projects/herobrine/motionsense_evoker.dts b/zephyr/projects/herobrine/motionsense_evoker.dts
new file mode 100644
index 0000000000..aa7646e0b3
--- /dev/null
+++ b/zephyr/projects/herobrine/motionsense_evoker.dts
@@ -0,0 +1,148 @@
+/* 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.
+ */
+
+#include <dt-bindings/motionsense/utils.h>
+
+
+/ {
+ aliases {
+ /*
+ * motion sense's <>_INT_EVENT is handled
+ * by alias. Using the alias, each driver creates
+ * its own <>_INT_EVENT.
+ */
+ bmi260-int = &base_accel;
+ };
+
+ /*
+ * Declare mutexes used by sensor drivers.
+ * A mutex node is used to create an instance of mutex_t.
+ * A mutex node is referenced by a sensor node if the
+ * corresponding sensor driver needs to use the
+ * instance of the mutex.
+ */
+ motionsense-mutex {
+ compatible = "cros-ec,motionsense-mutex";
+ lid_mutex: lid-mutex {
+ };
+
+ mutex_bmi260: bmi260-mutex {
+ };
+ };
+
+ /* Rotation matrix used by drivers. */
+ motionsense-rotation-ref {
+ compatible = "cros-ec,motionsense-rotation-ref";
+ lid_rot_ref: lid-rotation-ref {
+ mat33 = <(-1) 0 0
+ 0 (-1) 0
+ 0 0 1>;
+ };
+
+ base_rot_ref: base-rotation-ref {
+ mat33 = <0 1 0
+ (-1) 0 0
+ 0 0 1>;
+ };
+ };
+
+ /*
+ * Driver specific data. A driver-specific data can be shared with
+ * different motion sensors while they are using the same driver.
+ *
+ * If a node's compatible starts with "cros-ec,accelgyro-", it is for
+ * a common structure defined in accelgyro.h.
+ * e.g) compatible = "cros-ec,accelgyro-als-drv-data" is for
+ * "struct als_drv_data_t" in accelgyro.h
+ */
+ motionsense-sensor-data {
+ bma4xx_data: bma4xx-drv-data {
+ compatible = "cros-ec,drvdata-bma4xx";
+ status = "okay";
+ };
+
+ bmi260_data: bmi260-drv-data {
+ compatible = "cros-ec,drvdata-bmi260";
+ status = "okay";
+ };
+ };
+
+ /*
+ * List of motion sensors that creates motion_sensors array.
+ * The nodelabel "lid_accel" and "base_accel" are used to indicate
+ * motion sensor IDs for lid angle calculation.
+ */
+ motionsense-sensor {
+ lid_accel: lid-accel {
+ compatible = "cros-ec,bma4xx";
+ status = "okay";
+
+ active-mask = "SENSOR_ACTIVE_S0_S3";
+ location = "MOTIONSENSE_LOC_LID";
+ mutex = <&lid_mutex>;
+ port = <&i2c_sensor>;
+ rot-standard-ref = <&lid_rot_ref>;
+ default-range = <2>;
+ drv-data = <&bma4xx_data>;
+ i2c-spi-addr-flags = "BMA4_I2C_ADDR_PRIMARY";
+ configs {
+ compatible =
+ "cros-ec,motionsense-sensor-config";
+ ec-s0 {
+ odr = <(10000 | ROUND_UP_FLAG)>;
+ };
+ ec-s3 {
+ odr = <(10000 | ROUND_UP_FLAG)>;
+ };
+ };
+ };
+
+ base_accel: base-accel {
+ compatible = "cros-ec,bmi260-accel";
+ status = "okay";
+
+ active-mask = "SENSOR_ACTIVE_S0_S3";
+ location = "MOTIONSENSE_LOC_BASE";
+ mutex = <&mutex_bmi260>;
+ port = <&i2c_sensor>;
+ rot-standard-ref = <&base_rot_ref>;
+ drv-data = <&bmi260_data>;
+ configs {
+ compatible =
+ "cros-ec,motionsense-sensor-config";
+ ec-s0 {
+ odr = <(10000 | ROUND_UP_FLAG)>;
+ };
+ ec-s3 {
+ odr = <(10000 | ROUND_UP_FLAG)>;
+ };
+ };
+ };
+
+ base-gyro {
+ compatible = "cros-ec,bmi260-gyro";
+ status = "okay";
+
+ active-mask = "SENSOR_ACTIVE_S0_S3";
+ location = "MOTIONSENSE_LOC_BASE";
+ mutex = <&mutex_bmi260>;
+ port = <&i2c_sensor>;
+ rot-standard-ref = <&base_rot_ref>;
+ drv-data = <&bmi260_data>;
+ };
+ };
+
+ motionsense-sensor-info {
+ compatible = "cros-ec,motionsense-sensor-info";
+
+ /*
+ * list of GPIO interrupts that have to
+ * be enabled at initial stage
+ */
+ sensor-irqs = <&int_accel_gyro>;
+ /* list of sensors in force mode */
+ accel-force-mode-sensors = <&lid_accel>;
+ };
+};
diff --git a/zephyr/projects/herobrine/motionsense_hoglin.dts b/zephyr/projects/herobrine/motionsense_hoglin.dts
new file mode 100644
index 0000000000..c3935178ff
--- /dev/null
+++ b/zephyr/projects/herobrine/motionsense_hoglin.dts
@@ -0,0 +1,241 @@
+/* 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.
+ */
+
+#include <dt-bindings/motionsense/utils.h>
+
+
+/ {
+ aliases {
+ /*
+ * motion sense's <>_INT_EVENT is handled
+ * by alias. Using the alias, each driver creates
+ * its own <>_INT_EVENT.
+ */
+ bmi260-int = &base_accel;
+ tcs3400-int = &als_clear;
+ };
+
+ /*
+ * Declare mutexes used by sensor drivers.
+ * A mutex node is used to create an instance of mutex_t.
+ * A mutex node is referenced by a sensor node if the
+ * corresponding sensor driver needs to use the
+ * instance of the mutex.
+ */
+ motionsense-mutex {
+ compatible = "cros-ec,motionsense-mutex";
+ lid_mutex: lid-mutex {
+ };
+
+ mutex_bmi260: bmi260-mutex {
+ };
+ };
+
+ /* Rotation matrix used by drivers. */
+ motionsense-rotation-ref {
+ compatible = "cros-ec,motionsense-rotation-ref";
+ lid_rot_ref: lid-rotation-ref {
+ mat33 = <(-1) 0 0
+ 0 (-1) 0
+ 0 0 1>;
+ };
+
+ base_rot_ref: base-rotation-ref {
+ mat33 = <1 0 0
+ 0 (-1) 0
+ 0 0 (-1)>;
+ };
+ };
+
+ /*
+ * Driver specific data. A driver-specific data can be shared with
+ * different motion sensors while they are using the same driver.
+ *
+ * If a node's compatible starts with "cros-ec,accelgyro-", it is for
+ * a common structure defined in accelgyro.h.
+ * e.g) compatible = "cros-ec,accelgyro-als-drv-data" is for
+ * "struct als_drv_data_t" in accelgyro.h
+ */
+ motionsense-sensor-data {
+ bma4xx_data: bma4xx-drv-data {
+ compatible = "cros-ec,drvdata-bma4xx";
+ status = "okay";
+ };
+
+ bmi260_data: bmi260-drv-data {
+ compatible = "cros-ec,drvdata-bmi260";
+ status = "okay";
+ };
+
+ tcs_clear_data: tcs3400-clear-drv-data {
+ compatible = "cros-ec,drvdata-tcs3400-clear";
+ status = "okay";
+
+ als-drv-data {
+ compatible = "cros-ec,accelgyro-als-drv-data";
+ als-cal {
+ scale = <1>;
+ uscale = <0>;
+ offset = <0>;
+ als-channel-scale {
+ compatible = "cros-ec,accelgyro-als-channel-scale";
+ k-channel-scale = <1>;
+ cover-scale = <1>;
+ };
+ };
+ };
+ };
+
+ tcs_rgb_data: tcs3400-rgb-drv-data {
+ compatible = "cros-ec,drvdata-tcs3400-rgb";
+ status = "okay";
+
+ /* node for rgb_calibration_t defined in accelgyro.h */
+ rgb_calibration {
+ compatible =
+ "cros-ec,accelgyro-rgb-calibration";
+
+ irt = <1>;
+
+ rgb-cal-x {
+ offset = <0>;
+ coeff = <0 0 0 1>;
+ als-channel-scale {
+ compatible = "cros-ec,accelgyro-als-channel-scale";
+ k-channel-scale = <1>;
+ cover-scale = <1>;
+ };
+ };
+ rgb-cal-y {
+ offset = <0>;
+ coeff = <0 0 0 1>;
+ als-channel-scale {
+ compatible = "cros-ec,accelgyro-als-channel-scale";
+ k-channel-scale = <1>;
+ cover-scale = <1>;
+ };
+ };
+ rgb-cal-z {
+ offset = <0>;
+ coeff = <0 0 0 1>;
+ als-channel-scale {
+ compatible = "cros-ec,accelgyro-als-channel-scale";
+ k-channel-scale = <1>;
+ cover-scale = <1>;
+ };
+ };
+ };
+ };
+ };
+
+ /*
+ * List of motion sensors that creates motion_sensors array.
+ * The nodelabel "lid_accel" and "base_accel" are used to indicate
+ * motion sensor IDs for lid angle calculation.
+ */
+ motionsense-sensor {
+ lid_accel: lid-accel {
+ compatible = "cros-ec,bma4xx";
+ status = "okay";
+
+ active-mask = "SENSOR_ACTIVE_S0_S3";
+ location = "MOTIONSENSE_LOC_LID";
+ mutex = <&lid_mutex>;
+ port = <&i2c_sensor>;
+ rot-standard-ref = <&lid_rot_ref>;
+ default-range = <2>;
+ drv-data = <&bma4xx_data>;
+ i2c-spi-addr-flags = "BMA4_I2C_ADDR_PRIMARY";
+ configs {
+ compatible =
+ "cros-ec,motionsense-sensor-config";
+ ec-s0 {
+ odr = <(10000 | ROUND_UP_FLAG)>;
+ };
+ ec-s3 {
+ odr = <(10000 | ROUND_UP_FLAG)>;
+ };
+ };
+ };
+
+ base_accel: base-accel {
+ compatible = "cros-ec,bmi260-accel";
+ status = "okay";
+
+ active-mask = "SENSOR_ACTIVE_S0_S3";
+ location = "MOTIONSENSE_LOC_BASE";
+ mutex = <&mutex_bmi260>;
+ port = <&i2c_sensor>;
+ rot-standard-ref = <&base_rot_ref>;
+ drv-data = <&bmi260_data>;
+ configs {
+ compatible =
+ "cros-ec,motionsense-sensor-config";
+ ec-s0 {
+ odr = <(10000 | ROUND_UP_FLAG)>;
+ };
+ ec-s3 {
+ odr = <(10000 | ROUND_UP_FLAG)>;
+ };
+ };
+ };
+
+ base-gyro {
+ compatible = "cros-ec,bmi260-gyro";
+ status = "okay";
+
+ active-mask = "SENSOR_ACTIVE_S0_S3";
+ location = "MOTIONSENSE_LOC_BASE";
+ mutex = <&mutex_bmi260>;
+ port = <&i2c_sensor>;
+ rot-standard-ref = <&base_rot_ref>;
+ drv-data = <&bmi260_data>;
+ };
+
+ als_clear: base-als-clear {
+ compatible = "cros-ec,tcs3400-clear";
+ status = "okay";
+
+ active-mask = "SENSOR_ACTIVE_S0_S3";
+ location = "MOTIONSENSE_LOC_CAMERA";
+ port = <&i2c_sensor>;
+ default-range = <0x10000>;
+ drv-data = <&tcs_clear_data>;
+ i2c-spi-addr-flags = "TCS3400_I2C_ADDR_FLAGS";
+ configs {
+ compatible =
+ "cros-ec,motionsense-sensor-config";
+ ec-s0 {
+ /* Run ALS sensor in S0 */
+ odr = <1000>;
+ };
+ };
+ };
+
+ base-als-rgb {
+ compatible = "cros-ec,tcs3400-rgb";
+ status = "okay";
+
+ active-mask = "SENSOR_ACTIVE_S0_S3";
+ location = "MOTIONSENSE_LOC_CAMERA";
+ default-range = <0x10000>; /* scale = 1x, uscale = 0 */
+ drv-data = <&tcs_rgb_data>;
+ };
+ };
+
+ motionsense-sensor-info {
+ compatible = "cros-ec,motionsense-sensor-info";
+
+ /* list of entries for motion_als_sensors */
+ als-sensors = <&als_clear>;
+ /*
+ * list of GPIO interrupts that have to
+ * be enabled at initial stage
+ */
+ sensor-irqs = <&int_accel_gyro>;
+ /* list of sensors in force mode */
+ accel-force-mode-sensors = <&lid_accel &als_clear>;
+ };
+};
diff --git a/zephyr/projects/herobrine/motionsense_villager.dts b/zephyr/projects/herobrine/motionsense_villager.dts
new file mode 100644
index 0000000000..31d00e04a5
--- /dev/null
+++ b/zephyr/projects/herobrine/motionsense_villager.dts
@@ -0,0 +1,148 @@
+/* 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.
+ */
+
+#include <dt-bindings/motionsense/utils.h>
+
+
+/ {
+ aliases {
+ /*
+ * motion sense's <>_INT_EVENT is handled
+ * by alias. Using the alias, each driver creates
+ * its own <>_INT_EVENT.
+ */
+ bmi260-int = &base_accel;
+ };
+
+ /*
+ * Declare mutexes used by sensor drivers.
+ * A mutex node is used to create an instance of mutex_t.
+ * A mutex node is referenced by a sensor node if the
+ * corresponding sensor driver needs to use the
+ * instance of the mutex.
+ */
+ motionsense-mutex {
+ compatible = "cros-ec,motionsense-mutex";
+ lid_mutex: lid-mutex {
+ };
+
+ mutex_bmi260: bmi260-mutex {
+ };
+ };
+
+ /* Rotation matrix used by drivers. */
+ motionsense-rotation-ref {
+ compatible = "cros-ec,motionsense-rotation-ref";
+ lid_rot_ref: lid-rotation-ref {
+ mat33 = <0 1 0
+ (-1) 0 0
+ 0 0 1>;
+ };
+
+ base_rot_ref: base-rotation-ref {
+ mat33 = <1 0 0
+ 0 (-1) 0
+ 0 0 (-1)>;
+ };
+ };
+
+ /*
+ * Driver specific data. A driver-specific data can be shared with
+ * different motion sensors while they are using the same driver.
+ *
+ * If a node's compatible starts with "cros-ec,accelgyro-", it is for
+ * a common structure defined in accelgyro.h.
+ * e.g) compatible = "cros-ec,accelgyro-als-drv-data" is for
+ * "struct als_drv_data_t" in accelgyro.h
+ */
+ motionsense-sensor-data {
+ kx022_data: kx022-drv-data {
+ compatible = "cros-ec,drvdata-kionix";
+ status = "okay";
+ };
+
+ bmi260_data: bmi260-drv-data {
+ compatible = "cros-ec,drvdata-bmi260";
+ status = "okay";
+ };
+ };
+
+ /*
+ * List of motion sensors that creates motion_sensors array.
+ * The nodelabel "lid_accel" and "base_accel" are used to indicate
+ * motion sensor IDs for lid angle calculation.
+ */
+ motionsense-sensor {
+ lid_accel: lid-accel {
+ compatible = "cros-ec,kx022";
+ status = "okay";
+
+ active-mask = "SENSOR_ACTIVE_S0_S3";
+ location = "MOTIONSENSE_LOC_LID";
+ mutex = <&lid_mutex>;
+ port = <&i2c_sensor>;
+ rot-standard-ref = <&lid_rot_ref>;
+ default-range = <2>;
+ drv-data = <&kx022_data>;
+ i2c-spi-addr-flags = "KX022_ADDR0_FLAGS";
+ configs {
+ compatible =
+ "cros-ec,motionsense-sensor-config";
+ ec-s0 {
+ odr = <(10000 | ROUND_UP_FLAG)>;
+ };
+ ec-s3 {
+ odr = <(10000 | ROUND_UP_FLAG)>;
+ };
+ };
+ };
+
+ base_accel: base-accel {
+ compatible = "cros-ec,bmi260-accel";
+ status = "okay";
+
+ active-mask = "SENSOR_ACTIVE_S0_S3";
+ location = "MOTIONSENSE_LOC_BASE";
+ mutex = <&mutex_bmi260>;
+ port = <&i2c_sensor>;
+ rot-standard-ref = <&base_rot_ref>;
+ drv-data = <&bmi260_data>;
+ configs {
+ compatible =
+ "cros-ec,motionsense-sensor-config";
+ ec-s0 {
+ odr = <(10000 | ROUND_UP_FLAG)>;
+ };
+ ec-s3 {
+ odr = <(10000 | ROUND_UP_FLAG)>;
+ };
+ };
+ };
+
+ base-gyro {
+ compatible = "cros-ec,bmi260-gyro";
+ status = "okay";
+
+ active-mask = "SENSOR_ACTIVE_S0_S3";
+ location = "MOTIONSENSE_LOC_BASE";
+ mutex = <&mutex_bmi260>;
+ port = <&i2c_sensor>;
+ rot-standard-ref = <&base_rot_ref>;
+ drv-data = <&bmi260_data>;
+ };
+ };
+
+ motionsense-sensor-info {
+ compatible = "cros-ec,motionsense-sensor-info";
+
+ /*
+ * list of GPIO interrupts that have to
+ * be enabled at initial stage
+ */
+ sensor-irqs = <&int_accel_gyro>;
+ /* list of sensors in force mode */
+ accel-force-mode-sensors = <&lid_accel>;
+ };
+};
diff --git a/zephyr/projects/herobrine/motionsense_zombie.dts b/zephyr/projects/herobrine/motionsense_zombie.dts
new file mode 100644
index 0000000000..e069564b35
--- /dev/null
+++ b/zephyr/projects/herobrine/motionsense_zombie.dts
@@ -0,0 +1,148 @@
+/* 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.
+ */
+
+#include <dt-bindings/motionsense/utils.h>
+
+
+/ {
+ aliases {
+ /*
+ * motion sense's <>_INT_EVENT is handled
+ * by alias. Using the alias, each driver creates
+ * its own <>_INT_EVENT.
+ */
+ bmi260-int = &base_accel;
+ };
+
+ /*
+ * Declare mutexes used by sensor drivers.
+ * A mutex node is used to create an instance of mutex_t.
+ * A mutex node is referenced by a sensor node if the
+ * corresponding sensor driver needs to use the
+ * instance of the mutex.
+ */
+ motionsense-mutex {
+ compatible = "cros-ec,motionsense-mutex";
+ lid_mutex: lid-mutex {
+ };
+
+ mutex_bmi260: bmi260-mutex {
+ };
+ };
+
+ /* Rotation matrix used by drivers. */
+ motionsense-rotation-ref {
+ compatible = "cros-ec,motionsense-rotation-ref";
+ lid_rot_ref: lid-rotation-ref {
+ mat33 = <0 1 0
+ (-1) 0 0
+ 0 0 1>;
+ };
+
+ base_rot_ref: base-rotation-ref {
+ mat33 = <1 0 0
+ 0 (-1) 0
+ 0 0 (-1)>;
+ };
+ };
+
+ /*
+ * Driver specific data. A driver-specific data can be shared with
+ * different motion sensors while they are using the same driver.
+ *
+ * If a node's compatible starts with "cros-ec,accelgyro-", it is for
+ * a common structure defined in accelgyro.h.
+ * e.g) compatible = "cros-ec,accelgyro-als-drv-data" is for
+ * "struct als_drv_data_t" in accelgyro.h
+ */
+ motionsense-sensor-data {
+ kx022_data: kx022-drv-data {
+ compatible = "cros-ec,drvdata-kionix";
+ status = "okay";
+ };
+
+ bmi260_data: bmi260-drv-data {
+ compatible = "cros-ec,drvdata-bmi260";
+ status = "okay";
+ };
+ };
+
+ /*
+ * List of motion sensors that creates motion_sensors array.
+ * The nodelabel "lid_accel" and "base_accel" are used to indicate
+ * motion sensor IDs for lid angle calculation.
+ */
+ motionsense-sensor {
+ lid_accel: lid-accel {
+ compatible = "cros-ec,kx022";
+ status = "okay";
+
+ active-mask = "SENSOR_ACTIVE_S0_S3";
+ location = "MOTIONSENSE_LOC_LID";
+ mutex = <&lid_mutex>;
+ port = <&i2c_sensor>;
+ rot-standard-ref = <&lid_rot_ref>;
+ default-range = <2>;
+ drv-data = <&kx022_data>;
+ i2c-spi-addr-flags = "KX022_ADDR0_FLAGS";
+ configs {
+ compatible =
+ "cros-ec,motionsense-sensor-config";
+ ec-s0 {
+ odr = <(10000 | ROUND_UP_FLAG)>;
+ };
+ ec-s3 {
+ odr = <(10000 | ROUND_UP_FLAG)>;
+ };
+ };
+ };
+
+ base_accel: base-accel {
+ compatible = "cros-ec,bmi260-accel";
+ status = "okay";
+
+ active-mask = "SENSOR_ACTIVE_S0_S3";
+ location = "MOTIONSENSE_LOC_BASE";
+ mutex = <&mutex_bmi260>;
+ port = <&i2c_sensor>;
+ rot-standard-ref = <&base_rot_ref>;
+ drv-data = <&bmi260_data>;
+ configs {
+ compatible =
+ "cros-ec,motionsense-sensor-config";
+ ec-s0 {
+ odr = <(10000 | ROUND_UP_FLAG)>;
+ };
+ ec-s3 {
+ odr = <(10000 | ROUND_UP_FLAG)>;
+ };
+ };
+ };
+
+ base-gyro {
+ compatible = "cros-ec,bmi260-gyro";
+ status = "okay";
+
+ active-mask = "SENSOR_ACTIVE_S0_S3";
+ location = "MOTIONSENSE_LOC_BASE";
+ mutex = <&mutex_bmi260>;
+ port = <&i2c_sensor>;
+ rot-standard-ref = <&base_rot_ref>;
+ drv-data = <&bmi260_data>;
+ };
+ };
+
+ motionsense-sensor-info {
+ compatible = "cros-ec,motionsense-sensor-info";
+
+ /*
+ * list of GPIO interrupts that have to
+ * be enabled at initial stage
+ */
+ sensor-irqs = <&int_accel_gyro>;
+ /* list of sensors in force mode */
+ accel-force-mode-sensors = <&lid_accel>;
+ };
+};
diff --git a/zephyr/projects/herobrine/prj.conf b/zephyr/projects/herobrine/prj.conf
new file mode 100644
index 0000000000..3391e60dce
--- /dev/null
+++ b/zephyr/projects/herobrine/prj.conf
@@ -0,0 +1,160 @@
+# 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.
+
+CONFIG_CROS_EC=y
+CONFIG_SHIMMED_TASKS=y
+CONFIG_PLATFORM_EC=y
+CONFIG_PLATFORM_EC_BRINGUP=y
+CONFIG_PLATFORM_EC_EXTPOWER_GPIO=y
+CONFIG_PLATFORM_EC_SWITCH=y
+CONFIG_PLATFORM_EC_LID_SWITCH=y
+CONFIG_PLATFORM_EC_BACKLIGHT_LID=y
+CONFIG_PLATFORM_EC_POWER_BUTTON=y
+CONFIG_PLATFORM_EC_CBI_GPIO=y
+CONFIG_KERNEL_SHELL=y
+CONFIG_PLATFORM_EC_BOARD_RESET_AFTER_POWER_ON=y
+
+# I2C options
+CONFIG_I2C=y
+CONFIG_PLATFORM_EC_CONSOLE_CMD_I2C_SPEED=y
+CONFIG_PLATFORM_EC_HOSTCMD_I2C_CONTROL=y
+
+# Shell history and tab autocompletion (for convenience)
+CONFIG_SHELL_HELP=y
+CONFIG_SHELL_HISTORY=y
+CONFIG_SHELL_TAB=y
+CONFIG_SHELL_TAB_AUTOCOMPLETION=y
+
+# LED
+CONFIG_PLATFORM_EC_LED_COMMON=n
+CONFIG_PLATFORM_EC_LED_DT=y
+
+# PWM
+CONFIG_PWM=y
+CONFIG_PWM_SHELL=n
+
+# Application Processor is Qualcomm SC7280
+CONFIG_AP_ARM_QUALCOMM_SC7280=y
+
+# GPIO Switchcap
+CONFIG_PLATFORM_EC_SWITCHCAP_GPIO=y
+
+# Board version is selected over GPIO board ID pins.
+CONFIG_PLATFORM_EC_BOARD_VERSION_GPIO=y
+
+# Power Sequencing
+CONFIG_PLATFORM_EC_POWERSEQ=y
+CONFIG_PLATFORM_EC_POWERSEQ_HOST_SLEEP=y
+CONFIG_PLATFORM_EC_POWERSEQ_PP5000_CONTROL=n
+CONFIG_PLATFORM_EC_POWER_SLEEP_FAILURE_DETECTION=y
+CONFIG_PLATFORM_EC_CHIPSET_RESET_HOOK=y
+CONFIG_PLATFORM_EC_CHIPSET_RESUME_INIT_HOOK=y
+
+# MKBP event
+CONFIG_PLATFORM_EC_MKBP_EVENT=y
+CONFIG_PLATFORM_EC_MKBP_USE_GPIO=y
+
+# Keyboard
+CONFIG_PLATFORM_EC_KEYBOARD=y
+CONFIG_PLATFORM_EC_KEYBOARD_PROTOCOL_MKBP=y
+CONFIG_PLATFORM_EC_MKBP_INPUT_DEVICES=y
+CONFIG_PLATFORM_EC_KEYBOARD_COL2_INVERTED=y
+CONFIG_PLATFORM_EC_KEYBOARD_REFRESH_ROW3=y
+CONFIG_PLATFORM_EC_VOLUME_BUTTONS=y
+CONFIG_PLATFORM_EC_CMD_BUTTON=y
+CONFIG_CROS_KB_RAW_NPCX=y
+
+# ADC
+CONFIG_ADC=y
+CONFIG_ADC_SHELL=n
+
+# Battery
+CONFIG_PLATFORM_EC_BATTERY=y
+CONFIG_PLATFORM_EC_BATTERY_SMART=y
+CONFIG_PLATFORM_EC_I2C_VIRTUAL_BATTERY=y
+CONFIG_PLATFORM_EC_I2C_PASSTHRU_RESTRICTED=y
+CONFIG_PLATFORM_EC_BATTERY_FUEL_GAUGE=y
+CONFIG_PLATFORM_EC_BATTERY_CUT_OFF=y
+CONFIG_PLATFORM_EC_BATTERY_PRESENT_GPIO=y
+CONFIG_PLATFORM_EC_CHARGER_ISL9238C=y
+CONFIG_PLATFORM_EC_CHARGE_RAMP_HW=y
+CONFIG_PLATFORM_EC_USE_BATTERY_DEVICE_CHEMISTRY=y
+CONFIG_PLATFORM_EC_BATTERY_DEVICE_CHEMISTRY="LION"
+CONFIG_PLATFORM_EC_BATTERY_REVIVE_DISCONNECT=y
+CONFIG_PLATFORM_EC_CHARGER_DISCHARGE_ON_AC=y
+CONFIG_PLATFORM_EC_CHARGER_DISCHARGE_ON_AC_CHARGER=y
+CONFIG_PLATFORM_EC_CHARGER_MIN_BAT_PCT_FOR_POWER_ON=2
+CONFIG_PLATFORM_EC_CHARGER_MIN_POWER_MW_FOR_POWER_ON=12500
+CONFIG_PLATFORM_EC_CHARGER_PROFILE_OVERRIDE=y
+CONFIG_PLATFORM_EC_CHARGER_PSYS=y
+CONFIG_PLATFORM_EC_CHARGER_PSYS_READ=y
+CONFIG_PLATFORM_EC_CHARGER_SENSE_RESISTOR=10
+CONFIG_PLATFORM_EC_CHARGER_SENSE_RESISTOR_AC=20
+CONFIG_PLATFORM_EC_CONSOLE_CMD_CHARGER_ADC_AMON_BMON=y
+
+# USB-A
+CONFIG_PLATFORM_EC_USBA=y
+
+# USB-C
+CONFIG_PLATFORM_EC_USB_PD_FRS=y
+CONFIG_PLATFORM_EC_BC12_DETECT_PI3USB9201=y
+CONFIG_PLATFORM_EC_USB_PD_USB32_DRD=n
+CONFIG_PLATFORM_EC_USBC_PPC_SN5S330=y
+CONFIG_PLATFORM_EC_USBC_PPC_SYV682C=y
+CONFIG_PLATFORM_EC_USBC_PPC_SYV682X=y
+CONFIG_PLATFORM_EC_USB_PD_FRS_PPC=y
+CONFIG_PLATFORM_EC_USBC_RETIMER_FW_UPDATE=n
+CONFIG_PLATFORM_EC_USBC_SS_MUX_DFP_ONLY=y
+CONFIG_PLATFORM_EC_USB_DRP_ACC_TRYSRC=y
+CONFIG_PLATFORM_EC_USB_PD_5V_EN_CUSTOM=y
+CONFIG_PLATFORM_EC_USB_PD_VBUS_DETECT_TCPC=y
+CONFIG_PLATFORM_EC_USB_PD_DISCHARGE_PPC=y
+CONFIG_PLATFORM_EC_USB_PD_DPS=y
+CONFIG_PLATFORM_EC_USB_PD_REV30=y
+CONFIG_PLATFORM_EC_USB_PD_TBT_COMPAT_MODE=n
+CONFIG_PLATFORM_EC_USB_PD_USB4=n
+CONFIG_PLATFORM_EC_USB_PD_TCPC_LOW_POWER=y
+CONFIG_PLATFORM_EC_USB_PD_TCPM_PS8805=y
+CONFIG_PLATFORM_EC_USB_PD_TCPC_RUNTIME_CONFIG=n
+CONFIG_PLATFORM_EC_USB_MUX_RUNTIME_CONFIG=n
+CONFIG_PLATFORM_EC_USB_PD_LOGGING=y
+CONFIG_PLATFORM_EC_CONFIG_USB_PD_3A_PORTS=2
+
+# USB ID
+# This is allocated specifically for Herobrine
+# http://google3/hardware/standards/usb/
+# TODO(b/183608112): Move to device tree
+CONFIG_PLATFORM_EC_USB_PID=0x5055
+
+# RTC
+CONFIG_PLATFORM_EC_RTC=y
+CONFIG_CROS_RTC_NXP_PCF85063A=y
+CONFIG_PLATFORM_EC_HOSTCMD_RTC=y
+CONFIG_PLATFORM_EC_CONSOLE_CMD_RTC=y
+CONFIG_PLATFORM_EC_CONSOLE_CMD_RTC_ALARM=y
+
+# EC software sync
+CONFIG_PLATFORM_EC_VBOOT_HASH=y
+
+# Sensors
+CONFIG_PLATFORM_EC_MOTIONSENSE=y
+CONFIG_PLATFORM_EC_ACCEL_FIFO=y
+CONFIG_PLATFORM_EC_ACCEL_SPOOF_MODE=y
+CONFIG_PLATFORM_EC_CONSOLE_CMD_ACCELS=y
+CONFIG_PLATFORM_EC_CONSOLE_CMD_ACCEL_INFO=y
+CONFIG_PLATFORM_EC_GMR_TABLET_MODE=y
+CONFIG_PLATFORM_EC_LID_ANGLE=y
+CONFIG_PLATFORM_EC_LID_ANGLE_UPDATE=y
+CONFIG_PLATFORM_EC_SENSOR_TIGHT_TIMESTAMPS=y
+CONFIG_PLATFORM_EC_TABLET_MODE=y
+CONFIG_PLATFORM_EC_TABLET_MODE_SWITCH=y
+CONFIG_PLATFORM_EC_MAX_SENSOR_FREQ_MILLIHZ=100000
+
+# Sensor Drivers
+CONFIG_PLATFORM_EC_ACCEL_BMA255=y
+CONFIG_PLATFORM_EC_ACCELGYRO_BMI260=y
+CONFIG_PLATFORM_EC_ACCELGYRO_BMI_COMM_I2C=y
+
+CONFIG_SYSCON=y
+CONFIG_PLATFORM_EC_EMULATED_SYSRQ=y
diff --git a/zephyr/projects/herobrine/prj_evoker.conf b/zephyr/projects/herobrine/prj_evoker.conf
new file mode 100644
index 0000000000..b4a5fce160
--- /dev/null
+++ b/zephyr/projects/herobrine/prj_evoker.conf
@@ -0,0 +1,16 @@
+# 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.
+
+# Evoker board-specific Kconfig settings.
+CONFIG_BOARD_EVOKER=y
+
+# Disable type-c port sourcing 3A
+CONFIG_PLATFORM_EC_CONFIG_USB_PD_3A_PORTS=0
+
+CONFIG_PLATFORM_EC_ACCEL_BMA255=n
+CONFIG_PLATFORM_EC_ACCEL_BMA4XX=y
+
+# ISL9238C disable the CMOUT latch function.
+CONFIG_PLATFORM_EC_ISL9238C_DISABLE_CMOUT_LATCH=y
+CONFIG_PLATFORM_EC_CONSOLE_CMD_CHARGER_DUMP=y \ No newline at end of file
diff --git a/zephyr/projects/herobrine/prj_herobrine.conf b/zephyr/projects/herobrine/prj_herobrine.conf
new file mode 100644
index 0000000000..bf39f65692
--- /dev/null
+++ b/zephyr/projects/herobrine/prj_herobrine.conf
@@ -0,0 +1,13 @@
+# 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.
+
+# Herobrine-NPCX9 reference-board-specific Kconfig settings.
+CONFIG_BOARD_HEROBRINE=y
+
+# Sensors
+CONFIG_PLATFORM_EC_ALS=y
+
+# Sensor Drivers
+CONFIG_PLATFORM_EC_ALS_TCS3400=y
+CONFIG_PLATFORM_EC_ALS_TCS3400_EMULATED_IRQ_EVENT=y
diff --git a/zephyr/projects/herobrine/prj_hoglin.conf b/zephyr/projects/herobrine/prj_hoglin.conf
new file mode 100644
index 0000000000..c6e20937c0
--- /dev/null
+++ b/zephyr/projects/herobrine/prj_hoglin.conf
@@ -0,0 +1,15 @@
+# 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.
+
+# Hoglin reference-board-specific Kconfig settings.
+CONFIG_BOARD_HOGLIN=y
+CONFIG_PLATFORM_EC_ACCEL_BMA255=n
+CONFIG_PLATFORM_EC_ACCEL_BMA4XX=y
+
+# Sensors
+CONFIG_PLATFORM_EC_ALS=y
+
+# Sensor Drivers
+CONFIG_PLATFORM_EC_ALS_TCS3400=y
+CONFIG_PLATFORM_EC_ALS_TCS3400_EMULATED_IRQ_EVENT=y
diff --git a/zephyr/projects/herobrine/prj_villager.conf b/zephyr/projects/herobrine/prj_villager.conf
new file mode 100644
index 0000000000..35eebe6d99
--- /dev/null
+++ b/zephyr/projects/herobrine/prj_villager.conf
@@ -0,0 +1,8 @@
+# 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.
+
+# Villager board-specific Kconfig settings.
+CONFIG_BOARD_VILLAGER=y
+
+CONFIG_PLATFORM_EC_ACCEL_KX022=y
diff --git a/zephyr/projects/herobrine/prj_zoglin.conf b/zephyr/projects/herobrine/prj_zoglin.conf
new file mode 100644
index 0000000000..7f96cf6c79
--- /dev/null
+++ b/zephyr/projects/herobrine/prj_zoglin.conf
@@ -0,0 +1,15 @@
+# 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.
+
+# Zoglin reference-board-specific Kconfig settings.
+CONFIG_BOARD_ZOGLIN=y
+CONFIG_PLATFORM_EC_ACCEL_BMA255=n
+CONFIG_PLATFORM_EC_ACCEL_BMA4XX=y
+
+# Sensors
+CONFIG_PLATFORM_EC_ALS=y
+
+# Sensor Drivers
+CONFIG_PLATFORM_EC_ALS_TCS3400=y
+CONFIG_PLATFORM_EC_ALS_TCS3400_EMULATED_IRQ_EVENT=y
diff --git a/zephyr/projects/herobrine/prj_zombie.conf b/zephyr/projects/herobrine/prj_zombie.conf
new file mode 100644
index 0000000000..037ab5cc05
--- /dev/null
+++ b/zephyr/projects/herobrine/prj_zombie.conf
@@ -0,0 +1,8 @@
+# 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.
+
+# Zombie board-specific Kconfig settings.
+CONFIG_BOARD_ZOMBIE=y
+
+CONFIG_PLATFORM_EC_ACCEL_KX022=y
diff --git a/zephyr/projects/herobrine/src/board_chipset.c b/zephyr/projects/herobrine/src/board_chipset.c
new file mode 100644
index 0000000000..2312bdb1c4
--- /dev/null
+++ b/zephyr/projects/herobrine/src/board_chipset.c
@@ -0,0 +1,83 @@
+/* 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.
+ */
+
+/* Herobrine chipset-specific configuration */
+
+#include "charger.h"
+#include "common.h"
+#include "console.h"
+#include "battery.h"
+#include "gpio.h"
+#include "hooks.h"
+#include "timer.h"
+#include "usb_pd.h"
+
+#include "board_chipset.h"
+
+#define CPRINTS(format, args...) cprints(CC_HOOK, format, ##args)
+#define CPRINTF(format, args...) cprintf(CC_HOOK, format, ##args)
+
+/*
+ * A window of PD negotiation. It starts from the Type-C state reaching
+ * Attached.SNK, and ends when the PD contract is created. The VBUS may be
+ * raised anytime in this window.
+ *
+ * The current implementation is the worst case scenario: every message the PD
+ * negotiation is received at the last moment before timeout. More extra time
+ * is added to compensate the delay internally, like the decision of the DPM.
+ *
+ * TODO(waihong): Cancel this timer when the PD contract is negotiated.
+ */
+#define PD_READY_TIMEOUT \
+ (PD_T_SINK_WAIT_CAP + PD_T_SENDER_RESPONSE + PD_T_SINK_TRANSITION + \
+ 20 * MSEC)
+
+#define PD_READY_POLL_DELAY (10 * MSEC)
+
+static timestamp_t pd_ready_timeout;
+
+static bool pp5000_inited;
+
+__test_only void reset_pp5000_inited(void)
+{
+ pp5000_inited = false;
+}
+
+/* Called on USB PD connected */
+static void board_usb_pd_connect(void)
+{
+ int soc = -1;
+
+ /* First boot, battery unattached or low SOC */
+ if (!pp5000_inited &&
+ ((battery_state_of_charge_abs(&soc) != EC_SUCCESS ||
+ soc < charger_get_min_bat_pct_for_power_on()))) {
+ pd_ready_timeout = get_time();
+ pd_ready_timeout.val += PD_READY_TIMEOUT;
+ }
+}
+DECLARE_HOOK(HOOK_USB_PD_CONNECT, board_usb_pd_connect, HOOK_PRIO_DEFAULT);
+
+static void wait_pd_ready(void)
+{
+ CPRINTS("Wait PD negotiated VBUS transition %u",
+ pd_ready_timeout.le.lo);
+ while (pd_ready_timeout.val && get_time().val < pd_ready_timeout.val)
+ usleep(PD_READY_POLL_DELAY);
+}
+
+/* Called on AP S5 -> S3 transition */
+static void board_chipset_pre_init(void)
+{
+ if (!pp5000_inited) {
+ if (pd_ready_timeout.val) {
+ wait_pd_ready();
+ }
+ CPRINTS("Enable 5V rail");
+ gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_en_pp5000_s5), 1);
+ pp5000_inited = true;
+ }
+}
+DECLARE_HOOK(HOOK_CHIPSET_PRE_INIT, board_chipset_pre_init, HOOK_PRIO_DEFAULT);
diff --git a/zephyr/projects/herobrine/src/herobrine/alt_dev_replacement.c b/zephyr/projects/herobrine/src/herobrine/alt_dev_replacement.c
new file mode 100644
index 0000000000..00acd509f4
--- /dev/null
+++ b/zephyr/projects/herobrine/src/herobrine/alt_dev_replacement.c
@@ -0,0 +1,36 @@
+/* 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.
+ */
+#include <zephyr/logging/log.h>
+#include "usbc/ppc.h"
+#include "hooks.h"
+#include "cros_board_info.h"
+
+LOG_MODULE_REGISTER(alt_dev_replacement);
+
+#define BOARD_VERSION_UNKNOWN 0xffffffff
+
+/* Check board version to decide which ppc is used. */
+static bool board_has_alt_ppc(void)
+{
+ static uint32_t board_version = BOARD_VERSION_UNKNOWN;
+
+ if (board_version == BOARD_VERSION_UNKNOWN) {
+ if (cbi_get_board_version(&board_version) != EC_SUCCESS) {
+ LOG_ERR("Failed to get board version.");
+ board_version = 0;
+ }
+ }
+
+ return (board_version >= 1);
+}
+
+static void check_alternate_devices(void)
+{
+ /* Configure the PPC driver */
+ if (board_has_alt_ppc())
+ /* Arg is the USB port number */
+ PPC_ENABLE_ALTERNATE(0);
+}
+DECLARE_HOOK(HOOK_INIT, check_alternate_devices, HOOK_PRIO_DEFAULT);
diff --git a/zephyr/projects/herobrine/src/i2c.c b/zephyr/projects/herobrine/src/i2c.c
new file mode 100644
index 0000000000..88b722c42d
--- /dev/null
+++ b/zephyr/projects/herobrine/src/i2c.c
@@ -0,0 +1,17 @@
+/* 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.
+ */
+
+#include "i2c/i2c.h"
+#include "i2c.h"
+
+/* Herobrine-NPCX9 board specific i2c implementation */
+
+#ifdef CONFIG_PLATFORM_EC_I2C_PASSTHRU_RESTRICTED
+int board_allow_i2c_passthru(const struct i2c_cmd_desc_t *cmd_desc)
+{
+ return (i2c_get_device_for_port(cmd_desc->port) ==
+ i2c_get_device_for_port(I2C_PORT_VIRTUAL_BATTERY));
+}
+#endif
diff --git a/zephyr/projects/herobrine/src/usb_pd_policy.c b/zephyr/projects/herobrine/src/usb_pd_policy.c
new file mode 100644
index 0000000000..adc517d3cb
--- /dev/null
+++ b/zephyr/projects/herobrine/src/usb_pd_policy.c
@@ -0,0 +1,254 @@
+/* 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.
+ */
+
+#include <zephyr/drivers/gpio.h>
+
+#include "charge_manager.h"
+#include "chipset.h"
+#include "console.h"
+#include "system.h"
+#include "usb_mux.h"
+#include "usbc_ppc.h"
+#include "util.h"
+
+#define CPRINTS(format, args...) cprints(CC_USBCHARGE, format, ##args)
+#define CPRINTF(format, args...) cprintf(CC_USBCHARGE, format, ##args)
+
+int pd_check_vconn_swap(int port)
+{
+ /* In G3, do not allow vconn swap since PP5000 rail is off */
+ return gpio_pin_get_dt(GPIO_DT_FROM_NODELABEL(gpio_en_pp5000_s5));
+}
+
+static uint8_t vbus_en[CONFIG_USB_PD_PORT_MAX_COUNT];
+
+static void board_vbus_update_source_current(int port)
+{
+ ppc_vbus_source_enable(port, vbus_en[port]);
+}
+
+void pd_power_supply_reset(int port)
+{
+ int prev_en;
+
+ prev_en = vbus_en[port];
+
+ /* Disable VBUS */
+ vbus_en[port] = 0;
+ board_vbus_update_source_current(port);
+
+ /* Enable discharge if we were previously sourcing 5V */
+ if (prev_en)
+ pd_set_vbus_discharge(port, 1);
+
+ /* notify host of power info change */
+ pd_send_host_event(PD_EVENT_POWER_CHANGE);
+}
+
+int pd_set_power_supply_ready(int port)
+{
+ /* Disable charging */
+ board_vbus_sink_enable(port, 0);
+
+ pd_set_vbus_discharge(port, 0);
+
+ /* Provide VBUS */
+ vbus_en[port] = 1;
+ board_vbus_update_source_current(port);
+
+ /* notify host of power info change */
+ pd_send_host_event(PD_EVENT_POWER_CHANGE);
+
+ return EC_SUCCESS; /* we are ready */
+}
+
+int board_vbus_source_enabled(int port)
+{
+ return vbus_en[port];
+}
+
+int pd_snk_is_vbus_provided(int port)
+{
+ return tcpm_check_vbus_level(port, VBUS_PRESENT);
+}
+
+/* ----------------- Vendor Defined Messages ------------------ */
+#ifdef CONFIG_USB_PD_ALT_MODE_DFP
+__override int svdm_dp_config(int port, uint32_t *payload)
+{
+ int opos = pd_alt_mode(port, TCPCI_MSG_SOP, USB_SID_DISPLAYPORT);
+ uint8_t pin_mode = get_dp_pin_mode(port);
+
+ if (!pin_mode)
+ return 0;
+
+ /*
+ * Defer setting the usb_mux until HPD goes high, svdm_dp_attention().
+ * The AP only supports one DP phy. An external DP mux switches between
+ * the two ports. Should switch those muxes when it is really used,
+ * i.e. HPD high; otherwise, the real use case is preempted, like:
+ * (1) plug a dongle without monitor connected to port-0,
+ * (2) plug a dongle without monitor connected to port-1,
+ * (3) plug a monitor to the port-1 dongle.
+ */
+
+ payload[0] =
+ VDO(USB_SID_DISPLAYPORT, 1, CMD_DP_CONFIG | VDO_OPOS(opos));
+ payload[1] = VDO_DP_CFG(pin_mode, /* pin mode */
+ 1, /* DPv1.3 signaling */
+ 2); /* UFP connected */
+ return 2;
+};
+
+__override void svdm_dp_post_config(int port)
+{
+ dp_flags[port] |= DP_FLAGS_DP_ON;
+}
+
+/**
+ * Is the port fine to be muxed its DisplayPort lines?
+ *
+ * Only one port can be muxed to DisplayPort at a time.
+ *
+ * @param port Port number of TCPC.
+ * @return 1 is fine; 0 is bad as other port is already muxed;
+ */
+static int is_dp_muxable(int port)
+{
+ int i;
+
+ for (i = 0; i < CONFIG_USB_PD_PORT_MAX_COUNT; i++)
+ if (i != port) {
+ if (usb_mux_get(i) & USB_PD_MUX_DP_ENABLED)
+ return 0;
+ }
+
+ return 1;
+}
+
+__override int svdm_dp_attention(int port, uint32_t *payload)
+{
+ const struct gpio_dt_spec *hpd =
+ GPIO_DT_FROM_NODELABEL(gpio_dp_hot_plug_det_r);
+ int lvl = PD_VDO_DPSTS_HPD_LVL(payload[1]);
+ int irq = PD_VDO_DPSTS_HPD_IRQ(payload[1]);
+ int cur_lvl = gpio_pin_get_dt(hpd);
+ mux_state_t mux_state;
+
+ dp_status[port] = payload[1];
+
+ if (!is_dp_muxable(port)) {
+ /* TODO(waihong): Info user? */
+ CPRINTS("p%d: The other port is already muxed.", port);
+ return 0;
+ }
+
+ /*
+ * Initial implementation to handle HPD. Only the first-plugged port
+ * works, i.e. sending HPD signal to AP. The second-plugged port
+ * will be ignored.
+ *
+ * TODO(waihong): Continue the above case, if the first-plugged port
+ * is then unplugged, switch to the second-plugged port and signal AP?
+ */
+ if (lvl) {
+ /*
+ * Enable and switch the DP port selection mux to the
+ * correct port.
+ *
+ * TODO(waihong): Better to move switching DP mux to
+ * the usb_mux abstraction.
+ */
+ gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_dp_mux_sel),
+ port == 1);
+ gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_dp_mux_oe_l), 0);
+
+ /* Connect the SBU lines in PPC chip. */
+ if (IS_ENABLED(CONFIG_USBC_PPC_SBU))
+ ppc_set_sbu(port, 1);
+
+ /*
+ * Connect the USB SS/DP lines in TCPC chip.
+ *
+ * When mf_pref not true, still use the dock muxing
+ * because of the board USB-C topology (limited to 2
+ * lanes DP).
+ */
+ usb_mux_set(port, USB_PD_MUX_DOCK, USB_SWITCH_CONNECT,
+ polarity_rm_dts(pd_get_polarity(port)));
+ } else {
+ /* Disconnect the DP port selection mux. */
+ gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_dp_mux_oe_l), 1);
+ gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_dp_mux_sel), 0);
+
+ /* Disconnect the SBU lines in PPC chip. */
+ if (IS_ENABLED(CONFIG_USBC_PPC_SBU))
+ ppc_set_sbu(port, 0);
+
+ /* Disconnect the DP but keep the USB SS lines in TCPC chip. */
+ usb_mux_set(port, USB_PD_MUX_USB_ENABLED, USB_SWITCH_CONNECT,
+ polarity_rm_dts(pd_get_polarity(port)));
+ }
+
+ if (chipset_in_state(CHIPSET_STATE_ANY_SUSPEND) && (irq || lvl))
+ /*
+ * Wake up the AP. IRQ or level high indicates a DP sink is now
+ * present.
+ */
+ pd_notify_dp_alt_mode_entry(port);
+
+ /* Configure TCPC for the HPD event, for proper muxing */
+ mux_state = (lvl ? USB_PD_MUX_HPD_LVL : USB_PD_MUX_HPD_LVL_DEASSERTED) |
+ (irq ? USB_PD_MUX_HPD_IRQ : USB_PD_MUX_HPD_IRQ_DEASSERTED);
+ usb_mux_hpd_update(port, mux_state);
+
+ /* Signal AP for the HPD event, through GPIO to AP */
+ if (irq & cur_lvl) {
+ uint64_t now = get_time().val;
+ /* Wait for the minimum spacing between IRQ_HPD if needed */
+ if (now < svdm_hpd_deadline[port])
+ usleep(svdm_hpd_deadline[port] - now);
+
+ /* Generate IRQ_HPD pulse */
+ CPRINTS("C%d: Recv IRQ. HPD->0", port);
+ gpio_pin_set_dt(hpd, 0);
+ usleep(HPD_DSTREAM_DEBOUNCE_IRQ);
+ gpio_pin_set_dt(hpd, 1);
+ CPRINTS("C%d: Recv IRQ. HPD->1", port);
+
+ /* Set the minimum time delay (2ms) for the next HPD IRQ */
+ svdm_hpd_deadline[port] =
+ get_time().val + HPD_USTREAM_DEBOUNCE_LVL;
+ } else if (irq & !lvl) {
+ CPRINTF("ERR:HPD:IRQ&LOW\n");
+ return 0;
+ } else {
+ CPRINTS("C%d: Recv lvl. HPD->%d", port, lvl);
+ gpio_pin_set_dt(hpd, lvl);
+ /* Set the minimum time delay (2ms) for the next HPD IRQ */
+ svdm_hpd_deadline[port] =
+ get_time().val + HPD_USTREAM_DEBOUNCE_LVL;
+ }
+
+ return 1;
+}
+
+__override void svdm_exit_dp_mode(int port)
+{
+ CPRINTS("%s(%d)", __func__, port);
+ if (is_dp_muxable(port)) {
+ /* Disconnect the DP port selection mux. */
+ gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_dp_mux_oe_l), 1);
+ gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_dp_mux_sel), 0);
+
+ /* Signal AP for the HPD low event */
+ usb_mux_hpd_update(port, USB_PD_MUX_HPD_LVL_DEASSERTED |
+ USB_PD_MUX_HPD_IRQ_DEASSERTED);
+ CPRINTS("C%d: DP exit. HPD->0", port);
+ gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_dp_hot_plug_det_r),
+ 0);
+ }
+}
+#endif /* CONFIG_USB_PD_ALT_MODE_DFP */
diff --git a/zephyr/projects/herobrine/src/usbc_config.c b/zephyr/projects/herobrine/src/usbc_config.c
new file mode 100644
index 0000000000..f040ab12cb
--- /dev/null
+++ b/zephyr/projects/herobrine/src/usbc_config.c
@@ -0,0 +1,278 @@
+/* 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.
+ */
+
+/* Herobrine board-specific USB-C configuration */
+
+#include <zephyr/drivers/gpio.h>
+
+#include "charger.h"
+#include "charger/isl923x_public.h"
+#include "charge_manager.h"
+#include "charge_state.h"
+#include "common.h"
+#include "config.h"
+#include "cros_board_info.h"
+#include "gpio/gpio_int.h"
+#include "hooks.h"
+#include "ppc/sn5s330_public.h"
+#include "ppc/syv682x_public.h"
+#include "system.h"
+#include "tcpm/ps8xxx_public.h"
+#include "tcpm/tcpci.h"
+#include "timer.h"
+#include "usb_pd.h"
+#include "usb_mux.h"
+#include "usbc_ocp.h"
+#include "usbc_ppc.h"
+#include "usbc/ppc.h"
+
+#define CPRINTS(format, args...) cprints(CC_USBCHARGE, format, ##args)
+#define CPRINTF(format, args...) cprintf(CC_USBCHARGE, format, ##args)
+
+/* GPIO Interrupt Handlers */
+void tcpc_alert_event(enum gpio_signal signal)
+{
+ int port = -1;
+
+ switch (signal) {
+ case GPIO_USB_C0_PD_INT_ODL:
+ port = 0;
+ break;
+ case GPIO_USB_C1_PD_INT_ODL:
+ port = 1;
+ break;
+ default:
+ return;
+ }
+
+ schedule_deferred_pd_interrupt(port);
+}
+
+static void usba_oc_deferred(void)
+{
+ /* Use next number after all USB-C ports to indicate the USB-A port */
+ board_overcurrent_event(
+ CONFIG_USB_PD_PORT_MAX_COUNT,
+ !gpio_pin_get_dt(GPIO_DT_FROM_NODELABEL(gpio_usb_a0_oc_odl)));
+}
+DECLARE_DEFERRED(usba_oc_deferred);
+
+void usba_oc_interrupt(enum gpio_signal signal)
+{
+ hook_call_deferred(&usba_oc_deferred_data, 0);
+}
+
+void ppc_interrupt(enum gpio_signal signal)
+{
+ switch (signal) {
+ case GPIO_USB_C0_SWCTL_INT_ODL:
+ ppc_chips[0].drv->interrupt(0);
+ break;
+
+ case GPIO_USB_C1_SWCTL_INT_ODL:
+ ppc_chips[1].drv->interrupt(1);
+ break;
+
+ default:
+ break;
+ }
+}
+
+int charger_profile_override(struct charge_state_data *curr)
+{
+ int usb_mv;
+ int port;
+
+ if (curr->state != ST_CHARGE)
+ return 0;
+
+ /* Lower the max requested voltage to 5V when battery is full. */
+ if (chipset_in_state(CHIPSET_STATE_ANY_OFF) &&
+ !(curr->batt.flags & BATT_FLAG_BAD_STATUS) &&
+ !(curr->batt.flags & BATT_FLAG_WANT_CHARGE) &&
+ (curr->batt.status & STATUS_FULLY_CHARGED))
+ usb_mv = 5000;
+ else
+ usb_mv = PD_MAX_VOLTAGE_MV;
+
+ if (pd_get_max_voltage() != usb_mv) {
+ CPRINTS("VBUS limited to %dmV", usb_mv);
+ for (port = 0; port < CONFIG_USB_PD_PORT_MAX_COUNT; port++)
+ pd_set_external_voltage_limit(port, usb_mv);
+ }
+
+ return 0;
+}
+
+enum ec_status charger_profile_override_get_param(uint32_t param,
+ uint32_t *value)
+{
+ return EC_RES_INVALID_PARAM;
+}
+
+enum ec_status charger_profile_override_set_param(uint32_t param,
+ uint32_t value)
+{
+ return EC_RES_INVALID_PARAM;
+}
+
+/* Initialize board USC-C things */
+static void board_init_usbc(void)
+{
+ /* Enable USB-A overcurrent interrupt */
+ gpio_enable_dt_interrupt(GPIO_INT_FROM_NODELABEL(int_usb_a0_oc));
+}
+DECLARE_HOOK(HOOK_INIT, board_init_usbc, HOOK_PRIO_DEFAULT);
+
+void board_tcpc_init(void)
+{
+ /* Only reset TCPC if not sysjump */
+ if (!system_jumped_late()) {
+ /* TODO(crosbug.com/p/61098): How long do we need to wait? */
+ board_reset_pd_mcu();
+ }
+
+ /* Enable PPC interrupts */
+ gpio_enable_dt_interrupt(GPIO_INT_FROM_NODELABEL(int_usb_c0_swctl));
+
+ /* Enable TCPC interrupts */
+ gpio_enable_dt_interrupt(GPIO_INT_FROM_NODELABEL(int_usb_c0_pd));
+ gpio_enable_dt_interrupt(GPIO_INT_FROM_NODELABEL(int_usb_c1_pd));
+
+ /*
+ * Initialize HPD to low; after sysjump SOC needs to see
+ * HPD pulse to enable video path
+ */
+ for (int port = 0; port < CONFIG_USB_PD_PORT_MAX_COUNT; ++port)
+ usb_mux_hpd_update(port, USB_PD_MUX_HPD_LVL_DEASSERTED |
+ USB_PD_MUX_HPD_IRQ_DEASSERTED);
+}
+DECLARE_HOOK(HOOK_INIT, board_tcpc_init, HOOK_PRIO_POST_I2C);
+
+void board_reset_pd_mcu(void)
+{
+ cprints(CC_USB, "Resetting TCPCs...");
+ cflush();
+
+ gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_usb_c0_pd_rst_l), 0);
+ gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_usb_c1_pd_rst_l), 0);
+ msleep(PS8XXX_RESET_DELAY_MS);
+ gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_usb_c0_pd_rst_l), 1);
+ gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_usb_c1_pd_rst_l), 1);
+ msleep(PS8805_FW_INIT_DELAY_MS);
+}
+
+void board_set_tcpc_power_mode(int port, int mode)
+{
+ /* Ignore the "mode" to turn the chip on. We can only do a reset. */
+ if (mode)
+ return;
+
+ board_reset_pd_mcu();
+}
+
+int board_vbus_sink_enable(int port, int enable)
+{
+ /* Both ports are controlled by PPC SN5S330 */
+ return ppc_vbus_sink_enable(port, enable);
+}
+
+int board_is_sourcing_vbus(int port)
+{
+ /* Both ports are controlled by PPC SN5S330 */
+ return ppc_is_sourcing_vbus(port);
+}
+
+void board_overcurrent_event(int port, int is_overcurrented)
+{
+ /* TODO(b/120231371): Notify AP */
+ CPRINTS("p%d: overcurrent!", port);
+}
+
+int board_set_active_charge_port(int port)
+{
+ int is_real_port = (port >= 0 && port < CONFIG_USB_PD_PORT_MAX_COUNT);
+ int i;
+
+ if (!is_real_port && port != CHARGE_PORT_NONE)
+ return EC_ERROR_INVAL;
+
+ if (port == CHARGE_PORT_NONE) {
+ CPRINTS("Disabling all charging port");
+
+ /* Disable all ports. */
+ for (i = 0; i < CONFIG_USB_PD_PORT_MAX_COUNT; i++) {
+ /*
+ * Do not return early if one fails otherwise we can
+ * get into a boot loop assertion failure.
+ */
+ if (board_vbus_sink_enable(i, 0))
+ CPRINTS("Disabling p%d sink path failed.", i);
+ }
+
+ return EC_SUCCESS;
+ }
+
+ /* Check if the port is sourcing VBUS. */
+ if (board_is_sourcing_vbus(port)) {
+ CPRINTS("Skip enable p%d", port);
+ return EC_ERROR_INVAL;
+ }
+
+ CPRINTS("New charge port: p%d", port);
+
+ /*
+ * Turn off the other ports' sink path FETs, before enabling the
+ * requested charge port.
+ */
+ for (i = 0; i < CONFIG_USB_PD_PORT_MAX_COUNT; i++) {
+ if (i == port)
+ continue;
+
+ if (board_vbus_sink_enable(i, 0))
+ CPRINTS("p%d: sink path disable failed.", i);
+ }
+
+ /* Enable requested charge port. */
+ if (board_vbus_sink_enable(port, 1)) {
+ CPRINTS("p%d: sink path enable failed.", port);
+ return EC_ERROR_UNKNOWN;
+ }
+
+ return EC_SUCCESS;
+}
+
+void board_set_charge_limit(int port, int supplier, int charge_ma, int max_ma,
+ int charge_mv)
+{
+ /*
+ * Ignore lower charge ceiling on PD transition if our battery is
+ * critical, as we may brownout.
+ */
+ if (supplier == CHARGE_SUPPLIER_PD && charge_ma < 1500 &&
+ charge_get_percent() < CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON) {
+ CPRINTS("Using max ilim %d", max_ma);
+ charge_ma = max_ma;
+ }
+
+ charge_set_input_current_limit(
+ MAX(charge_ma, CONFIG_CHARGER_INPUT_CURRENT), charge_mv);
+}
+
+uint16_t tcpc_get_alert_status(void)
+{
+ uint16_t status = 0;
+
+ if (!gpio_pin_get_dt(GPIO_DT_FROM_NODELABEL(gpio_usb_c0_pd_int_odl)))
+ if (gpio_pin_get_dt(
+ GPIO_DT_FROM_NODELABEL(gpio_usb_c0_pd_rst_l)))
+ status |= PD_STATUS_TCPC_ALERT_0;
+ if (!gpio_pin_get_dt(GPIO_DT_FROM_NODELABEL(gpio_usb_c1_pd_int_odl)))
+ if (gpio_pin_get_dt(
+ GPIO_DT_FROM_NODELABEL(gpio_usb_c1_pd_rst_l)))
+ status |= PD_STATUS_TCPC_ALERT_1;
+
+ return status;
+}
diff --git a/zephyr/projects/herobrine/switchcap.dts b/zephyr/projects/herobrine/switchcap.dts
new file mode 100644
index 0000000000..ed200a0c6f
--- /dev/null
+++ b/zephyr/projects/herobrine/switchcap.dts
@@ -0,0 +1,12 @@
+/* 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.
+ */
+
+/ {
+ switchcap {
+ compatible = "switchcap-gpio";
+ enable-pin = <&gpio_switchcap_on>;
+ power-good-pin = <&gpio_switchcap_pg>;
+ };
+};
diff --git a/zephyr/projects/herobrine/switchcap_hoglin.dts b/zephyr/projects/herobrine/switchcap_hoglin.dts
new file mode 100644
index 0000000000..7c083667a1
--- /dev/null
+++ b/zephyr/projects/herobrine/switchcap_hoglin.dts
@@ -0,0 +1,12 @@
+/* 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.
+ */
+
+/ {
+ switchcap {
+ compatible = "switchcap-gpio";
+ enable-pin = <&gpio_switchcap_on>;
+ poff-delay-ms = <550>;
+ };
+};
diff --git a/zephyr/projects/herobrine/usbc_evoker.dts b/zephyr/projects/herobrine/usbc_evoker.dts
new file mode 100644
index 0000000000..20bd48382f
--- /dev/null
+++ b/zephyr/projects/herobrine/usbc_evoker.dts
@@ -0,0 +1,42 @@
+/* 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.
+ */
+
+/ {
+ usbc {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port0@0 {
+ compatible = "named-usbc-port";
+ reg = <0>;
+ bc12 = <&bc12_port0>;
+ ppc = <&ppc_port0>;
+ tcpc = <&tcpc_port0>;
+ chg = <&charger>;
+ usb-mux-chain-0 {
+ compatible = "cros-ec,usb-mux-chain";
+ usb-muxes = <&usb_mux_0>;
+ };
+ };
+ usb_mux_0: usb-mux-0 {
+ compatible = "parade,usbc-mux-ps8xxx";
+ };
+
+ port1@1 {
+ compatible = "named-usbc-port";
+ reg = <1>;
+ bc12 = <&bc12_port1>;
+ ppc = <&ppc_port1>;
+ tcpc = <&tcpc_port1>;
+ usb-mux-chain-1 {
+ compatible = "cros-ec,usb-mux-chain";
+ usb-muxes = <&usb_mux_1>;
+ };
+ };
+ usb_mux_1: usb-mux-1 {
+ compatible = "parade,usbc-mux-ps8xxx";
+ };
+ };
+};
diff --git a/zephyr/projects/herobrine/usbc_herobrine.dts b/zephyr/projects/herobrine/usbc_herobrine.dts
new file mode 100644
index 0000000000..675286ecd7
--- /dev/null
+++ b/zephyr/projects/herobrine/usbc_herobrine.dts
@@ -0,0 +1,43 @@
+/* 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.
+ */
+
+/ {
+ usbc {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port0@0 {
+ compatible = "named-usbc-port";
+ reg = <0>;
+ bc12 = <&bc12_port0>;
+ ppc = <&ppc_port0>;
+ ppc_alt = <&ppc_port0_alt>;
+ tcpc = <&tcpc_port0>;
+ chg = <&charger>;
+ usb-mux-chain-0 {
+ compatible = "cros-ec,usb-mux-chain";
+ usb-muxes = <&usb_mux_0>;
+ };
+ };
+ usb_mux_0: usb-mux-0 {
+ compatible = "parade,usbc-mux-ps8xxx";
+ };
+
+ port1@1 {
+ compatible = "named-usbc-port";
+ reg = <1>;
+ bc12 = <&bc12_port1>;
+ ppc = <&ppc_port1>;
+ tcpc = <&tcpc_port1>;
+ usb-mux-chain-1 {
+ compatible = "cros-ec,usb-mux-chain";
+ usb-muxes = <&usb_mux_1>;
+ };
+ };
+ usb_mux_1: usb-mux-1 {
+ compatible = "parade,usbc-mux-ps8xxx";
+ };
+ };
+};
diff --git a/zephyr/projects/herobrine/usbc_hoglin.dts b/zephyr/projects/herobrine/usbc_hoglin.dts
new file mode 100644
index 0000000000..20bd48382f
--- /dev/null
+++ b/zephyr/projects/herobrine/usbc_hoglin.dts
@@ -0,0 +1,42 @@
+/* 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.
+ */
+
+/ {
+ usbc {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port0@0 {
+ compatible = "named-usbc-port";
+ reg = <0>;
+ bc12 = <&bc12_port0>;
+ ppc = <&ppc_port0>;
+ tcpc = <&tcpc_port0>;
+ chg = <&charger>;
+ usb-mux-chain-0 {
+ compatible = "cros-ec,usb-mux-chain";
+ usb-muxes = <&usb_mux_0>;
+ };
+ };
+ usb_mux_0: usb-mux-0 {
+ compatible = "parade,usbc-mux-ps8xxx";
+ };
+
+ port1@1 {
+ compatible = "named-usbc-port";
+ reg = <1>;
+ bc12 = <&bc12_port1>;
+ ppc = <&ppc_port1>;
+ tcpc = <&tcpc_port1>;
+ usb-mux-chain-1 {
+ compatible = "cros-ec,usb-mux-chain";
+ usb-muxes = <&usb_mux_1>;
+ };
+ };
+ usb_mux_1: usb-mux-1 {
+ compatible = "parade,usbc-mux-ps8xxx";
+ };
+ };
+};
diff --git a/zephyr/projects/herobrine/usbc_villager.dts b/zephyr/projects/herobrine/usbc_villager.dts
new file mode 100644
index 0000000000..20bd48382f
--- /dev/null
+++ b/zephyr/projects/herobrine/usbc_villager.dts
@@ -0,0 +1,42 @@
+/* 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.
+ */
+
+/ {
+ usbc {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port0@0 {
+ compatible = "named-usbc-port";
+ reg = <0>;
+ bc12 = <&bc12_port0>;
+ ppc = <&ppc_port0>;
+ tcpc = <&tcpc_port0>;
+ chg = <&charger>;
+ usb-mux-chain-0 {
+ compatible = "cros-ec,usb-mux-chain";
+ usb-muxes = <&usb_mux_0>;
+ };
+ };
+ usb_mux_0: usb-mux-0 {
+ compatible = "parade,usbc-mux-ps8xxx";
+ };
+
+ port1@1 {
+ compatible = "named-usbc-port";
+ reg = <1>;
+ bc12 = <&bc12_port1>;
+ ppc = <&ppc_port1>;
+ tcpc = <&tcpc_port1>;
+ usb-mux-chain-1 {
+ compatible = "cros-ec,usb-mux-chain";
+ usb-muxes = <&usb_mux_1>;
+ };
+ };
+ usb_mux_1: usb-mux-1 {
+ compatible = "parade,usbc-mux-ps8xxx";
+ };
+ };
+};
diff --git a/zephyr/projects/herobrine/usbc_zombie.dts b/zephyr/projects/herobrine/usbc_zombie.dts
new file mode 100644
index 0000000000..20bd48382f
--- /dev/null
+++ b/zephyr/projects/herobrine/usbc_zombie.dts
@@ -0,0 +1,42 @@
+/* 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.
+ */
+
+/ {
+ usbc {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port0@0 {
+ compatible = "named-usbc-port";
+ reg = <0>;
+ bc12 = <&bc12_port0>;
+ ppc = <&ppc_port0>;
+ tcpc = <&tcpc_port0>;
+ chg = <&charger>;
+ usb-mux-chain-0 {
+ compatible = "cros-ec,usb-mux-chain";
+ usb-muxes = <&usb_mux_0>;
+ };
+ };
+ usb_mux_0: usb-mux-0 {
+ compatible = "parade,usbc-mux-ps8xxx";
+ };
+
+ port1@1 {
+ compatible = "named-usbc-port";
+ reg = <1>;
+ bc12 = <&bc12_port1>;
+ ppc = <&ppc_port1>;
+ tcpc = <&tcpc_port1>;
+ usb-mux-chain-1 {
+ compatible = "cros-ec,usb-mux-chain";
+ usb-muxes = <&usb_mux_1>;
+ };
+ };
+ usb_mux_1: usb-mux-1 {
+ compatible = "parade,usbc-mux-ps8xxx";
+ };
+ };
+};