diff options
author | Abe Levkoy <alevkoy@chromium.org> | 2022-07-28 10:44:56 -0600 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-07-28 19:06:59 +0000 |
commit | 05526f8b35b439935486c7484eedd32e506531a5 (patch) | |
tree | 3a78f253b9d370b761c6aab2b8b28d7ea3dcf6d8 /zephyr/test/ap_power/boards | |
parent | a211a65b42bea72228e9b37e893f50c642ffd04e (diff) | |
download | chrome-ec-05526f8b35b439935486c7484eedd32e506531a5.tar.gz |
zephyr: tests: Migrate ap_power test to twister
Add a testcase.yaml and standardize DTS overlay.
BUG=b:240343495
TEST=zmake test test-ap_power; ./twister -T zephyr/test/ap_power
BRANCH=none
Signed-off-by: Abe Levkoy <alevkoy@chromium.org>
Change-Id: Ia4d8954108f612a820fe7b2814146e9decae2573
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3792304
Commit-Queue: Tristan Honscheid <honscheid@google.com>
Reviewed-by: Tristan Honscheid <honscheid@google.com>
Diffstat (limited to 'zephyr/test/ap_power/boards')
-rw-r--r-- | zephyr/test/ap_power/boards/native_posix.overlay | 197 |
1 files changed, 197 insertions, 0 deletions
diff --git a/zephyr/test/ap_power/boards/native_posix.overlay b/zephyr/test/ap_power/boards/native_posix.overlay new file mode 100644 index 0000000000..76a45a1f6b --- /dev/null +++ b/zephyr/test/ap_power/boards/native_posix.overlay @@ -0,0 +1,197 @@ +/* Copyright 2022 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#include <board-overlays/native_posix.dts> +#include <cros/binman.dtsi> +#include <dt-bindings/gpio_defines.h> +#include <freq.h> + +/ { + chosen { + cros-ec,espi = &espi0; + intel-ap-pwrseq,espi = &espi0; + }; + + /* + * Keep these GPIOs in pin order. + * If you need to add one, make sure you increase + * ngpios in the gpio0 node further down. + */ + named-gpios { + compatible = "named-gpios"; + + gpio_ec_pwr_btn_odl: ec_pwr_btn_odl { + /* GPIO_PULL_UP will cause this start asserted, + * i.e. not pressed. + */ + gpios = <&gpio0 1 (GPIO_INPUT | GPIO_PULL_UP)>; + enum-name = "GPIO_POWER_BUTTON_L"; + }; + gpio_pch_pwrbtn_l: pch_pwrbtn_l { + gpios = <&gpio0 2 GPIO_OUTPUT>; + enum-name = "GPIO_PCH_PWRBTN_L"; + }; + gpio_ec_pch_wake_odl: ec_pch_wake_odl { + gpios = <&gpio0 3 GPIO_OUTPUT_HIGH>; + }; + gpio_lid_open_ec: lid_open_ec { + /* GPIO_PULL_UP will cause this start asserted. */ + gpios = <&gpio0 4 (GPIO_INPUT | GPIO_PULL_UP)>; + enum-name = "GPIO_LID_OPEN"; + }; + }; + gpio-interrupts { + compatible = "cros-ec,gpio-interrupts"; + + int_lid_open_ec: lid_open_ec { + irq-pin = <&gpio_lid_open_ec>; + flags = <GPIO_INT_EDGE_BOTH>; + handler = "lid_interrupt"; + }; + }; + + common-pwrseq { + compatible = "intel,ap-pwrseq"; + }; + + pwr-en-pp5000-s5 { + compatible = "intel,ap-pwrseq-gpio"; + dbg-label = "PP5000_S5 enable output to regulator"; + enum-name = "PWR_EN_PP5000_A"; + gpios = <&gpio0 10 0>; + output; + }; + pwr-en-pp3300-s5 { + compatible = "intel,ap-pwrseq-gpio"; + dbg-label = "PP3300_S5 enable output to LS"; + enum-name = "PWR_EN_PP3300_A"; + gpios = <&gpio0 11 0>; + output; + }; + pwr-pg-ec-rsmrst-odl { + compatible = "intel,ap-pwrseq-gpio"; + dbg-label = "RSMRST power good from regulator"; + enum-name = "PWR_RSMRST"; + gpios = <&gpio0 12 0>; + interrupt-flags = <GPIO_INT_EDGE_BOTH>; + }; + pwr-ec-pch-rsmrst-odl { + compatible = "intel,ap-pwrseq-gpio"; + dbg-label = "RSMRST output to PCH"; + enum-name = "PWR_EC_PCH_RSMRST"; + gpios = <&gpio0 13 0>; + output; + }; + pwr-slp-s0-l { + compatible = "intel,ap-pwrseq-gpio"; + dbg-label = "SLP_S0_L input from PCH"; + enum-name = "PWR_SLP_S0"; + gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; + interrupt-flags = <GPIO_INT_EDGE_BOTH>; + no-enable; + }; + pwr-slp-s3-l { + compatible = "intel,ap-pwrseq-gpio"; + dbg-label = "SLP_S3_L input from PCH"; + enum-name = "PWR_SLP_S3"; + gpios = <&gpio0 15 GPIO_ACTIVE_LOW>; + interrupt-flags = <GPIO_INT_EDGE_BOTH>; + }; + pwr-slp-sus-l { + compatible = "intel,ap-pwrseq-gpio"; + dbg-label = "SLP_SUS_L input from PCH"; + enum-name = "PWR_SLP_SUS"; + gpios = <&gpio0 16 GPIO_ACTIVE_LOW>; + interrupt-flags = <GPIO_INT_EDGE_BOTH>; + }; + pwr-ec-soc-dsw-pwrok { + compatible = "intel,ap-pwrseq-gpio"; + dbg-label = "DSW_PWROK output to PCH"; + enum-name = "PWR_EC_SOC_DSW_PWROK"; + gpios = <&gpio0 17 0>; + output; + }; + pwr-vccst-pwrgd-od { + compatible = "intel,ap-pwrseq-gpio"; + dbg-label = "VCCST_PWRGD output to PCH"; + enum-name = "PWR_VCCST_PWRGD"; + gpios = <&gpio0 18 0>; + output; + }; + pwr-imvp9-vrrdy-od { + compatible = "intel,ap-pwrseq-gpio"; + dbg-label = "VRRDY input from IMVP9"; + enum-name = "PWR_IMVP9_VRRDY"; + gpios = <&gpio0 19 0>; + }; + pwr-pch-pwrok { + compatible = "intel,ap-pwrseq-gpio"; + dbg-label = "PCH_PWROK output to PCH"; + enum-name = "PWR_PCH_PWROK"; + gpios = <&gpio0 20 0>; + output; + }; + pwr-ec-pch-sys-pwrok { + compatible = "intel,ap-pwrseq-gpio"; + dbg-label = "SYS_PWROK output to PCH"; + enum-name = "PWR_EC_PCH_SYS_PWROK"; + gpios = <&gpio0 21 0>; + output; + }; + pwr-sys-rst-l { + compatible = "intel,ap-pwrseq-gpio"; + dbg-label = "SYS_RESET# output to PCH"; + enum-name = "PWR_SYS_RST"; + gpios = <&gpio0 22 GPIO_ACTIVE_LOW>; + output; + }; + pwr-slp-s4 { + compatible = "intel,ap-pwrseq-vw"; + dbg-label = "SLP_S4 virtual wire input from PCH"; + enum-name = "PWR_SLP_S4"; + virtual-wire = "ESPI_VWIRE_SIGNAL_SLP_S4"; + vw-invert; + }; + pwr-slp-s5 { + compatible = "intel,ap-pwrseq-vw"; + dbg-label = "SLP_S5 virtual wire input from PCH"; + enum-name = "PWR_SLP_S5"; + virtual-wire = "ESPI_VWIRE_SIGNAL_SLP_S5"; + vw-invert; + }; + pwr-all-sys-pwrgd { + compatible = "intel,ap-pwrseq-external"; + dbg-label = "Combined all power good"; + enum-name = "PWR_ALL_SYS_PWRGD"; + }; + pwr-pp3300-pwrok { + compatible = "intel,ap-pwrseq-external"; + dbg-label = "PP3300 PWROK"; + enum-name = "PWR_DSW_PWROK"; + }; + pwr-pp1p05-pwrok { + compatible = "intel,ap-pwrseq-external"; + dbg-label = "PP1P05 PWROK"; + enum-name = "PWR_PG_PP1P05"; + }; + + clock: clock { + compatible = "cros,clock-control-emul"; + clock-frequency = <DT_FREQ_M(100)>; /* 100 MHz */ + }; +}; + +&espi0 { + espi-host@0 { + status = "okay"; + compatible = "zephyr,espi-emul-espi-host"; + reg = <0x0>; + label = "ESPI_HOST"; + }; +}; + +&gpio0 { + ngpios = <23>; +}; |