uniphier: set CONSOLE_FLAG_TRANSLATE_CRLF and clean up console driver
authorMasahiro Yamada <[email protected]>
Tue, 23 Jul 2019 03:53:41 +0000 (12:53 +0900)
committerPaul Beesley <[email protected]>
Tue, 3 Sep 2019 09:08:16 +0000 (09:08 +0000)
This console driver sends '\r' before 'n', not after.
It works, but the convention is "\r\n" (i.e. CRLF)

Instead of fixing it in the driver, set CONSOLE_FLAG_TRANSLATE_CRLF
to leave it to the framework.

Change-Id: I2154e29313739a40dff70cfb5c0f8989136d4ad2
Signed-off-by: Masahiro Yamada <[email protected]>
plat/socionext/uniphier/uniphier_console.S
plat/socionext/uniphier/uniphier_console_setup.c

index 2c8dc8f8455bbf7e02edd18c20a208423237909f..1113c6e81efe7af7f4fd9225a6d242141f0b09d6 100644 (file)
@@ -23,15 +23,9 @@ func uniphier_console_putc
 0:     ldr     w2, [x1, #UNIPHIER_UART_LSR]
        tbz     w2, #UNIPHIER_UART_LSR_THRE_BIT, 0b
 
-       mov     w2, w0
+       str     w0, [x1, #UNIPHIER_UART_TX]
 
-1:     str     w2, [x1, #UNIPHIER_UART_TX]
-
-       cmp     w2, #'\n'
-       b.ne    2f
-       mov     w2, #'\r'       /* Append '\r' to '\n' */
-       b       1b
-2:     ret
+       ret
 endfunc uniphier_console_putc
 
 /*
index 8185ec5a12cdb26705c03ef81ce1121071290c52..64ee797148b976692f672de5554ec46886324032 100644 (file)
@@ -32,7 +32,8 @@ static struct uniphier_console uniphier_console = {
 #if DEBUG
                         CONSOLE_FLAG_RUNTIME |
 #endif
-                        CONSOLE_FLAG_CRASH,
+                        CONSOLE_FLAG_CRASH |
+                        CONSOLE_FLAG_TRANSLATE_CRLF,
                .putc = uniphier_console_putc,
                .getc = uniphier_console_getc,
                .flush = uniphier_console_flush,