summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTing Shen <phoenixshen@google.com>2022-12-15 15:38:07 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-12-15 09:07:45 +0000
commit3f560db8974b16907b4a3fb3755d98f75276ff67 (patch)
treee6b52b0eecf0721a09eba1d66ed978d40cd6adbf
parent358ebcc1f7e32ed3aa6b1c1b39c8cba1fe065ba2 (diff)
downloadchrome-ec-3f560db8974b16907b4a3fb3755d98f75276ff67.tar.gz
zephyr: reorganize dts files in krabby test
The DTC_OVERLAY_FILE line in testcase.yaml is too long now. Migrate to the latest project.overlay style to manage the dts files better. BUG=none TEST=twister -v -i --coverage -p native_posix -p unit_testing \ -T zephyr/test/krabby BRANCH=none Change-Id: Idb5332f84690f8c46bc23b7715b625f247e62d95 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4109550 Tested-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@google.com> Auto-Submit: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Eric Yilun Lin <yllin@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
-rw-r--r--zephyr/test/krabby/adc_temp.dts23
-rw-r--r--zephyr/test/krabby/common.dtsi (renamed from zephyr/test/krabby/common.dts)0
-rw-r--r--zephyr/test/krabby/krabby.default.overlay13
-rw-r--r--zephyr/test/krabby/krabby.tentacruel.overlay (renamed from zephyr/test/krabby/cbi_sensor.dts)55
-rw-r--r--zephyr/test/krabby/pinctrl.dts40
-rw-r--r--zephyr/test/krabby/testcase.yaml4
6 files changed, 70 insertions, 65 deletions
diff --git a/zephyr/test/krabby/adc_temp.dts b/zephyr/test/krabby/adc_temp.dts
deleted file mode 100644
index c0d17cca13..0000000000
--- a/zephyr/test/krabby/adc_temp.dts
+++ /dev/null
@@ -1,23 +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 <cros/thermistor/thermistor.dtsi>
-
-/ {
- name_temp_charger: charger {
- compatible = "cros-ec,temp-sensor-thermistor";
-
- thermistor = <&thermistor_rt9490>;
- adc = <&adc_charger>;
- };
-
- named-temp-sensors {
- compatible = "cros-ec,temp-sensors";
- temp_charger: charger {
- status = "okay";
- sensor = <&name_temp_charger>;
- };
- };
-};
diff --git a/zephyr/test/krabby/common.dts b/zephyr/test/krabby/common.dtsi
index 9e94392561..9e94392561 100644
--- a/zephyr/test/krabby/common.dts
+++ b/zephyr/test/krabby/common.dtsi
diff --git a/zephyr/test/krabby/krabby.default.overlay b/zephyr/test/krabby/krabby.default.overlay
new file mode 100644
index 0000000000..1e88870327
--- /dev/null
+++ b/zephyr/test/krabby/krabby.default.overlay
@@ -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.
+ */
+
+#include "common.dtsi"
+#include "../program/corsola/ite_gpio.dtsi"
+#include "../program/corsola/ite_interrupts.dtsi"
+
+/* remove pinctrl to avoid pull in too many unwanted dependency */
+/delete-node/ &pinctrl;
+
+/delete-node/ &{/hibernate-wake-pins};
diff --git a/zephyr/test/krabby/cbi_sensor.dts b/zephyr/test/krabby/krabby.tentacruel.overlay
index 46e6ccf9ca..553c19fb69 100644
--- a/zephyr/test/krabby/cbi_sensor.dts
+++ b/zephyr/test/krabby/krabby.tentacruel.overlay
@@ -3,8 +3,59 @@
* found in the LICENSE file.
*/
+#include "common.dtsi"
+#include "../program/corsola/ite_gpio.dtsi"
+#include "../program/corsola/ite_interrupts.dtsi"
+#include "../program/corsola/ite_motionsense.dtsi"
+#include "../program/corsola/tentacruel/cbi.dtsi"
+#include "../program/corsola/tentacruel/thermistor.dtsi"
+
+/* remove pinctrl to avoid pull in too many unwanted dependency */
+/delete-node/ &pinctrl;
+
+/delete-node/ &{/hibernate-wake-pins};
/ {
+ name_temp_charger: charger {
+ compatible = "cros-ec,temp-sensor-thermistor";
+
+ thermistor = <&thermistor_rt9490>;
+ adc = <&adc_charger>;
+ };
+
+ named-temp-sensors {
+ compatible = "cros-ec,temp-sensors";
+ temp_charger: charger {
+ status = "okay";
+ sensor = <&name_temp_charger>;
+ };
+ };
+
+ named-gpios {
+ /delete-node/ usb_c0_ppc_bc12_int_odl;
+
+ usb_c0_ppc_int_odl: usb_c0_ppc_int_odl {
+ gpios = <&gpiod 1 GPIO_INPUT>;
+ enum-name = "GPIO_USB_C0_PPC_INT_ODL";
+ };
+
+ usb_c0_bc12_int_odl: usb_c0_bc12_int_odl {
+ gpios = <&gpiof 1 GPIO_INPUT>;
+ enum-name = "GPIO_USB_C0_BC12_INT_ODL";
+ };
+
+ /delete-node/ usb_c0_ppc_frsinfo;
+
+ usb_c0_frs_en: usb_c0_frs_en {
+ gpios = <&gpiof 0 GPIO_OUTPUT_LOW>;
+ enum-name = "GPIO_USB_C0_FRS_EN";
+ };
+ };
+
+ gpio-interrupts {
+ /delete-node/ usb_c0_ppc_bc12;
+ };
+
aliases {
/*
* motion sense's <>_INT_EVENT is handled
@@ -14,6 +65,7 @@
bmi3xx-int = &base_accel;
bma4xx-int = &lid_accel;
};
+
named-i2c-ports {
compatible = "named-i2c-ports";
@@ -26,6 +78,7 @@
enum-names = "I2C_PORT_EEPROM";
};
};
+
gpio-interrupts {
int_base_imu: base_imu {
handler = "base_sensor_interrupt";
@@ -35,6 +88,7 @@
handler = "lid_sensor_interrupt";
};
};
+
/*
* change all underlying sensor drivers to bmi260 to have a easier way
* to mock interrupt handlers.
@@ -50,6 +104,7 @@
status = "okay";
};
};
+
motionsense-sensor-alt {
alt_lid_accel: alt-lid-accel {
compatible = "cros-ec,bmi260-accel";
diff --git a/zephyr/test/krabby/pinctrl.dts b/zephyr/test/krabby/pinctrl.dts
deleted file mode 100644
index 7a5ed4feb0..0000000000
--- a/zephyr/test/krabby/pinctrl.dts
+++ /dev/null
@@ -1,40 +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.
- */
-
-/* remove pinctrl to avoid pull in too many unwanted dependency */
-/delete-node/ &pinctrl;
-
-/delete-node/ &{/hibernate-wake-pins};
-
-/ {
- named-gpios {
- /delete-node/ usb_c0_ppc_bc12_int_odl;
-
- usb_c0_ppc_int_odl: usb_c0_ppc_int_odl {
- gpios = <&gpiod 1 GPIO_INPUT>;
- enum-name = "GPIO_USB_C0_PPC_INT_ODL";
- };
-
- usb_c0_bc12_int_odl: usb_c0_bc12_int_odl {
- gpios = <&gpiof 1 GPIO_INPUT>;
- enum-name = "GPIO_USB_C0_BC12_INT_ODL";
- };
-
- /delete-node/ usb_c0_ppc_frsinfo;
-
- usb_c0_frs_en: usb_c0_frs_en {
- gpios = <&gpiof 0 GPIO_OUTPUT_LOW>;
- enum-name = "GPIO_USB_C0_FRS_EN";
- };
- };
-
- gpio-interrupts {
- int_base_imu: base_imu {
- handler = "motion_interrupt";
- };
-
- /delete-node/ usb_c0_ppc_bc12;
- };
-};
diff --git a/zephyr/test/krabby/testcase.yaml b/zephyr/test/krabby/testcase.yaml
index 0994091c5a..3a8c0770e1 100644
--- a/zephyr/test/krabby/testcase.yaml
+++ b/zephyr/test/krabby/testcase.yaml
@@ -6,12 +6,12 @@ common:
platform_allow: native_posix
tests:
krabby.default:
- extra_args: DTC_OVERLAY_FILE="common.dts;../program/corsola/ite_interrupts.dtsi;../program/corsola/ite_gpio.dtsi;pinctrl.dts"
+ extra_args: DTC_OVERLAY_FILE="krabby.default.overlay"
extra_configs:
- CONFIG_TEST_KRABBY=y
- CONFIG_MUX_INIT_ADC=y
krabby.tentacruel:
- extra_args: DTC_OVERLAY_FILE="common.dts;adc_temp.dts;../program/corsola/ite_interrupts.dtsi;../program/corsola/ite_gpio.dtsi;../program/corsola/tentacruel/thermistor.dtsi;pinctrl.dts;../program/corsola/ite_motionsense.dtsi;../program/corsola/tentacruel/cbi.dtsi;cbi_sensor.dts""
+ extra_args: DTC_OVERLAY_FILE="krabby.tentacruel.overlay"
extra_configs:
- CONFIG_TEST_TENTACRUEL=y
- CONFIG_PLATFORM_EC_CHARGER_PROFILE_OVERRIDE=y