[U-Boot] [PATCH 1/4] Revert "serial: ns16550: Add RX interrupt buffer support"

This reverts commit 6822cf3ec7c8768b8727573b8f4b2cb3d870b881.
As Bin Meng has tested and pointed out, we don't need the RX interrupt for the RX buffer support at all. Just reading all available characters into a buffer is sufficient to solve the problem with the dropped characters upon long lines pasted into the U-Boot prompt. Since this RX buffer support can be implemented in a generic way, without any device specifica (e.g. for the ns16550), I'll post a new patch with a new serial RX buffer support for DM, which all DM based serial drivers can use.
Signed-off-by: Stefan Roese sr@denx.de Cc: Simon Glass sjg@chromium.org Cc: Bin Meng bmeng.cn@gmail.com Cc: Tom Rini trini@konsulko.com --- drivers/serial/Kconfig | 10 ---- drivers/serial/ns16550.c | 123 ++--------------------------------------------- include/ns16550.h | 10 ---- 3 files changed, 5 insertions(+), 138 deletions(-)
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index a8e997834a..1c2c5d66e1 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig @@ -64,16 +64,6 @@ config DM_SERIAL implements serial_putc() etc. The uclass interface is defined in include/serial.h.
-config SERIAL_IRQ_BUFFER - bool "Enable RX interrupt buffer for serial input" - depends on DM_SERIAL - default n - help - Enable RX interrupt buffer support for the serial driver. - This enables pasting longer strings, even when the RX FIFO - of the UART is not big enough (e.g. 16 bytes on the normal - NS16550). - config SPL_DM_SERIAL bool "Enable Driver Model for serial drivers in SPL" depends on DM_SERIAL diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c index 607a1b8c1d..c702304e79 100644 --- a/drivers/serial/ns16550.c +++ b/drivers/serial/ns16550.c @@ -314,80 +314,6 @@ DEBUG_UART_FUNCS #endif
#ifdef CONFIG_DM_SERIAL - -#if CONFIG_IS_ENABLED(SERIAL_IRQ_BUFFER) - -#define BUF_COUNT 256 - -static void rx_fifo_to_buf(struct udevice *dev) -{ - struct NS16550 *const com_port = dev_get_priv(dev); - struct ns16550_platdata *plat = dev->platdata; - - /* Read all available chars into buffer */ - while ((serial_in(&com_port->lsr) & UART_LSR_DR)) { - plat->buf[plat->wr_ptr++] = serial_in(&com_port->rbr); - plat->wr_ptr %= BUF_COUNT; - } -} - -static int rx_pending(struct udevice *dev) -{ - struct ns16550_platdata *plat = dev->platdata; - - /* - * At startup it may happen, that some already received chars are - * "stuck" in the RX FIFO, even with the interrupt enabled. This - * RX FIFO flushing makes sure, that these chars are read out and - * the RX interrupts works as expected. - */ - rx_fifo_to_buf(dev); - - return plat->rd_ptr != plat->wr_ptr ? 1 : 0; -} - -static int rx_get(struct udevice *dev) -{ - struct ns16550_platdata *plat = dev->platdata; - char val; - - val = plat->buf[plat->rd_ptr++]; - plat->rd_ptr %= BUF_COUNT; - - return val; -} - -void ns16550_handle_irq(void *data) -{ - struct udevice *dev = (struct udevice *)data; - struct NS16550 *const com_port = dev_get_priv(dev); - - /* Check if interrupt is pending */ - if (serial_in(&com_port->iir) & UART_IIR_NO_INT) - return; - - /* Flush all available characters from the RX FIFO into the RX buffer */ - rx_fifo_to_buf(dev); -} - -#else /* CONFIG_SERIAL_IRQ_BUFFER */ - -static int rx_pending(struct udevice *dev) -{ - struct NS16550 *const com_port = dev_get_priv(dev); - - return serial_in(&com_port->lsr) & UART_LSR_DR ? 1 : 0; -} - -static int rx_get(struct udevice *dev) -{ - struct NS16550 *const com_port = dev_get_priv(dev); - - return serial_in(&com_port->rbr); -} - -#endif /* CONFIG_SERIAL_IRQ_BUFFER */ - static int ns16550_serial_putc(struct udevice *dev, const char ch) { struct NS16550 *const com_port = dev_get_priv(dev); @@ -413,17 +339,19 @@ static int ns16550_serial_pending(struct udevice *dev, bool input) struct NS16550 *const com_port = dev_get_priv(dev);
if (input) - return rx_pending(dev); + return serial_in(&com_port->lsr) & UART_LSR_DR ? 1 : 0; else return serial_in(&com_port->lsr) & UART_LSR_THRE ? 0 : 1; }
static int ns16550_serial_getc(struct udevice *dev) { - if (!ns16550_serial_pending(dev, true)) + struct NS16550 *const com_port = dev_get_priv(dev); + + if (!(serial_in(&com_port->lsr) & UART_LSR_DR)) return -EAGAIN;
- return rx_get(dev); + return serial_in(&com_port->rbr); }
static int ns16550_serial_setbrg(struct udevice *dev, int baudrate) @@ -446,39 +374,8 @@ int ns16550_serial_probe(struct udevice *dev) com_port->plat = dev_get_platdata(dev); NS16550_init(com_port, -1);
-#if CONFIG_IS_ENABLED(SERIAL_IRQ_BUFFER) - if (gd->flags & GD_FLG_RELOC) { - struct ns16550_platdata *plat = dev->platdata; - - /* Allocate the RX buffer */ - plat->buf = malloc(BUF_COUNT); - - /* Install the interrupt handler */ - irq_install_handler(plat->irq, ns16550_handle_irq, dev); - - /* Enable RX interrupts */ - serial_out(UART_IER_RDI, &com_port->ier); - } -#endif - - return 0; -} - -#if CONFIG_IS_ENABLED(SERIAL_PRESENT) && \ - (!defined(CONFIG_TPL_BUILD) || defined(CONFIG_TPL_DM_SERIAL)) -static int ns16550_serial_remove(struct udevice *dev) -{ -#if CONFIG_IS_ENABLED(SERIAL_IRQ_BUFFER) - if (gd->flags & GD_FLG_RELOC) { - struct ns16550_platdata *plat = dev->platdata; - - irq_free_handler(plat->irq); - } -#endif - return 0; } -#endif
#if CONFIG_IS_ENABLED(OF_CONTROL) enum { @@ -561,15 +458,6 @@ int ns16550_serial_ofdata_to_platdata(struct udevice *dev) if (port_type == PORT_JZ4780) plat->fcr |= UART_FCR_UME;
-#if CONFIG_IS_ENABLED(SERIAL_IRQ_BUFFER) - plat->irq = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), - "interrupts", 0); - if (!plat->irq) { - debug("ns16550 interrupt not provided\n"); - return -EINVAL; - } -#endif - return 0; } #endif @@ -617,7 +505,6 @@ U_BOOT_DRIVER(ns16550_serial) = { #endif .priv_auto_alloc_size = sizeof(struct NS16550), .probe = ns16550_serial_probe, - .remove = ns16550_serial_remove, .ops = &ns16550_serial_ops, .flags = DM_FLAG_PRE_RELOC, }; diff --git a/include/ns16550.h b/include/ns16550.h index 7e9944d0d9..5fcbcd2e74 100644 --- a/include/ns16550.h +++ b/include/ns16550.h @@ -51,10 +51,6 @@ * @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; @@ -62,12 +58,6 @@ struct ns16550_platdata { int clock; int reg_offset; u32 fcr; - - int irq; - - char *buf; - int rd_ptr; - int wr_ptr; };
struct udevice;

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 buffer support for all DM based serial drivers. 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 Cc: Simon Glass sjg@chromium.org Cc: Bin Meng bmeng.cn@gmail.com Cc: Tom Rini trini@konsulko.com --- drivers/serial/Kconfig | 15 +++++++++++++ drivers/serial/serial-uclass.c | 48 ++++++++++++++++++++++++++++++++++++++++-- include/serial.h | 10 ++++++++- 3 files changed, 70 insertions(+), 3 deletions(-)
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index 1c2c5d66e1..aeed538fa4 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig @@ -64,6 +64,21 @@ config DM_SERIAL implements serial_putc() etc. The uclass interface is defined in include/serial.h.
+config SERIAL_RX_BUFFER + bool "Enable RX buffer for serial input" + depends on DM_SERIAL + help + Enable RX buffer support for the serial driver. This enables + pasting longer strings, even when the RX FIFO of the UART is + not big enough (e.g. 16 bytes on the normal NS16550). + +config SERIAL_RX_BUFFER_SIZE + int "RX buffer size" + depends on SERIAL_RX_BUFFER + default 256 + help + The size of the RX buffer (needs to be power of 2) + config SPL_DM_SERIAL bool "Enable Driver Model for serial drivers in SPL" depends on DM_SERIAL diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c index 998d372da6..2e5116f7ce 100644 --- a/drivers/serial/serial-uclass.c +++ b/drivers/serial/serial-uclass.c @@ -160,7 +160,7 @@ static void _serial_puts(struct udevice *dev, const char *str) _serial_putc(dev, *str++); }
-static int _serial_getc(struct udevice *dev) +static int __serial_getc(struct udevice *dev) { struct dm_serial_ops *ops = serial_get_ops(dev); int err; @@ -174,7 +174,7 @@ static int _serial_getc(struct udevice *dev) return err >= 0 ? err : 0; }
-static int _serial_tstc(struct udevice *dev) +static int __serial_tstc(struct udevice *dev) { struct dm_serial_ops *ops = serial_get_ops(dev);
@@ -184,6 +184,44 @@ static int _serial_tstc(struct udevice *dev) return 1; }
+#if CONFIG_IS_ENABLED(SERIAL_RX_BUFFER) +static int _serial_tstc(struct udevice *dev) +{ + struct serial_dev_priv *upriv = dev_get_uclass_priv(dev); + + /* Read all available chars into the RX buffer */ + while (__serial_tstc(dev)) { + upriv->buf[upriv->wr_ptr++] = __serial_getc(dev); + upriv->wr_ptr %= CONFIG_SERIAL_RX_BUFFER_SIZE; + } + + return upriv->rd_ptr != upriv->wr_ptr ? 1 : 0; +} + +static int _serial_getc(struct udevice *dev) +{ + struct serial_dev_priv *upriv = dev_get_uclass_priv(dev); + char val; + + val = upriv->buf[upriv->rd_ptr++]; + upriv->rd_ptr %= CONFIG_SERIAL_RX_BUFFER_SIZE; + + return val; +} + +#else /* CONFIG_IS_ENABLED(SERIAL_RX_BUFFER) */ + +static int _serial_getc(struct udevice *dev) +{ + return __serial_getc(dev); +} + +static int _serial_tstc(struct udevice *dev) +{ + return __serial_tstc(dev); +} +#endif /* CONFIG_IS_ENABLED(SERIAL_RX_BUFFER) */ + void serial_putc(char ch) { if (gd->cur_serial_dev) @@ -359,6 +397,12 @@ static int serial_post_probe(struct udevice *dev) sdev.puts = serial_stub_puts; sdev.getc = serial_stub_getc; sdev.tstc = serial_stub_tstc; + +#if CONFIG_IS_ENABLED(SERIAL_RX_BUFFER) + /* Allocate the RX buffer */ + upriv->buf = malloc(CONFIG_SERIAL_RX_BUFFER_SIZE); +#endif + stdio_register_dev(&sdev, &upriv->sdev); #endif return 0; diff --git a/include/serial.h b/include/serial.h index f4171964ae..d87f01082a 100644 --- a/include/serial.h +++ b/include/serial.h @@ -148,10 +148,18 @@ struct dm_serial_ops { /** * struct serial_dev_priv - information about a device used by the uclass * - * @sdev: stdio device attached to this uart + * @sdev: stdio device attached to this uart + * + * @buf: Pointer to the RX buffer + * @rd_ptr: Read pointer in the RX buffer + * @wr_ptr: Write pointer in the RX buffer */ struct serial_dev_priv { struct stdio_dev *sdev; + + char *buf; + int rd_ptr; + int wr_ptr; };
/* Access the serial operations for a device */

On Wed, Aug 16, 2017 at 11:37 PM, Stefan Roese sr@denx.de wrote:
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 buffer support for all DM based serial drivers. 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 Cc: Simon Glass sjg@chromium.org Cc: Bin Meng bmeng.cn@gmail.com Cc: Tom Rini trini@konsulko.com
drivers/serial/Kconfig | 15 +++++++++++++ drivers/serial/serial-uclass.c | 48 ++++++++++++++++++++++++++++++++++++++++-- include/serial.h | 10 ++++++++- 3 files changed, 70 insertions(+), 3 deletions(-)
Great!
Reviewed-by: Bin Meng bmeng.cn@gmail.com
Tested on MinnowMax Tested-by: Bin Meng bmeng.cn@gmail.com

On Thu, Aug 17, 2017 at 3:11 PM, Bin Meng bmeng.cn@gmail.com wrote:
On Wed, Aug 16, 2017 at 11:37 PM, Stefan Roese sr@denx.de wrote:
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 buffer support for all DM based serial drivers. 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 Cc: Simon Glass sjg@chromium.org Cc: Bin Meng bmeng.cn@gmail.com Cc: Tom Rini trini@konsulko.com
drivers/serial/Kconfig | 15 +++++++++++++ drivers/serial/serial-uclass.c | 48 ++++++++++++++++++++++++++++++++++++++++-- include/serial.h | 10 ++++++++- 3 files changed, 70 insertions(+), 3 deletions(-)
Great!
Reviewed-by: Bin Meng bmeng.cn@gmail.com
Tested on MinnowMax Tested-by: Bin Meng bmeng.cn@gmail.com
applied to u-boot-x86, thanks!

Hi Stefan,
On 16 August 2017 at 09:37, Stefan Roese sr@denx.de wrote:
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 buffer support for all DM based serial drivers. 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 Cc: Simon Glass sjg@chromium.org Cc: Bin Meng bmeng.cn@gmail.com Cc: Tom Rini trini@konsulko.com
drivers/serial/Kconfig | 15 +++++++++++++ drivers/serial/serial-uclass.c | 48 ++++++++++++++++++++++++++++++++++++++++-- include/serial.h | 10 ++++++++- 3 files changed, 70 insertions(+), 3 deletions(-)
I have wanted this for a long time - this is a really great feature!
- Simon

To support more input characters (longer stings pasted into the U-Boot prompt) without dropping, lets selects the recently added UART RX buffer for these boards.
Signed-off-by: Stefan Roese sr@denx.de Cc: Simon Glass sjg@chromium.org Cc: Bin Meng bmeng.cn@gmail.com --- board/congatec/conga-qeval20-qa3-e3845/Kconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/board/congatec/conga-qeval20-qa3-e3845/Kconfig b/board/congatec/conga-qeval20-qa3-e3845/Kconfig index e1fae737ac..9e44413c2c 100644 --- a/board/congatec/conga-qeval20-qa3-e3845/Kconfig +++ b/board/congatec/conga-qeval20-qa3-e3845/Kconfig @@ -25,6 +25,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy select SPI_FLASH_STMICRO imply SPI_FLASH_SPANSION imply SPI_FLASH_WINBOND + select SERIAL_RX_BUFFER
config PCIE_ECAM_BASE default 0xe0000000

Hi Bin,
On 16.08.2017 17:37, Stefan Roese wrote:
To support more input characters (longer stings pasted into the U-Boot prompt) without dropping, lets selects the recently added UART RX buffer for these boards.
Signed-off-by: Stefan Roese sr@denx.de Cc: Simon Glass sjg@chromium.org Cc: Bin Meng bmeng.cn@gmail.com
board/congatec/conga-qeval20-qa3-e3845/Kconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/board/congatec/conga-qeval20-qa3-e3845/Kconfig b/board/congatec/conga-qeval20-qa3-e3845/Kconfig index e1fae737ac..9e44413c2c 100644 --- a/board/congatec/conga-qeval20-qa3-e3845/Kconfig +++ b/board/congatec/conga-qeval20-qa3-e3845/Kconfig @@ -25,6 +25,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy select SPI_FLASH_STMICRO imply SPI_FLASH_SPANSION imply SPI_FLASH_WINBOND
- select SERIAL_RX_BUFFER
It might be better to select (or imply) this Kconfig option for x86 in general, once this support is available in mainline.
What do you think?
Thanks, Stefan

Hi Stefan,
On Wed, Aug 16, 2017 at 11:43 PM, Stefan Roese sr@denx.de wrote:
Hi Bin,
On 16.08.2017 17:37, Stefan Roese wrote:
To support more input characters (longer stings pasted into the U-Boot prompt) without dropping, lets selects the recently added UART RX buffer for these boards.
Signed-off-by: Stefan Roese sr@denx.de Cc: Simon Glass sjg@chromium.org Cc: Bin Meng bmeng.cn@gmail.com
board/congatec/conga-qeval20-qa3-e3845/Kconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/board/congatec/conga-qeval20-qa3-e3845/Kconfig b/board/congatec/conga-qeval20-qa3-e3845/Kconfig index e1fae737ac..9e44413c2c 100644 --- a/board/congatec/conga-qeval20-qa3-e3845/Kconfig +++ b/board/congatec/conga-qeval20-qa3-e3845/Kconfig @@ -25,6 +25,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy select SPI_FLASH_STMICRO imply SPI_FLASH_SPANSION imply SPI_FLASH_WINBOND
select SERIAL_RX_BUFFER
It might be better to select (or imply) this Kconfig option for x86 in general, once this support is available in mainline.
What do you think?
When I tested the patch on the QEMU, I got interesting results:
Without the patch, QEMU's ns16550 does not lose any character or out of order when I paste a really long strings to the U-Boot console (it seems that U-Boot's maximum length for a command line is 256, so the 256 bytes are all there).
After applying the patch, I got something interesting:
The long strings I was using for testing was: "As Bin Meng has tested and pointed out, we don't need the RX interrupt for the RX buffer support at all. Just reading all available characters into a buffer is sufficient to solve the problem with the dropped characters upon long lines pasted into the U-Boot prompt. Since this RX buffer support can be implemented in a generic way, without any device specifica (e.g. for the ns16550), I'll post a new patch with a new serial RX buffer support for DM, which all DM based serial drivers can use. 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 buffer support for all DM based serial drivers. With this option enabled, I was able paste really long lines into the U-Boot console, without any characters missing."
I just got the following strings on the console:
=> serial drivers. With this option enabled, I was able paste really long lines into the U-Boot console, without any characters missing. Unknown command 'serial' - try 'help' => serial drivers. With this option enabled, I was able paste really long lines into the U-Boot console, without any characters missing. Unknown command 'serial' - try 'help'
All previous characters before this string are completely lost.
If we want to turn this option for all x86, I think this should be fixed.
Regards, Bin

Hi Bin,
On 17.08.2017 09:19, Bin Meng wrote:
On Wed, Aug 16, 2017 at 11:43 PM, Stefan Roese sr@denx.de wrote:
Hi Bin,
On 16.08.2017 17:37, Stefan Roese wrote:
To support more input characters (longer stings pasted into the U-Boot prompt) without dropping, lets selects the recently added UART RX buffer for these boards.
Signed-off-by: Stefan Roese sr@denx.de Cc: Simon Glass sjg@chromium.org Cc: Bin Meng bmeng.cn@gmail.com
board/congatec/conga-qeval20-qa3-e3845/Kconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/board/congatec/conga-qeval20-qa3-e3845/Kconfig b/board/congatec/conga-qeval20-qa3-e3845/Kconfig index e1fae737ac..9e44413c2c 100644 --- a/board/congatec/conga-qeval20-qa3-e3845/Kconfig +++ b/board/congatec/conga-qeval20-qa3-e3845/Kconfig @@ -25,6 +25,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy select SPI_FLASH_STMICRO imply SPI_FLASH_SPANSION imply SPI_FLASH_WINBOND
select SERIAL_RX_BUFFER
It might be better to select (or imply) this Kconfig option for x86 in general, once this support is available in mainline.
What do you think?
When I tested the patch on the QEMU, I got interesting results:
Without the patch, QEMU's ns16550 does not lose any character or out of order when I paste a really long strings to the U-Boot console (it seems that U-Boot's maximum length for a command line is 256, so the 256 bytes are all there).
After applying the patch, I got something interesting:
The long strings I was using for testing was: "As Bin Meng has tested and pointed out, we don't need the RX interrupt for the RX buffer support at all. Just reading all available characters into a buffer is sufficient to solve the problem with the dropped characters upon long lines pasted into the U-Boot prompt. Since this RX buffer support can be implemented in a generic way, without any device specifica (e.g. for the ns16550), I'll post a new patch with a new serial RX buffer support for DM, which all DM based serial drivers can use. 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 buffer support for all DM based serial drivers. With this option enabled, I was able paste really long lines into the U-Boot console, without any characters missing."
I just got the following strings on the console:
=> serial drivers. With this option enabled, I was able paste really long lines into the U-Boot console, without any characters missing. Unknown command 'serial' - try 'help' => serial drivers. With this option enabled, I was able paste really long lines into the U-Boot console, without any characters missing. Unknown command 'serial' - try 'help'
All previous characters before this string are completely lost.
If we want to turn this option for all x86, I think this should be fixed.
Okay, I fully agree. I'll hopefully be able to revisit this RX buffer support in a few weeks again and fix this issue on QEMU. Until then, it would be great if those 4 patches could be applied to enable this RX buffer support for these specific x86 boards.
Thanks, Stefan

On Wed, Aug 16, 2017 at 11:37 PM, Stefan Roese sr@denx.de wrote:
To support more input characters (longer stings pasted into the U-Boot prompt) without dropping, lets selects the recently added UART RX buffer for these boards.
Signed-off-by: Stefan Roese sr@denx.de Cc: Simon Glass sjg@chromium.org Cc: Bin Meng bmeng.cn@gmail.com
board/congatec/conga-qeval20-qa3-e3845/Kconfig | 1 + 1 file changed, 1 insertion(+)
Reviewed-by: Bin Meng bmeng.cn@gmail.com

On Thu, Aug 17, 2017 at 3:11 PM, Bin Meng bmeng.cn@gmail.com wrote:
On Wed, Aug 16, 2017 at 11:37 PM, Stefan Roese sr@denx.de wrote:
To support more input characters (longer stings pasted into the U-Boot prompt) without dropping, lets selects the recently added UART RX buffer for these boards.
Signed-off-by: Stefan Roese sr@denx.de Cc: Simon Glass sjg@chromium.org Cc: Bin Meng bmeng.cn@gmail.com
board/congatec/conga-qeval20-qa3-e3845/Kconfig | 1 + 1 file changed, 1 insertion(+)
Reviewed-by: Bin Meng bmeng.cn@gmail.com
applied to u-boot-x86, thanks!

To support more input characters (longer stings pasted into the U-Boot prompt) without dropping, lets selects the recently added UART RX buffer for these boards.
Signed-off-by: Stefan Roese sr@denx.de Cc: Simon Glass sjg@chromium.org Cc: Bin Meng bmeng.cn@gmail.com --- board/dfi/dfi-bt700/Kconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/board/dfi/dfi-bt700/Kconfig b/board/dfi/dfi-bt700/Kconfig index 4b6c3fc56c..f92f50a448 100644 --- a/board/dfi/dfi-bt700/Kconfig +++ b/board/dfi/dfi-bt700/Kconfig @@ -25,6 +25,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy select SPI_FLASH_STMICRO imply SPI_FLASH_SPANSION imply SPI_FLASH_WINBOND + select SERIAL_RX_BUFFER
config PCIE_ECAM_BASE default 0xe0000000

On Wed, Aug 16, 2017 at 11:37 PM, Stefan Roese sr@denx.de wrote:
To support more input characters (longer stings pasted into the U-Boot prompt) without dropping, lets selects the recently added UART RX buffer for these boards.
Signed-off-by: Stefan Roese sr@denx.de Cc: Simon Glass sjg@chromium.org Cc: Bin Meng bmeng.cn@gmail.com
board/dfi/dfi-bt700/Kconfig | 1 + 1 file changed, 1 insertion(+)
Reviewed-by: Bin Meng bmeng.cn@gmail.com

On Thu, Aug 17, 2017 at 3:11 PM, Bin Meng bmeng.cn@gmail.com wrote:
On Wed, Aug 16, 2017 at 11:37 PM, Stefan Roese sr@denx.de wrote:
To support more input characters (longer stings pasted into the U-Boot prompt) without dropping, lets selects the recently added UART RX buffer for these boards.
Signed-off-by: Stefan Roese sr@denx.de Cc: Simon Glass sjg@chromium.org Cc: Bin Meng bmeng.cn@gmail.com
board/dfi/dfi-bt700/Kconfig | 1 + 1 file changed, 1 insertion(+)
Reviewed-by: Bin Meng bmeng.cn@gmail.com
applied to u-boot-x86, thanks!

On Wed, Aug 16, 2017 at 11:37 PM, Stefan Roese sr@denx.de wrote:
This reverts commit 6822cf3ec7c8768b8727573b8f4b2cb3d870b881.
As Bin Meng has tested and pointed out, we don't need the RX interrupt for the RX buffer support at all. Just reading all available characters into a buffer is sufficient to solve the problem with the dropped characters upon long lines pasted into the U-Boot prompt. Since this RX buffer support can be implemented in a generic way, without any device specifica (e.g. for the ns16550), I'll post a new patch with a new serial RX buffer support for DM, which all DM based serial drivers can use.
Signed-off-by: Stefan Roese sr@denx.de Cc: Simon Glass sjg@chromium.org Cc: Bin Meng bmeng.cn@gmail.com Cc: Tom Rini trini@konsulko.com
drivers/serial/Kconfig | 10 ---- drivers/serial/ns16550.c | 123 ++--------------------------------------------- include/ns16550.h | 10 ---- 3 files changed, 5 insertions(+), 138 deletions(-)
Reviewed-by: Bin Meng bmeng.cn@gmail.com

On Thu, Aug 17, 2017 at 3:11 PM, Bin Meng bmeng.cn@gmail.com wrote:
On Wed, Aug 16, 2017 at 11:37 PM, Stefan Roese sr@denx.de wrote:
This reverts commit 6822cf3ec7c8768b8727573b8f4b2cb3d870b881.
As Bin Meng has tested and pointed out, we don't need the RX interrupt for the RX buffer support at all. Just reading all available characters into a buffer is sufficient to solve the problem with the dropped characters upon long lines pasted into the U-Boot prompt. Since this RX buffer support can be implemented in a generic way, without any device specifica (e.g. for the ns16550), I'll post a new patch with a new serial RX buffer support for DM, which all DM based serial drivers can use.
Signed-off-by: Stefan Roese sr@denx.de Cc: Simon Glass sjg@chromium.org Cc: Bin Meng bmeng.cn@gmail.com Cc: Tom Rini trini@konsulko.com
drivers/serial/Kconfig | 10 ---- drivers/serial/ns16550.c | 123 ++--------------------------------------------- include/ns16550.h | 10 ---- 3 files changed, 5 insertions(+), 138 deletions(-)
Reviewed-by: Bin Meng bmeng.cn@gmail.com
applied to u-boot-x86, thanks!
participants (3)
-
Bin Meng
-
Simon Glass
-
Stefan Roese