From e987b7a98a13a1a1d13f3a86f54fdf343345327f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Mon, 21 Oct 2024 13:11:55 +0200 Subject: [PATCH] tests: benchmarks: Add support for "jedec,mspi-nor" flash devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... so that the tests can be built for nRF54H20 and nRF9280 after they are switched to use the new MSPI driver for EXMIF. Signed-off-by: Andrzej Głąbek --- tests/benchmarks/peripheral_load/src/flash_thread.c | 2 ++ .../power_consumption/flash/src/driver_test.c | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/benchmarks/peripheral_load/src/flash_thread.c b/tests/benchmarks/peripheral_load/src/flash_thread.c index f0e0ae028f3a..2c97b9a3d1e5 100644 --- a/tests/benchmarks/peripheral_load/src/flash_thread.c +++ b/tests/benchmarks/peripheral_load/src/flash_thread.c @@ -13,6 +13,8 @@ LOG_MODULE_REGISTER(flash_thd, LOG_LEVEL_INF); #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) #else diff --git a/tests/benchmarks/power_consumption/flash/src/driver_test.c b/tests/benchmarks/power_consumption/flash/src/driver_test.c index 4a37b1921bc6..23f818ca54f8 100644 --- a/tests/benchmarks/power_consumption/flash/src/driver_test.c +++ b/tests/benchmarks/power_consumption/flash/src/driver_test.c @@ -8,11 +8,20 @@ #include #include +#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) +#else +#error Unsupported flash driver +#define FLASH_NODE DT_INVALID_NODE +#endif + #define TEST_AREA_OFFSET 0xff000 #define EXPECTED_SIZE 512 uint8_t buf[EXPECTED_SIZE]; -static const struct device *flash_dev = DEVICE_DT_GET(DT_INST(0, jedec_spi_nor)); +static const struct device *flash_dev = DEVICE_DT_GET(FLASH_NODE); void thread_definition(void)