ARM: earlycon: Fix <CR><LF><CR> end-of-line
cover ARM: earlycon: Fix <CR><LF><CR> end-of-line
Since very beginning the early serial console on ARM produces <CR><LF><CR> line terminator. There are couple of problems connected:
1. C function early_write() adds <CR> to each <LF> even though underlying Assembler printch() does this already
2. printch() adds <CR> *after* <LF>, not before, as it is usually being done
This patchset is tested on a Keystone2 machine (Cortex-A15) with CONFIG_THUMB2_KERNEL=n.
Alexander Sverdlin (2):
ARM: Make DEBUG_LL produce CRLF instead of LFCR
ARM: early_printk: Stop emitting double CR on the console
arch/arm/kernel/debug.S | 11 +++++++---- arch/arm/kernel/early_printk.c | 2 -- 2 files changed, 7 insertions(+), 6 deletions(-)
Signature · 1 line
2.4.6
PATCH 1/2 ARM: Make DEBUG_LL produce CRLF instead of LFCR
This change almost doubles the usage of DEBUG_LL macros but in exchange terminates all the console output with CRLF not LFCR.
--- arch/arm/kernel/debug.S | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
arch/arm/kernel/debug.S +7 -4
@@ -80,12 +80,15 @@ hexbuf: .space 16 ENTRY(printascii) addruart_current r3, r1, r2 b 2f -1: waituart r2, r3 +1: teq r1, #'\n' + bne 3f + waituart r2, r3 + mov r2, #'\r' + senduart r2, r3 + busyuart r2, r3 +3: waituart r2, r3 senduart r1, r3 busyuart r2, r3 - teq r1, #'\n' - moveq r1, #'\r' - beq 1b 2: teq r0, #0 ldrneb r1, [r0], #1 teqne r1, #0
Signature · 1 line
2.4.6
PATCH 2/2 ARM: early_printk: Stop emitting double CR on the console
In reply to Alexander Sverdlinprintch already takes care about LF->CRLF translation, so early_write() just produced extra CR.
--- arch/arm/kernel/early_printk.c | 2 -- 1 file changed, 2 deletions(-)
arch/arm/kernel/early_printk.c +0 -2
@@ -17,8 +17,6 @@ extern void printch(int);static void early_write (const char *s,unsigned n) {while (n-- >0 ) { -if (*s =='\n' ) -printch ('\r' );printch (*s); s++; }
Signature · 1 line
2.4.6
Russell King - ARM Linux
maintainercover ARM: earlycon: Fix <CR><LF><CR> end-of-line
In reply to Alexander SverdlinQuoted 5 lines · Alexander Sverdlin
Since very beginning the early serial console on ARM produces <CR><LF><CR> line terminator. There are couple of problems connected:
1. C functionearly_write()adds <CR> to each <LF> even though underlying Assemblerprintch()does this already
2.printch()adds <CR> *after* <LF>, not before, as it is usually being done
You omit to say why you want this change...
Signature · 3 lines
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up According to speedtest.net: 8.21Mbps down 510kbps up
cover ARM: earlycon: Fix <CR><LF><CR> end-of-line
Quoted 6 lines · Russell King - ARM Linux
Quoted 5 lines
Since very beginning the early serial console on ARM produces <CR><LF><CR> line terminator. There are couple of problems connected:
1. C functionearly_write()adds <CR> to each <LF> even though underlying Assemblerprintch()does this already
2.printch()adds <CR> *after* <LF>, not before, as it is usually being doneYou omit to say why you want this change...
Well, only because it produces normal serial log after the change, as all other ARCHs do. Depending on the viewer one either doesn't have extra "^M" at the beginning of each line or the lines are not interlaced (with extra empty lines) any more.
Signature · 2 lines
Best regards, Alexander Sverdlin.