summaryrefslogtreecommitdiff
path: root/zephyr/test/skyrim
diff options
context:
space:
mode:
Diffstat (limited to 'zephyr/test/skyrim')
-rw-r--r--zephyr/test/skyrim/CMakeLists.txt8
-rw-r--r--zephyr/test/skyrim/Kconfig38
-rw-r--r--zephyr/test/skyrim/boards/native_posix.overlay73
-rw-r--r--zephyr/test/skyrim/prj.conf2
-rw-r--r--zephyr/test/skyrim/src/common.c7
-rw-r--r--zephyr/test/skyrim/src/common/alt_charger.c55
-rw-r--r--zephyr/test/skyrim/src/common/fan.c92
-rw-r--r--zephyr/test/skyrim/src/common/ppc_config.c58
-rw-r--r--zephyr/test/skyrim/src/crystaldrift/common.c3
-rw-r--r--zephyr/test/skyrim/src/frostflow/usb_mux_config.c60
-rw-r--r--zephyr/test/skyrim/src/markarth/common.c3
-rw-r--r--zephyr/test/skyrim/src/winterhold/ppc_config.c38
-rw-r--r--zephyr/test/skyrim/testcase.yaml57
13 files changed, 492 insertions, 2 deletions
diff --git a/zephyr/test/skyrim/CMakeLists.txt b/zephyr/test/skyrim/CMakeLists.txt
index 8fbcc78432..72f995d0c0 100644
--- a/zephyr/test/skyrim/CMakeLists.txt
+++ b/zephyr/test/skyrim/CMakeLists.txt
@@ -10,6 +10,10 @@ zephyr_include_directories("${PLATFORM_EC_PROGRAM_DIR}/skyrim/include")
add_subdirectory(${PLATFORM_EC}/zephyr/test/test_utils test_utils)
-target_sources(app PRIVATE src/${CONFIG_TEST_BOARD_NAME}/common.c)
+target_sources(app PRIVATE src/common.c src/${CONFIG_TEST_BOARD_NAME}/common.c)
-target_sources_ifdef(CONFIG_TEST_BOARD_USB_PD_POLICY app PRIVATE src/baseboard/usb_pd_policy.c ${PLATFORM_EC_PROGRAM_DIR}/skyrim/src/usb_pd_policy.c) \ No newline at end of file
+target_sources_ifdef(CONFIG_TEST_BOARD_ALT_CHARGER app PRIVATE src/${CONFIG_TEST_BOARD_ALT_CHARGER_SRC} ${PLATFORM_EC_PROGRAM_DIR}/skyrim/${CONFIG_TEST_BOARD_NAME}/src/alt_charger.c)
+target_sources_ifdef(CONFIG_TEST_BOARD_FAN app PRIVATE src/${CONFIG_TEST_BOARD_FAN_SRC} ${PLATFORM_EC_PROGRAM_DIR}/skyrim/${CONFIG_TEST_BOARD_NAME}/src/fan.c)
+target_sources_ifdef(CONFIG_TEST_BOARD_PPC_CONFIG app PRIVATE src/${CONFIG_TEST_BOARD_PPC_CONFIG_SRC} ${PLATFORM_EC_PROGRAM_DIR}/skyrim/${CONFIG_TEST_BOARD_NAME}/src/ppc_config.c)
+target_sources_ifdef(CONFIG_TEST_BOARD_USB_PD_POLICY app PRIVATE src/baseboard/usb_pd_policy.c ${PLATFORM_EC_PROGRAM_DIR}/skyrim/src/usb_pd_policy.c)
+target_sources_ifdef(CONFIG_TEST_BOARD_USB_MUX_CONFIG app PRIVATE src/${TEST_BOARD_USB_MUX_CONFIG_SRC} ${PLATFORM_EC_PROGRAM_DIR}/skyrim/${CONFIG_TEST_BOARD_NAME}/src/usb_mux_config.c)
diff --git a/zephyr/test/skyrim/Kconfig b/zephyr/test/skyrim/Kconfig
index 41685834be..99013c0f6f 100644
--- a/zephyr/test/skyrim/Kconfig
+++ b/zephyr/test/skyrim/Kconfig
@@ -48,11 +48,49 @@ config TEST_BOARD_NAME
default "skyrim" if TEST_BOARD_SKYRIM
default "winterhold" if TEST_BOARD_WINTERHOLD
+config TEST_BOARD_ALT_CHARGER
+ bool "Enable alt charger specific tests"
+
+config TEST_BOARD_ALT_CHARGER_SRC
+ string "Source file to use for this test"
+ default "common/alt_charger.c"
+ depends on TEST_BOARD_ALT_CHARGER
+
+config TEST_BOARD_FAN
+ bool "Enable fan tests"
+
+config TEST_BOARD_FAN_SRC
+ string "Source file to use for this test"
+ default "common/fan.c"
+ depends on TEST_BOARD_FAN
+
config TEST_BOARD_USB_PD_POLICY
bool "Enable USB PD policy specific tests"
select TEST_ENABLE_USB_PD_HOST_CMD
default n
+config TEST_BOARD_PPC_CONFIG
+ bool "Enable PPC config tests"
+ default n
+
+config TEST_BOARD_PPC_CONFIG_SRC
+ string "Source file to use for this test"
+ default "common/ppc_config.c"
+ depends on TEST_BOARD_PPC
+
+config TEST_BOARD_USB_MUX_CONFIG
+ bool "Enable USB mux config tests"
+ default n
+
+config TEST_BOARD_USB_MUX_CONFIG_SRC
+ string "Source file to use for this test"
+ default "common/usb_mux_config.c"
+ depends on TEST_BOARD_USB_MUX_CONFIG
+
+config SKYRIM_LOG_LEVEL
+ int "Fake config to allow building"
+ default 4 # Log level debug by default
+
config TEST_ENABLE_USB_PD_HOST_CMD
bool "Fake config to enable this feature"
default n
diff --git a/zephyr/test/skyrim/boards/native_posix.overlay b/zephyr/test/skyrim/boards/native_posix.overlay
index 7328610584..5bf8c86ec7 100644
--- a/zephyr/test/skyrim/boards/native_posix.overlay
+++ b/zephyr/test/skyrim/boards/native_posix.overlay
@@ -25,6 +25,79 @@
gpios = <&gpio0 2 GPIO_OUTPUT_LOW>;
enum-name = "IOEX_USB_C1_TCPC_FASTSW_CTL_EN";
};
+
+ gpio_usb_c0_ppc_int_odl: usb_c0_ppc_int_odl {
+ gpios = <&gpio0 3 GPIO_INPUT>;
+ enum-name = "GPIO_USB_C0_PPC_INT_ODL";
+ };
+ gpio_usb_c1_ppc_int_odl: usb_c1_ppc_int_odl {
+ gpios = <&gpio0 4 GPIO_INPUT>;
+ enum-name = "GPIO_USB_C1_PPC_INT_ODL";
+ };
+
+ ioex_usb_c0_ilim_3a_en: usb_c0_ppc_ilim_3a_en {
+ gpios = <&gpio0 5 GPIO_OUTPUT_LOW>;
+ enum-name = "IOEX_USB_C0_PPC_ILIM_3A_EN";
+ };
+
+ gpio_usb_c1_in_hpd: usb_c1_in_hpd {
+ gpios = <&gpio0 6 GPIO_OUTPUT_LOW>;
+ enum-name = "IOEX_USB_C1_HPD_IN_DB";
+ };
+
+ ioex_usb_c1_sbu_flip: usb_c1_sbu_flip {
+ gpios = <&gpio0 7 GPIO_OUTPUT_LOW>;
+ enum-name = "IOEX_USB_C1_SBU_FLIP";
+ };
+
+ ioex_usb_c0_sbu_flip: usb_c0_sbu_flip {
+ gpios = <&gpio0 8 GPIO_OUTPUT_LOW>;
+ enum-name = "IOEX_USB_C0_SBU_FLIP";
+ };
+ };
+
+ skyrim-fw-config {
+ compatible = "cros-ec,cbi-fw-config";
+
+ fan {
+ enum-name = "FW_FAN";
+ start = <10>;
+ size = <1>;
+
+ no-fan {
+ compatible = "cros-ec,cbi-fw-config-value";
+ enum-name = "FW_FAN_NOT_PRESENT";
+ value = <0>;
+ };
+ fan-present {
+ compatible = "cros-ec,cbi-fw-config-value";
+ enum-name = "FW_FAN_PRESENT";
+ value = <1>;
+ /*
+ * Set as default so that unprovisioned
+ * configs will run the fan regardless.
+ */
+ default;
+ };
+ };
+
+ charger-option {
+ enum-name = "FW_CHARGER";
+ start = <11>;
+ size = <2>;
+
+ charger-option-isl9241 {
+ compatible = "cros-ec,cbi-fw-config-value";
+ enum-name = "FW_CHARGER_ISL9241";
+ value = <0>;
+ default;
+ };
+ charger-option-isl9538 {
+ compatible = "cros-ec,cbi-fw-config-value";
+ enum-name = "FW_CHARGER_ISL9538";
+ value = <1>;
+ };
+ };
};
};
diff --git a/zephyr/test/skyrim/prj.conf b/zephyr/test/skyrim/prj.conf
index 77f7eab5a2..d9b3ba4ab9 100644
--- a/zephyr/test/skyrim/prj.conf
+++ b/zephyr/test/skyrim/prj.conf
@@ -7,7 +7,9 @@ CONFIG_ZTEST_ASSERT_VERBOSE=1
CONFIG_ZTEST_NEW_API=y
CONFIG_ASSERT=y
+CONFIG_PLATFORM_EC_CBI=y
CONFIG_CROS_EC=y
CONFIG_PLATFORM_EC=y
+CONFIG_PLATFORM_EC_HOOKS=y
CONFIG_EMUL=y
CONFIG_GPIO=y
diff --git a/zephyr/test/skyrim/src/common.c b/zephyr/test/skyrim/src/common.c
new file mode 100644
index 0000000000..b369d0bdaa
--- /dev/null
+++ b/zephyr/test/skyrim/src/common.c
@@ -0,0 +1,7 @@
+/* Copyright 2023 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>
+
+LOG_MODULE_REGISTER(skyrim, CONFIG_SKYRIM_LOG_LEVEL);
diff --git a/zephyr/test/skyrim/src/common/alt_charger.c b/zephyr/test/skyrim/src/common/alt_charger.c
new file mode 100644
index 0000000000..c03d31aaeb
--- /dev/null
+++ b/zephyr/test/skyrim/src/common/alt_charger.c
@@ -0,0 +1,55 @@
+/* Copyright 2023 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/devicetree.h>
+#include <zephyr/fff.h>
+#include <zephyr/ztest.h>
+
+#include <charger.h>
+#include <cros_cbi.h>
+#include <hooks.h>
+
+FAKE_VALUE_FUNC(int, cros_cbi_get_fw_config, enum cbi_fw_config_field_id,
+ uint32_t *);
+FAKE_VOID_FUNC(chg_enable_alternate_test, int);
+
+void alt_charger_init(void);
+
+static bool alt_charger;
+static int cros_cbi_get_fw_config_mock(enum cbi_fw_config_field_id field_id,
+ uint32_t *value)
+{
+ if (field_id != FW_CHARGER)
+ return -EINVAL;
+
+ *value = alt_charger ? FW_CHARGER_ISL9538 : FW_CHARGER_ISL9241;
+ return 0;
+}
+
+static void alt_charger_before(void *fixture)
+{
+ ARG_UNUSED(fixture);
+ RESET_FAKE(cros_cbi_get_fw_config);
+ RESET_FAKE(chg_enable_alternate_test);
+
+ cros_cbi_get_fw_config_fake.custom_fake = cros_cbi_get_fw_config_mock;
+}
+
+ZTEST_SUITE(alt_charger, NULL, NULL, alt_charger_before, NULL, NULL);
+
+ZTEST(alt_charger, normal_charger)
+{
+ alt_charger = false;
+ alt_charger_init();
+ /* Test that the alternative charger wasn't enabled. */
+ zassert_equal(chg_enable_alternate_test_fake.call_count, 0);
+}
+
+ZTEST(alt_charger, alt_charger)
+{
+ alt_charger = true;
+ alt_charger_init();
+ zassert_equal(chg_enable_alternate_test_fake.call_count, 1);
+ zassert_equal(chg_enable_alternate_test_fake.arg0_val, 0);
+}
diff --git a/zephyr/test/skyrim/src/common/fan.c b/zephyr/test/skyrim/src/common/fan.c
new file mode 100644
index 0000000000..4968938298
--- /dev/null
+++ b/zephyr/test/skyrim/src/common/fan.c
@@ -0,0 +1,92 @@
+/* Copyright 2023 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/devicetree.h>
+#include <zephyr/fff.h>
+#include <zephyr/ztest.h>
+
+#include <cros_board_info.h>
+#include <cros_cbi.h>
+#include <fan.h>
+#include <hooks.h>
+
+FAKE_VOID_FUNC(fan_set_count, int);
+FAKE_VALUE_FUNC(int, cros_cbi_get_fw_config, enum cbi_fw_config_field_id,
+ uint32_t *);
+FAKE_VALUE_FUNC(int, cbi_get_board_version, uint32_t *);
+
+void fan_init(void);
+bool board_supports_pcore_ocp(void);
+
+static bool fan_present;
+static int board_version;
+
+static int cros_cbi_get_fw_config_mock(enum cbi_fw_config_field_id field_id,
+ uint32_t *value)
+{
+ if (field_id != FW_FAN)
+ return -EINVAL;
+
+ *value = fan_present ? FW_FAN_PRESENT : FW_FAN_NOT_PRESENT;
+ return 0;
+}
+
+static int cbi_get_board_version_mock(uint32_t *value)
+{
+ *value = board_version;
+ return EC_SUCCESS;
+}
+
+static void fan_before(void *fixture)
+{
+ ARG_UNUSED(fixture);
+ RESET_FAKE(fan_set_count);
+ RESET_FAKE(cros_cbi_get_fw_config);
+ RESET_FAKE(cbi_get_board_version);
+
+ cros_cbi_get_fw_config_fake.custom_fake = cros_cbi_get_fw_config_mock;
+ cbi_get_board_version_fake.custom_fake = cbi_get_board_version_mock;
+}
+
+ZTEST_SUITE(fan, NULL, NULL, fan_before, NULL, NULL);
+
+ZTEST(fan, board_supports_pcore_ocp)
+{
+ /* Only supported for board version > 3. */
+ board_version = 2;
+ zassert_false(board_supports_pcore_ocp());
+ board_version = 3;
+ zassert_false(board_supports_pcore_ocp());
+ board_version = 4;
+ zassert_true(board_supports_pcore_ocp());
+}
+
+ZTEST(fan, fan_init)
+{
+ /* Only disable fans on board version >= 3. */
+ fan_present = false;
+ board_version = 2;
+ fan_init();
+ zassert_equal(fan_set_count_fake.call_count, 0);
+
+ fan_present = true;
+ board_version = 3;
+ fan_init();
+ zassert_equal(fan_set_count_fake.call_count, 0);
+
+ fan_present = true;
+ board_version = 4;
+ fan_init();
+ zassert_equal(fan_set_count_fake.call_count, 0);
+
+ fan_present = false;
+ board_version = 3;
+ fan_init();
+ zassert_equal(fan_set_count_fake.call_count, 1);
+
+ fan_present = false;
+ board_version = 4;
+ fan_init();
+ zassert_equal(fan_set_count_fake.call_count, 2);
+}
diff --git a/zephyr/test/skyrim/src/common/ppc_config.c b/zephyr/test/skyrim/src/common/ppc_config.c
new file mode 100644
index 0000000000..0721e9c313
--- /dev/null
+++ b/zephyr/test/skyrim/src/common/ppc_config.c
@@ -0,0 +1,58 @@
+/* Copyright 2023 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/gpio_emul.h>
+#include <zephyr/fff.h>
+#include <zephyr/ztest.h>
+
+#include <gpio.h>
+#include <usbc_ppc.h>
+
+FAKE_VOID_FUNC(aoz1380_interrupt, int);
+FAKE_VOID_FUNC(nx20p348x_interrupt, int);
+
+static void ppc_config_before(void *fixture)
+{
+ ARG_UNUSED(fixture);
+ RESET_FAKE(aoz1380_interrupt);
+ RESET_FAKE(nx20p348x_interrupt);
+}
+
+void ppc_interrupt(enum gpio_signal signal);
+int board_aoz1380_set_vbus_source_current_limit(int port,
+ enum tcpc_rp_value rp);
+
+ZTEST_SUITE(ppc_config, NULL, NULL, ppc_config_before, NULL, NULL);
+
+ZTEST(ppc_config, board_aoz1380_set_vbus_source_current_limit)
+{
+ int rv;
+ const struct gpio_dt_spec *gpio =
+ GPIO_DT_FROM_NODELABEL(ioex_usb_c0_ilim_3a_en);
+
+ /*
+ * board_aoz1380_set_vbus_source_current_limit should set
+ * ioex_usb_c0_ilim_3a_en to 1 for 3A, 0 otherwise.
+ */
+ rv = board_aoz1380_set_vbus_source_current_limit(0, TYPEC_RP_3A0);
+ zassert_equal(rv, EC_SUCCESS);
+ zassert_equal(gpio_emul_output_get(gpio->port, gpio->pin), 1);
+
+ rv = board_aoz1380_set_vbus_source_current_limit(0, TYPEC_RP_1A5);
+ zassert_equal(rv, EC_SUCCESS);
+ zassert_equal(gpio_emul_output_get(gpio->port, gpio->pin), 0);
+}
+
+ZTEST(ppc_config, ppc_interrupt)
+{
+ ppc_interrupt(GPIO_USB_C0_PPC_INT_ODL);
+ zassert_equal(aoz1380_interrupt_fake.call_count, 1);
+ /* port */
+ zassert_equal(aoz1380_interrupt_fake.arg0_val, 0);
+
+ ppc_interrupt(GPIO_USB_C1_PPC_INT_ODL);
+ zassert_equal(nx20p348x_interrupt_fake.call_count, 1);
+ /* port */
+ zassert_equal(nx20p348x_interrupt_fake.arg0_val, 1);
+}
diff --git a/zephyr/test/skyrim/src/crystaldrift/common.c b/zephyr/test/skyrim/src/crystaldrift/common.c
index 841b7db140..9fa7864859 100644
--- a/zephyr/test/skyrim/src/crystaldrift/common.c
+++ b/zephyr/test/skyrim/src/crystaldrift/common.c
@@ -2,6 +2,9 @@
* 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 <zephyr/ztest.h>
+LOG_MODULE_REGISTER(crystaldrift, CONFIG_SKYRIM_LOG_LEVEL);
+
ZTEST_SUITE(common, NULL, NULL, NULL, NULL, NULL);
diff --git a/zephyr/test/skyrim/src/frostflow/usb_mux_config.c b/zephyr/test/skyrim/src/frostflow/usb_mux_config.c
new file mode 100644
index 0000000000..929bd318d4
--- /dev/null
+++ b/zephyr/test/skyrim/src/frostflow/usb_mux_config.c
@@ -0,0 +1,60 @@
+/* Copyright 2023 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/gpio_emul.h>
+#include <zephyr/fff.h>
+#include <zephyr/ztest.h>
+
+#include <gpio.h>
+#include <usbc/usb_muxes.h>
+
+int board_c0_amd_fp6_mux_set(const struct usb_mux *me, mux_state_t mux_state);
+int board_c1_ps8818_mux_set(const struct usb_mux *me, mux_state_t mux_state);
+
+ZTEST_SUITE(usb_mux_config, NULL, NULL, NULL, NULL, NULL);
+
+ZTEST(usb_mux_config, board_c0_amd_fp6_mux_set)
+{
+ const struct gpio_dt_spec *c0 =
+ GPIO_DT_FROM_NODELABEL(ioex_usb_c0_sbu_flip);
+ const struct gpio_dt_spec *c1 =
+ GPIO_DT_FROM_NODELABEL(ioex_usb_c1_sbu_flip);
+ struct usb_mux mux;
+ int rv;
+
+ /* Output for each port should match inverted status. */
+ mux.usb_port = 0;
+ rv = board_c0_amd_fp6_mux_set(&mux, 0);
+ zassert_equal(rv, EC_SUCCESS);
+ zassert_equal(gpio_emul_output_get(c0->port, c0->pin), 0);
+
+ rv = board_c0_amd_fp6_mux_set(&mux, USB_PD_MUX_POLARITY_INVERTED);
+ zassert_equal(rv, EC_SUCCESS);
+ zassert_equal(gpio_emul_output_get(c0->port, c0->pin), 1);
+
+ mux.usb_port = 1;
+ rv = board_c0_amd_fp6_mux_set(&mux, 0);
+ zassert_equal(rv, EC_SUCCESS);
+ zassert_equal(gpio_emul_output_get(c1->port, c1->pin), 0);
+
+ rv = board_c0_amd_fp6_mux_set(&mux, USB_PD_MUX_POLARITY_INVERTED);
+ zassert_equal(rv, EC_SUCCESS);
+ zassert_equal(gpio_emul_output_get(c1->port, c1->pin), 1);
+}
+
+ZTEST(usb_mux_config, board_c1_ps8818_mux_set)
+{
+ const struct gpio_dt_spec *gpio =
+ GPIO_DT_FROM_NODELABEL(gpio_usb_c1_in_hpd);
+ struct usb_mux mux;
+
+ /* gpio_usb_c1_in_hpd should match if DP is enabled. */
+ mux.usb_port = 0;
+ zassert_ok(board_c1_ps8818_mux_set(&mux, 0));
+ zassert_equal(gpio_emul_output_get(gpio->port, gpio->pin), 0);
+
+ mux.usb_port = 1;
+ zassert_ok(board_c1_ps8818_mux_set(&mux, USB_PD_MUX_DP_ENABLED));
+ zassert_equal(gpio_emul_output_get(gpio->port, gpio->pin), 1);
+}
diff --git a/zephyr/test/skyrim/src/markarth/common.c b/zephyr/test/skyrim/src/markarth/common.c
index 841b7db140..b302042761 100644
--- a/zephyr/test/skyrim/src/markarth/common.c
+++ b/zephyr/test/skyrim/src/markarth/common.c
@@ -2,6 +2,9 @@
* 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 <zephyr/ztest.h>
+LOG_MODULE_REGISTER(markarth, CONFIG_SKYRIM_LOG_LEVEL);
+
ZTEST_SUITE(common, NULL, NULL, NULL, NULL, NULL);
diff --git a/zephyr/test/skyrim/src/winterhold/ppc_config.c b/zephyr/test/skyrim/src/winterhold/ppc_config.c
new file mode 100644
index 0000000000..131a74855e
--- /dev/null
+++ b/zephyr/test/skyrim/src/winterhold/ppc_config.c
@@ -0,0 +1,38 @@
+/* Copyright 2023 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/fff.h>
+#include <zephyr/ztest.h>
+
+#include <gpio.h>
+#include <usbc_ppc.h>
+
+FAKE_VOID_FUNC(nx20p348x_interrupt, int);
+DEFINE_FAKE_VOID_FUNC(nx20p348x_interrupt, int);
+
+static void ppc_config_before(void *fixture)
+{
+ ARG_UNUSED(fixture);
+ RESET_FAKE(nx20p348x_interrupt);
+}
+
+void ppc_interrupt(enum gpio_signal signal);
+
+ZTEST_SUITE(ppc_config, NULL, NULL, ppc_config_before, NULL, NULL);
+
+ZTEST(ppc_config, ppc_interrupt_c0)
+{
+ ppc_interrupt(GPIO_USB_C0_PPC_INT_ODL);
+ zassert_equal(nx20p348x_interrupt_fake.call_count, 1);
+ /* port */
+ zassert_equal(nx20p348x_interrupt_fake.arg0_val, 0);
+}
+
+ZTEST(ppc_config, ppc_interrupt_c1)
+{
+ ppc_interrupt(GPIO_USB_C1_PPC_INT_ODL);
+ zassert_equal(nx20p348x_interrupt_fake.call_count, 1);
+ /* port */
+ zassert_equal(nx20p348x_interrupt_fake.arg0_val, 1);
+}
diff --git a/zephyr/test/skyrim/testcase.yaml b/zephyr/test/skyrim/testcase.yaml
index 29d22a2fcd..d2330c740b 100644
--- a/zephyr/test/skyrim/testcase.yaml
+++ b/zephyr/test/skyrim/testcase.yaml
@@ -26,22 +26,79 @@ tests:
extra_configs:
- CONFIG_TEST_BOARD_CRYSTALDRIFT=y
+ skyrim.crystaldrift.alt_charger:
+ extra_configs:
+ - CONFIG_TEST_BOARD_CRYSTALDRIFT=y
+ - CONFIG_TEST_BOARD_ALT_CHARGER=y
+
+ skyrim.crystaldrift.fan:
+ extra_configs:
+ - CONFIG_TEST_BOARD_CRYSTALDRIFT=y
+ - CONFIG_TEST_BOARD_FAN=y
+
+ skyrim.crystaldrift.ppc_config:
+ extra_configs:
+ - CONFIG_TEST_BOARD_CRYSTALDRIFT=y
+ - CONFIG_TEST_BOARD_PPC_CONFIG=y
+
# Frostflow tests
skyrim.frostflow:
extra_configs:
- CONFIG_TEST_BOARD_FROSTFLOW=y
+ skyrim.frostflow.ppc_config:
+ extra_configs:
+ - CONFIG_TEST_BOARD_FROSTFLOW=y
+ - CONFIG_TEST_BOARD_PPC_CONFIG=y
+
+ # skyrim.frostflow.usb_mux_config:
+ # extra_configs:
+ # - CONFIG_TEST_BOARD_FROSTFLOW=y
+ # - CONFIG_TEST_BOARD_USB_MUX_CONFIG=y
+ # - CONFIG_TEST_BOARD_USB_MUX_CONFIG_SRC="frostflow/usb_mux_config.c"
+
# Markarth tests
skyrim.markarth:
extra_configs:
- CONFIG_TEST_BOARD_MARKARTH=y
+ skyrim.markarth.fan:
+ extra_configs:
+ - CONFIG_TEST_BOARD_MARKARTH=y
+ - CONFIG_TEST_BOARD_FAN=y
+
+ skyrim.markarth.ppc_config:
+ extra_configs:
+ - CONFIG_TEST_BOARD_MARKARTH=y
+ - CONFIG_TEST_BOARD_PPC_CONFIG=y
+
# Skyrim tests
skyrim.skyrim:
extra_configs:
- CONFIG_TEST_BOARD_SKYRIM=y
+ skyrim.skyrim.alt_charger:
+ extra_configs:
+ - CONFIG_TEST_BOARD_SKYRIM=y
+ - CONFIG_TEST_BOARD_ALT_CHARGER=y
+
+ skyrim.skyrim.fan:
+ extra_configs:
+ - CONFIG_TEST_BOARD_SKYRIM=y
+ - CONFIG_TEST_BOARD_FAN=y
+
+ skyrim.skyrim.ppc_config:
+ extra_configs:
+ - CONFIG_TEST_BOARD_SKYRIM=y
+ - CONFIG_TEST_BOARD_PPC_CONFIG=y
+
# Winterhold tests
skyrim.winterhold:
extra_configs:
- CONFIG_TEST_BOARD_WINTERHOLD=y
+
+ skyrim.winterhold.ppc_config:
+ extra_configs:
+ - CONFIG_TEST_BOARD_WINTERHOLD=y
+ - CONFIG_TEST_BOARD_PPC_CONFIG=y
+ - CONFIG_TEST_BOARD_PPC_CONFIG_SRC="winterhold/ppc_config.c"