Skip to content

Commit a19f747

Browse files
andreas-schwabpalmer-dabbelt
authored andcommitted
tty/serial: use uart_console_write in the RISC-V SBL early console
This enables proper NLCR processing. Suggested-by: Anup Patel <anup@brainfault.org> Signed-off-by: Andreas Schwab <schwab@suse.de> Reviewed-by: Anup Patel <anup@brainfault.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
1 parent 2a200fb commit a19f747

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

drivers/tty/serial/earlycon-riscv-sbi.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,16 @@
1010
#include <linux/serial_core.h>
1111
#include <asm/sbi.h>
1212

13-
static void sbi_console_write(struct console *con,
14-
const char *s, unsigned int n)
13+
static void sbi_putc(struct uart_port *port, int c)
1514
{
16-
int i;
15+
sbi_console_putchar(c);
16+
}
1717

18-
for (i = 0; i < n; ++i)
19-
sbi_console_putchar(s[i]);
18+
static void sbi_console_write(struct console *con,
19+
const char *s, unsigned n)
20+
{
21+
struct earlycon_device *dev = con->data;
22+
uart_console_write(&dev->port, s, n, sbi_putc);
2023
}
2124

2225
static int __init early_sbi_setup(struct earlycon_device *device,

0 commit comments

Comments
 (0)