1 From 4d3c17975c7814884a721fe693b3adf5c426d759 Mon Sep 17 00:00:00 2001
2 From: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Tue, 10 Nov 2015 22:18:39 +0100
4 Subject: [RFC] serial: core: add support for boot console with arbitrary
7 The Arduino Yun uses a baud rate of 250000 by default. The serial is
8 going over the Atmel ATmega and is used to connect to this chip.
9 Without this patch Linux wants to switch the console to 9600 Baud.
11 With this patch Linux will use the configured baud rate and not a
12 default one specified in uart_register_driver().
14 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
15 [rebased to 4.14, slightly reworded commit message]
16 Signed-off-by: Sungbo Eo <mans0n@gorani.run>
18 drivers/tty/serial/serial_core.c | 6 +++++-
19 include/linux/console.h | 1 +
20 2 files changed, 6 insertions(+), 1 deletions(-)
22 --- a/drivers/tty/serial/serial_core.c
23 +++ b/drivers/tty/serial/serial_core.c
24 @@ -220,6 +220,8 @@ static int uart_port_startup(struct tty_
26 if (uart_console(uport) && uport->cons->cflag) {
27 tty->termios.c_cflag = uport->cons->cflag;
28 + tty->termios.c_ospeed = uport->cons->baud;
29 + tty->termios.c_ispeed = uport->cons->baud;
30 uport->cons->cflag = 0;
33 @@ -2110,8 +2112,10 @@ uart_set_options(struct uart_port *port,
34 * Allow the setting of the UART parameters with a NULL console
39 co->cflag = termios.c_cflag;
45 --- a/include/linux/console.h
46 +++ b/include/linux/console.h
47 @@ -153,6 +153,7 @@ struct console {