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:
parent
f7a2093c51
commit
32d10fca25
10 changed files with 167 additions and 0 deletions
|
@ -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";
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ toolchain:
|
|||
- gnuarmemb
|
||||
- xtools
|
||||
supported:
|
||||
- dma
|
||||
- netif:eth
|
||||
- adc
|
||||
- i2s
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -7,6 +7,7 @@ toolchain:
|
|||
- gnuarmemb
|
||||
- xtools
|
||||
supported:
|
||||
- dma
|
||||
- netif:eth
|
||||
- adc
|
||||
- arduino_gpio
|
||||
|
|
|
@ -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>;
|
||||
};
|
||||
};
|
41
tests/drivers/spi/spi_loopback/boards/sam_v71_xult.overlay
Normal file
41
tests/drivers/spi/spi_loopback/boards/sam_v71_xult.overlay
Normal 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>;
|
||||
};
|
||||
};
|
19
tests/drivers/spi/spi_loopback/boards/tdk_robokit1.overlay
Normal file
19
tests/drivers/spi/spi_loopback/boards/tdk_robokit1.overlay
Normal 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>;
|
||||
};
|
||||
};
|
2
tests/drivers/spi/spi_loopback/overlay-sam-spi-dma.conf
Normal file
2
tests/drivers/spi/spi_loopback/overlay-sam-spi-dma.conf
Normal file
|
@ -0,0 +1,2 @@
|
|||
# enable DMA mode
|
||||
CONFIG_SPI_SAM_DMA=y
|
45
tests/drivers/spi/spi_loopback/overlay-sam-spi-dma.overlay
Normal file
45
tests/drivers/spi/spi_loopback/overlay-sam-spi-dma.overlay
Normal 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>;
|
||||
};
|
||||
};
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue