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 baud rate set to 16Mbps now. Signed-off-by: Raymond Lei <raymond.lei@nxp.com>
This commit is contained in:
parent
581e7ff2aa
commit
dd90248a3a
@ -199,13 +199,13 @@ static void spi_flexio_master_init(FLEXIO_SPI_Type *base, flexio_spi_master_conf
|
||||
timerConfig.timerEnable = kFLEXIO_TimerEnableOnTriggerHigh;
|
||||
timerConfig.timerStop = kFLEXIO_TimerStopBitEnableOnTimerDisable;
|
||||
timerConfig.timerStart = kFLEXIO_TimerStartBitEnabled;
|
||||
/* Low 8-bits are used to configure baudrate. */
|
||||
/* Low 8-bits are used to configure baud rate. */
|
||||
timerDiv = (uint16_t)(srcClock_Hz / masterConfig->baudRate_Bps);
|
||||
|
||||
/* Add protection if the required band rate overflows.
|
||||
* FLEXIO input freq can't meet required band rate. Max band rate can
|
||||
/* Add protection if the required baud rate overflows.
|
||||
* FLEXIO input freq can't meet required baud rate. Max baud rate can
|
||||
* not exceed 1/4 of input freq. You can raise input freq or lower
|
||||
* bandrate required to remove this warning.
|
||||
* baud rate required to remove this warning.
|
||||
*/
|
||||
if (timerDiv < 4) {
|
||||
timerDiv = 4;
|
||||
@ -214,7 +214,7 @@ static void spi_flexio_master_init(FLEXIO_SPI_Type *base, flexio_spi_master_conf
|
||||
timerDiv += timerDiv & 1UL;
|
||||
|
||||
if (masterConfig->baudRate_Bps != (srcClock_Hz / timerDiv)) {
|
||||
LOG_WRN("Bandrate req:%uKbps, got:%uKbps",
|
||||
LOG_WRN("baud rate req:%uKbps, got:%uKbps",
|
||||
(uint32_t)(masterConfig->baudRate_Bps / 1000),
|
||||
(uint32_t)(srcClock_Hz / (timerDiv*1000)));
|
||||
}
|
||||
|
||||
@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright 2025 NXP
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
&lpspi1 {
|
||||
dmas = <&edma0 0 36>, <&edma0 1 37>;
|
||||
dma-names = "rx", "tx";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
|
||||
&pinctrl {
|
||||
pinmux_flexio2spi1: pinmux_flexio2spi1 {
|
||||
group0 {
|
||||
pinmux = <&iomuxc_gpio_ad_29_gpio9_io28>, /* cs */
|
||||
<&iomuxc_gpio_ad_28_flexio2_flexio28>, /* sck */
|
||||
<&iomuxc_gpio_ad_30_flexio2_flexio30>, /* sdo */
|
||||
<&iomuxc_gpio_ad_31_flexio2_flexio31>; /* sdi */
|
||||
drive-strength = "high";
|
||||
slew-rate = "slow";
|
||||
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
&flexio2 {
|
||||
status = "okay";
|
||||
|
||||
flexio2spi1: flexio2spi1 {
|
||||
compatible = "nxp,flexio-spi";
|
||||
cs-gpios = <&gpio9 28 GPIO_ACTIVE_LOW>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
sdo-pin = <30>;
|
||||
sdi-pin = <31>;
|
||||
sck-pin = <28>;
|
||||
pinctrl-0 = <&pinmux_flexio2spi1>;
|
||||
pinctrl-names = "default";
|
||||
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>;
|
||||
};
|
||||
};
|
||||
};
|
||||
@ -1,34 +1,28 @@
|
||||
/*
|
||||
* Copyright (c) 2024, STRIM, ALC
|
||||
* Copyright (c) 2025, NXP
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* On RT1060 EVKC, SPI loopback test, short J17-9 and J17-10
|
||||
* On RT1064 EVK, SPI loopback test, short J24-9 and J24-10
|
||||
*/
|
||||
|
||||
&pinctrl {
|
||||
pinmux_flexio3spi0: pinmux_flexio3spi0 {
|
||||
group0 {
|
||||
pinmux =
|
||||
<&iomuxc_gpio_ad_b0_03_gpio1_io03>, /* cs */
|
||||
<&iomuxc_gpio_ad_b1_10_flexio3_flexio10>, /* sck */
|
||||
<&iomuxc_gpio_ad_b1_01_flexio3_flexio01>, /* sdo */
|
||||
<&iomuxc_gpio_ad_b1_04_flexio3_flexio04>; /* sdi */
|
||||
drive-strength = "r0-6";
|
||||
slew-rate = "slow";
|
||||
nxp,speed = "150-mhz";
|
||||
};
|
||||
};
|
||||
pinmux_flexio3spi1: pinmux_flexio3spi1 {
|
||||
group0 {
|
||||
pinmux =
|
||||
<&iomuxc_gpio_ad_b0_02_gpio1_io02>, /* cs */
|
||||
<&iomuxc_gpio_ad_b1_11_flexio3_flexio11>, /* sck */
|
||||
<&iomuxc_gpio_ad_b1_00_flexio3_flexio00>, /* sdo */
|
||||
<&iomuxc_gpio_ad_b1_05_flexio3_flexio05>; /* sdi */
|
||||
<&iomuxc_gpio_ad_b1_01_flexio3_flexio01>; /* sdi */
|
||||
drive-strength = "r0-6";
|
||||
slew-rate = "slow";
|
||||
nxp,speed = "150-mhz";
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
&flexio3 {
|
||||
@ -39,8 +33,8 @@
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
cs-gpios = <&gpio1 3 GPIO_ACTIVE_LOW>;
|
||||
sdo-pin = <1>;
|
||||
sdi-pin = <4>;
|
||||
sdo-pin = <0>;
|
||||
sdi-pin = <1>;
|
||||
sck-pin = <10>;
|
||||
pinctrl-0 = <&pinmux_flexio3spi0>;
|
||||
pinctrl-names = "default";
|
||||
@ -50,28 +44,13 @@
|
||||
reg = <0>;
|
||||
spi-max-frequency = <500000>;
|
||||
};
|
||||
};
|
||||
flexio3_spi1: flexio3_spi1 {
|
||||
compatible = "nxp,flexio-spi";
|
||||
status = "okay";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
cs-gpios = <&gpio1 2 GPIO_ACTIVE_LOW>;
|
||||
sdo-pin = <0>;
|
||||
sdi-pin = <5>;
|
||||
sck-pin = <11>;
|
||||
pinctrl-0 = <&pinmux_flexio3spi1>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
fast@0 {
|
||||
status = "okay";
|
||||
compatible = "test-spi-loopback-fast";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <4000000>;
|
||||
spi-max-frequency = <16000000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
/* pinmux_lpspi3 overlaps pinmux_flexio3spi1 */
|
||||
&lpspi3 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
@ -196,12 +196,21 @@ tests:
|
||||
extra_args: DTC_OVERLAY_FILE="overlay-mcux-flexio-spi.overlay"
|
||||
filter: CONFIG_DT_HAS_NXP_FLEXIO_ENABLED and
|
||||
CONFIG_DT_HAS_NXP_FLEXIO_SPI_ENABLED
|
||||
platform_allow: mimxrt1064_evk
|
||||
platform_allow:
|
||||
- mimxrt1064_evk
|
||||
- mimxrt1060_evk/mimxrt1062/qspi
|
||||
drivers.spi.mimxrt1170_evk_mimxrt1176_cm7_flexio_spi.loopback:
|
||||
extra_args: DTC_OVERLAY_FILE="boards/mimxrt1170_evk_mimxrt1176_cm7_flexio_spi.overlay"
|
||||
filter: CONFIG_DT_HAS_NXP_FLEXIO_ENABLED and
|
||||
CONFIG_DT_HAS_NXP_FLEXIO_SPI_ENABLED
|
||||
platform_allow:
|
||||
- mimxrt1170_evk/mimxrt1176/cm7
|
||||
drivers.spi.mimxrt1040evk_flexio_spi.loopback:
|
||||
extra_args: DTC_OVERLAY_FILE="boards/mimxrt1040_evk_flexio_spi.overlay"
|
||||
filter: CONFIG_DT_HAS_NXP_FLEXIO_ENABLED and
|
||||
CONFIG_DT_HAS_NXP_FLEXIO_SPI_ENABLED
|
||||
platform_allow: mimxrt1040_evk
|
||||
platform_allow:
|
||||
- mimxrt1040_evk
|
||||
drivers.spi.nrf54h_fast_2mhz:
|
||||
extra_args:
|
||||
- DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user