tests: spi: spi_loopback: add interrupt and DMA tests for GD32 boards
Add interrupt and DMA tests for GD32 boards. Use overlay-gd32-spi-interrupt.conf when testing interrupt based transfer, use overlay-gd32-spi-dma.conf when testing DMA transfer, Add overlay file for GD32 boards for these tests. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
This commit is contained in:
parent
e55cbb8ce6
commit
2af7d728e2
14 changed files with 436 additions and 0 deletions
42
tests/drivers/spi/spi_loopback/boards/gd32f403z_eval.overlay
Normal file
42
tests/drivers/spi/spi_loopback/boards/gd32f403z_eval.overlay
Normal file
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Copyright (c) 2022 TOKITA Hiroshi <tokita.hiroshi@gmail.com>
|
||||
*/
|
||||
|
||||
#include <dt-bindings/dma/gd32_dma.h>
|
||||
|
||||
&dma0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pinctrl {
|
||||
spi0_default: spi0_default {
|
||||
group1 {
|
||||
pinmux = <SPI0_MISO_PA6_INP_NORMP>, <SPI0_SCK_PA5_OUT_NORMP>,
|
||||
<SPI0_MOSI_PA7_OUT_NORMP>, <SPI0_NSS_PA4_OUT_NORMP>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&spi0 {
|
||||
status = "okay";
|
||||
pinctrl-0 = <&spi0_default>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
cs-gpios = <&gpioa 4 GPIO_ACTIVE_LOW>;
|
||||
|
||||
dmas = <&dma0 1 0>, <&dma0 2 0>;
|
||||
dma-names = "rx", "tx";
|
||||
|
||||
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>;
|
||||
};
|
||||
};
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Copyright (c) 2022 TOKITA Hiroshi <tokita.hiroshi@gmail.com>
|
||||
*/
|
||||
|
||||
#include <dt-bindings/dma/gd32_dma.h>
|
||||
|
||||
&dma1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pinctrl {
|
||||
spi0_default: spi0_default {
|
||||
group1 {
|
||||
pinmux = <SPI0_MISO_PA6>, <SPI0_SCK_PA5>,
|
||||
<SPI0_MOSI_PA7>, <SPI0_NSS_PA4>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&spi0 {
|
||||
status = "okay";
|
||||
pinctrl-0 = <&spi0_default>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
cs-gpios = <&gpioa 4 GPIO_ACTIVE_LOW>;
|
||||
|
||||
dmas = <&dma1 0 3 0 0>, <&dma1 5 3 0 0>;
|
||||
dma-names = "rx", "tx";
|
||||
|
||||
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>;
|
||||
};
|
||||
};
|
42
tests/drivers/spi/spi_loopback/boards/gd32f450i_eval.overlay
Normal file
42
tests/drivers/spi/spi_loopback/boards/gd32f450i_eval.overlay
Normal file
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Copyright (c) 2022 TOKITA Hiroshi <tokita.hiroshi@gmail.com>
|
||||
*/
|
||||
|
||||
#include <dt-bindings/dma/gd32_dma.h>
|
||||
|
||||
&dma1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pinctrl {
|
||||
spi0_default: spi0_default {
|
||||
group1 {
|
||||
pinmux = <SPI0_MISO_PA6>, <SPI0_SCK_PA5>,
|
||||
<SPI0_MOSI_PA7>, <SPI0_NSS_PA4>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&spi0 {
|
||||
status = "okay";
|
||||
pinctrl-0 = <&spi0_default>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
cs-gpios = <&gpioa 4 GPIO_ACTIVE_LOW>;
|
||||
|
||||
dmas = <&dma1 0 3 0 0>, <&dma1 5 3 0 0>;
|
||||
dma-names = "rx", "tx";
|
||||
|
||||
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>;
|
||||
};
|
||||
};
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Copyright (c) 2022 TOKITA Hiroshi <tokita.hiroshi@gmail.com>
|
||||
*/
|
||||
|
||||
#include <dt-bindings/dma/gd32_dma.h>
|
||||
|
||||
&dma1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pinctrl {
|
||||
spi0_default: spi0_default {
|
||||
group1 {
|
||||
pinmux = <SPI0_MISO_PA6>, <SPI0_SCK_PA5>,
|
||||
<SPI0_MOSI_PA7>, <SPI0_NSS_PA4>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&spi0 {
|
||||
status = "okay";
|
||||
pinctrl-0 = <&spi0_default>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
cs-gpios = <&gpioa 4 GPIO_ACTIVE_LOW>;
|
||||
|
||||
dmas = <&dma1 0 3 0 0>, <&dma1 5 3 0 0>;
|
||||
dma-names = "rx", "tx";
|
||||
|
||||
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>;
|
||||
};
|
||||
};
|
42
tests/drivers/spi/spi_loopback/boards/gd32f450z_eval.overlay
Normal file
42
tests/drivers/spi/spi_loopback/boards/gd32f450z_eval.overlay
Normal file
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Copyright (c) 2022 TOKITA Hiroshi <tokita.hiroshi@gmail.com>
|
||||
*/
|
||||
|
||||
#include <dt-bindings/dma/gd32_dma.h>
|
||||
|
||||
&dma1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pinctrl {
|
||||
spi0_default: spi0_default {
|
||||
group1 {
|
||||
pinmux = <SPI0_MISO_PA6>, <SPI0_SCK_PA5>,
|
||||
<SPI0_MOSI_PA7>, <SPI0_NSS_PA4>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&spi0 {
|
||||
status = "okay";
|
||||
pinctrl-0 = <&spi0_default>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
cs-gpios = <&gpioa 4 GPIO_ACTIVE_LOW>;
|
||||
|
||||
dmas = <&dma1 0 3 0 0>, <&dma1 5 3 0 0>;
|
||||
dma-names = "rx", "tx";
|
||||
|
||||
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>;
|
||||
};
|
||||
};
|
42
tests/drivers/spi/spi_loopback/boards/gd32f470i_eval.overlay
Normal file
42
tests/drivers/spi/spi_loopback/boards/gd32f470i_eval.overlay
Normal file
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Copyright (c) 2022 TOKITA Hiroshi <tokita.hiroshi@gmail.com>
|
||||
*/
|
||||
|
||||
#include <dt-bindings/dma/gd32_dma.h>
|
||||
|
||||
&dma1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pinctrl {
|
||||
spi0_default: spi0_default {
|
||||
group1 {
|
||||
pinmux = <SPI0_MISO_PA6>, <SPI0_SCK_PA5>,
|
||||
<SPI0_MOSI_PA7>, <SPI0_NSS_PA4>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&spi0 {
|
||||
status = "okay";
|
||||
pinctrl-0 = <&spi0_default>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
cs-gpios = <&gpioa 4 GPIO_ACTIVE_LOW>;
|
||||
|
||||
dmas = <&dma1 0 3 0 0>, <&dma1 5 3 0 0>;
|
||||
dma-names = "rx", "tx";
|
||||
|
||||
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>;
|
||||
};
|
||||
};
|
|
@ -0,0 +1,4 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
# Copyright (c) 2022 TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
|
||||
|
||||
CONFIG_GPIO=y
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Copyright (c) 2022 TOKITA Hiroshi <tokita.hiroshi@gmail.com>
|
||||
*/
|
||||
|
||||
#include <dt-bindings/dma/gd32_dma.h>
|
||||
|
||||
&dma0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pinctrl {
|
||||
spi0_default: spi0_default {
|
||||
group1 {
|
||||
pinmux = <SPI0_MISO_PA6_INP_NORMP>, <SPI0_SCK_PA5_OUT_NORMP>,
|
||||
<SPI0_MOSI_PA7_OUT_NORMP>, <SPI0_NSS_PA4_OUT_NORMP>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&spi0 {
|
||||
status = "okay";
|
||||
pinctrl-0 = <&spi0_default>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
cs-gpios = <&gpioa 4 GPIO_ACTIVE_LOW>;
|
||||
|
||||
dmas = <&dma0 1 0>, <&dma0 2 0>;
|
||||
dma-names = "rx", "tx";
|
||||
|
||||
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>;
|
||||
};
|
||||
};
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Copyright (c) 2022 TOKITA Hiroshi <tokita.hiroshi@gmail.com>
|
||||
*/
|
||||
|
||||
#include <dt-bindings/dma/gd32_dma.h>
|
||||
|
||||
&dma0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pinctrl {
|
||||
spi0_default: spi0_default {
|
||||
group1 {
|
||||
pinmux = <SPI0_MISO_PA6_INP_NORMP>, <SPI0_SCK_PA5_OUT_NORMP>,
|
||||
<SPI0_MOSI_PA7_OUT_NORMP>, <SPI0_NSS_PA4_OUT_NORMP>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&spi0 {
|
||||
status = "okay";
|
||||
pinctrl-0 = <&spi0_default>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
cs-gpios = <&gpioa 4 GPIO_ACTIVE_LOW>;
|
||||
|
||||
dmas = <&dma0 1 0>, <&dma0 2 0>;
|
||||
dma-names = "rx", "tx";
|
||||
|
||||
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>;
|
||||
};
|
||||
};
|
42
tests/drivers/spi/spi_loopback/boards/longan_nano.overlay
Normal file
42
tests/drivers/spi/spi_loopback/boards/longan_nano.overlay
Normal file
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Copyright (c) 2022 TOKITA Hiroshi <tokita.hiroshi@gmail.com>
|
||||
*/
|
||||
|
||||
#include <dt-bindings/dma/gd32_dma.h>
|
||||
|
||||
&dma0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pinctrl {
|
||||
spi0_default: spi0_default {
|
||||
group1 {
|
||||
pinmux = <SPI0_MISO_PA6_INP_NORMP>, <SPI0_SCK_PA5_OUT_NORMP>,
|
||||
<SPI0_MOSI_PA7_OUT_NORMP>, <SPI0_NSS_PA4_OUT_NORMP>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&spi0 {
|
||||
status = "okay";
|
||||
pinctrl-0 = <&spi0_default>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
cs-gpios = <&gpioa 4 GPIO_ACTIVE_LOW>;
|
||||
|
||||
dmas = <&dma0 1 0>, <&dma0 2 0>;
|
||||
dma-names = "rx", "tx";
|
||||
|
||||
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>;
|
||||
};
|
||||
};
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Copyright (c) 2022 TOKITA Hiroshi <tokita.hiroshi@gmail.com>
|
||||
*/
|
||||
|
||||
#include <dt-bindings/dma/gd32_dma.h>
|
||||
|
||||
&dma0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pinctrl {
|
||||
spi0_default: spi0_default {
|
||||
group1 {
|
||||
pinmux = <SPI0_MISO_PA6_INP_NORMP>, <SPI0_SCK_PA5_OUT_NORMP>,
|
||||
<SPI0_MOSI_PA7_OUT_NORMP>, <SPI0_NSS_PA4_OUT_NORMP>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&spi0 {
|
||||
status = "okay";
|
||||
pinctrl-0 = <&spi0_default>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
cs-gpios = <&gpioa 4 GPIO_ACTIVE_LOW>;
|
||||
|
||||
dmas = <&dma0 1 0>, <&dma0 2 0>;
|
||||
dma-names = "rx", "tx";
|
||||
|
||||
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-gd32-spi-dma.conf
Normal file
2
tests/drivers/spi/spi_loopback/overlay-gd32-spi-dma.conf
Normal file
|
@ -0,0 +1,2 @@
|
|||
# enable DMA mode for SPI loopback test
|
||||
CONFIG_SPI_GD32_DMA=y
|
|
@ -0,0 +1,2 @@
|
|||
# enable interrupt mode for SPI loopback test
|
||||
CONFIG_SPI_GD32_INTERRUPT=y
|
|
@ -27,3 +27,11 @@ tests:
|
|||
nucleo_l152re nucleo_wl55jc nucleo_h743zi
|
||||
integration_platforms:
|
||||
- nucleo_g474re
|
||||
drivers.gd32_spi_interrupt.loopback:
|
||||
extra_args: OVERLAY_CONFIG="overlay-gd32-spi-interrupt.conf"
|
||||
platform_allow: gd32f403z_eval gd32f407v_start gd32f450i_eval gd32f450v_start
|
||||
gd32f450z_eval gd32f470i_eval gd32vf103c_starter gd32vf103v_eval longan_nano longan_nano_lite
|
||||
drivers.gd32_spi_dma.loopback:
|
||||
extra_args: OVERLAY_CONFIG="overlay-gd32-spi-dma.conf"
|
||||
platform_allow: gd32f403z_eval gd32f407v_start gd32f450i_eval gd32f450v_start
|
||||
gd32f450z_eval gd32f470i_eval gd32vf103c_starter gd32vf103v_eval longan_nano longan_nano_lite
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue