Skip to content

Commit 4df24fe

Browse files
Linus WalleijRussell King
authored andcommitted
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: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
1 parent 2c50a57 commit 4df24fe

5 files changed

Lines changed: 19 additions & 10 deletions

File tree

‎arch/arm/Kconfig.debug‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1546,6 +1546,17 @@ config DEBUG_SIRFSOC_UART
15461546
bool
15471547
depends on ARCH_SIRF
15481548

1549+
config DEBUG_UART_FLOW_CONTROL
1550+
bool "Enable flow control (CTS) for the debug UART"
1551+
depends on DEBUG_LL
1552+
default y if ARCH_EBSA110 || DEBUG_FOOTBRIDGE_COM1 || DEBUG_GEMINI || ARCH_RPC
1553+
help
1554+
Some UART ports are connected to terminals that will use modem
1555+
control signals to indicate whether they are ready to receive text.
1556+
In practice this means that the terminal is asserting the special
1557+
control signal CTS (Clear To Send). If your debug UART supports
1558+
this and your debug terminal will require it, enable this option.
1559+
15491560
config DEBUG_LL_INCLUDE
15501561
string
15511562
default "debug/sa1100.S" if DEBUG_SA1100
@@ -1893,11 +1904,6 @@ config DEBUG_UART_8250_PALMCHIP
18931904
except for having a different register layout. Say Y here if
18941905
the debug UART is of this type.
18951906

1896-
config DEBUG_UART_8250_FLOW_CONTROL
1897-
bool "Enable flow control for 8250 UART"
1898-
depends on DEBUG_LL_UART_8250 || DEBUG_UART_8250
1899-
default y if ARCH_EBSA110 || DEBUG_FOOTBRIDGE_COM1 || DEBUG_GEMINI || ARCH_RPC
1900-
19011907
config DEBUG_UNCOMPRESS
19021908
bool "Enable decompressor debugging via DEBUG_LL output"
19031909
depends on ARCH_MULTIPLATFORM || PLAT_SAMSUNG || ARM_SINGLE_ARMV7M

‎arch/arm/boot/compressed/debug.S‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88

99
ENTRY(putc)
1010
addruart r1, r2, r3
11+
#ifdef CONFIG_DEBUG_UART_FLOW_CONTROL
1112
waituartcts r3, r1
13+
#endif
1214
waituarttxrdy r3, r1
1315
senduart r0, r1
1416
busyuart r3, r1

‎arch/arm/include/debug/8250.S‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@
4949
.endm
5050

5151
.macro waituartcts,rd,rx
52-
#ifdef CONFIG_DEBUG_UART_8250_FLOW_CONTROL
5352
1001: load \rd, [\rx, #UART_MSR << UART_SHIFT]
5453
tst \rd, #UART_MSR_CTS
5554
beq 1001b
56-
#endif
5755
.endm

‎arch/arm/include/debug/tegra.S‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,12 @@
179179
.endm
180180

181181
.macro waituartcts, rd, rx
182-
#ifdef FLOW_CONTROL
183182
cmp \rx, #0
184183
beq 1002f
185184
1001: ldrb \rd, [\rx, #UART_MSR << UART_SHIFT]
186185
tst \rd, #UART_MSR_CTS
187186
beq 1001b
188187
1002:
189-
#endif
190188
.endm
191189

192190
.macro waituarttxrdy,rd,rx

‎arch/arm/kernel/debug.S‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,17 @@ ENTRY(printascii)
8989
2: teq r1, #'\n'
9090
bne 3f
9191
mov r1, #'\r'
92+
#ifdef CONFIG_DEBUG_UART_FLOW_CONTROL
9293
waituartcts r2, r3
94+
#endif
9395
waituarttxrdy r2, r3
9496
senduart r1, r3
9597
busyuart r2, r3
9698
mov r1, #'\n'
97-
3: waituartcts r2, r3
99+
3:
100+
#ifdef CONFIG_DEBUG_UART_FLOW_CONTROL
101+
waituartcts r2, r3
102+
#endif
98103
waituarttxrdy r2, r3
99104
senduart r1, r3
100105
busyuart r2, r3

0 commit comments

Comments
 (0)