From 2f1e2cfb06f142eabe578234f9dc174bfd479c33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Fri, 18 Oct 2024 10:16:08 +0200 Subject: [PATCH] [nrf fromlist] samples|tests: drivers: flash: Add support for "jedec,mspi-nor" devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extend several flash samples and tests so that they can also be used with "jedec,mspi-nor" devices. Add configurations needed for the nrf54h20dk/nrf54h20/cpuapp target. Signed-off-by: Andrzej Głąbek (cherry picked from commit 280e331a584d80925711077fed8eefa09843e5bf) Upstream PR: https://github.com/zephyrproject-rtos/zephyr/pull/80042 --- .../jesd216/boards/nrf54h20dk_nrf54h20_cpuapp.conf | 8 ++++++++ samples/drivers/jesd216/src/main.c | 4 +++- .../spi_flash/boards/nrf54h20dk_nrf54h20_cpuapp.conf | 7 +++++++ samples/drivers/spi_flash/sample.yaml | 2 +- samples/drivers/spi_flash/src/main.c | 2 ++ tests/drivers/flash/common/src/main.c | 2 ++ 6 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 samples/drivers/jesd216/boards/nrf54h20dk_nrf54h20_cpuapp.conf create mode 100644 samples/drivers/spi_flash/boards/nrf54h20dk_nrf54h20_cpuapp.conf diff --git a/samples/drivers/jesd216/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/samples/drivers/jesd216/boards/nrf54h20dk_nrf54h20_cpuapp.conf new file mode 100644 index 00000000000..a63e49842cc --- /dev/null +++ b/samples/drivers/jesd216/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -0,0 +1,8 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +CONFIG_SPI=n +CONFIG_SPI_NOR=n diff --git a/samples/drivers/jesd216/src/main.c b/samples/drivers/jesd216/src/main.c index 480649397b6..b8dad485997 100644 --- a/samples/drivers/jesd216/src/main.c +++ b/samples/drivers/jesd216/src/main.c @@ -14,6 +14,8 @@ #if DT_HAS_COMPAT_STATUS_OKAY(jedec_spi_nor) #define FLASH_NODE DT_COMPAT_GET_ANY_STATUS_OKAY(jedec_spi_nor) +#elif DT_HAS_COMPAT_STATUS_OKAY(jedec_mspi_nor) +#define FLASH_NODE DT_COMPAT_GET_ANY_STATUS_OKAY(jedec_mspi_nor) #elif DT_HAS_COMPAT_STATUS_OKAY(nordic_qspi_nor) #define FLASH_NODE DT_COMPAT_GET_ANY_STATUS_OKAY(nordic_qspi_nor) #elif DT_HAS_COMPAT_STATUS_OKAY(st_stm32_qspi_nor) @@ -201,7 +203,7 @@ static void summarize_dw15(const struct jesd216_param_header *php, printf("0-4-4 Mode methods: entry 0x%01x ; exit 0x%02x\n", dw15.entry_044, dw15.exit_044); } else { - printf("0-4-4 Mode: not supported"); + printf("0-4-4 Mode: not supported\n"); } printf("4-4-4 Mode sequences: enable 0x%02x ; disable 0x%01x\n", dw15.enable_444, dw15.disable_444); diff --git a/samples/drivers/spi_flash/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/samples/drivers/spi_flash/boards/nrf54h20dk_nrf54h20_cpuapp.conf new file mode 100644 index 00000000000..85ea4275428 --- /dev/null +++ b/samples/drivers/spi_flash/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -0,0 +1,7 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +CONFIG_SPI=n diff --git a/samples/drivers/spi_flash/sample.yaml b/samples/drivers/spi_flash/sample.yaml index 377c5ccec6e..68facc5f50a 100644 --- a/samples/drivers/spi_flash/sample.yaml +++ b/samples/drivers/spi_flash/sample.yaml @@ -7,7 +7,7 @@ tests: - flash filter: dt_compat_enabled("jedec,spi-nor") or dt_compat_enabled("st,stm32-qspi-nor") or dt_compat_enabled("st,stm32-ospi-nor") or dt_compat_enabled("st,stm32-xspi-nor") - or (dt_compat_enabled("nordic,qspi-nor") and CONFIG_NORDIC_QSPI_NOR) + or dt_compat_enabled("nordic,qspi-nor") or dt_compat_enabled("jedec,spi-nor") platform_exclude: hifive_unmatched harness: console harness_config: diff --git a/samples/drivers/spi_flash/src/main.c b/samples/drivers/spi_flash/src/main.c index b84359ae05b..52e8b6062b5 100644 --- a/samples/drivers/spi_flash/src/main.c +++ b/samples/drivers/spi_flash/src/main.c @@ -34,6 +34,8 @@ #if DT_HAS_COMPAT_STATUS_OKAY(jedec_spi_nor) #define SPI_FLASH_COMPAT jedec_spi_nor +#elif DT_HAS_COMPAT_STATUS_OKAY(jedec_mspi_nor) +#define SPI_FLASH_COMPAT jedec_mspi_nor #elif DT_HAS_COMPAT_STATUS_OKAY(st_stm32_qspi_nor) #define SPI_FLASH_COMPAT st_stm32_qspi_nor #elif DT_HAS_COMPAT_STATUS_OKAY(st_stm32_ospi_nor) diff --git a/tests/drivers/flash/common/src/main.c b/tests/drivers/flash/common/src/main.c index 9ca767943d9..66a5eba0297 100644 --- a/tests/drivers/flash/common/src/main.c +++ b/tests/drivers/flash/common/src/main.c @@ -14,6 +14,8 @@ #define TEST_AREA_DEV_NODE DT_INST(0, nordic_qspi_nor) #elif defined(CONFIG_SPI_NOR) #define TEST_AREA_DEV_NODE DT_INST(0, jedec_spi_nor) +#elif defined(CONFIG_FLASH_MSPI_NOR) +#define TEST_AREA_DEV_NODE DT_INST(0, jedec_mspi_nor) #else #define TEST_AREA storage_partition #endif