diff --git a/tests/drivers/flash/common/boards/mx25uw63_low_freq.overlay b/tests/drivers/flash/common/boards/mx25uw63_low_freq.overlay new file mode 100644 index 00000000000..950005eaf5c --- /dev/null +++ b/tests/drivers/flash/common/boards/mx25uw63_low_freq.overlay @@ -0,0 +1,10 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&mx25uw63 { + status = "okay"; + mspi-max-frequency = ; +}; diff --git a/tests/drivers/flash/common/boards/mx25uw63_single_io_4B_addr_sreset.overlay b/tests/drivers/flash/common/boards/mx25uw63_single_io_4B_addr_sreset.overlay new file mode 100644 index 00000000000..587d6854656 --- /dev/null +++ b/tests/drivers/flash/common/boards/mx25uw63_single_io_4B_addr_sreset.overlay @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&pinctrl { + + /delete-node/ exmif_default; + /delete-node/ exmif_sleep; + + exmif_default: exmif_default { + group1 { + psels = , + , + , + , + , + , + , + , + , + ; + nordic,drive-mode = ; + }; + }; + + exmif_sleep: exmif_sleep { + group1 { + low-power-enable; + psels = , + , + , + , + , + , + , + , + , + ; + }; + }; + +}; + +&gpio6 { + status = "okay"; +}; + +&exmif { + status = "okay"; + pinctrl-0 = <&exmif_default>; + pinctrl-1 = <&exmif_sleep>; + pinctrl-names = "default", "sleep"; + ce-gpios = <&gpio6 3 GPIO_ACTIVE_LOW>; +}; + +&mx25uw63 { + status = "okay"; + mspi-max-frequency = ; + mspi-io-mode = "MSPI_IO_MODE_SINGLE"; + use-4byte-addressing; + initial-soft-reset; +}; diff --git a/tests/drivers/flash/common/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/flash/common/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 22c24c32f6d..5272bb8fdde 100644 --- a/tests/drivers/flash/common/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/flash/common/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -4,6 +4,16 @@ * SPDX-License-Identifier: Apache-2.0 */ +/ { + zephyr,user { + test-gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>; + }; +}; + +&gpio0 { + status = "okay"; +}; + &gpio6 { status = "okay"; zephyr,pm-device-runtime-auto; @@ -16,4 +26,5 @@ &mx25uw63 { status = "okay"; + supply-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>; }; diff --git a/tests/drivers/flash/common/src/main.c b/tests/drivers/flash/common/src/main.c index 337876a9e8d..b629c39ebc5 100644 --- a/tests/drivers/flash/common/src/main.c +++ b/tests/drivers/flash/common/src/main.c @@ -9,6 +9,7 @@ #include #include #include +#include #if defined(CONFIG_NORDIC_QSPI_NOR) #define TEST_AREA_DEV_NODE DT_INST(0, nordic_qspi_nor) @@ -327,6 +328,22 @@ ZTEST(flash_driver, test_flash_erase) zassert_not_equal(expected[0], erase_value, "These values shall be different"); } +ZTEST(flash_driver, test_supply_gpios_control) +{ + if (!DT_NODE_HAS_PROP(TEST_AREA_DEV_NODE, supply_gpios)) { + ztest_test_skip(); + } + +#if DT_NODE_HAS_PROP(DT_PATH(zephyr_user), test_gpios) + const struct gpio_dt_spec test_gpio = + GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), test_gpios); + zassert_true(gpio_is_ready_dt(&test_gpio), "Test GPIO is not ready\n"); + zassert_ok(gpio_pin_configure_dt(&test_gpio, GPIO_INPUT | GPIO_PULL_DOWN), + "Failed to configure test pin\n"); + zassert_equal(gpio_pin_get(test_gpio.port, test_gpio.pin), 1, "Supply GPIO is not set\n"); +#endif +} + struct test_cb_data_type { uint32_t page_counter; /* used to count how many pages was iterated */ uint32_t exit_page; /* terminate iteration when this page is reached */ diff --git a/tests/drivers/flash/common/testcase.yaml b/tests/drivers/flash/common/testcase.yaml index 34123ffde77..6f59f3799c5 100644 --- a/tests/drivers/flash/common/testcase.yaml +++ b/tests/drivers/flash/common/testcase.yaml @@ -182,3 +182,13 @@ tests: extra_args: - DTC_OVERLAY_FILE="./boards/${BOARD}_qspi_nor.overlay" - CONF_FILE="./prj.conf ./boards/${BOARD}_qspi_nor.conf" + drivers.flash.common.mspi_single_io.4B_addr_soft_reset: + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp + extra_args: + - EXTRA_DTC_OVERLAY_FILE=boards/mx25uw63_single_io_4B_addr_sreset.overlay + drivers.flash.common.mspi_low_frequency: + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp + extra_args: + - EXTRA_DTC_OVERLAY_FILE=boards/mx25uw63_low_freq.overlay