Skip to content

Commit c292b21

Browse files
lucien-nxpjhedberg
authored andcommitted
tests: drivers: spi: spi_loopback: add flexio_spi usage on RT1180
Increase latency for DMA/FLEXIO Disable default lpspi3 instance Configure flexio2_spi pin Enable flexio2 as spi function Signed-off-by: Lucien Zhao <[email protected]>
1 parent d61236d commit c292b21

File tree

3 files changed

+63
-14
lines changed

3 files changed

+63
-14
lines changed

tests/drivers/spi/spi_loopback/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ config SPI_LARGE_BUFFER_SIZE
1313

1414
config SPI_IDEAL_TRANSFER_DURATION_SCALING
1515
int "Scaling factor to compare ideal and measured SPI transfer duration"
16-
default 40 if SPI_NXP_LPSPI_DMA
16+
default 40 if SPI_NXP_LPSPI_DMA || SPI_MCUX_FLEXIO
1717
default 8
1818

1919
if SOC_SERIES_STM32H7X
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright 2025 NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/* To test this sample, connect J41.4 <-> J41.6 */
8+
&lpspi3 {
9+
status = "disabled";
10+
};
11+
12+
&pinctrl {
13+
pinmux_flexio2spi1: pinmux_flexio2spi1 {
14+
group0 {
15+
pinmux = <&iomuxc_gpio_ad_02_gpio4_io02>, /* cs */
16+
<&iomuxc_gpio_ad_03_flexio2_d03>, /* sdo */
17+
<&iomuxc_gpio_ad_04_flexio2_d04>, /* sdi */
18+
<&iomuxc_gpio_ad_05_flexio2_d05>; /* sck */
19+
drive-strength = "high";
20+
slew-rate = "slow";
21+
};
22+
};
23+
};
24+
25+
&flexio2 {
26+
status = "okay";
27+
28+
flexio2spi1: flexio2spi1 {
29+
compatible = "nxp,flexio-spi";
30+
cs-gpios = <&gpio4 2 GPIO_ACTIVE_LOW>;
31+
#address-cells = <1>;
32+
#size-cells = <0>;
33+
sdo-pin = <3>;
34+
sdi-pin = <4>;
35+
sck-pin = <5>;
36+
pinctrl-0 = <&pinmux_flexio2spi1>;
37+
pinctrl-names = "default";
38+
status = "okay";
39+
40+
slow@0 {
41+
compatible = "test-spi-loopback-slow";
42+
reg = <0>;
43+
spi-max-frequency = <500000>;
44+
};
45+
fast@0 {
46+
compatible = "test-spi-loopback-fast";
47+
reg = <0>;
48+
spi-max-frequency = <16000000>;
49+
};
50+
};
51+
};

tests/drivers/spi/spi_loopback/testcase.yaml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -192,24 +192,22 @@ tests:
192192
- DTC_OVERLAY_FILE="boards/rpi_pico_pio.overlay"
193193
- EXTRA_CONF_FILE="overlay-rpi-pico-pio.conf"
194194
platform_allow: rpi_pico
195-
drivers.spi.mcux_flexio_spi.loopback:
196-
extra_args: DTC_OVERLAY_FILE="overlay-mcux-flexio-spi.overlay"
195+
drivers.spi.flexio_spi.loopback:
196+
extra_args:
197+
- platform:mimxrt1170_evk/mimxrt1176/cm7:DTC_OVERLAY_FILE="boards/mimxrt1170_evk_mimxrt1176_cm7_flexio_spi.overlay"
198+
- platform:mimxrt1180_evk/mimxrt1189/cm33:DTC_OVERLAY_FILE="boards/mimxrt1180_evk_flexio_spi.overlay"
199+
- platform:mimxrt1180_evk/mimxrt1189/cm7:DTC_OVERLAY_FILE="boards/mimxrt1180_evk_flexio_spi.overlay"
200+
- platform:mimxrt1064_evk:DTC_OVERLAY_FILE="overlay-mcux-flexio-spi.overlay"
201+
- platform:mimxrt1060_evk/mimxrt1062/qspi:DTC_OVERLAY_FILE="overlay-mcux-flexio-spi.overlay"
202+
- platform:mimxrt1040_evk:DTC_OVERLAY_FILE="boards/mimxrt1040_evk_flexio_spi.overlay"
197203
filter: CONFIG_DT_HAS_NXP_FLEXIO_ENABLED and
198204
CONFIG_DT_HAS_NXP_FLEXIO_SPI_ENABLED
199205
platform_allow:
206+
- mimxrt1170_evk/mimxrt1176/cm7
207+
- mimxrt1180_evk/mimxrt1189/cm33
208+
- mimxrt1180_evk/mimxrt1189/cm7
200209
- mimxrt1064_evk
201210
- mimxrt1060_evk/mimxrt1062/qspi
202-
drivers.spi.mimxrt1170_evk_mimxrt1176_cm7_flexio_spi.loopback:
203-
extra_args: DTC_OVERLAY_FILE="boards/mimxrt1170_evk_mimxrt1176_cm7_flexio_spi.overlay"
204-
filter: CONFIG_DT_HAS_NXP_FLEXIO_ENABLED and
205-
CONFIG_DT_HAS_NXP_FLEXIO_SPI_ENABLED
206-
platform_allow:
207-
- mimxrt1170_evk/mimxrt1176/cm7
208-
drivers.spi.mimxrt1040evk_flexio_spi.loopback:
209-
extra_args: DTC_OVERLAY_FILE="boards/mimxrt1040_evk_flexio_spi.overlay"
210-
filter: CONFIG_DT_HAS_NXP_FLEXIO_ENABLED and
211-
CONFIG_DT_HAS_NXP_FLEXIO_SPI_ENABLED
212-
platform_allow:
213211
- mimxrt1040_evk
214212
drivers.spi.nrf54h_fast_2mhz:
215213
extra_args:

0 commit comments

Comments
 (0)