tests: spi_loopback: Enable SPI testing on SAM

Adds the needed overlays and board dtsi modifications to run the
spi loopback test on the sam e70 xplained, tdk robokit1, and sam v71 xult.

Tests both DMA and non-DMA configurations.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
This commit is contained in:
Tom Burdick 2022-10-25 10:08:31 -05:00 committed by Fabio Baltieri
commit 32d10fca25
10 changed files with 167 additions and 0 deletions

View file

@ -97,6 +97,9 @@
cs-gpios = <&piod 25 GPIO_ACTIVE_LOW>,
<&piod 27 GPIO_ACTIVE_LOW>;
dmas = <&xdmac 1 DMA_PERID_SPI0_TX>, <&xdmac 2 DMA_PERID_SPI0_RX>;
dma-names = "tx", "rx";
};
&usart1 {
@ -191,6 +194,10 @@ zephyr_udc0: &usbhs {
dmas = <&xdmac 22 DMA_PERID_SSC_RX>, <&xdmac 23 DMA_PERID_SSC_TX>;
};
&xdmac {
status = "okay";
};
&can0 {
status = "okay";

View file

@ -9,6 +9,7 @@ toolchain:
- gnuarmemb
- xtools
supported:
- dma
- netif:eth
- adc
- i2s

View file

@ -196,6 +196,9 @@
cs-gpios = <&piod 25 GPIO_ACTIVE_LOW>,
<&piod 27 GPIO_ACTIVE_LOW>;
dmas = <&xdmac 1 DMA_PERID_SPI0_TX>, <&xdmac 2 DMA_PERID_SPI0_RX>;
dma-names = "tx", "rx";
};
&usart1 {

View file

@ -7,6 +7,7 @@ toolchain:
- gnuarmemb
- xtools
supported:
- dma
- netif:eth
- adc
- arduino_gpio

View file

@ -0,0 +1,41 @@
/*
* Copyright (c) 2022 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
&spi0 {
loopback;
dmas = <&xdmac 1 DMA_PERID_SPI0_TX>, <&xdmac 2 DMA_PERID_SPI0_RX>;
dma-names = "tx", "rx";
slow@0 {
compatible = "test-spi-loopback-slow";
reg = <0>;
spi-max-frequency = <500000>;
};
fast@0 {
compatible = "test-spi-loopback-fast";
reg = <0>;
spi-max-frequency = <1000000>;
};
};
&spi1 {
loopback;
dmas = <&xdmac 3 DMA_PERID_SPI1_TX>, <&xdmac 4 DMA_PERID_SPI1_RX>;
dma-names = "tx", "rx";
slow@0 {
compatible = "test-spi-loopback-slow";
reg = <0>;
spi-max-frequency = <500000>;
};
fast@0 {
compatible = "test-spi-loopback-fast";
reg = <0>;
spi-max-frequency = <1000000>;
};
};

View file

@ -0,0 +1,41 @@
/*
* Copyright (c) 2022 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
&spi0 {
loopback;
dmas = <&xdmac 1 DMA_PERID_SPI0_TX>, <&xdmac 2 DMA_PERID_SPI0_RX>;
dma-names = "tx", "rx";
slow@0 {
compatible = "test-spi-loopback-slow";
reg = <0>;
spi-max-frequency = <500000>;
};
fast@0 {
compatible = "test-spi-loopback-fast";
reg = <0>;
spi-max-frequency = <1000000>;
};
};
&spi1 {
loopback;
dmas = <&xdmac 3 DMA_PERID_SPI1_TX>, <&xdmac 4 DMA_PERID_SPI1_RX>;
dma-names = "tx", "rx";
slow@0 {
compatible = "test-spi-loopback-slow";
reg = <0>;
spi-max-frequency = <500000>;
};
fast@0 {
compatible = "test-spi-loopback-fast";
reg = <0>;
spi-max-frequency = <1000000>;
};
};

View file

@ -0,0 +1,19 @@
/*
* Copyright (c) 2022 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
&spi0 {
loopback;
slow@0 {
compatible = "test-spi-loopback-slow";
reg = <0>;
spi-max-frequency = <500000>;
};
fast@0 {
compatible = "test-spi-loopback-fast";
reg = <0>;
spi-max-frequency = <16000000>;
};
};

View file

@ -0,0 +1,2 @@
# enable DMA mode
CONFIG_SPI_SAM_DMA=y

View file

@ -0,0 +1,45 @@
/*
* Copyright (c) 2022 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
&dma0 {
status = "okay";
};
&spi0 {
loopback;
dmas = <&dma0 1 DMA_PERID_SPI0_TX>, <&dma0 2 DMA_PERID_SPI0_RX>;
dma-names = "tx", "rx";
slow@0 {
compatible = "test-spi-loopback-slow";
reg = <0>;
spi-max-frequency = <500000>;
};
fast@0 {
compatible = "test-spi-loopback-fast";
reg = <0>;
spi-max-frequency = <1000000>;
};
};
&spi1 {
loopback;
dmas = <&dma0 3 DMA_PERID_SPI1_TX>, <&dma0 4 DMA_PERID_SPI1_RX>;
dma-names = "tx", "rx";
slow@0 {
compatible = "test-spi-loopback-slow";
reg = <0>;
spi-max-frequency = <500000>;
};
fast@0 {
compatible = "test-spi-loopback-fast";
reg = <0>;
spi-max-frequency = <1000000>;
};
};

View file

@ -16,6 +16,13 @@ tests:
harness_config:
fixture: spi_loopback
platform_allow: frdm_k64f
drivers.sam_spi_dma.loopback:
tags: dma
harness: ztest
extra_args: OVERLAY_CONFIG="overlay-sam-spi-dma.conf" DTC_OVERLAY_FILE="overlay-sam-spi-dma.overlay"
harness_config:
fixture: spi_loopback
platform_allow: sam_e70_xplained sam_v71_xult tdk_robokit1
drivers.stm32_spi_dma.loopback:
tags: dma
harness: ztest