tn3399_openwrt/target/linux/ath79/patches-5.4/921-serial-core-add-support-for-boot-console-with-arbitr.patch
John Audia 752cd29904 kernel: bump 5.4 to 5.4.124
Manually rebased:
  generic/hack-5.4/662-remove_pfifo_fast.patch

All other patches automatically rebased.

Build system: x86_64
Build-tested: ipq806x/R7800
Run-tested: ipq806x/R7800

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
[manual changes to ramips/patches-5.10/835-asoc-add-mt7620-support.patch]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-06-06 00:25:25 +02:00

55 lines
1.6 KiB
Diff

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