arch/arm/src/imxrt/imxrt_serial.c: This commit improves the performance of UART serial ports on the IMXRT by enabling the RX & TX FIFOS and transmission on the holding register being empty (TDRE) rather than transmission being complete (TC).

This commit is contained in:
Dave Marples 2019-11-04 11:16:46 -06:00 committed by Gregory Nutt
parent 6d197e5a59
commit 48d1d9d84f
2 changed files with 9 additions and 6 deletions

View File

@ -556,6 +556,9 @@ int imxrt_lpuart_configure(uint32_t base,
return ERROR;
}
putreg32(LPUART_FIFO_RXFE | LPUART_FIFO_RXIDEN_1 | LPUART_FIFO_TXFE ,
base + IMXRT_LPUART_FIFO_OFFSET);
regval |= LPUART_CTRL_RE | LPUART_CTRL_TE;
putreg32(regval, base + IMXRT_LPUART_CTRL_OFFSET);

View File

@ -1034,7 +1034,7 @@ static void imxrt_detach(struct uart_dev_s *dev)
* Name: imxrt_interrupt (and front-ends)
*
* Description:
* This is the common UART interrupt handler. It should cal
* This is the common UART interrupt handler. It should call
* uart_transmitchars or uart_receivechar to perform the appropriate data
* transfers.
*
@ -1071,7 +1071,7 @@ static int imxrt_interrupt(int irq, void *context, FAR void *arg)
*/
usr = imxrt_serialin(priv, IMXRT_LPUART_STAT_OFFSET);
usr &= (LPUART_STAT_RDRF | LPUART_STAT_TC | LPUART_STAT_OR |
usr &= (LPUART_STAT_RDRF | LPUART_STAT_TDRE | LPUART_STAT_OR |
LPUART_STAT_FE);
/* Clear serial overrun and framing errors */
@ -1097,8 +1097,8 @@ static int imxrt_interrupt(int irq, void *context, FAR void *arg)
/* Handle outgoing, transmit bytes */
if ((usr & LPUART_STAT_TC) != 0 &&
(priv->ie & LPUART_CTRL_TCIE) != 0)
if ((usr & LPUART_STAT_TDRE) != 0 &&
(priv->ie & LPUART_CTRL_TIE) != 0)
{
uart_xmitchars(dev);
handled = true;
@ -1473,12 +1473,12 @@ static void imxrt_txint(struct uart_dev_s *dev, bool enable)
if (enable)
{
#ifndef CONFIG_SUPPRESS_SERIAL_INTS
priv->ie |= LPUART_CTRL_TCIE;
priv->ie |= LPUART_CTRL_TIE;
#endif
}
else
{
priv->ie &= ~LPUART_CTRL_TCIE;
priv->ie &= ~LPUART_CTRL_TIE;
}
regval = imxrt_serialin(priv, IMXRT_LPUART_CTRL_OFFSET);