* [PATCH 0/2] ARM: earlycon: Fix <CR><LF><CR> end-of-line
@ 2017-09-27 11:49 Alexander Sverdlin
2017-09-27 11:49 ` [PATCH 1/2] ARM: Make DEBUG_LL produce CRLF instead of LFCR Alexander Sverdlin
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Alexander Sverdlin @ 2017-09-27 11:49 UTC (permalink / raw)
To: linux-arm-kernel
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(-)
--
2.4.6
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] ARM: Make DEBUG_LL produce CRLF instead of LFCR
2017-09-27 11:49 [PATCH 0/2] ARM: earlycon: Fix <CR><LF><CR> end-of-line Alexander Sverdlin
@ 2017-09-27 11:49 ` Alexander Sverdlin
2017-09-27 11:49 ` [PATCH 2/2] ARM: early_printk: Stop emitting double CR on the console Alexander Sverdlin
2017-09-27 11:52 ` [PATCH 0/2] ARM: earlycon: Fix <CR><LF><CR> end-of-line Russell King - ARM Linux
2 siblings, 0 replies; 5+ messages in thread
From: Alexander Sverdlin @ 2017-09-27 11:49 UTC (permalink / raw)
To: linux-arm-kernel
This change almost doubles the usage of DEBUG_LL macros but
in exchange terminates all the console output with CRLF not LFCR.
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
---
arch/arm/kernel/debug.S | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/arch/arm/kernel/debug.S b/arch/arm/kernel/debug.S
index ea9646c..ca502cc 100644
--- a/arch/arm/kernel/debug.S
+++ b/arch/arm/kernel/debug.S
@@ -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
--
2.4.6
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] ARM: early_printk: Stop emitting double CR on the console
2017-09-27 11:49 [PATCH 0/2] ARM: earlycon: Fix <CR><LF><CR> end-of-line Alexander Sverdlin
2017-09-27 11:49 ` [PATCH 1/2] ARM: Make DEBUG_LL produce CRLF instead of LFCR Alexander Sverdlin
@ 2017-09-27 11:49 ` Alexander Sverdlin
2017-09-27 11:52 ` [PATCH 0/2] ARM: earlycon: Fix <CR><LF><CR> end-of-line Russell King - ARM Linux
2 siblings, 0 replies; 5+ messages in thread
From: Alexander Sverdlin @ 2017-09-27 11:49 UTC (permalink / raw)
To: linux-arm-kernel
printch already takes care about LF->CRLF translation, so
early_write() just produced extra CR.
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
---
arch/arm/kernel/early_printk.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/arch/arm/kernel/early_printk.c b/arch/arm/kernel/early_printk.c
index 4307653..8300d5b 100644
--- a/arch/arm/kernel/early_printk.c
+++ b/arch/arm/kernel/early_printk.c
@@ -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++;
}
--
2.4.6
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 0/2] ARM: earlycon: Fix <CR><LF><CR> end-of-line
2017-09-27 11:49 [PATCH 0/2] ARM: earlycon: Fix <CR><LF><CR> end-of-line Alexander Sverdlin
2017-09-27 11:49 ` [PATCH 1/2] ARM: Make DEBUG_LL produce CRLF instead of LFCR Alexander Sverdlin
2017-09-27 11:49 ` [PATCH 2/2] ARM: early_printk: Stop emitting double CR on the console Alexander Sverdlin
@ 2017-09-27 11:52 ` Russell King - ARM Linux
2017-09-27 11:57 ` Alexander Sverdlin
2 siblings, 1 reply; 5+ messages in thread
From: Russell King - ARM Linux @ 2017-09-27 11:52 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Sep 27, 2017 at 01:49:27PM +0200, Alexander Sverdlin wrote:
> 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
You omit to say why you want this change...
--
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 0/2] ARM: earlycon: Fix <CR><LF><CR> end-of-line
2017-09-27 11:52 ` [PATCH 0/2] ARM: earlycon: Fix <CR><LF><CR> end-of-line Russell King - ARM Linux
@ 2017-09-27 11:57 ` Alexander Sverdlin
0 siblings, 0 replies; 5+ messages in thread
From: Alexander Sverdlin @ 2017-09-27 11:57 UTC (permalink / raw)
To: linux-arm-kernel
On 27/09/17 13:52, Russell King - ARM Linux wrote:
>> 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
> You 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.
--
Best regards,
Alexander Sverdlin.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-09-27 11:57 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-27 11:49 [PATCH 0/2] ARM: earlycon: Fix <CR><LF><CR> end-of-line Alexander Sverdlin
2017-09-27 11:49 ` [PATCH 1/2] ARM: Make DEBUG_LL produce CRLF instead of LFCR Alexander Sverdlin
2017-09-27 11:49 ` [PATCH 2/2] ARM: early_printk: Stop emitting double CR on the console Alexander Sverdlin
2017-09-27 11:52 ` [PATCH 0/2] ARM: earlycon: Fix <CR><LF><CR> end-of-line Russell King - ARM Linux
2017-09-27 11:57 ` Alexander Sverdlin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox