Skip to content

Commit

Permalink
tests: benchmarks: Add support for "jedec,mspi-nor" flash devices
Browse files Browse the repository at this point in the history
... 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 <[email protected]>
  • Loading branch information
anangl authored and NordicBuilder committed Dec 14, 2024
1 parent 05b9d9e commit fe64eba
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tests/benchmarks/peripheral_load/src/flash_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 10 additions & 1 deletion tests/benchmarks/power_consumption/flash/src/driver_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,20 @@
#include <zephyr/storage/flash_map.h>
#include <zephyr/kernel.h>

#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)
Expand Down

0 comments on commit fe64eba

Please sign in to comment.