boards: mimxrt595: Add SPI support
Enable access to the HS_SPI pins(JP26) on the mimxrt595_evk board. Using DMA mode, tested with spi_loopback testcase. Signed-off-by: Chay Guo <changyi.guo@nxp.com>
This commit is contained in:
parent
705ab550d1
commit
77a0bc2135
8 changed files with 59 additions and 0 deletions
|
@ -79,6 +79,8 @@ features:
|
|||
+-----------+------------+-------------------------------------+
|
||||
| I2C | on-chip | i2c |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| SPI | on-chip | spi |
|
||||
+-----------+------------+-------------------------------------+
|
||||
|
||||
The default configuration can be found in the defconfig file:
|
||||
|
||||
|
@ -115,6 +117,14 @@ functionality of a pin.
|
|||
+---------+-----------------+----------------------------+
|
||||
| PIO0_22 | GPIO | FXOS8700 TRIGGER |
|
||||
+---------+-----------------+----------------------------+
|
||||
| PIO1_5 | SPI | SPI MOSI |
|
||||
+---------+-----------------+----------------------------+
|
||||
| PIO1_4 | SPI | SPI MISO |
|
||||
+---------+-----------------+----------------------------+
|
||||
| PIO1_3 | SPI | SPI SCK |
|
||||
+---------+-----------------+----------------------------+
|
||||
| PIO1_6 | SPI | SPI SSEL |
|
||||
+---------+-----------------+----------------------------+
|
||||
|
||||
System Clock
|
||||
============
|
||||
|
|
|
@ -49,4 +49,16 @@
|
|||
};
|
||||
};
|
||||
|
||||
pinmux_flexcomm16_spi: pinmux_flexcomm16_spi {
|
||||
group0 {
|
||||
pinmux = <HS_SPI1_SCK_PIO1_3>,
|
||||
<HS_SPI1_MISO_PIO1_4>,
|
||||
<HS_SPI1_MOSI_PIO1_5>,
|
||||
<HS_SPI1_SSELN0_PIO1_6>;
|
||||
input-enable;
|
||||
slew-rate = "normal";
|
||||
drive-strength = "normal";
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
|
|
@ -122,6 +122,15 @@ arduino_i2c: &flexcomm4 {
|
|||
};
|
||||
};
|
||||
|
||||
hs_spi1: &hs_lspi1 {
|
||||
compatible = "nxp,lpc-spi";
|
||||
pinctrl-0 = <&pinmux_flexcomm16_spi>;
|
||||
pinctrl-names = "default";
|
||||
dmas = <&dma0 28>, <&dma0 29>;
|
||||
dma-names = "rx", "tx";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
arduino_serial: &flexcomm12 {
|
||||
compatible = "nxp,lpc-usart";
|
||||
status = "okay";
|
||||
|
|
|
@ -21,3 +21,4 @@ supported:
|
|||
- dma
|
||||
- gpio
|
||||
- i2c
|
||||
- spi
|
||||
|
|
|
@ -306,6 +306,17 @@
|
|||
#size-cells = <0>;
|
||||
};
|
||||
|
||||
hs_lspi1: spi@128000 {
|
||||
compatible = "nxp,lpc-spi";
|
||||
reg = <0x128000 0x1000>;
|
||||
interrupts = <66 0>;
|
||||
label = "HS_LSPI_1";
|
||||
clocks = <&clkctl1 MCUX_HS_SPI1_CLK>;
|
||||
status = "disabled";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
};
|
||||
|
||||
dma0: dma-controller@104000 {
|
||||
compatible = "nxp,lpc-dma";
|
||||
reg = <0x104000 0x1000>;
|
||||
|
|
|
@ -24,6 +24,10 @@ config I2C_MCUX_FLEXCOMM
|
|||
default y if HAS_MCUX_FLEXCOMM
|
||||
depends on I2C
|
||||
|
||||
config SPI_MCUX_FLEXCOMM
|
||||
default y if HAS_MCUX_FLEXCOMM
|
||||
depends on SPI
|
||||
|
||||
config CLOCK_CONTROL_MCUX_SYSCON
|
||||
default y if HAS_MCUX_SYSCON
|
||||
depends on CLOCK_CONTROL
|
||||
|
|
|
@ -188,6 +188,9 @@ void clock_init(void)
|
|||
/* Switch FLEXCOMM4 to FRO_DIV4 */
|
||||
CLOCK_AttachClk(kFRO_DIV4_to_FLEXCOMM4);
|
||||
#endif
|
||||
#if DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(hs_spi1), nxp_lpc_spi, okay)
|
||||
CLOCK_AttachClk(kFRO_DIV4_to_FLEXCOMM16);
|
||||
#endif
|
||||
#if DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(flexcomm12), nxp_lpc_usart, okay)
|
||||
/* Switch FLEXCOMM12 to FRG */
|
||||
CLOCK_AttachClk(kFRG_to_FLEXCOMM12);
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
#
|
||||
# Copyright (c) 2020, NXP
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
CONFIG_SPI_LOOPBACK_DRV_NAME="HS_LSPI_1"
|
||||
CONFIG_SPI_MCUX_FLEXCOMM_DMA=y
|
||||
CONFIG_SPI_ASYNC=n
|
Loading…
Add table
Add a link
Reference in a new issue