serial: ns16550: Add RX interrupt buffer support

Pasting longer lines into the U-Boot console prompt sometimes leads to
characters missing. One problem here is the small 16-byte FIFO of the
legacy NS16550 UART, e.g. on x86 platforms.

This patch now introduces a Kconfig option to enable RX interrupt
buffer support for NS16550 style UARTs. With this option enabled, I was
able paste really long lines into the U-Boot console, without any
characters missing.

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Cc: Bin Meng <bmeng.cn@gmail.com>
[trini: Guard ns16550_serial_remove with
CONFIG_IS_ENABLED(SERIAL_PRESENT) to match struct assignment]
Signed-off-by: Tom Rini <trini@konsulko.com>
diff --git a/include/ns16550.h b/include/ns16550.h
index 5fcbcd2..7e9944d 100644
--- a/include/ns16550.h
+++ b/include/ns16550.h
@@ -51,6 +51,10 @@
  * @base:		Base register address
  * @reg_shift:		Shift size of registers (0=byte, 1=16bit, 2=32bit...)
  * @clock:		UART base clock speed in Hz
+ *
+ * @buf:		Pointer to the RX interrupt buffer
+ * @rd_ptr:		Read pointer in the RX interrupt buffer
+ * @wr_ptr:		Write pointer in the RX interrupt buffer
  */
 struct ns16550_platdata {
 	unsigned long base;
@@ -58,6 +62,12 @@
 	int clock;
 	int reg_offset;
 	u32 fcr;
+
+	int irq;
+
+	char *buf;
+	int rd_ptr;
+	int wr_ptr;
 };
 
 struct udevice;