Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions tests/drivers/flash/common/boards/mx25uw63_low_freq.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright (c) 2025 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/

&mx25uw63 {
status = "okay";
mspi-max-frequency = <DT_FREQ_K(256)>;
};
Original file line number Diff line number Diff line change
@@ -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 = <NRF_PSEL(EXMIF_CK, 6, 0)>,
<NRF_PSEL(EXMIF_RWDS, 6, 2)>,
<NRF_PSEL(EXMIF_DQ0, 6, 7)>,
<NRF_PSEL(EXMIF_DQ1, 6, 5)>,
<NRF_PSEL(EXMIF_DQ2, 6, 10)>,
<NRF_PSEL(EXMIF_DQ3, 6, 9)>,
<NRF_PSEL(EXMIF_DQ4, 6, 11)>,
<NRF_PSEL(EXMIF_DQ5, 6, 8)>,
<NRF_PSEL(EXMIF_DQ6, 6, 6)>,
<NRF_PSEL(EXMIF_DQ7, 6, 4)>;
nordic,drive-mode = <NRF_DRIVE_H0H1>;
};
};

exmif_sleep: exmif_sleep {
group1 {
low-power-enable;
psels = <NRF_PSEL(EXMIF_CK, 6, 0)>,
<NRF_PSEL(EXMIF_RWDS, 6, 2)>,
<NRF_PSEL(EXMIF_DQ0, 6, 7)>,
<NRF_PSEL(EXMIF_DQ1, 6, 5)>,
<NRF_PSEL(EXMIF_DQ2, 6, 10)>,
<NRF_PSEL(EXMIF_DQ3, 6, 9)>,
<NRF_PSEL(EXMIF_DQ4, 6, 11)>,
<NRF_PSEL(EXMIF_DQ5, 6, 8)>,
<NRF_PSEL(EXMIF_DQ6, 6, 6)>,
<NRF_PSEL(EXMIF_DQ7, 6, 4)>;
};
};

};

&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 = <DT_FREQ_M(50)>;
mspi-io-mode = "MSPI_IO_MODE_SINGLE";
use-4byte-addressing;
initial-soft-reset;
};
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -16,4 +26,5 @@

&mx25uw63 {
status = "okay";
supply-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
};
17 changes: 17 additions & 0 deletions tests/drivers/flash/common/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <zephyr/drivers/flash.h>
#include <zephyr/devicetree.h>
#include <zephyr/storage/flash_map.h>
#include <zephyr/drivers/gpio.h>

#if defined(CONFIG_NORDIC_QSPI_NOR)
#define TEST_AREA_DEV_NODE DT_INST(0, nordic_qspi_nor)
Expand Down Expand Up @@ -327,6 +328,22 @@
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");

Check notice on line 340 in tests/drivers/flash/common/src/main.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

tests/drivers/flash/common/src/main.c:340 - const struct gpio_dt_spec test_gpio = - GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), test_gpios); + const struct gpio_dt_spec test_gpio = GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), test_gpios);
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 */
Expand Down
10 changes: 10 additions & 0 deletions tests/drivers/flash/common/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading