From 5e9326e2dcb1b8ced4bb8cc4f30da62513bff29b Mon Sep 17 00:00:00 2001 From: Jakub Zymelka Date: Mon, 18 Nov 2024 10:18:42 +0100 Subject: [PATCH] [nrf noup] tests: drivers: mspi: add SDP MSPI testcase Add SDP MPSI testcase to basic API test. Signed-off-by: Jakub Zymelka --- .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 24 +++++++++++++++++++ tests/drivers/mspi/api/src/main.c | 6 +++++ tests/drivers/mspi/api/testcase.yaml | 16 +++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 tests/drivers/mspi/api/boards/nrf54l15dk_nrf54l15_cpuapp.overlay diff --git a/tests/drivers/mspi/api/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/drivers/mspi/api/boards/nrf54l15dk_nrf54l15_cpuapp.overlay new file mode 100644 index 00000000000..add78111464 --- /dev/null +++ b/tests/drivers/mspi/api/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + aliases { + mspi0 = &sdp_mspi; + }; +}; + +&cpuflpr_vpr { + status = "okay"; + + sdp_mspi: sdp_mspi@5004c000 { + mspi_device: mspi_device@0 { + status = "okay"; + compatible = "zephyr,mspi-emul-device"; + reg = <0x0>; + mspi-max-frequency = <48000000>; + }; + }; +}; diff --git a/tests/drivers/mspi/api/src/main.c b/tests/drivers/mspi/api/src/main.c index d6b632f29c1..eb3494aa635 100644 --- a/tests/drivers/mspi/api/src/main.c +++ b/tests/drivers/mspi/api/src/main.c @@ -51,13 +51,17 @@ static struct mspi_dev_cfg device_cfg[] = { DT_FOREACH_CHILD_STATUS_OKAY_SEP(MSPI_BUS_NODE, MSPI_DEVICE_CONFIG_DT, (,)) }; +#if CONFIG_MSPI_XIP static struct mspi_xip_cfg xip_cfg[] = { DT_FOREACH_CHILD_STATUS_OKAY_SEP(MSPI_BUS_NODE, MSPI_XIP_CONFIG_DT, (,)) }; +#endif +#if CONFIG_MSPI_SCRAMBLE static struct mspi_scramble_cfg scramble_cfg[] = { DT_FOREACH_CHILD_STATUS_OKAY_SEP(MSPI_BUS_NODE, MSPI_SCRAMBLE_CONFIG_DT, (,)) }; +#endif ZTEST(mspi_api, test_mspi_api) { @@ -102,9 +106,11 @@ ZTEST(mspi_api, test_mspi_api) zassert_equal(ret, 0, "mspi_timing_config failed."); #endif +#if CONFIG_MSPI_ASYNC ret = mspi_register_callback(mspi_bus, &dev_id[dev_idx], MSPI_BUS_XFER_COMPLETE, NULL, NULL); zassert_equal(ret, 0, "mspi_register_callback failed."); +#endif ret = mspi_get_channel_status(mspi_bus, 0); zassert_equal(ret, 0, "mspi_get_channel_status failed."); diff --git a/tests/drivers/mspi/api/testcase.yaml b/tests/drivers/mspi/api/testcase.yaml index 3675cc485f3..730f6f61438 100644 --- a/tests/drivers/mspi/api/testcase.yaml +++ b/tests/drivers/mspi/api/testcase.yaml @@ -15,3 +15,19 @@ tests: - apollo3p_evb integration_platforms: - native_sim + + drivers.mspi.api.emspi: + tags: + - drivers + - mspi + - api + harness: ztest + platform_allow: + - nrf54l15dk_nrf54l15_cpuapp + integration_platforms: + - nrf54l15dk_nrf54l15_cpuapp + extra_args: + - SB_CONFIG_VPR_LAUNCHER=n + - SB_CONFIG_PARTITION_MANAGER=n + - SB_CONFIG_SDP=y + - SB_CONFIG_SDP_MSPI=y