Skip to content

Commit

Permalink
[nrf noup] tests: drivers: mspi: add SDP MSPI testcase
Browse files Browse the repository at this point in the history
Add SDP MPSI testcase to basic API test.

Signed-off-by: Jakub Zymelka <[email protected]>
  • Loading branch information
jaz1-nordic committed Nov 14, 2024
1 parent 42fc53c commit 6303428
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/drivers/mspi/api/boards/nrf54l15dk_nrf54l15_cpuapp.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (c) 2024 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/

/ {

Check warning on line 7 in tests/drivers/mspi/api/boards/nrf54l15dk_nrf54l15_cpuapp.overlay

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

tests/drivers/mspi/api/boards/nrf54l15dk_nrf54l15_cpuapp.overlay:7 please, no spaces at the start of a line
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>;
};
};
};

Check warning on line 24 in tests/drivers/mspi/api/boards/nrf54l15dk_nrf54l15_cpuapp.overlay

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

MISSING_EOF_NEWLINE

tests/drivers/mspi/api/boards/nrf54l15dk_nrf54l15_cpuapp.overlay:24 adding a line without newline at end of file
10 changes: 10 additions & 0 deletions tests/drivers/mspi/api/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ typedef struct mspi_ambiq_timing_cfg mspi_timing_cfg;
typedef enum mspi_ambiq_timing_param mspi_timing_param;
#endif

// #if defined(CONFIG_SOC_NRF54L15_CPUAPP)

Check failure on line 23 in tests/drivers/mspi/api/src/main.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

C99_COMMENTS

tests/drivers/mspi/api/src/main.c:23 do not use C99 // comments
// #define MSPI_BUS_NODE DT_NODELABEL(sdp_mspi)

Check failure on line 24 in tests/drivers/mspi/api/src/main.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

C99_COMMENTS

tests/drivers/mspi/api/src/main.c:24 do not use C99 // comments
// #else

Check failure on line 25 in tests/drivers/mspi/api/src/main.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

C99_COMMENTS

tests/drivers/mspi/api/src/main.c:25 do not use C99 // comments
#define MSPI_BUS_NODE DT_ALIAS(mspi0)
// #endif

Check failure on line 27 in tests/drivers/mspi/api/src/main.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

C99_COMMENTS

tests/drivers/mspi/api/src/main.c:27 do not use C99 // comments

static const struct device *mspi_devices[] = {
DT_FOREACH_CHILD_STATUS_OKAY_SEP(MSPI_BUS_NODE, DEVICE_DT_GET, (,))
Expand Down Expand Up @@ -51,13 +55,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)
{
Expand Down Expand Up @@ -102,9 +110,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.");
Expand Down
16 changes: 16 additions & 0 deletions tests/drivers/mspi/api/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 6303428

Please sign in to comment.