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>
This commit is contained in:
parent
69c144aff2
commit
0382f08f2a
6 changed files with 62 additions and 1 deletions
|
@ -12,4 +12,19 @@ config BOARD_TWR_KE18F_FLEXIO_CLKOUT
|
||||||
help
|
help
|
||||||
Enable the CLKOUT signal on FlexIO header pin 7 (PTE10).
|
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
|
endif #BOARD_TWR_KE18F
|
||||||
|
|
|
@ -27,6 +27,16 @@ config I2C_1
|
||||||
|
|
||||||
endif # I2C
|
endif # I2C
|
||||||
|
|
||||||
|
if SPI_MCUX_LPSPI
|
||||||
|
|
||||||
|
config SPI_0
|
||||||
|
default y
|
||||||
|
|
||||||
|
config SPI_1
|
||||||
|
default y
|
||||||
|
|
||||||
|
endif # SPI_MCUX_LPSPI
|
||||||
|
|
||||||
if PINMUX_MCUX
|
if PINMUX_MCUX
|
||||||
|
|
||||||
config PINMUX_MCUX_PORTA
|
config PINMUX_MCUX_PORTA
|
||||||
|
|
|
@ -74,7 +74,8 @@ features:
|
||||||
| | | trigger supported with H/W mods |
|
| | | trigger supported with H/W mods |
|
||||||
| | | explained below; |
|
| | | explained below; |
|
||||||
+-----------+------------+-------------------------------------+
|
+-----------+------------+-------------------------------------+
|
||||||
|
| SPI(M) | on-chip | spi |
|
||||||
|
+-----------+------------+-------------------------------------+
|
||||||
|
|
||||||
The default configuration can be found in the defconfig file:
|
The default configuration can be found in the defconfig file:
|
||||||
``boards/arm/twr_ke18f/twr_ke18f_defconfig``.
|
``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));
|
pinmux_pin_set(portb, 1, PORT_PCR_MUX(kPORT_MuxAlt2));
|
||||||
#endif
|
#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
|
#ifdef CONFIG_BOARD_TWR_KE18F_FLEXIO_CLKOUT
|
||||||
/* CLKOUT */
|
/* CLKOUT */
|
||||||
pinmux_pin_set(porte, 10, PORT_PCR_MUX(kPORT_MuxAlt2));
|
pinmux_pin_set(porte, 10, PORT_PCR_MUX(kPORT_MuxAlt2));
|
||||||
|
|
|
@ -133,6 +133,14 @@
|
||||||
status = "ok";
|
status = "ok";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
&spi0 {
|
||||||
|
status = "ok";
|
||||||
|
};
|
||||||
|
|
||||||
|
&spi1 {
|
||||||
|
status = "ok";
|
||||||
|
};
|
||||||
|
|
||||||
&flash0 {
|
&flash0 {
|
||||||
/*
|
/*
|
||||||
* For more information, see:
|
* For more information, see:
|
||||||
|
|
|
@ -13,3 +13,4 @@ supported:
|
||||||
- counter
|
- counter
|
||||||
- i2c
|
- i2c
|
||||||
- hwinfo
|
- hwinfo
|
||||||
|
- spi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue