Commit 4df24fef authored by Linus Walleij's avatar Linus Walleij Committed by Russell King

ARM: 9005/1: debug: Select flow control for all debug UARTs

Instead of a flow control selection mechanism specifically for
8250, make this available for all debug UARTs. If the debug
UART supports waiting for CTS to be asserted, then this code
can be activated for terminals that need it.

We keep the defaults for EBSA110, Footbridge, Gemini and RPC
so that this still works as expected for these older platforms:
they assume that flow control shall be enabled for debug
prints.

I switch the location of the check for
ifdef CONFIG_DEBUG_UART_FLOW_CONTROL from the actual debug
UART drivers: the code would get compiled-out for 8250 and
Tegra unless their custom config (or passing -DFLOW_CONTROL
in the Tegra case) was not set. Instead this is conditional
at the three places where we print debug messages. The idea
is that debug UARTs can be implemented without this ifdef
boilerplate so they look cleaner, alas the ifdef has to be
somewhere.
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
parent 2c50a570
...@@ -1546,6 +1546,17 @@ config DEBUG_SIRFSOC_UART ...@@ -1546,6 +1546,17 @@ config DEBUG_SIRFSOC_UART
bool bool
depends on ARCH_SIRF depends on ARCH_SIRF
config DEBUG_UART_FLOW_CONTROL
bool "Enable flow control (CTS) for the debug UART"
depends on DEBUG_LL
default y if ARCH_EBSA110 || DEBUG_FOOTBRIDGE_COM1 || DEBUG_GEMINI || ARCH_RPC
help
Some UART ports are connected to terminals that will use modem
control signals to indicate whether they are ready to receive text.
In practice this means that the terminal is asserting the special
control signal CTS (Clear To Send). If your debug UART supports
this and your debug terminal will require it, enable this option.
config DEBUG_LL_INCLUDE config DEBUG_LL_INCLUDE
string string
default "debug/sa1100.S" if DEBUG_SA1100 default "debug/sa1100.S" if DEBUG_SA1100
...@@ -1893,11 +1904,6 @@ config DEBUG_UART_8250_PALMCHIP ...@@ -1893,11 +1904,6 @@ config DEBUG_UART_8250_PALMCHIP
except for having a different register layout. Say Y here if except for having a different register layout. Say Y here if
the debug UART is of this type. the debug UART is of this type.
config DEBUG_UART_8250_FLOW_CONTROL
bool "Enable flow control for 8250 UART"
depends on DEBUG_LL_UART_8250 || DEBUG_UART_8250
default y if ARCH_EBSA110 || DEBUG_FOOTBRIDGE_COM1 || DEBUG_GEMINI || ARCH_RPC
config DEBUG_UNCOMPRESS config DEBUG_UNCOMPRESS
bool "Enable decompressor debugging via DEBUG_LL output" bool "Enable decompressor debugging via DEBUG_LL output"
depends on ARCH_MULTIPLATFORM || PLAT_SAMSUNG || ARM_SINGLE_ARMV7M depends on ARCH_MULTIPLATFORM || PLAT_SAMSUNG || ARM_SINGLE_ARMV7M
......
...@@ -8,7 +8,9 @@ ...@@ -8,7 +8,9 @@
ENTRY(putc) ENTRY(putc)
addruart r1, r2, r3 addruart r1, r2, r3
#ifdef CONFIG_DEBUG_UART_FLOW_CONTROL
waituartcts r3, r1 waituartcts r3, r1
#endif
waituarttxrdy r3, r1 waituarttxrdy r3, r1
senduart r0, r1 senduart r0, r1
busyuart r3, r1 busyuart r3, r1
......
...@@ -49,9 +49,7 @@ ...@@ -49,9 +49,7 @@
.endm .endm
.macro waituartcts,rd,rx .macro waituartcts,rd,rx
#ifdef CONFIG_DEBUG_UART_8250_FLOW_CONTROL
1001: load \rd, [\rx, #UART_MSR << UART_SHIFT] 1001: load \rd, [\rx, #UART_MSR << UART_SHIFT]
tst \rd, #UART_MSR_CTS tst \rd, #UART_MSR_CTS
beq 1001b beq 1001b
#endif
.endm .endm
...@@ -179,14 +179,12 @@ ...@@ -179,14 +179,12 @@
.endm .endm
.macro waituartcts, rd, rx .macro waituartcts, rd, rx
#ifdef FLOW_CONTROL
cmp \rx, #0 cmp \rx, #0
beq 1002f beq 1002f
1001: ldrb \rd, [\rx, #UART_MSR << UART_SHIFT] 1001: ldrb \rd, [\rx, #UART_MSR << UART_SHIFT]
tst \rd, #UART_MSR_CTS tst \rd, #UART_MSR_CTS
beq 1001b beq 1001b
1002: 1002:
#endif
.endm .endm
.macro waituarttxrdy,rd,rx .macro waituarttxrdy,rd,rx
......
...@@ -89,12 +89,17 @@ ENTRY(printascii) ...@@ -89,12 +89,17 @@ ENTRY(printascii)
2: teq r1, #'\n' 2: teq r1, #'\n'
bne 3f bne 3f
mov r1, #'\r' mov r1, #'\r'
#ifdef CONFIG_DEBUG_UART_FLOW_CONTROL
waituartcts r2, r3 waituartcts r2, r3
#endif
waituarttxrdy r2, r3 waituarttxrdy r2, r3
senduart r1, r3 senduart r1, r3
busyuart r2, r3 busyuart r2, r3
mov r1, #'\n' mov r1, #'\n'
3: waituartcts r2, r3 3:
#ifdef CONFIG_DEBUG_UART_FLOW_CONTROL
waituartcts r2, r3
#endif
waituarttxrdy r2, r3 waituarttxrdy r2, r3
senduart r1, r3 senduart r1, r3
busyuart r2, r3 busyuart r2, r3
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment