From 435f32d19189d1ee9bbb575df7d909572dc149e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Fri, 19 Apr 2024 08:49:02 +0200 Subject: [PATCH] tests: drivers: spi: spi_slave: Add nrf54h20dk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add configuration for nrf54h20dk to the test. Signed-off-by: Krzysztof Chruściński --- .../boards/nrf54h20dk_nrf54h20_common.dtsi | 79 +++++++++++++++++++ .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 14 ++++ .../boards/nrf54h20dk_nrf54h20_cpurad.overlay | 14 ++++ tests/drivers/spi/spi_slave/src/main.c | 1 + tests/drivers/spi/spi_slave/testcase.yaml | 4 +- 5 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 tests/drivers/spi/spi_slave/boards/nrf54h20dk_nrf54h20_common.dtsi create mode 100644 tests/drivers/spi/spi_slave/boards/nrf54h20dk_nrf54h20_cpuapp.overlay create mode 100644 tests/drivers/spi/spi_slave/boards/nrf54h20dk_nrf54h20_cpurad.overlay diff --git a/tests/drivers/spi/spi_slave/boards/nrf54h20dk_nrf54h20_common.dtsi b/tests/drivers/spi/spi_slave/boards/nrf54h20dk_nrf54h20_common.dtsi new file mode 100644 index 0000000000..0a9425cc2f --- /dev/null +++ b/tests/drivers/spi/spi_slave/boards/nrf54h20dk_nrf54h20_common.dtsi @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&pinctrl { + spi130_default_alt: spi130_default_alt { + group1 { + psels = , + , + ; + }; + }; + + spi130_sleep_alt: spi130_sleep_alt { + group1 { + psels = , + , + ; + low-power-enable; + }; + }; + + spis131_default_alt: spis131_default_alt { + group1 { + psels = , + , + , + ; + }; + }; + + spis131_sleep_alt: spis131_sleep_alt { + group1 { + psels = , + , + , + ; + low-power-enable; + }; + }; + +}; + +&gpio0 { + status = "okay"; +}; + +&gpiote130 { + status = "okay"; + owned-channels = <7>; +}; + +dut_spi: &spi130 { + compatible = "nordic,nrf-spim"; + status = "okay"; + pinctrl-0 = <&spi130_default_alt>; + pinctrl-1 = <&spi130_sleep_alt>; + pinctrl-names = "default", "sleep"; + overrun-character = <0x00>; + cs-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; + dut_spi_dt: test-spi-dev@0 { + compatible = "vnd,spi-device"; + reg = <0>; + spi-max-frequency = <500000>; + }; +}; + +dut_spis: &spi131 { + compatible = "nordic,nrf-spis"; + status = "okay"; + def-char = <0x00>; + pinctrl-0 = <&spis131_default_alt>; + pinctrl-1 = <&spis131_sleep_alt>; + pinctrl-names = "default", "sleep"; + /delete-property/rx-delay-supported; + /delete-property/rx-delay; +}; diff --git a/tests/drivers/spi/spi_slave/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/spi/spi_slave/boards/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 0000000000..ff337ebdec --- /dev/null +++ b/tests/drivers/spi/spi_slave/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ +#include "nrf54h20dk_nrf54h20_common.dtsi" + +&dut_spi { + memory-regions = <&cpuapp_dma_region>; +}; + +&dut_spis { + memory-regions = <&cpuapp_dma_region>; +}; diff --git a/tests/drivers/spi/spi_slave/boards/nrf54h20dk_nrf54h20_cpurad.overlay b/tests/drivers/spi/spi_slave/boards/nrf54h20dk_nrf54h20_cpurad.overlay new file mode 100644 index 0000000000..936bd5b15d --- /dev/null +++ b/tests/drivers/spi/spi_slave/boards/nrf54h20dk_nrf54h20_cpurad.overlay @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ +#include "nrf54h20dk_nrf54h20_common.dtsi" + +&dut_spi { + memory-regions = <&cpurad_dma_region>; +}; + +&dut_spis { + memory-regions = <&cpurad_dma_region>; +}; diff --git a/tests/drivers/spi/spi_slave/src/main.c b/tests/drivers/spi/spi_slave/src/main.c index 7a6ca1b754..5f441480c1 100644 --- a/tests/drivers/spi/spi_slave/src/main.c +++ b/tests/drivers/spi/spi_slave/src/main.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #define SPI_MODE (SPI_MODE_CPOL | SPI_MODE_CPHA | SPI_WORD_SET(8) | SPI_LINES_SINGLE) diff --git a/tests/drivers/spi/spi_slave/testcase.yaml b/tests/drivers/spi/spi_slave/testcase.yaml index 1b5a46cc9e..c38b3e7295 100644 --- a/tests/drivers/spi/spi_slave/testcase.yaml +++ b/tests/drivers/spi/spi_slave/testcase.yaml @@ -5,6 +5,8 @@ tests: harness: ztest harness_config: fixture: gpio_spi_loopback - platform_allow: nrf52840dk/nrf52840 nrf54l15pdk/nrf54l15/cpuapp + platform_allow: | + nrf52840dk/nrf52840 nrf54l15pdk/nrf54l15/cpuapp nrf54h20dk/nrf54h20/cpuapp + nrf54h20dk/nrf54h20/cpurad integration_platforms: - nrf52840dk/nrf52840