summaryrefslogtreecommitdiff
path: root/zephyr/program/corsola
diff options
context:
space:
mode:
authorEric Yilun Lin <yllin@chromium.org>2022-11-15 16:15:13 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-11-22 05:42:07 +0000
commit6ff9e40f0574d45989b072c2909d7301a5722fbb (patch)
tree13d4fe4d05b12ac5240419b3ac8f8596781fc24e /zephyr/program/corsola
parent9e03f318c58dbd9944db627accead18b5d11c5a0 (diff)
downloadchrome-ec-6ff9e40f0574d45989b072c2909d7301a5722fbb.tar.gz
corsola: steelix: uses npcx_*.dtsi
Merge the .dtsi files to steelix/project.overlay cbi.dtsi and interrupts.dtsi are the exceptions which are shared with the tests. BUG=b:254097516 TEST=zmake compare-builds; Note, only the npcx_gpio.dtsi makes the build difference due to the GPIO sequence changed. BRANCH=none Change-Id: I5a6a4a54ac6d0cc6bfbfb1eb671947d95e56cf0e Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4037127 Auto-Submit: Eric Yilun Lin <yllin@google.com> Tested-by: Eric Yilun Lin <yllin@google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
Diffstat (limited to 'zephyr/program/corsola')
-rw-r--r--zephyr/program/corsola/battery_kingler.dtsi15
-rw-r--r--zephyr/program/corsola/battery_steelix.dtsi24
-rw-r--r--zephyr/program/corsola/gpio_steelix.dtsi255
-rw-r--r--zephyr/program/corsola/keyboard_steelix.dtsi29
-rw-r--r--zephyr/program/corsola/kingler/project.overlay79
-rw-r--r--zephyr/program/corsola/led_kingler.dtsi71
-rw-r--r--zephyr/program/corsola/led_steelix.dtsi55
-rw-r--r--zephyr/program/corsola/motionsense_steelix.dtsi133
-rw-r--r--zephyr/program/corsola/steelix/cbi.dtsi (renamed from zephyr/program/corsola/cbi_steelix.dtsi)0
-rw-r--r--zephyr/program/corsola/steelix/interrupts.dtsi (renamed from zephyr/program/corsola/interrupts_steelix.dtsi)2
-rw-r--r--zephyr/program/corsola/steelix/project.overlay288
-rw-r--r--zephyr/program/corsola/usba_steelix.dtsi10
12 files changed, 359 insertions, 602 deletions
diff --git a/zephyr/program/corsola/battery_kingler.dtsi b/zephyr/program/corsola/battery_kingler.dtsi
deleted file mode 100644
index b01fb8a46d..0000000000
--- a/zephyr/program/corsola/battery_kingler.dtsi
+++ /dev/null
@@ -1,15 +0,0 @@
-/* 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: smp_l20m3pg2 {
- compatible = "smp,l20m3pg2", "battery-smart";
- };
- lgc_l20l3pg2 {
- compatible = "lgc,l20l3pg2", "battery-smart";
- };
- };
-};
diff --git a/zephyr/program/corsola/battery_steelix.dtsi b/zephyr/program/corsola/battery_steelix.dtsi
deleted file mode 100644
index 594c83478c..0000000000
--- a/zephyr/program/corsola/battery_steelix.dtsi
+++ /dev/null
@@ -1,24 +0,0 @@
-/* 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: byd_l22b3pg0 {
- compatible = "byd,l22b3pg0", "battery-smart";
- };
- celxpert_l22c3pg0 {
- compatible = "celxpert,l22c3pg0", "battery-smart";
- };
- cosmx_l22x3pg0 {
- compatible = "cosmx,l22x3pg0", "battery-smart";
- };
- smp_l22m3pg0 {
- compatible = "smp,l22m3pg0", "battery-smart";
- };
- sunwoda_l22d3pg0 {
- compatible = "sunwoda,l22d3pg0", "battery-smart";
- };
- };
-};
diff --git a/zephyr/program/corsola/gpio_steelix.dtsi b/zephyr/program/corsola/gpio_steelix.dtsi
deleted file mode 100644
index 14120e6d7d..0000000000
--- a/zephyr/program/corsola/gpio_steelix.dtsi
+++ /dev/null
@@ -1,255 +0,0 @@
-/* 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-cbi-wp = &gpio_ec_cbi_wp;
- gpio-wp = &gpio_ec_wp_l;
- gpio-kbd-kso2 = &gpio_ec_kso_02_inv;
- };
-
- named-gpios {
- compatible = "named-gpios";
-
- /*
- * In npcx9 series, gpio46, gpio47, and the whole gpio5 port
- * belong to VHIF power well. On steelix, it is connencted to
- * 1.8V.
- */
- base_imu_int_l: base_imu_int_l {
- gpios = <&gpio5 6 GPIO_INPUT>;
- };
- spi_ap_clk_ec {
- gpios = <&gpio5 5 GPIO_INPUT>;
- };
- spi_ap_cs_ec_l {
- gpios = <&gpio5 3 GPIO_INPUT>;
- };
- spi_ap_do_ec_di {
- gpios = <&gpio4 6 GPIO_INPUT>;
- };
- spi_ap_di_ec_do {
- gpios = <&gpio4 7 GPIO_INPUT>;
- };
- ap_ec_warm_rst_req: ap_ec_warm_rst_req {
- gpios = <&gpio5 1 (GPIO_INPUT | GPIO_ACTIVE_HIGH)>;
- enum-name = "GPIO_AP_EC_WARM_RST_REQ";
- };
- ap_ec_wdtrst_l: ap_ec_wdtrst_l {
- gpios = <&gpio5 2 (GPIO_INPUT | GPIO_ACTIVE_LOW)>;
- enum-name = "GPIO_AP_EC_WDTRST_L";
- };
- ap_in_sleep_l: ap_in_sleep_l {
- gpios = <&gpio5 4 (GPIO_INPUT | GPIO_ACTIVE_LOW)>;
- enum-name = "GPIO_AP_IN_SLEEP_L";
- };
- gpio_en_ulp: en_ulp {
- gpios = <&gpioc 6 GPIO_OUTPUT_LOW>;
- };
- en_ec_id_odl {
- gpios = <&gpio7 6 GPIO_ODR_HIGH>;
- };
- sys_rst_odl {
- gpios = <&gpioc 5 (GPIO_ODR_LOW | GPIO_VOLTAGE_1P8)>;
- enum-name = "GPIO_SYS_RST_ODL";
- };
- ec_i2c_sensor_scl {
- gpios = <&gpiob 5 (GPIO_INPUT | GPIO_VOLTAGE_1P8)>;
- };
- ec_i2c_sensor_sda {
- gpios = <&gpiob 4 (GPIO_INPUT | GPIO_VOLTAGE_1P8)>;
- };
- ec_i2c_usb_c0_scl {
- gpios = <&gpio9 0 GPIO_INPUT>;
- };
- ec_i2c_usb_c0_sda {
- gpios = <&gpio8 7 GPIO_INPUT>;
- };
- ec_i2c_usb_c1_scl {
- gpios = <&gpio9 2 GPIO_INPUT>;
- };
- ec_i2c_usb_c1_sda {
- gpios = <&gpio9 1 GPIO_INPUT>;
- };
- ec_i2c_pwr_cbi_scl {
- gpios = <&gpiod 1 (GPIO_INPUT | GPIO_VOLTAGE_1P8)>;
- };
- ec_i2c_pwr_cbi_sda {
- gpios = <&gpiod 0 (GPIO_INPUT | GPIO_VOLTAGE_1P8)>;
- };
- ec_i2c_batt_scl {
- gpios = <&gpio3 3 GPIO_INPUT>;
- };
- ec_i2c_batt_sda {
- gpios = <&gpio3 6 GPIO_INPUT>;
- };
- en_pp5000_usb_a1_vbus: en_pp5000_usb_a1_vbus_x {
- gpios = <&gpiof 5 GPIO_OUTPUT_LOW>;
- };
- usb_a1_fault_odl {
- gpios = <&gpiof 4 GPIO_INPUT>;
- };
- ec_pen_chg_dis_odl {
- gpios = <&gpioe 4 GPIO_INPUT>;
- };
- gpio_ec_cbi_wp: ec_cbi_wp {
- gpios = <&gpio8 0 GPIO_OUTPUT_LOW>;
- };
- gpio_ec_wp_l: ec_wp_odl {
- gpios = <&gpioe 3 (GPIO_INPUT | GPIO_ACTIVE_LOW |
- GPIO_VOLTAGE_1P8)>;
- };
- lid_accel_int_l {
- gpios = <&gpiob 3 (GPIO_INPUT | GPIO_VOLTAGE_1P8)>;
- };
- gpio_tablet_mode_l: tablet_mode_l {
- gpios = <&gpiob 2 GPIO_INPUT>;
- enum-name = "GPIO_TABLET_MODE_L";
- };
- ec_ap_int_odl {
- gpios = <&gpioc 1 (GPIO_ODR_HIGH | GPIO_VOLTAGE_1P8)>;
- enum-name = "GPIO_EC_INT_L";
- };
- gpio_ec_kso_02_inv: ec_kso_02_inv {
- gpios = <&gpio1 7 (GPIO_OUTPUT_LOW | GPIO_ACTIVE_LOW)>;
- };
- gpio_usb_c0_bc12_int_odl: usb_c0_bc12_int_odl {
- gpios = <&gpio8 3 GPIO_INPUT>;
- enum-name = "GPIO_USB_C0_BC12_INT_ODL";
- };
- ec_entering_rw {
- gpios = <&gpio0 3 GPIO_OUTPUT_LOW>;
- };
- charger_prochot_odl {
- gpios = <&gpiob 1 GPIO_INPUT>;
- };
- ec_rst_odl {
- gpios = <&gpio7 7 GPIO_INPUT>;
- };
- gpio_lid_open: lid_open {
- gpios = <&gpiod 2 GPIO_INPUT>;
- enum-name = "GPIO_LID_OPEN";
- };
- gpio_acok_od: acok_od {
- gpios = <&gpio0 0 GPIO_INPUT>;
- enum-name = "GPIO_AC_PRESENT";
- };
- gpio_gsc_ec_pwr_btn_odl: gsc_ec_pwr_btn_odl {
- gpios = <&gpio0 1 GPIO_INPUT>;
- enum-name = "GPIO_POWER_BUTTON_L";
- };
- gpio_en_5v_usm: en_5v_usm {
- gpios = <&gpio0 2 GPIO_OUTPUT_LOW>;
- };
- packet_mode_en {
- gpios = <&gpio7 5 GPIO_OUTPUT_LOW>;
- enum-name = "GPIO_PACKET_MODE_EN";
- };
- gpio_x_ec_gpio2: x_ec_gpio2 {
- gpios = <&gpiod 4 GPIO_INPUT>;
- };
- /*
- * In npcx9 series, gpio93-97, the whole gpioa port, and gpiob0
- * belong to VSPI power well. On steelix, it is connencted to
- * 1.8V.
- */
- ap_sysrst_odl_r: ap_sysrst_odl_r {
- gpios = <&gpioa 1 (GPIO_INPUT | GPIO_ACTIVE_LOW)>;
- enum-name = "GPIO_AP_EC_SYSRST_ODL";
- };
- gpio_ap_xhci_init_done: ap_xhci_init_done {
- gpios = <&gpioa 3 GPIO_INPUT>;
- };
- gpio_usb_c0_ppc_int_odl: usb_c0_ppc_int_odl {
- gpios = <&gpio6 7 GPIO_INPUT>;
- enum-name = "GPIO_USB_C0_PPC_INT_ODL";
- };
- pg_pp5000_z2_od {
- gpios = <&gpio7 0 GPIO_INPUT>;
- };
- gpio_ec_x_gpio1: ec_x_gpio1 {
- gpios = <&gpio6 2 GPIO_OUTPUT_LOW>;
- };
- dp_aux_path_sel: dp_aux_path_sel {
- gpios = <&gpio6 3 GPIO_OUTPUT_HIGH>;
- };
- gpio_ec_bl_en_od: ec_bl_en_od {
- gpios = <&gpio4 0 (GPIO_ODR_LOW | GPIO_VOLTAGE_1P8)>;
- };
- gpio_ec_x_gpio3: ec_x_gpio3 {
- gpios = <&gpiod 3 GPIO_OUTPUT_LOW>;
- };
- gpio_usb_c0_tcpc_int_odl: usb_c0_tcpc_int_odl {
- gpios = <&gpio7 3 GPIO_INPUT>;
- enum-name = "GPIO_USB_C0_TCPC_INT_ODL";
- };
- gpio_usb_c0_tcpc_rst: usb_c0_tcpc_rst {
- gpios = <&gpioc 0 GPIO_OUTPUT_LOW>;
- };
- en_pp5000_usb_a0_vbus: en_pp5000_usb_a0_vbus {
- gpios = <&gpio6 0 GPIO_OUTPUT_LOW>;
- };
- gpio_hdmi_prsnt_odl: hdmi_prsnt_odl {
- gpios = <&gpio3 7 GPIO_INPUT>;
- };
- en_pp5000_z2 {
- gpios = <&gpio3 4 GPIO_OUTPUT_HIGH>;
- };
- gpio_usb_c1_tcpc_int_odl: usb_c1_tcpc_int_odl {
- gpios = <&gpioe 1 GPIO_INPUT>;
- };
- ec_batt_pres_odl {
- gpios = <&gpioe 0 GPIO_INPUT>;
- enum-name = "GPIO_BATT_PRES_ODL";
- };
- usb_a0_fault_odl {
- gpios = <&gpioc 7 GPIO_INPUT>;
- };
- ec_ap_dp_hpd_odl: ec_ap_dp_hpd_odl {
- gpios = <&gpio6 1 GPIO_ODR_HIGH>;
- };
- ec_pmic_en_odl {
- gpios = <&gpio7 4 (GPIO_ODR_HIGH | GPIO_VOLTAGE_1P8)>;
- enum-name = "GPIO_EC_PMIC_EN_ODL";
- };
- gpio_ec_volup_btn_odl: ec_volup_btn_odl {
- gpios = <&gpiod 5 GPIO_INPUT>;
- enum-name = "GPIO_VOLUME_UP_L";
- };
- gpio_ec_voldn_btn_odl: ec_voldn_btn_odl {
- gpios = <&gpioe 2 GPIO_INPUT>;
- enum-name = "GPIO_VOLUME_DOWN_L";
- };
- gpio_ccd_mode_odl: ccd_mode_odl {
- gpios = <&gpioe 5 GPIO_INPUT>;
- enum-name = "GPIO_CCD_MODE_ODL";
- };
- /* unimplemented GPIOs */
- entering-rw {
- enum-name = "GPIO_ENTERING_RW";
- };
- };
-
- /*
- * aliases for sub-board GPIOs
- */
- aliases {
- gpio-en-hdmi-pwr = &gpio_ec_x_gpio1;
- gpio-usb-c1-frs-en = &gpio_ec_x_gpio1;
- gpio-usb-c1-ppc-int-odl = &gpio_x_ec_gpio2;
- gpio-ps185-ec-dp-hpd = &gpio_x_ec_gpio2;
- gpio-usb-c1-dp-in-hpd = &gpio_ec_x_gpio3;
- gpio-ps185-pwrdn-odl = &gpio_ec_x_gpio3;
- };
-
- hibernate-wake-pins {
- compatible = "cros-ec,hibernate-wake-pins";
- wakeup-irqs = <
- &int_ac_present
- &int_power_button
- &int_lid_open
- >;
- };
-};
diff --git a/zephyr/program/corsola/keyboard_steelix.dtsi b/zephyr/program/corsola/keyboard_steelix.dtsi
deleted file mode 100644
index 951389448a..0000000000
--- a/zephyr/program/corsola/keyboard_steelix.dtsi
+++ /dev/null
@@ -1,29 +0,0 @@
-/* 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.
- */
-
-/ {
- cros-keyscan {
- compatible = "cros-ec,keyscan";
-
- debounce-down = <15000>;
- debounce-up = <15000>;
-
- actual-key-mask = <
- 0x1c /* C0 */
- 0xff /* C1 */
- 0xff /* C2 */
- 0xff /* C3 */
- 0xff /* C4 */
- 0xf5 /* C5 */
- 0xff /* C6 */
- 0xa4 /* C7 */
- 0xff /* C8 */
- 0xfe /* C9 */
- 0x55 /* C10 */
- 0xfa /* C11 */
- 0xca /* C12 */
- >;
- };
-};
diff --git a/zephyr/program/corsola/kingler/project.overlay b/zephyr/program/corsola/kingler/project.overlay
index baa3185616..93f06d94e2 100644
--- a/zephyr/program/corsola/kingler/project.overlay
+++ b/zephyr/program/corsola/kingler/project.overlay
@@ -9,13 +9,88 @@
#include "../power_signal.dtsi"
#include "../usba.dtsi"
#include "../npcx_adc.dtsi"
-#include "../battery_kingler.dtsi"
#include "../npcx_host_interface.dtsi"
#include "../npcx_i2c.dtsi"
#include "../npcx_interrupts.dtsi"
#include "../npcx_gpio.dtsi"
#include "../npcx_keyboard.dtsi"
-#include "../led_kingler.dtsi"
#include "../npcx_motionsense.dtsi"
#include "../npcx_usbc.dtsi"
#include "../npcx_default_gpio_pinctrl.dtsi"
+
+/* board override */
+/ {
+ batteries {
+ default_battery: smp_l20m3pg2 {
+ compatible = "smp,l20m3pg2", "battery-smart";
+ };
+ lgc_l20l3pg2 {
+ compatible = "lgc,l20l3pg2", "battery-smart";
+ };
+ };
+
+ pwmleds {
+ compatible = "pwm-leds";
+ pwm_led0: pwm_led_0 {
+ pwms = <&pwm0 0 PWM_HZ(100) PWM_POLARITY_INVERTED
+ &pwm1 0 PWM_HZ(100) PWM_POLARITY_INVERTED
+ &pwm2 0 PWM_HZ(100) PWM_POLARITY_INVERTED>;
+ };
+ };
+
+ cros-pwmleds {
+ compatible = "cros-ec,pwm-leds";
+
+ leds = <&pwm_led0>;
+
+ color-map-red = <100 0 0>;
+ color-map-green = < 0 100 0>;
+ color-map-amber = <100 20 0>;
+
+ brightness-range = <255 255 0 0 0 255>;
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ pwm_led_0@0 {
+ reg = <0>;
+ ec-led-name = "EC_LED_ID_BATTERY_LED";
+ };
+ };
+};
+
+/* Red LED */
+&pwm0_gpc3 {
+ drive-open-drain;
+};
+
+&pwm0 {
+ status = "okay";
+ clock-bus = "NPCX_CLOCK_BUS_LFCLK";
+ pinctrl-0 = <&pwm0_gpc3>;
+ pinctrl-names = "default";
+};
+
+/* Green LED */
+&pwm1_gpc2 {
+ drive-open-drain;
+};
+
+&pwm1 {
+ status = "okay";
+ clock-bus = "NPCX_CLOCK_BUS_LFCLK";
+ pinctrl-0 = <&pwm1_gpc2>;
+ pinctrl-names = "default";
+};
+
+/* Blue LED */
+&pwm2_gpc4 {
+ drive-open-drain;
+};
+
+&pwm2 {
+ status = "okay";
+ clock-bus = "NPCX_CLOCK_BUS_LFCLK";
+ pinctrl-0 = <&pwm2_gpc4>;
+ pinctrl-names = "default";
+};
diff --git a/zephyr/program/corsola/led_kingler.dtsi b/zephyr/program/corsola/led_kingler.dtsi
deleted file mode 100644
index 92f6c4d4fe..0000000000
--- a/zephyr/program/corsola/led_kingler.dtsi
+++ /dev/null
@@ -1,71 +0,0 @@
-/* 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.
- */
-
-/ {
- pwmleds {
- compatible = "pwm-leds";
- pwm_led0: pwm_led_0 {
- pwms = <&pwm0 0 PWM_HZ(100) PWM_POLARITY_INVERTED
- &pwm1 0 PWM_HZ(100) PWM_POLARITY_INVERTED
- &pwm2 0 PWM_HZ(100) PWM_POLARITY_INVERTED>;
- };
- };
-
- cros-pwmleds {
- compatible = "cros-ec,pwm-leds";
-
- leds = <&pwm_led0>;
-
- color-map-red = <100 0 0>;
- color-map-green = < 0 100 0>;
- color-map-amber = <100 20 0>;
-
- brightness-range = <255 255 0 0 0 255>;
-
- #address-cells = <1>;
- #size-cells = <0>;
-
- pwm_led_0@0 {
- reg = <0>;
- ec-led-name = "EC_LED_ID_BATTERY_LED";
- };
- };
-};
-
-/* Red LED */
-&pwm0_gpc3 {
- drive-open-drain;
-};
-
-&pwm0 {
- status = "okay";
- clock-bus = "NPCX_CLOCK_BUS_LFCLK";
- pinctrl-0 = <&pwm0_gpc3>;
- pinctrl-names = "default";
-};
-
-/* Green LED */
-&pwm1_gpc2 {
- drive-open-drain;
-};
-
-&pwm1 {
- status = "okay";
- clock-bus = "NPCX_CLOCK_BUS_LFCLK";
- pinctrl-0 = <&pwm1_gpc2>;
- pinctrl-names = "default";
-};
-
-/* Blue LED */
-&pwm2_gpc4 {
- drive-open-drain;
-};
-
-&pwm2 {
- status = "okay";
- clock-bus = "NPCX_CLOCK_BUS_LFCLK";
- pinctrl-0 = <&pwm2_gpc4>;
- pinctrl-names = "default";
-};
diff --git a/zephyr/program/corsola/led_steelix.dtsi b/zephyr/program/corsola/led_steelix.dtsi
deleted file mode 100644
index 6a25929327..0000000000
--- a/zephyr/program/corsola/led_steelix.dtsi
+++ /dev/null
@@ -1,55 +0,0 @@
-/* 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.
- */
-
-/ {
- pwmleds {
- compatible = "pwm-leds";
- led_battery_red: ec_led1_odl {
- pwms = <&pwm0 0 PWM_HZ(100) PWM_POLARITY_INVERTED>;
- };
- led_battery_green: ec_led2_odl {
- pwms = <&pwm1 0 PWM_HZ(100) PWM_POLARITY_INVERTED>;
- };
- led_power_white: ec_led3_odl {
- pwms = <&pwm4 0 PWM_HZ(100) PWM_POLARITY_INVERTED>;
- };
- };
-};
-
-/* Red LED */
-&pwm0_gpc3 {
- drive-open-drain;
-};
-
-&pwm0 {
- status = "okay";
- clock-bus = "NPCX_CLOCK_BUS_LFCLK";
- pinctrl-0 = <&pwm0_gpc3>;
- pinctrl-names = "default";
-};
-
-/* Green LED */
-&pwm1_gpc2 {
- drive-open-drain;
-};
-
-&pwm1 {
- status = "okay";
- clock-bus = "NPCX_CLOCK_BUS_LFCLK";
- pinctrl-0 = <&pwm1_gpc2>;
- pinctrl-names = "default";
-};
-
-/* White LED */
-&pwm4_gpb6 {
- drive-open-drain;
-};
-
-&pwm4 {
- status = "okay";
- clock-bus = "NPCX_CLOCK_BUS_LFCLK";
- pinctrl-0 = <&pwm4_gpb6>;
- pinctrl-names = "default";
-};
diff --git a/zephyr/program/corsola/motionsense_steelix.dtsi b/zephyr/program/corsola/motionsense_steelix.dtsi
deleted file mode 100644
index df96fc2e42..0000000000
--- a/zephyr/program/corsola/motionsense_steelix.dtsi
+++ /dev/null
@@ -1,133 +0,0 @@
-/* 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>
-
-/* inherit the rot_ref from Kingler and overwrite it */
-&lid_rot_ref {
- mat33 = <0 1 0
- 1 0 0
- 0 0 (-1)>;
-};
-
-&base_rot_ref {
- mat33 = <1 0 0
- 0 (-1) 0
- 0 0 (-1)>;
-};
-
-/ {
- aliases {
- /*
- * motion sense's <>_INT_EVENT is handled
- * by alias. Using the alias, each driver creates
- * its own <>_INT_EVENT.
- */
- lsm6dsm-int = &base_accel;
- };
-
- /* Rotation matrix used by drivers. */
- motionsense-rotation-ref {
- compatible = "cros-ec,motionsense-rotation-ref";
- base_rot_ref_lsm6dsm: base-rotation-ref-lsm6dsm {
- 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 {
- lis2dw12_data: lis2dw12-drv-data {
- compatible = "cros-ec,drvdata-lis2dw12";
- status = "okay";
- };
- lsm6dsm_data_accel: lsm6dsm-accel-drv-data {
- compatible = "cros-ec,drvdata-lsm6dsm";
- status = "okay";
- };
- lsm6dsm_data_gyro: lsm6dsm-gyro-drv-data {
- compatible = "cros-ec,drvdata-lsm6dsm";
- status = "okay";
- };
- };
-
- motionsense-sensor-alt {
- alt_lid_accel: alt-lid-accel {
- compatible = "cros-ec,lis2dw12";
- 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 = <&lis2dw12_data>;
- i2c-spi-addr-flags = "LIS2DWL_ADDR0_FLAGS";
- alternate-for = <&lid_accel>;
- alternate-ssfc-indicator = <&lid_sensor_1>;
- configs {
- compatible =
- "cros-ec,motionsense-sensor-config";
- ec-s0 {
- odr = <(12500 | ROUND_UP_FLAG)>;
- };
- ec-s3 {
- odr = <(12500 | ROUND_UP_FLAG)>;
- };
- };
- };
-
- alt_base_accel: alt-base-accel {
- compatible = "cros-ec,lsm6dsm-accel";
- status = "okay";
-
- active-mask = "SENSOR_ACTIVE_S0_S3";
- location = "MOTIONSENSE_LOC_BASE";
- mutex = <&base_mutex>;
- port = <&i2c_sensor>;
- rot-standard-ref = <&base_rot_ref_lsm6dsm>;
- drv-data = <&lsm6dsm_data_accel>;
- alternate-for = <&base_accel>;
- alternate-ssfc-indicator = <&base_sensor_1>;
- configs {
- compatible =
- "cros-ec,motionsense-sensor-config";
- ec-s0 {
- odr = <(12500 | ROUND_UP_FLAG)>;
- ec-rate = <(100 * USEC_PER_MSEC)>;
- };
- ec-s3 {
- odr = <(12500 | ROUND_UP_FLAG)>;
- ec-rate = <0>;
- };
- };
- };
-
- alt_base_gyro: alt-base-gyro {
- compatible = "cros-ec,lsm6dsm-gyro";
- status = "okay";
-
- active-mask = "SENSOR_ACTIVE_S0_S3";
- location = "MOTIONSENSE_LOC_BASE";
- mutex = <&base_mutex>;
- port = <&i2c_sensor>;
- rot-standard-ref = <&base_rot_ref_lsm6dsm>;
- default-range = <(1000 | ROUND_UP_FLAG)>; /* dps */
- drv-data = <&lsm6dsm_data_gyro>;
- alternate-for = <&base_gyro>;
- alternate-ssfc-indicator = <&base_sensor_1>;
- };
- };
-};
diff --git a/zephyr/program/corsola/cbi_steelix.dtsi b/zephyr/program/corsola/steelix/cbi.dtsi
index 6636b53a96..6636b53a96 100644
--- a/zephyr/program/corsola/cbi_steelix.dtsi
+++ b/zephyr/program/corsola/steelix/cbi.dtsi
diff --git a/zephyr/program/corsola/interrupts_steelix.dtsi b/zephyr/program/corsola/steelix/interrupts.dtsi
index 816beb95f4..b212cd9496 100644
--- a/zephyr/program/corsola/interrupts_steelix.dtsi
+++ b/zephyr/program/corsola/steelix/interrupts.dtsi
@@ -3,8 +3,10 @@
* found in the LICENSE file.
*/
+ /* This file should only be included in the project.overlay. */
&int_base_imu {
irq-pin = <&base_imu_int_l>;
flags = <GPIO_INT_EDGE_FALLING>;
handler = "motion_interrupt";
};
+
diff --git a/zephyr/program/corsola/steelix/project.overlay b/zephyr/program/corsola/steelix/project.overlay
index 3feea490be..f850a51563 100644
--- a/zephyr/program/corsola/steelix/project.overlay
+++ b/zephyr/program/corsola/steelix/project.overlay
@@ -9,18 +9,290 @@
#include "../power_signal.dtsi"
#include "../usba.dtsi"
#include "../npcx_adc.dtsi"
-#include "../battery_steelix.dtsi"
+#include "../npcx_gpio.dtsi"
#include "../npcx_host_interface.dtsi"
#include "../npcx_i2c.dtsi"
#include "../npcx_interrupts.dtsi"
-#include "../interrupts_steelix.dtsi"
-#include "../cbi_steelix.dtsi"
-#include "../gpio_steelix.dtsi"
#include "../npcx_keyboard.dtsi"
-#include "../keyboard_steelix.dtsi"
-#include "../led_steelix.dtsi"
#include "../npcx_motionsense.dtsi"
-#include "../motionsense_steelix.dtsi"
-#include "../usba_steelix.dtsi"
#include "../npcx_usbc.dtsi"
#include "../npcx_default_gpio_pinctrl.dtsi"
+
+/* Projrect level DTS shared with tests */
+#include "./cbi.dtsi"
+#include "./interrupts.dtsi"
+
+/* board override */
+/ {
+ aliases {
+ /*
+ * motion sense's <>_INT_EVENT is handled
+ * by alias. Using the alias, each driver creates
+ * its own <>_INT_EVENT.
+ */
+ lsm6dsm-int = &base_accel;
+ };
+
+ named-gpios {
+ en_pp5000_usb_a1_vbus: en_pp5000_usb_a1_vbus_x {
+ gpios = <&gpiof 5 GPIO_OUTPUT_LOW>;
+ };
+ usb_a1_fault_odl {
+ gpios = <&gpiof 4 GPIO_INPUT>;
+ };
+ };
+
+ batteries {
+ default_battery: byd_l22b3pg0 {
+ compatible = "byd,l22b3pg0", "battery-smart";
+ };
+ celxpert_l22c3pg0 {
+ compatible = "celxpert,l22c3pg0", "battery-smart";
+ };
+ cosmx_l22x3pg0 {
+ compatible = "cosmx,l22x3pg0", "battery-smart";
+ };
+ smp_l22m3pg0 {
+ compatible = "smp,l22m3pg0", "battery-smart";
+ };
+ sunwoda_l22d3pg0 {
+ compatible = "sunwoda,l22d3pg0", "battery-smart";
+ };
+ };
+
+
+ /* Steelix-specific ssfc fields. */
+ steelix-ssfc {
+ compatible = "cros-ec,cbi-ssfc";
+
+ /* SSFC field to identify BASE motion sensor. */
+ base-sensor {
+ enum-name = "BASE_SENSOR";
+ size = <3>;
+
+ base_sensor_0: bmi323 {
+ compatible = "cros-ec,cbi-ssfc-value";
+ status = "okay";
+ value = <1>;
+ default;
+ };
+ base_sensor_1: lsm6dsm {
+ compatible = "cros-ec,cbi-ssfc-value";
+ status = "okay";
+ value = <2>;
+ };
+ };
+
+ /* SSFC field to identify LID motion sensor. */
+ lid-sensor {
+ enum-name = "LID_SENSOR";
+ size = <3>;
+
+ lid_sensor_0: bma422 {
+ compatible = "cros-ec,cbi-ssfc-value";
+ status = "okay";
+ value = <1>;
+ default;
+ };
+ lid_sensor_1: lis2dw12 {
+ compatible = "cros-ec,cbi-ssfc-value";
+ status = "okay";
+ value = <2>;
+ };
+ };
+ };
+
+ /* Rotation matrix used by drivers. */
+ motionsense-rotation-ref {
+ compatible = "cros-ec,motionsense-rotation-ref";
+ base_rot_ref_lsm6dsm: base-rotation-ref-lsm6dsm {
+ 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 {
+ lis2dw12_data: lis2dw12-drv-data {
+ compatible = "cros-ec,drvdata-lis2dw12";
+ status = "okay";
+ };
+ lsm6dsm_data_accel: lsm6dsm-accel-drv-data {
+ compatible = "cros-ec,drvdata-lsm6dsm";
+ status = "okay";
+ };
+ lsm6dsm_data_gyro: lsm6dsm-gyro-drv-data {
+ compatible = "cros-ec,drvdata-lsm6dsm";
+ status = "okay";
+ };
+ };
+
+ motionsense-sensor-alt {
+ alt_lid_accel: alt-lid-accel {
+ compatible = "cros-ec,lis2dw12";
+ 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 = <&lis2dw12_data>;
+ i2c-spi-addr-flags = "LIS2DWL_ADDR0_FLAGS";
+ alternate-for = <&lid_accel>;
+ alternate-ssfc-indicator = <&lid_sensor_1>;
+ configs {
+ compatible =
+ "cros-ec,motionsense-sensor-config";
+ ec-s0 {
+ odr = <(12500 | ROUND_UP_FLAG)>;
+ };
+ ec-s3 {
+ odr = <(12500 | ROUND_UP_FLAG)>;
+ };
+ };
+ };
+
+ alt_base_accel: alt-base-accel {
+ compatible = "cros-ec,lsm6dsm-accel";
+ status = "okay";
+
+ active-mask = "SENSOR_ACTIVE_S0_S3";
+ location = "MOTIONSENSE_LOC_BASE";
+ mutex = <&base_mutex>;
+ port = <&i2c_sensor>;
+ rot-standard-ref = <&base_rot_ref_lsm6dsm>;
+ drv-data = <&lsm6dsm_data_accel>;
+ alternate-for = <&base_accel>;
+ alternate-ssfc-indicator = <&base_sensor_1>;
+ configs {
+ compatible =
+ "cros-ec,motionsense-sensor-config";
+ ec-s0 {
+ odr = <(12500 | ROUND_UP_FLAG)>;
+ ec-rate = <(100 * USEC_PER_MSEC)>;
+ };
+ ec-s3 {
+ odr = <(12500 | ROUND_UP_FLAG)>;
+ ec-rate = <0>;
+ };
+ };
+ };
+
+ alt_base_gyro: alt-base-gyro {
+ compatible = "cros-ec,lsm6dsm-gyro";
+ status = "okay";
+
+ active-mask = "SENSOR_ACTIVE_S0_S3";
+ location = "MOTIONSENSE_LOC_BASE";
+ mutex = <&base_mutex>;
+ port = <&i2c_sensor>;
+ rot-standard-ref = <&base_rot_ref_lsm6dsm>;
+ default-range = <(1000 | ROUND_UP_FLAG)>; /* dps */
+ drv-data = <&lsm6dsm_data_gyro>;
+ alternate-for = <&base_gyro>;
+ alternate-ssfc-indicator = <&base_sensor_1>;
+ };
+ };
+
+ cros-keyscan {
+ compatible = "cros-ec,keyscan";
+
+ debounce-down = <15000>;
+ debounce-up = <15000>;
+
+ actual-key-mask = <
+ 0x1c /* C0 */
+ 0xff /* C1 */
+ 0xff /* C2 */
+ 0xff /* C3 */
+ 0xff /* C4 */
+ 0xf5 /* C5 */
+ 0xff /* C6 */
+ 0xa4 /* C7 */
+ 0xff /* C8 */
+ 0xfe /* C9 */
+ 0x55 /* C10 */
+ 0xfa /* C11 */
+ 0xca /* C12 */
+ >;
+ };
+
+ pwmleds {
+ compatible = "pwm-leds";
+ led_battery_red: ec_led1_odl {
+ pwms = <&pwm0 0 PWM_HZ(100) PWM_POLARITY_INVERTED>;
+ };
+ led_battery_green: ec_led2_odl {
+ pwms = <&pwm1 0 PWM_HZ(100) PWM_POLARITY_INVERTED>;
+ };
+ led_power_white: ec_led3_odl {
+ pwms = <&pwm4 0 PWM_HZ(100) PWM_POLARITY_INVERTED>;
+ };
+ };
+};
+
+/* Red LED */
+&pwm0_gpc3 {
+ drive-open-drain;
+};
+
+&pwm0 {
+ status = "okay";
+ clock-bus = "NPCX_CLOCK_BUS_LFCLK";
+ pinctrl-0 = <&pwm0_gpc3>;
+ pinctrl-names = "default";
+};
+
+/* Green LED */
+&pwm1_gpc2 {
+ drive-open-drain;
+};
+
+&pwm1 {
+ status = "okay";
+ clock-bus = "NPCX_CLOCK_BUS_LFCLK";
+ pinctrl-0 = <&pwm1_gpc2>;
+ pinctrl-names = "default";
+};
+
+/* White LED */
+&pwm4_gpb6 {
+ drive-open-drain;
+};
+
+&pwm4 {
+ status = "okay";
+ clock-bus = "NPCX_CLOCK_BUS_LFCLK";
+ pinctrl-0 = <&pwm4_gpb6>;
+ pinctrl-names = "default";
+};
+
+/* inherit the rot_ref from Kingler and overwrite it */
+&lid_rot_ref {
+ mat33 = <0 1 0
+ 1 0 0
+ 0 0 (-1)>;
+};
+
+&base_rot_ref {
+ mat33 = <1 0 0
+ 0 (-1) 0
+ 0 0 (-1)>;
+};
+
+/* steelix usba port enable config */
+&usba_port_enable_list {
+ enable-pins = <&en_pp5000_usb_a0_vbus
+ &en_pp5000_usb_a1_vbus>;
+};
diff --git a/zephyr/program/corsola/usba_steelix.dtsi b/zephyr/program/corsola/usba_steelix.dtsi
deleted file mode 100644
index 0ddd67f664..0000000000
--- a/zephyr/program/corsola/usba_steelix.dtsi
+++ /dev/null
@@ -1,10 +0,0 @@
-/* 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.
- */
-
-/* steelix usba port enable config */
-&usba_port_enable_list {
- enable-pins = <&en_pp5000_usb_a0_vbus
- &en_pp5000_usb_a1_vbus>;
-};