serial: enable 64-bytes FIFO for UART 16750 in uart_ns16550 driver

UART 16750 is basically a UART 16550 with a 64-bytes FIFO.
The 64-bytes FIFO can be enabled via register FCR.

Account for it in the uart_ns16550 driver whenever the
CONFIG_UART_NS16750 variable is set.

Change-Id: I2342b28a41d03c96410bbfbe57e4b5a4e335731d
Signed-off-by: Jean-Paul Etienne <fractalclone@gmail.com>
This commit is contained in:
Jean-Paul Etienne 2016-11-15 02:23:45 +00:00 committed by Anas Nashif
parent 0e650d4eaf
commit cfa43f5bda
2 changed files with 18 additions and 1 deletions

View file

@ -46,6 +46,13 @@ config UART_NS16550_DRV_CMD
Says n if not sure.
config UART_NS16750
bool "Enable 64-bytes FIFO for UART 16750"
default n
depends on UART_NS16550
help
This enables support for 64-bytes FIFO if UART controller is 16750.
# ---------- Port 0 ----------
menuconfig UART_NS16550_PORT_0

View file

@ -125,6 +125,12 @@
#define FCR_FIFO_8 0x80 /* 8 bytes in RCVR FIFO */
#define FCR_FIFO_14 0xC0 /* 14 bytes in RCVR FIFO */
/*
* UART NS16750 supports 64 bytes FIFO, which can be enabled
* via the FCR register
*/
#define FCR_FIFO_64 0x20 /* Enable 64 bytes FIFO */
/* constants for line control register */
#define LCR_CS5 0x00 /* 5 bits data size */
@ -347,7 +353,11 @@ static int uart_ns16550_init(struct device *dev)
* Clear TX and RX FIFO
*/
OUTBYTE(FCR(dev),
FCR_FIFO | FCR_MODE0 | FCR_FIFO_8 | FCR_RCVRCLR | FCR_XMITCLR);
FCR_FIFO | FCR_MODE0 | FCR_FIFO_8 | FCR_RCVRCLR | FCR_XMITCLR
#ifdef CONFIG_UART_NS16750
| FCR_FIFO_64
#endif
);
/* clear the port */
INBYTE(RDR(dev));