Skip to content

Commit 457bbe3

Browse files
committed
test: spi_loopback: nxp: Add Flexio spi test support
Add overlay file for RT1170 EVK and simply existing flexio spi overlay file for RT1060 EVKC and RT1064 EVK. One flexio-spi interface for both slow and fast tests. Fast bandrate set to 16Mbps now. Signed-off-by: Raymond Lei <[email protected]>
1 parent 82ef24b commit 457bbe3

File tree

3 files changed

+81
-34
lines changed

3 files changed

+81
-34
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
* Copyright 2025 NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
&lpspi1 {
8+
dmas = <&edma0 0 36>, <&edma0 1 37>;
9+
dma-names = "rx", "tx";
10+
status = "disabled";
11+
};
12+
13+
14+
&pinctrl {
15+
pinmux_flexio2spi1: pinmux_flexio2spi1 {
16+
group0 {
17+
pinmux = <&iomuxc_gpio_ad_29_gpio9_io28>, /* cs */
18+
<&iomuxc_gpio_ad_28_flexio2_flexio28>, /* sck */
19+
<&iomuxc_gpio_ad_30_flexio2_flexio30>, /* sdo */
20+
<&iomuxc_gpio_ad_31_flexio2_flexio31>; /* sdi */
21+
drive-strength = "high";
22+
slew-rate = "slow";
23+
24+
};
25+
};
26+
};
27+
28+
29+
&flexio2 {
30+
status = "okay";
31+
32+
flexio2spi1: flexio2spi1 {
33+
compatible = "nxp,flexio-spi";
34+
cs-gpios = <&gpio9 28 GPIO_ACTIVE_LOW>;
35+
#address-cells = <1>;
36+
#size-cells = <0>;
37+
sdo-pin = <30>;
38+
sdi-pin = <31>;
39+
sck-pin = <28>;
40+
pinctrl-0 = <&pinmux_flexio2spi1>;
41+
pinctrl-names = "default";
42+
status = "okay";
43+
44+
slow@0 {
45+
compatible = "test-spi-loopback-slow";
46+
reg = <0>;
47+
spi-max-frequency = <500000>;
48+
};
49+
fast@0 {
50+
compatible = "test-spi-loopback-fast";
51+
reg = <0>;
52+
spi-max-frequency = <16000000>;
53+
};
54+
};
55+
};
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,27 @@
11
/*
22
* Copyright (c) 2024, STRIM, ALC
3-
*
3+
* Copyright (c) 2025, NXP
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7+
/* On RT1060 EVKC, SPI loopback test, short J17-9 and J17-10
8+
* On RT1064 EVK, SPI loopback test, short J24-9 and J24-10
9+
*/
10+
711
&pinctrl {
812
pinmux_flexio3spi0: pinmux_flexio3spi0 {
913
group0 {
1014
pinmux =
1115
<&iomuxc_gpio_ad_b0_03_gpio1_io03>, /* cs */
1216
<&iomuxc_gpio_ad_b1_10_flexio3_flexio10>, /* sck */
13-
<&iomuxc_gpio_ad_b1_01_flexio3_flexio01>, /* sdo */
14-
<&iomuxc_gpio_ad_b1_04_flexio3_flexio04>; /* sdi */
15-
drive-strength = "r0-6";
16-
slew-rate = "slow";
17-
nxp,speed = "150-mhz";
18-
};
19-
};
20-
pinmux_flexio3spi1: pinmux_flexio3spi1 {
21-
group0 {
22-
pinmux =
23-
<&iomuxc_gpio_ad_b0_02_gpio1_io02>, /* cs */
24-
<&iomuxc_gpio_ad_b1_11_flexio3_flexio11>, /* sck */
2517
<&iomuxc_gpio_ad_b1_00_flexio3_flexio00>, /* sdo */
26-
<&iomuxc_gpio_ad_b1_05_flexio3_flexio05>; /* sdi */
18+
<&iomuxc_gpio_ad_b1_01_flexio3_flexio01>; /* sdi */
2719
drive-strength = "r0-6";
2820
slew-rate = "slow";
2921
nxp,speed = "150-mhz";
3022
};
3123
};
24+
3225
};
3326

3427
&flexio3 {
@@ -39,8 +32,8 @@
3932
#address-cells = <1>;
4033
#size-cells = <0>;
4134
cs-gpios = <&gpio1 3 GPIO_ACTIVE_LOW>;
42-
sdo-pin = <1>;
43-
sdi-pin = <4>;
35+
sdo-pin = <0>;
36+
sdi-pin = <1>;
4437
sck-pin = <10>;
4538
pinctrl-0 = <&pinmux_flexio3spi0>;
4639
pinctrl-names = "default";
@@ -50,28 +43,13 @@
5043
reg = <0>;
5144
spi-max-frequency = <500000>;
5245
};
53-
};
54-
flexio3_spi1: flexio3_spi1 {
55-
compatible = "nxp,flexio-spi";
56-
status = "okay";
57-
#address-cells = <1>;
58-
#size-cells = <0>;
59-
cs-gpios = <&gpio1 2 GPIO_ACTIVE_LOW>;
60-
sdo-pin = <0>;
61-
sdi-pin = <5>;
62-
sck-pin = <11>;
63-
pinctrl-0 = <&pinmux_flexio3spi1>;
64-
pinctrl-names = "default";
46+
6547
fast@0 {
6648
status = "okay";
6749
compatible = "test-spi-loopback-fast";
6850
reg = <0>;
69-
spi-max-frequency = <4000000>;
51+
spi-max-frequency = <16000000>;
7052
};
7153
};
72-
};
7354

74-
/* pinmux_lpspi3 overlaps pinmux_flexio3spi1 */
75-
&lpspi3 {
76-
status = "disabled";
7755
};

tests/drivers/spi/spi_loopback/testcase.yaml

+15-1
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,26 @@ tests:
222222
extra_args: DTC_OVERLAY_FILE="overlay-mcux-flexio-spi.overlay"
223223
filter: CONFIG_DT_HAS_NXP_FLEXIO_ENABLED and
224224
CONFIG_DT_HAS_NXP_FLEXIO_SPI_ENABLED
225-
platform_allow: mimxrt1064_evk
225+
platform_allow:
226+
- mimxrt1064_evk
227+
- mimxrt1060_evk/mimxrt1062/qspi
228+
- mimxrt1060_evk@B/mimxrt1062/qspi
229+
- mimxrt1060_evk@C/mimxrt1062/qspi
230+
231+
drivers.spi.mimxrt1170_evk_mimxrt1176_cm7_flexio_spi.loopback:
232+
extra_args: DTC_OVERLAY_FILE="boards/mimxrt1170_evk_mimxrt1176_cm7_flexio_spi.overlay"
233+
filter: CONFIG_DT_HAS_NXP_FLEXIO_ENABLED and
234+
CONFIG_DT_HAS_NXP_FLEXIO_SPI_ENABLED
235+
platform_allow:
236+
- mimxrt1170_evk@A/mimxrt1176/cm7
237+
- mimxrt1170_evk@B/mimxrt1176/cm7
238+
226239
drivers.spi.mimxrt1040evk_flexio_spi.loopback:
227240
extra_args: DTC_OVERLAY_FILE="boards/mimxrt1040_evk_flexio_spi.overlay"
228241
filter: CONFIG_DT_HAS_NXP_FLEXIO_ENABLED and
229242
CONFIG_DT_HAS_NXP_FLEXIO_SPI_ENABLED
230243
platform_allow: mimxrt1040_evk
244+
231245
drivers.spi.nrf54h_fast_8mhz:
232246
extra_args: DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay"
233247
platform_allow:

0 commit comments

Comments
 (0)