k64: Move uart console pins to board pinmux tables
Moves the uart console pins from the k64 soc init to the frdm_k64f and hexiwear_k64 board pinmux tables. Not having these pins in the board pinmux tables led one to believe that no pins in PORTB were being used on the hexiwear_k64 board, and thus the port was incorrectly disabled by default. Also fixes PORTB to be enabled by default if the uart console is used. Change-Id: Ide6b7b34dfba8a75a02a8f2bf37cce843afb92f1 Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
This commit is contained in:
parent
d2c9446163
commit
4184c7f82e
5 changed files with 13 additions and 53 deletions
|
@ -179,17 +179,6 @@ extern "C" {
|
|||
|
||||
#endif /* CONFIG_UART_K20 */
|
||||
|
||||
/* Uart console settings */
|
||||
#if defined(CONFIG_UART_CONSOLE)
|
||||
|
||||
#define CONFIG_UART_CONSOLE_PORT PCR_PORT_B
|
||||
#define CONFIG_UART_CONSOLE_PORT_RX_PIN 16
|
||||
#define CONFIG_UART_CONSOLE_PORT_TX_PIN 17
|
||||
#define CONFIG_UART_CONSOLE_PORT_MUX_FUNC PCR_MUX_ALT3
|
||||
#define CONFIG_UART_CONSOLE_CLK_FREQ SYSCLK_DEFAULT_IOSC_HZ
|
||||
|
||||
#endif /* CONFIG_UART_CONSOLE */
|
||||
|
||||
/*
|
||||
* GPIO configuration settings
|
||||
*/
|
||||
|
|
|
@ -39,44 +39,6 @@
|
|||
|
||||
#ifdef CONFIG_UART_K20
|
||||
|
||||
#if defined(CONFIG_UART_CONSOLE) && \
|
||||
(defined(CONFIG_PRINTK) || defined(CONFIG_STDOUT_CONSOLE))
|
||||
|
||||
static PORT_Type *const ports[] = PORT_BASE_PTRS;
|
||||
|
||||
/**
|
||||
* @brief Initialize K20 serial port as console
|
||||
*
|
||||
* Initialize the UART port for console I/O.
|
||||
*
|
||||
* @param dev The UART device struct
|
||||
*
|
||||
* @return 0 if successful, otherwise failed.
|
||||
*/
|
||||
static ALWAYS_INLINE int uart_k20_console_init(void)
|
||||
{
|
||||
PORT_Type *port;
|
||||
uint32_t rxPin;
|
||||
uint32_t txPin;
|
||||
|
||||
/* Port/pin ctrl module */
|
||||
port = ports[CONFIG_UART_CONSOLE_PORT];
|
||||
|
||||
/* UART0 Rx and Tx pin assignments */
|
||||
rxPin = CONFIG_UART_CONSOLE_PORT_RX_PIN;
|
||||
txPin = CONFIG_UART_CONSOLE_PORT_TX_PIN;
|
||||
|
||||
/* Enable the UART Rx and Tx Pins */
|
||||
port->PCR[rxPin] = PORT_PCR_MUX(CONFIG_UART_CONSOLE_PORT_MUX_FUNC);
|
||||
port->PCR[txPin] = PORT_PCR_MUX(CONFIG_UART_CONSOLE_PORT_MUX_FUNC);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
#define uart_k20_console_init(...)
|
||||
#endif /* CONFIG_UART_CONSOLE && (CONFIG_PRINTK || CONFIG_STDOUT_CONSOLE) */
|
||||
|
||||
static int uart_k20_init(struct device *dev)
|
||||
{
|
||||
uint32_t scgc4;
|
||||
|
@ -111,9 +73,6 @@ static int uart_k20_init(struct device *dev)
|
|||
SIM->SCGC1 |= SIM_SCGC1_UART4(1);
|
||||
#endif
|
||||
|
||||
/* Initialize UART port for console if needed */
|
||||
uart_k20_console_init();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,6 +43,12 @@ static int frdm_k64f_pinmux_init(struct device *dev)
|
|||
device_get_binding(CONFIG_PINMUX_MCUX_PORTE_NAME);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_UART_K20_PORT_0
|
||||
/* UART0 RX, TX */
|
||||
pinmux_pin_set(portb, 16, PORT_PCR_MUX(kPORT_MuxAlt3));
|
||||
pinmux_pin_set(portb, 17, PORT_PCR_MUX(kPORT_MuxAlt3));
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_UART_K20_PORT_3
|
||||
/* UART3 RX, TX */
|
||||
pinmux_pin_set(portc, 16, PORT_PCR_MUX(kPORT_MuxAlt3));
|
||||
|
|
|
@ -99,7 +99,7 @@ config PINMUX_MCUX_PORTA
|
|||
def_bool n
|
||||
|
||||
config PINMUX_MCUX_PORTB
|
||||
def_bool n
|
||||
def_bool y if UART_K20_PORT_0
|
||||
|
||||
config PINMUX_MCUX_PORTC
|
||||
def_bool y
|
||||
|
|
|
@ -58,6 +58,12 @@ static int hexiwear_k64_pinmux_init(struct device *dev)
|
|||
/* FXOS8700 INT1 */
|
||||
pinmux_pin_set(portc, 1, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
|
||||
#ifdef CONFIG_UART_K20_PORT_0
|
||||
/* UART0 RX, TX */
|
||||
pinmux_pin_set(portb, 16, PORT_PCR_MUX(kPORT_MuxAlt3));
|
||||
pinmux_pin_set(portb, 17, PORT_PCR_MUX(kPORT_MuxAlt3));
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_UART_K20_PORT_4
|
||||
/* UART4 RX, TX - BLE */
|
||||
pinmux_pin_set(porte, 24, PORT_PCR_MUX(kPORT_MuxAlt3));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue