Revert "serial: ns16550: Add RX interrupt buffer support"
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.
--- drivers/serial/Kconfig | 10 ---- drivers/serial/ns16550.c | 123 ++--------------------------------------------- include/ns16550.h | 10 ---- 3 files changed, 5 insertions(+), 138 deletions(-)
drivers/serial/Kconfig +0 -10
@@ -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
drivers/serial/ns16550.c +5 -118
163 lines not on this page · raw message
include/ns16550.h +0 -10
@@ -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 ;
Signature · 1 line
2.14.1
PATCH 2/4 serial: serial-uclass: Add generic serial RX 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 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.
--- drivers/serial/Kconfig | 15 +++++++++++++ drivers/serial/serial-uclass.c | 48 ++++++++++++++++++++++++++++++++++++++++-- include/serial.h | 10 ++++++++- 3 files changed, 70 insertions(+), 3 deletions(-)
drivers/serial/Kconfig +15 -0
@@ -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
drivers/serial/serial-uclass.c +46 -2
72 lines not on this page · raw message
include/serial.h +9 -1
@@ -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 */
Signature · 1 line
2.14.1
PATCH 2/4 serial: serial-uclass: Add generic serial RX buffer support
Quoted 13 lines · Stefan Roese
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
Kconfigoption 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 <[email protected]>Cc Simon Glass <[email protected]>Cc Bin Meng <[email protected]>Cc Tom Rini <[email protected]>
Quoted 6 lines
--- drivers/serial/Kconfig | 15 +++++++++++++ drivers/serial/serial-uclass.c | 48 ++++++++++++++++++++++++++++++++++++++++-- include/serial.h | 10 ++++++++- 3 files changed, 70 insertions(+), 3 deletions(-)
Great!
Tested on MinnowMax
PATCH 2/4 serial: serial-uclass: Add generic serial RX buffer support
Quoted 21 lines · Bin Meng
Quoted 13 lines · Stefan Roese
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
Kconfigoption 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 <[email protected]>Cc Simon Glass <[email protected]>Cc Bin Meng <[email protected]>Cc Tom Rini <[email protected]>Quoted 6 lines
--- drivers/serial/Kconfig | 15 +++++++++++++ drivers/serial/serial-uclass.c | 48 ++++++++++++++++++++++++++++++++++++++++-- include/serial.h | 10 ++++++++- 3 files changed, 70 insertions(+), 3 deletions(-)
Quoted 6 lines
Great!
Reviewed-by Bin Meng <[email protected]>Tested on MinnowMax
Tested-by Bin Meng <[email protected]>
applied to u-boot-x86, thanks!
PATCH 2/4 serial: serial-uclass: Add generic serial RX buffer support
In reply to Stefan RoeseHi Stefan,
Quoted 13 lines · Stefan Roese
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
Kconfigoption 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 <[email protected]>Cc Simon Glass <[email protected]>Cc Bin Meng <[email protected]>Cc Tom Rini <[email protected]>
Quoted 6 lines
--- 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
PATCH 3/4 x86: conga-qeval20-qa3-e3845: Select SERIAL_RX_BUFFER via Kconfig
In reply to Stefan RoeseTo 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.
--- board/congatec/conga-qeval20-qa3-e3845/Kconfig | 1 + 1 file changed, 1 insertion(+)
board/congatec/conga-qeval20-qa3-e3845/Kconfig +1 -0
@@ -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
Signature · 1 line
2.14.1
PATCH 3/4 x86: conga-qeval20-qa3-e3845: Select SERIAL_RX_BUFFER via Kconfig
Hi Bin,
Quoted 16 lines · Stefan Roese
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 <[email protected]>Cc Simon Glass <[email protected]>Cc Bin Meng <[email protected]>--- board/congatec/conga-qeval20-qa3-e3845/Kconfig | 1 + 1 file changed, 1 insertion(+)board/congatec/conga-qeval20-qa3-e3845/Kconfig +0
-0
board/congatec/conga-qeval20-qa3-e3845/Kconfig config BOARD_SPECIFIC_OPTIONS # dummy · line 28
Quoted 4 lines
board/congatec/conga-qeval20-qa3-e3845/Kconfig +1
-0@@ -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
PATCH 3/4 x86: conga-qeval20-qa3-e3845: Select SERIAL_RX_BUFFER via Kconfig
Hi Stefan,
Quoted 30 lines · Stefan Roese
Hi Bin,
Quoted 18 lines · Stefan Roese
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 <[email protected]>Cc Simon Glass <[email protected]>Cc Bin Meng <[email protected]>--- board/congatec/conga-qeval20-qa3-e3845/Kconfig | 1 + 1 file changed, 1 insertion(+)board/congatec/conga-qeval20-qa3-e3845/Kconfig +0
-0board/congatec/conga-qeval20-qa3-e3845/Kconfig config BOARD_SPECIFIC_OPTIONS # dummy · line 28
Quoted 4 lines
board/congatec/conga-qeval20-qa3-e3845/Kconfig +1
-0@@ -25,6 +25,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy select SPI_FLASH_STMICRO imply SPI_FLASH_SPANSION imply SPI_FLASH_WINBOND + select SERIAL_RX_BUFFERIt might be better to select (or imply) this
Kconfigoption for x86 in general, once this support is available in mainline.
Quoted 1 line
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
PATCH 3/4 x86: conga-qeval20-qa3-e3845: Select SERIAL_RX_BUFFER via Kconfig
Hi Bin,
Quoted 66 lines · Bin Meng
Quoted 30 lines · Stefan Roese
Hi Bin,
Quoted 18 lines · Stefan Roese
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 <[email protected]>Cc Simon Glass <[email protected]>Cc Bin Meng <[email protected]>--- board/congatec/conga-qeval20-qa3-e3845/Kconfig | 1 + 1 file changed, 1 insertion(+)board/congatec/conga-qeval20-qa3-e3845/Kconfig +0
-0board/congatec/conga-qeval20-qa3-e3845/Kconfig config BOARD_SPECIFIC_OPTIONS # dummy · line 28
Quoted 4 lines
board/congatec/conga-qeval20-qa3-e3845/Kconfig +1
-0@@ -25,6 +25,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy select SPI_FLASH_STMICRO imply SPI_FLASH_SPANSION imply SPI_FLASH_WINBOND + select SERIAL_RX_BUFFERIt might be better to select (or imply) this
Kconfigoption for x86 in general, once this support is available in mainline.Quoted 1 line
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
Kconfigoption 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'
Quoted 3 lines
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
PATCH 3/4 x86: conga-qeval20-qa3-e3845: Select SERIAL_RX_BUFFER via Kconfig
In reply to Stefan RoeseQuoted 11 lines · Stefan Roese
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 <[email protected]>Cc Simon Glass <[email protected]>Cc Bin Meng <[email protected]>--- board/congatec/conga-qeval20-qa3-e3845/Kconfig | 1 + 1 file changed, 1 insertion(+)
PATCH 3/4 x86: conga-qeval20-qa3-e3845: Select SERIAL_RX_BUFFER via Kconfig
Quoted 13 lines · Bin Meng
Quoted 11 lines · Stefan Roese
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 <[email protected]>Cc Simon Glass <[email protected]>Cc Bin Meng <[email protected]>--- board/congatec/conga-qeval20-qa3-e3845/Kconfig | 1 + 1 file changed, 1 insertion(+)
Quoted 1 line
Reviewed-by Bin Meng <[email protected]>
applied to u-boot-x86, thanks!
PATCH 4/4 x86: dfi-bt700: Select SERIAL_RX_BUFFER via Kconfig
In reply to Stefan RoeseTo 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.
--- board/dfi/dfi-bt700/Kconfig | 1 + 1 file changed, 1 insertion(+)
board/dfi/dfi-bt700/Kconfig +1 -0
@@ -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
Signature · 1 line
2.14.1
PATCH 4/4 x86: dfi-bt700: Select SERIAL_RX_BUFFER via Kconfig
Quoted 11 lines · Stefan Roese
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 <[email protected]>Cc Simon Glass <[email protected]>Cc Bin Meng <[email protected]>--- board/dfi/dfi-bt700/Kconfig | 1 + 1 file changed, 1 insertion(+)
PATCH 4/4 x86: dfi-bt700: Select SERIAL_RX_BUFFER via Kconfig
Quoted 13 lines · Bin Meng
Quoted 11 lines · Stefan Roese
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 <[email protected]>Cc Simon Glass <[email protected]>Cc Bin Meng <[email protected]>--- board/dfi/dfi-bt700/Kconfig | 1 + 1 file changed, 1 insertion(+)
Quoted 1 line
Reviewed-by Bin Meng <[email protected]>
applied to u-boot-x86, thanks!
PATCH 1/4 Revert "serial: ns16550: Add RX interrupt buffer support"
In reply to Stefan RoeseQuoted 15 lines · Stefan Roese
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 <[email protected]>Cc Simon Glass <[email protected]>Cc Bin Meng <[email protected]>Cc Tom Rini <[email protected]>
Quoted 6 lines
--- drivers/serial/Kconfig | 10 ---- drivers/serial/ns16550.c | 123 ++--------------------------------------------- include/ns16550.h | 10 ---- 3 files changed, 5 insertions(+), 138 deletions(-)
PATCH 1/4 Revert "serial: ns16550: Add RX interrupt buffer support"
Quoted 23 lines · Bin Meng
Quoted 15 lines · Stefan Roese
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 <[email protected]>Cc Simon Glass <[email protected]>Cc Bin Meng <[email protected]>Cc Tom Rini <[email protected]>Quoted 6 lines
--- drivers/serial/Kconfig | 10 ---- drivers/serial/ns16550.c | 123 ++--------------------------------------------- include/ns16550.h | 10 ---- 3 files changed, 5 insertions(+), 138 deletions(-)
Quoted 1 line
Reviewed-by Bin Meng <[email protected]>
applied to u-boot-x86, thanks!