Skip to content

Commit 67d47fa

Browse files
committed
[nrf fromlist] samples|tests: drivers: flash: Add support for "jedec,mspi-nor" devices
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. Upstream PR #: 80042 Signed-off-by: Andrzej Głąbek <[email protected]>
1 parent 2af818a commit 67d47fa

File tree

7 files changed

+24
-3
lines changed

7 files changed

+24
-3
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#
2+
# Copyright (c) 2024 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
7+
CONFIG_SPI=n
8+
CONFIG_SPI_NOR=n

samples/drivers/jesd216/sample.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ tests:
1919
- hifive_unmatched
2020
- mimxrt1170_evk/mimxrt1176/cm7
2121
- mimxrt1170_evk/mimxrt1176/cm4
22-
filter: dt_compat_enabled("jedec,spi-nor")
22+
filter: dt_compat_enabled("jedec,spi-nor") or dt_compat_enabled("jedec,mspi-nor")
2323
depends_on: spi
2424
sample.drivers.jesd216.nrf52840dk_spi:
2525
extra_args:

samples/drivers/jesd216/src/main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
#if DT_HAS_COMPAT_STATUS_OKAY(jedec_spi_nor)
1616
#define FLASH_NODE DT_COMPAT_GET_ANY_STATUS_OKAY(jedec_spi_nor)
17+
#elif DT_HAS_COMPAT_STATUS_OKAY(jedec_mspi_nor)
18+
#define FLASH_NODE DT_COMPAT_GET_ANY_STATUS_OKAY(jedec_mspi_nor)
1719
#elif DT_HAS_COMPAT_STATUS_OKAY(nordic_qspi_nor)
1820
#define FLASH_NODE DT_COMPAT_GET_ANY_STATUS_OKAY(nordic_qspi_nor)
1921
#elif DT_HAS_COMPAT_STATUS_OKAY(st_stm32_qspi_nor)
@@ -201,7 +203,7 @@ static void summarize_dw15(const struct jesd216_param_header *php,
201203
printf("0-4-4 Mode methods: entry 0x%01x ; exit 0x%02x\n",
202204
dw15.entry_044, dw15.exit_044);
203205
} else {
204-
printf("0-4-4 Mode: not supported");
206+
printf("0-4-4 Mode: not supported\n");
205207
}
206208
printf("4-4-4 Mode sequences: enable 0x%02x ; disable 0x%01x\n",
207209
dw15.enable_444, dw15.disable_444);
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#
2+
# Copyright (c) 2024 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
7+
CONFIG_SPI=n

samples/drivers/spi_flash/sample.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ tests:
77
- flash
88
filter: dt_compat_enabled("jedec,spi-nor") or dt_compat_enabled("st,stm32-qspi-nor")
99
or dt_compat_enabled("st,stm32-ospi-nor") or dt_compat_enabled("st,stm32-xspi-nor")
10-
or (dt_compat_enabled("nordic,qspi-nor") and CONFIG_NORDIC_QSPI_NOR)
10+
or dt_compat_enabled("nordic,qspi-nor") or dt_compat_enabled("jedec,mspi-nor")
1111
platform_exclude: hifive_unmatched
1212
harness: console
1313
harness_config:

samples/drivers/spi_flash/src/main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434

3535
#if DT_HAS_COMPAT_STATUS_OKAY(jedec_spi_nor)
3636
#define SPI_FLASH_COMPAT jedec_spi_nor
37+
#elif DT_HAS_COMPAT_STATUS_OKAY(jedec_mspi_nor)
38+
#define SPI_FLASH_COMPAT jedec_mspi_nor
3739
#elif DT_HAS_COMPAT_STATUS_OKAY(st_stm32_qspi_nor)
3840
#define SPI_FLASH_COMPAT st_stm32_qspi_nor
3941
#elif DT_HAS_COMPAT_STATUS_OKAY(st_stm32_ospi_nor)

tests/drivers/flash/common/src/main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
#define TEST_AREA_DEV_NODE DT_INST(0, nordic_qspi_nor)
1515
#elif defined(CONFIG_SPI_NOR)
1616
#define TEST_AREA_DEV_NODE DT_INST(0, jedec_spi_nor)
17+
#elif defined(CONFIG_FLASH_MSPI_NOR)
18+
#define TEST_AREA_DEV_NODE DT_INST(0, jedec_mspi_nor)
1719
#else
1820
#define TEST_AREA storage_partition
1921
#endif

0 commit comments

Comments
 (0)