Skip to content

Commit 6303428

Browse files
committed
[nrf noup] tests: drivers: mspi: add SDP MSPI testcase
Add SDP MPSI testcase to basic API test. Signed-off-by: Jakub Zymelka <[email protected]>
1 parent 42fc53c commit 6303428

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright (c) 2024 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/ {
8+
aliases {
9+
mspi0 = &sdp_mspi;
10+
};
11+
};
12+
13+
&cpuflpr_vpr {
14+
status = "okay";
15+
16+
sdp_mspi: sdp_mspi@5004c000 {
17+
mspi_device: mspi_device@0 {
18+
status = "okay";
19+
compatible = "zephyr,mspi-emul-device";
20+
reg = <0x0>;
21+
mspi-max-frequency = <48000000>;
22+
};
23+
};
24+
};

tests/drivers/mspi/api/src/main.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ typedef struct mspi_ambiq_timing_cfg mspi_timing_cfg;
2020
typedef enum mspi_ambiq_timing_param mspi_timing_param;
2121
#endif
2222

23+
// #if defined(CONFIG_SOC_NRF54L15_CPUAPP)
24+
// #define MSPI_BUS_NODE DT_NODELABEL(sdp_mspi)
25+
// #else
2326
#define MSPI_BUS_NODE DT_ALIAS(mspi0)
27+
// #endif
2428

2529
static const struct device *mspi_devices[] = {
2630
DT_FOREACH_CHILD_STATUS_OKAY_SEP(MSPI_BUS_NODE, DEVICE_DT_GET, (,))
@@ -51,13 +55,17 @@ static struct mspi_dev_cfg device_cfg[] = {
5155
DT_FOREACH_CHILD_STATUS_OKAY_SEP(MSPI_BUS_NODE, MSPI_DEVICE_CONFIG_DT, (,))
5256
};
5357

58+
#if CONFIG_MSPI_XIP
5459
static struct mspi_xip_cfg xip_cfg[] = {
5560
DT_FOREACH_CHILD_STATUS_OKAY_SEP(MSPI_BUS_NODE, MSPI_XIP_CONFIG_DT, (,))
5661
};
62+
#endif
5763

64+
#if CONFIG_MSPI_SCRAMBLE
5865
static struct mspi_scramble_cfg scramble_cfg[] = {
5966
DT_FOREACH_CHILD_STATUS_OKAY_SEP(MSPI_BUS_NODE, MSPI_SCRAMBLE_CONFIG_DT, (,))
6067
};
68+
#endif
6169

6270
ZTEST(mspi_api, test_mspi_api)
6371
{
@@ -102,9 +110,11 @@ ZTEST(mspi_api, test_mspi_api)
102110
zassert_equal(ret, 0, "mspi_timing_config failed.");
103111
#endif
104112

113+
#if CONFIG_MSPI_ASYNC
105114
ret = mspi_register_callback(mspi_bus, &dev_id[dev_idx],
106115
MSPI_BUS_XFER_COMPLETE, NULL, NULL);
107116
zassert_equal(ret, 0, "mspi_register_callback failed.");
117+
#endif
108118

109119
ret = mspi_get_channel_status(mspi_bus, 0);
110120
zassert_equal(ret, 0, "mspi_get_channel_status failed.");

tests/drivers/mspi/api/testcase.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,19 @@ tests:
1515
- apollo3p_evb
1616
integration_platforms:
1717
- native_sim
18+
19+
drivers.mspi.api.emspi:
20+
tags:
21+
- drivers
22+
- mspi
23+
- api
24+
harness: ztest
25+
platform_allow:
26+
- nrf54l15dk_nrf54l15_cpuapp
27+
integration_platforms:
28+
- nrf54l15dk_nrf54l15_cpuapp
29+
extra_args:
30+
- SB_CONFIG_VPR_LAUNCHER=n
31+
- SB_CONFIG_PARTITION_MANAGER=n
32+
- SB_CONFIG_SDP=y
33+
- SB_CONFIG_SDP_MSPI=y

0 commit comments

Comments
 (0)