tests: spi_loopback: Rework test

* Move test to using devicetree for various "device" params.
* Move test to using spi_dt_spec to simplify code

Signed-off-by: Kumar Gala <galak@kernel.org>
This commit is contained in:
Kumar Gala 2022-07-22 14:49:37 -05:00 committed by Carles Cufí
commit ac50f8a99e
103 changed files with 908 additions and 293 deletions

View file

@ -4,34 +4,5 @@ mainmenu "SPI Loopback Test"
source "Kconfig.zephyr"
config SPI_LOOPBACK_DRV_NAME
string "SPI device name to use for test"
config SPI_LOOPBACK_CS_GPIO
bool "SPI port CS pin is controlled via a GPIO port during test"
depends on GPIO
config SPI_LOOPBACK_CS_CTRL_GPIO_DRV_NAME
string "The GPIO port which is used to control CS"
depends on SPI_LOOPBACK_CS_GPIO
default "GPIO_0"
config SPI_LOOPBACK_CS_CTRL_GPIO_PIN
int "The GPIO PIN which is used to act as a CS pin"
depends on SPI_LOOPBACK_CS_GPIO
default 0
config SPI_LOOPBACK_SLAVE_NUMBER
int "Slave number from 0 to host controller slave limit"
default 0
config SPI_LOOPBACK_SLOW_FREQ
int "The frequency in Hz to use when testing in slow mode"
default 500000
config SPI_LOOPBACK_FAST_FREQ
int "The frequency in Hz to use when testing in fast mode"
default 16000000
config SPI_LOOPBACK_MODE_LOOP
bool "Configure the SPI in LOOP mode, so that no extra wiring is needed"

View file

@ -1,2 +1 @@
CONFIG_SPI_LOOPBACK_DRV_NAME="SPI_2"
CONFIG_SPI_STM32_INTERRUPT=y

View file

@ -0,0 +1,18 @@
/*
* Copyright (c) 2022 Kumar Gala <galak@kernel.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
&spi2 {
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

@ -1,4 +0,0 @@
CONFIG_SPI_LOOPBACK_CS_GPIO=y
CONFIG_SPI_LOOPBACK_CS_CTRL_GPIO_DRV_NAME="GPIOE"
CONFIG_SPI_LOOPBACK_CS_CTRL_GPIO_PIN=11
CONFIG_SPI_LOOPBACK_DRV_NAME="SPI_4"

View file

@ -0,0 +1,19 @@
/*
* Copyright (c) 2022 Kumar Gala <galak@kernel.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
&spi4 {
cs-gpios = <&gpioe 11 GPIO_ACTIVE_LOW>;
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

@ -1,5 +1,2 @@
CONFIG_SPI_LOOPBACK_DRV_NAME="SERCOM1"
CONFIG_GPIO=y
CONFIG_SPI_LOOPBACK_MODE_LOOP=y
CONFIG_SPI_LOOPBACK_CS_GPIO=y
CONFIG_SPI_LOOPBACK_CS_CTRL_GPIO_DRV_NAME="PORTA"
CONFIG_SPI_LOOPBACK_CS_CTRL_GPIO_PIN=7

View file

@ -0,0 +1,19 @@
/*
* Copyright (c) 2022 Kumar Gala <galak@kernel.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
&sercom1 {
cs-gpios = <&porta 7 GPIO_ACTIVE_LOW>;
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

@ -1,4 +1,2 @@
CONFIG_SPI_LOOPBACK_DRV_NAME="SERCOM4"
CONFIG_SPI_LOOPBACK_CS_GPIO=y
CONFIG_SPI_LOOPBACK_CS_CTRL_GPIO_DRV_NAME="PINMUX_A"
CONFIG_SPI_LOOPBACK_CS_CTRL_GPIO_PIN=3
CONFIG_GPIO=y
CONFIG_SPI_ASYNC=n

View file

@ -0,0 +1,19 @@
/*
* Copyright (c) 2022 Kumar Gala <galak@kernel.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
&sercom4 {
cs-gpios = <&porta 3 GPIO_ACTIVE_LOW>;
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

@ -4,5 +4,4 @@
# SPDX-License-Identifier: Apache-2.0
#
CONFIG_SPI_LOOPBACK_DRV_NAME="DAPLINK_SINGLE_SPI_0"
CONFIG_SPI_LOOPBACK_MODE_LOOP=y

View file

@ -6,4 +6,14 @@
&daplink_single_spi0 {
status = "okay";
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

@ -1,2 +1 @@
CONFIG_SPI_LOOPBACK_DRV_NAME="SERCOM5"
CONFIG_SPI_LOOPBACK_CS_GPIO=n
CONFIG_SPI_ASYNC=n

View file

@ -8,4 +8,14 @@
/* Internally connect MOSI to MISO for loop-back operation */
dipo = <0>;
dopo = <0>;
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

@ -1,2 +0,0 @@
CONFIG_SPI_LOOPBACK_DRV_NAME="SPI_0"
CONFIG_SPI_LOOPBACK_CS_GPIO=n

View file

@ -8,4 +8,14 @@
/* Internally connect MOSI to MISO for loop-back operation */
dipo = <3>;
dopo = <2>;
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

@ -1,2 +1 @@
CONFIG_SPI_LOOPBACK_DRV_NAME="SPI_0"
CONFIG_SPI_LOOPBACK_CS_GPIO=n
CONFIG_SPI_ASYNC=n

View file

@ -8,4 +8,14 @@
/* Internally connect MOSI to MISO for loop-back operation */
dipo = <0>;
dopo = <0>;
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

@ -7,3 +7,16 @@
&rcc {
apb2-prescaler = <2>;
};
&spi1 {
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

@ -1,8 +1,3 @@
CONFIG_SPI_LOOPBACK_DRV_NAME="SPI_0"
CONFIG_SPI_LOOPBACK_SLOW_FREQ=2000000
CONFIG_SPI_LOOPBACK_FAST_FREQ=3000000
CONFIG_SPI_LOOPBACK_MODE_LOOP=y
#The driver does not yet have async support

View file

@ -0,0 +1,18 @@
/*
* Copyright (c) 2022 Kumar Gala <galak@kernel.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
&spi0 {
slow@0 {
compatible = "test-spi-loopback-slow";
reg = <0>;
spi-max-frequency = <2000000>;
};
fast@0 {
compatible = "test-spi-loopback-fast";
reg = <0>;
spi-max-frequency = <3000000>;
};
};

View file

@ -1 +0,0 @@
CONFIG_GPIO=y

View file

@ -1,2 +0,0 @@
CONFIG_SPI_LOOPBACK_DRV_NAME="SPI_0"
CONFIG_SPI_LOOPBACK_SLOW_FREQ=128000

View file

@ -0,0 +1,18 @@
/*
* Copyright (c) 2022 Kumar Gala <galak@kernel.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
&spi0 {
slow@0 {
compatible = "test-spi-loopback-slow";
reg = <0>;
spi-max-frequency = <128000>;
};
fast@0 {
compatible = "test-spi-loopback-fast";
reg = <0>;
spi-max-frequency = <16000000>;
};
};

View file

@ -1,2 +1 @@
CONFIG_SPI_LOOPBACK_DRV_NAME="SPI_3"
CONFIG_SPI_ESP32_INTERRUPT=y

View file

@ -0,0 +1,18 @@
/*
* Copyright (c) 2022 Kumar Gala <galak@kernel.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
&spi3 {
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

@ -1,2 +1 @@
CONFIG_SPI_LOOPBACK_DRV_NAME="SPI_2"
CONFIG_SPI_ESP32_INTERRUPT=y

View file

@ -0,0 +1,18 @@
/*
* Copyright (c) 2022 Kumar Gala <galak@kernel.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
&spi2 {
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

@ -1,2 +1 @@
CONFIG_SPI_LOOPBACK_DRV_NAME="SPI_3"
CONFIG_SPI_ESP32_INTERRUPT=y

View file

@ -0,0 +1,18 @@
/*
* Copyright (c) 2022 Kumar Gala <galak@kernel.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
&spi3 {
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

@ -1,7 +0,0 @@
#
# Copyright (c) 2018, NXP
#
# SPDX-License-Identifier: Apache-2.0
#
CONFIG_SPI_LOOPBACK_DRV_NAME="SPI_0"

View file

@ -0,0 +1,18 @@
/*
* Copyright (c) 2022 Kumar Gala <galak@kernel.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
&spi0 {
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

@ -1,9 +0,0 @@
#
# Copyright (c) 2018, NXP
#
# SPDX-License-Identifier: Apache-2.0
#
CONFIG_SPI_LOOPBACK_DRV_NAME="SPI_0"
CONFIG_SPI_LOOPBACK_SLOW_FREQ=5000
CONFIG_SPI_LOOPBACK_FAST_FREQ=160000

View file

@ -0,0 +1,18 @@
/*
* Copyright (c) 2022 Kumar Gala <galak@kernel.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
&spi0 {
slow@0 {
compatible = "test-spi-loopback-slow";
reg = <0>;
spi-max-frequency = <5000>;
};
fast@0 {
compatible = "test-spi-loopback-fast";
reg = <0>;
spi-max-frequency = <160000>;
};
};

View file

@ -1,8 +0,0 @@
#
# Copyright (c) 2019, NXP
#
# SPDX-License-Identifier: Apache-2.0
#
CONFIG_SPI_LOOPBACK_DRV_NAME="FLEXCOMM_5"
CONFIG_SPI_LOOPBACK_SLAVE_NUMBER=2

View file

@ -0,0 +1,18 @@
/*
* Copyright (c) 2022 Kumar Gala <galak@kernel.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
&flexcomm5 {
slow@2 {
compatible = "test-spi-loopback-slow";
reg = <2>;
spi-max-frequency = <500000>;
};
fast@2 {
compatible = "test-spi-loopback-fast";
reg = <2>;
spi-max-frequency = <16000000>;
};
};

View file

@ -1,10 +0,0 @@
#
# Copyright (c) 2020 Henrik Brix Andersen <henrik@brixandersen.dk>
#
# SPDX-License-Identifier: Apache-2.0
#
CONFIG_SPI_LOOPBACK_DRV_NAME="HS_LSPI"
CONFIG_SPI_LOOPBACK_SLAVE_NUMBER=1
CONFIG_SPI_LOOPBACK_SLOW_FREQ=5000
CONFIG_SPI_LOOPBACK_FAST_FREQ=160000

View file

@ -0,0 +1,18 @@
/*
* Copyright (c) 2022 Kumar Gala <galak@kernel.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
&hs_lspi {
slow@1 {
compatible = "test-spi-loopback-slow";
reg = <1>;
spi-max-frequency = <5000>;
};
fast@1 {
compatible = "test-spi-loopback-fast";
reg = <1>;
spi-max-frequency = <160000>;
};
};

View file

@ -3,8 +3,5 @@
#
# SPDX-License-Identifier: Apache-2.0
#
CONFIG_SPI_LOOPBACK_DRV_NAME="HS_LSPI"
CONFIG_SPI_LOOPBACK_SLAVE_NUMBER=1
CONFIG_SPI_MCUX_FLEXCOMM_DMA=y
CONFIG_SPI_ASYNC=n

View file

@ -0,0 +1,20 @@
/*
* Copyright (c) 2022 Kumar Gala <galak@kernel.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
&hs_lspi {
/delete-property/ cs-gpios;
slow@1 {
compatible = "test-spi-loopback-slow";
reg = <1>;
spi-max-frequency = <5000>;
};
fast@1 {
compatible = "test-spi-loopback-fast";
reg = <1>;
spi-max-frequency = <160000>;
};
};

View file

@ -3,7 +3,5 @@
#
# SPDX-License-Identifier: Apache-2.0
#
CONFIG_SPI_LOOPBACK_DRV_NAME="SPI_1"
CONFIG_SPI_MCUX_LPSPI_DMA=y
CONFIG_SPI_ASYNC=n

View file

@ -0,0 +1,18 @@
/*
* Copyright (c) 2022 Kumar Gala <galak@kernel.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
&lpspi1 {
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

@ -3,7 +3,5 @@
#
# SPDX-License-Identifier: Apache-2.0
#
CONFIG_SPI_LOOPBACK_DRV_NAME="SPI_1"
CONFIG_SPI_MCUX_LPSPI_DMA=y
CONFIG_SPI_ASYNC=n

View file

@ -0,0 +1,18 @@
/*
* Copyright (c) 2022 Kumar Gala <galak@kernel.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
&lpspi1 {
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

@ -3,7 +3,5 @@
#
# SPDX-License-Identifier: Apache-2.0
#
CONFIG_SPI_LOOPBACK_DRV_NAME="SPI_1"
CONFIG_SPI_MCUX_LPSPI_DMA=y
CONFIG_SPI_ASYNC=n

View file

@ -0,0 +1,18 @@
/*
* Copyright (c) 2022 Kumar Gala <galak@kernel.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
&lpspi1 {
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

@ -3,7 +3,5 @@
#
# SPDX-License-Identifier: Apache-2.0
#
CONFIG_SPI_LOOPBACK_DRV_NAME="SPI_1"
CONFIG_SPI_MCUX_LPSPI_DMA=y
CONFIG_SPI_ASYNC=n

View file

@ -0,0 +1,18 @@
/*
* Copyright (c) 2022 Kumar Gala <galak@kernel.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
&lpspi1 {
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

@ -3,7 +3,5 @@
#
# SPDX-License-Identifier: Apache-2.0
#
CONFIG_SPI_LOOPBACK_DRV_NAME="SPI_1"
CONFIG_SPI_MCUX_LPSPI_DMA=y
CONFIG_SPI_ASYNC=n

View file

@ -0,0 +1,18 @@
/*
* Copyright (c) 2022 Kumar Gala <galak@kernel.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
&lpspi1 {
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

@ -3,7 +3,5 @@
#
# SPDX-License-Identifier: Apache-2.0
#
CONFIG_SPI_LOOPBACK_DRV_NAME="SPI_1"
CONFIG_SPI_MCUX_LPSPI_DMA=y
CONFIG_SPI_ASYNC=n

View file

@ -0,0 +1,18 @@
/*
* Copyright (c) 2022 Kumar Gala <galak@kernel.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
&lpspi1 {
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

@ -3,7 +3,5 @@
#
# SPDX-License-Identifier: Apache-2.0
#
CONFIG_SPI_LOOPBACK_DRV_NAME="SPI_1"
CONFIG_SPI_MCUX_LPSPI_DMA=y
CONFIG_SPI_ASYNC=n

View file

@ -0,0 +1,18 @@
/*
* Copyright (c) 2022 Kumar Gala <galak@kernel.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
&lpspi1 {
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

@ -3,7 +3,5 @@
#
# SPDX-License-Identifier: Apache-2.0
#
CONFIG_SPI_LOOPBACK_DRV_NAME="HS_LSPI_1"
CONFIG_SPI_MCUX_FLEXCOMM_DMA=y
CONFIG_SPI_ASYNC=n

View file

@ -0,0 +1,18 @@
/*
* Copyright (c) 2022 Kumar Gala <galak@kernel.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
&hs_lspi1 {
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

@ -3,7 +3,5 @@
#
# SPDX-License-Identifier: Apache-2.0
#
CONFIG_SPI_LOOPBACK_DRV_NAME="FLEXCOMM_5"
CONFIG_SPI_MCUX_FLEXCOMM_DMA=y
CONFIG_SPI_ASYNC=n

View file

@ -0,0 +1,18 @@
/*
* Copyright (c) 2022 Kumar Gala <galak@kernel.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
&flexcomm5 {
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

@ -1,4 +0,0 @@
CONFIG_SPI_LOOPBACK_DRV_NAME="SPI_1"
CONFIG_SPI_LOOPBACK_CS_GPIO=y
CONFIG_SPI_LOOPBACK_CS_CTRL_GPIO_DRV_NAME="GPIO_0"
CONFIG_SPI_LOOPBACK_CS_CTRL_GPIO_PIN=28

View file

@ -6,4 +6,15 @@
&spi1 {
overrun-character = <0x00>;
cs-gpios = <&gpio0 28 GPIO_ACTIVE_LOW>;
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

@ -1,4 +0,0 @@
CONFIG_SPI_LOOPBACK_DRV_NAME="SPI_3"
CONFIG_SPI_LOOPBACK_CS_GPIO=y
CONFIG_SPI_LOOPBACK_CS_CTRL_GPIO_DRV_NAME="GPIO_0"
CONFIG_SPI_LOOPBACK_CS_CTRL_GPIO_PIN=28

View file

@ -7,4 +7,15 @@
&spi3 {
overrun-character = <0x00>;
rx-delay = <1>;
cs-gpios = <&gpio0 28 GPIO_ACTIVE_LOW>;
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

@ -1,4 +0,0 @@
CONFIG_SPI_LOOPBACK_DRV_NAME="SPI_1"
CONFIG_SPI_LOOPBACK_CS_GPIO=y
CONFIG_SPI_LOOPBACK_CS_CTRL_GPIO_DRV_NAME="GPIO_0"
CONFIG_SPI_LOOPBACK_CS_CTRL_GPIO_PIN=28

View file

@ -6,4 +6,15 @@
&spi1 {
overrun-character = <0x00>;
cs-gpios = <&gpio0 28 GPIO_ACTIVE_LOW>;
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

@ -1,4 +0,0 @@
CONFIG_SPI_LOOPBACK_DRV_NAME="SPI_3"
CONFIG_SPI_LOOPBACK_CS_GPIO=y
CONFIG_SPI_LOOPBACK_CS_CTRL_GPIO_DRV_NAME="GPIO_0"
CONFIG_SPI_LOOPBACK_CS_CTRL_GPIO_PIN=16

View file

@ -6,4 +6,15 @@
&spi3 {
overrun-character = <0x00>;
cs-gpios = <&gpio0 16 GPIO_ACTIVE_LOW>;
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

@ -12,6 +12,16 @@
&spi1 {
status = "okay";
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>;
};
};
&dma2 {

View file

@ -1,2 +1 @@
CONFIG_SPI_LOOPBACK_DRV_NAME="SPI_2"
CONFIG_SPI_STM32_INTERRUPT=y

View file

@ -0,0 +1,18 @@
/*
* Copyright (c) 2022 Kumar Gala <galak@kernel.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
&spi2 {
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

@ -12,6 +12,16 @@
&spi1 {
status = "okay";
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>;
};
};
&dma2 {

View file

@ -12,6 +12,16 @@
&spi1 {
status = "okay";
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>;
};
};
&dma2 {

View file

@ -11,6 +11,16 @@
&dma1 3 0 0x28480 0x03>;
dma-names = "tx", "rx";
status = "okay";
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>;
};
};
&dma1 {

View file

@ -8,6 +8,16 @@
dmas = <&dma2 5 3 0x28440 0x03
&dma2 2 3 0x28480 0x03>;
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 = <16000000>;
};
};
&dma2 {

View file

@ -8,6 +8,16 @@
dmas = <&dmamux1 2 17 0x20440
&dmamux1 1 16 0x20480>;
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 = <16000000>;
};
};
&dma1 {

View file

@ -8,6 +8,16 @@
dmas = <&dmamux1 0 11 0x20440
&dmamux1 1 10 0x20480>;
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 = <16000000>;
};
};
&dma1 {

View file

@ -17,6 +17,16 @@
dmas = <&dmamux1 0 11 0x20440
&dmamux1 8 10 0x20480>;
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 = <16000000>;
};
};
&dma1 {

View file

@ -15,4 +15,14 @@
/delete-property/ clocks;
clocks = <&rcc STM32_CLOCK_BUS_APB2 0x00001000>,
<&rcc STM32_SRC_PLL1_Q SPI123_SEL(0)>;
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

@ -8,6 +8,16 @@
dmas = <&dmamux1 0 38 0x20440
&dmamux1 1 37 0x20480>;
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 = <16000000>;
};
};
&dma1 {

View file

@ -11,6 +11,16 @@
&dma1 2 0x20480>;
dma-names = "tx", "rx";
status = "okay";
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>;
};
};
&dma1 {

View file

@ -8,6 +8,16 @@
dmas = <&dma1 3 1 0x20440
&dma1 2 1 0x20480>;
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 = <16000000>;
};
};
&dma1 {

View file

@ -8,6 +8,16 @@
dmas = <&dmamux1 0 11 0x20440
&dmamux1 7 10 0x20480>;
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 = <16000000>;
};
};
&dma1 {

View file

@ -8,6 +8,16 @@
dmas = <&dmamux1 0 12 0x440
&dmamux1 7 11 0x480>;
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 = <16000000>;
};
};
&dma1 {

View file

@ -7,3 +7,16 @@
&rcc {
apb2-prescaler = <2>;
};
&spi1 {
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

@ -8,6 +8,16 @@
dmas = <&dmamux1 11 7 0x20440
&dmamux1 1 6 0x20480>;
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 = <16000000>;
};
};
&dma1 {

View file

@ -8,6 +8,16 @@
dmas = <&dmamux1 11 8 0x20440
&dmamux1 1 7 0x20480>;
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 = <16000000>;
};
};
&dma1 {

View file

@ -1,3 +1,2 @@
# Loopback on UEXT connector
CONFIG_SPI_LOOPBACK_DRV_NAME="SPI_2"
CONFIG_SPI_ESP32_INTERRUPT=y

View file

@ -0,0 +1,18 @@
/*
* Copyright (c) 2022 Kumar Gala <galak@kernel.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
&spi2 {
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

@ -1,8 +0,0 @@
#
# Copyright (c) 2018, NXP
#
# SPDX-License-Identifier: Apache-2.0
#
CONFIG_SPI_LOOPBACK_DRV_NAME="SPI_0"
CONFIG_SPI_LOOPBACK_SLAVE_NUMBER=2

View file

@ -0,0 +1,18 @@
/*
* Copyright (c) 2022 Kumar Gala <galak@kernel.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
&lpspi0 {
slow@2 {
compatible = "test-spi-loopback-slow";
reg = <2>;
spi-max-frequency = <500000>;
};
fast@2 {
compatible = "test-spi-loopback-fast";
reg = <2>;
spi-max-frequency = <16000000>;
};
};

View file

@ -8,6 +8,16 @@
dmas = <&dmamux1 0 12 0x440
&dmamux1 7 11 0x480>;
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 = <16000000>;
};
};
&dma1 {

View file

@ -1,7 +0,0 @@
#
# Copyright (c) 2019, STMicroelectronics
#
# SPDX-License-Identifier: Apache-2.0
#
CONFIG_SPI_LOOPBACK_DRV_NAME="SPI_4"

View file

@ -0,0 +1,18 @@
/*
* Copyright (c) 2022 Kumar Gala <galak@kernel.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
&spi4 {
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

@ -1,7 +0,0 @@
#
# Copyright (c) 2021 Telink Semiconductor
#
# SPDX-License-Identifier: Apache-2.0
#
CONFIG_SPI_LOOPBACK_DRV_NAME="PSPI"

View file

@ -0,0 +1,18 @@
/*
* Copyright (c) 2022 Kumar Gala <galak@kernel.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
&pspi {
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

@ -1,7 +0,0 @@
#
# Copyright (c) 2019 Vestas Wind Systems A/S
#
# SPDX-License-Identifier: Apache-2.0
#
CONFIG_SPI_LOOPBACK_DRV_NAME="SPI_0"

View file

@ -0,0 +1,18 @@
/*
* Copyright (c) 2022 Kumar Gala <galak@kernel.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
&lpspi0 {
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,13 @@
#
# Copyright (c) 2022 Kumar Gala <galak@kernel.org>
#
# SPDX-License-Identifier: Apache-2.0
#
description: |
This binding provides resources required to build and run the
tests/drivers/spi/spi_loopback test in Zephyr.
compatible: "test-spi-loopback-fast"
include: [spi-device.yaml]

View file

@ -0,0 +1,13 @@
#
# Copyright (c) 2022 Kumar Gala <galak@kernel.org>
#
# SPDX-License-Identifier: Apache-2.0
#
description: |
This binding provides resources required to build and run the
tests/drivers/spi/spi_loopback test in Zephyr.
compatible: "test-spi-loopback-slow"
include: [spi-device.yaml]

View file

@ -2,4 +2,3 @@
CONFIG_DMA=y
CONFIG_DSPI_MCUX_EDMA=y
CONFIG_MCUX_DSPI_BUFFER_SIZE=144
CONFIG_SPI_LOOPBACK_FAST_FREQ=1000000

View file

@ -0,0 +1,18 @@
/*
* Copyright (c) 2022 Kumar Gala <galak@kernel.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
&spi0 {
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

@ -1,5 +1,4 @@
# enable DMA mode for SPI loopback test
CONFIG_SPI_LOOPBACK_DRV_NAME="SPI_1"
CONFIG_SPI_STM32_DMA=y
CONFIG_SPI_STM32_INTERRUPT=n
CONFIG_SPI_ASYNC=n

Some files were not shown because too many files have changed in this diff Show more