Skip to content
Permalink
Browse files

boards: arm: twr_ke18f: add SPI support

Add SPI support to the NXP TWR-KE18F development board. There are no
onboard SPI devices, but both SPI busses are available on the primary
Tower System elevator connector.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
  • Loading branch information...
henrikbrixandersen authored and MaureenHelm committed May 16, 2019
1 parent 69c144a commit 0382f08f2a921e8ef2965f0ccf25fd12a3330fc7
@@ -12,4 +12,19 @@ config BOARD_TWR_KE18F_FLEXIO_CLKOUT
help
Enable the CLKOUT signal on FlexIO header pin 7 (PTE10).

config BOARD_TWR_KE18F_SPI_0_PCS2
bool "Use PTE6 as dedicated SPI_0 PCS2 chip select"
depends on SPI_0
default y

config BOARD_TWR_KE18F_SPI_1_PCS0
bool "Use PTD3 as dedicated SPI_1 PCS0 chip select"
depends on SPI_1
default y

config BOARD_TWR_KE18F_SPI_1_PCS2
bool "Use PTA16 as dedicated SPI_1 PCS2 chip select"
depends on SPI_1
default y

endif #BOARD_TWR_KE18F
@@ -27,6 +27,16 @@ config I2C_1

endif # I2C

if SPI_MCUX_LPSPI

config SPI_0
default y

config SPI_1
default y

endif # SPI_MCUX_LPSPI

if PINMUX_MCUX

config PINMUX_MCUX_PORTA
@@ -74,7 +74,8 @@ features:
| | | trigger supported with H/W mods |
| | | explained below; |
+-----------+------------+-------------------------------------+

| SPI(M) | on-chip | spi |
+-----------+------------+-------------------------------------+

The default configuration can be found in the defconfig file:
``boards/arm/twr_ke18f/twr_ke18f_defconfig``.
@@ -53,6 +53,32 @@ static int twr_ke18f_pinmux_init(struct device *dev)
pinmux_pin_set(portb, 1, PORT_PCR_MUX(kPORT_MuxAlt2));
#endif

#ifdef CONFIG_SPI_0
/* SPI0 SCK, SIN, SOUT */
pinmux_pin_set(porte, 0, PORT_PCR_MUX(kPORT_MuxAlt2));
pinmux_pin_set(porte, 1, PORT_PCR_MUX(kPORT_MuxAlt2));
pinmux_pin_set(porte, 2, PORT_PCR_MUX(kPORT_MuxAlt2));
#endif
#ifdef CONFIG_BOARD_TWR_KE18F_SPI_0_PCS2
/* SPI0 PCS2 */
pinmux_pin_set(porte, 6, PORT_PCR_MUX(kPORT_MuxAlt2));
#endif

#ifdef CONFIG_SPI_1
/* SPI1 SCK, SIN, SOUT */
pinmux_pin_set(portd, 0, PORT_PCR_MUX(kPORT_MuxAlt3));
pinmux_pin_set(portd, 1, PORT_PCR_MUX(kPORT_MuxAlt3));
pinmux_pin_set(portd, 2, PORT_PCR_MUX(kPORT_MuxAlt3));
#endif
#ifdef CONFIG_BOARD_TWR_KE18F_SPI_1_PCS0
/* SPI1 PCS0 */
pinmux_pin_set(portd, 3, PORT_PCR_MUX(kPORT_MuxAlt3));
#endif
#ifdef CONFIG_BOARD_TWR_KE18F_SPI_1_PCS2
/* SPI1 PCS2 */
pinmux_pin_set(porta, 16, PORT_PCR_MUX(kPORT_MuxAlt3));
#endif

#ifdef CONFIG_BOARD_TWR_KE18F_FLEXIO_CLKOUT
/* CLKOUT */
pinmux_pin_set(porte, 10, PORT_PCR_MUX(kPORT_MuxAlt2));
@@ -133,6 +133,14 @@
status = "ok";
};

&spi0 {
status = "ok";
};

&spi1 {
status = "ok";
};

&flash0 {
/*
* For more information, see:
@@ -13,3 +13,4 @@ supported:
- counter
- i2c
- hwinfo
- spi

0 comments on commit 0382f08

Please sign in to comment.
You can’t perform that action at this time.