Skip to content

Commit 435f32d

Browse files
nordic-krchnashif
authored andcommitted
tests: drivers: spi: spi_slave: Add nrf54h20dk
Add configuration for nrf54h20dk to the test. Signed-off-by: Krzysztof Chruściński <[email protected]>
1 parent 47896e4 commit 435f32d

File tree

5 files changed

+111
-1
lines changed

5 files changed

+111
-1
lines changed
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
/*
2+
* Copyright (c) 2024 Nordic Semiconductor
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
&pinctrl {
8+
spi130_default_alt: spi130_default_alt {
9+
group1 {
10+
psels = <NRF_PSEL(SPIM_SCK, 0, 0)>,
11+
<NRF_PSEL(SPIM_MISO, 0, 6)>,
12+
<NRF_PSEL(SPIM_MOSI, 0, 8)>;
13+
};
14+
};
15+
16+
spi130_sleep_alt: spi130_sleep_alt {
17+
group1 {
18+
psels = <NRF_PSEL(SPIM_SCK, 0, 0)>,
19+
<NRF_PSEL(SPIM_MISO, 0, 6)>,
20+
<NRF_PSEL(SPIM_MOSI, 0, 8)>;
21+
low-power-enable;
22+
};
23+
};
24+
25+
spis131_default_alt: spis131_default_alt {
26+
group1 {
27+
psels = <NRF_PSEL(SPIS_SCK, 0, 1)>,
28+
<NRF_PSEL(SPIS_MISO, 0, 7)>,
29+
<NRF_PSEL(SPIS_MOSI, 0, 9)>,
30+
<NRF_PSEL(SPIS_CSN, 0, 11)>;
31+
};
32+
};
33+
34+
spis131_sleep_alt: spis131_sleep_alt {
35+
group1 {
36+
psels = <NRF_PSEL(SPIS_SCK, 0, 1)>,
37+
<NRF_PSEL(SPIS_MISO, 0, 7)>,
38+
<NRF_PSEL(SPIS_MOSI, 0, 9)>,
39+
<NRF_PSEL(SPIS_CSN, 0, 11)>;
40+
low-power-enable;
41+
};
42+
};
43+
44+
};
45+
46+
&gpio0 {
47+
status = "okay";
48+
};
49+
50+
&gpiote130 {
51+
status = "okay";
52+
owned-channels = <7>;
53+
};
54+
55+
dut_spi: &spi130 {
56+
compatible = "nordic,nrf-spim";
57+
status = "okay";
58+
pinctrl-0 = <&spi130_default_alt>;
59+
pinctrl-1 = <&spi130_sleep_alt>;
60+
pinctrl-names = "default", "sleep";
61+
overrun-character = <0x00>;
62+
cs-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
63+
dut_spi_dt: test-spi-dev@0 {
64+
compatible = "vnd,spi-device";
65+
reg = <0>;
66+
spi-max-frequency = <500000>;
67+
};
68+
};
69+
70+
dut_spis: &spi131 {
71+
compatible = "nordic,nrf-spis";
72+
status = "okay";
73+
def-char = <0x00>;
74+
pinctrl-0 = <&spis131_default_alt>;
75+
pinctrl-1 = <&spis131_sleep_alt>;
76+
pinctrl-names = "default", "sleep";
77+
/delete-property/rx-delay-supported;
78+
/delete-property/rx-delay;
79+
};
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* Copyright (c) 2024 Nordic Semiconductor
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
#include "nrf54h20dk_nrf54h20_common.dtsi"
7+
8+
&dut_spi {
9+
memory-regions = <&cpuapp_dma_region>;
10+
};
11+
12+
&dut_spis {
13+
memory-regions = <&cpuapp_dma_region>;
14+
};
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* Copyright (c) 2024 Nordic Semiconductor
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
#include "nrf54h20dk_nrf54h20_common.dtsi"
7+
8+
&dut_spi {
9+
memory-regions = <&cpurad_dma_region>;
10+
};
11+
12+
&dut_spis {
13+
memory-regions = <&cpurad_dma_region>;
14+
};

tests/drivers/spi/spi_slave/src/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <string.h>
99
#include <zephyr/kernel.h>
1010
#include <zephyr/drivers/spi.h>
11+
#include <zephyr/linker/devicetree_regions.h>
1112
#include <zephyr/ztest.h>
1213

1314
#define SPI_MODE (SPI_MODE_CPOL | SPI_MODE_CPHA | SPI_WORD_SET(8) | SPI_LINES_SINGLE)

tests/drivers/spi/spi_slave/testcase.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ tests:
55
harness: ztest
66
harness_config:
77
fixture: gpio_spi_loopback
8-
platform_allow: nrf52840dk/nrf52840 nrf54l15pdk/nrf54l15/cpuapp
8+
platform_allow: |
9+
nrf52840dk/nrf52840 nrf54l15pdk/nrf54l15/cpuapp nrf54h20dk/nrf54h20/cpuapp
10+
nrf54h20dk/nrf54h20/cpurad
911
integration_platforms:
1012
- nrf52840dk/nrf52840

0 commit comments

Comments
 (0)