aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2015-11-10 23:11:10 +0000
committerHauke Mehrtens <hauke@hauke-m.de>2015-11-10 23:11:10 +0000
commit1bfbf2de6df94a5e62f690bec9999702e3ad4c81 (patch)
treecc1c9162e65ca9a94e3d3c54e754b2691f0ff820
parentabea1127c931350c1b4551c8c3071d80cec17c54 (diff)
downloadupstream-1bfbf2de6df94a5e62f690bec9999702e3ad4c81.tar.gz
upstream-1bfbf2de6df94a5e62f690bec9999702e3ad4c81.tar.bz2
upstream-1bfbf2de6df94a5e62f690bec9999702e3ad4c81.zip
ar71xx: 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 230400 Baud. With this patch Linux will use the configured baud rate and not some standard one which is near by. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> SVN-Revision: 47450
-rw-r--r--target/linux/ar71xx/patches-4.1/821-serial-core-add-support-for-boot-console-with-arbitr.patch76
1 files changed, 76 insertions, 0 deletions
diff --git a/target/linux/ar71xx/patches-4.1/821-serial-core-add-support-for-boot-console-with-arbitr.patch b/target/linux/ar71xx/patches-4.1/821-serial-core-add-support-for-boot-console-with-arbitr.patch
new file mode 100644
index 0000000000..79150f63c2
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.1/821-serial-core-add-support-for-boot-console-with-arbitr.patch
@@ -0,0 +1,76 @@
+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 230400 Baud.
+
+With this patch Linux will use the configured baud rate and not some
+standard one which is near by.
+
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+---
+ drivers/tty/serial/serial_core.c | 13 ++++++++++---
+ include/linux/console.h | 1 +
+ 2 files changed, 11 insertions(+), 3 deletions(-)
+
+--- a/drivers/tty/serial/serial_core.c
++++ b/drivers/tty/serial/serial_core.c
+@@ -164,6 +164,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;
+ }
+ /*
+@@ -1901,7 +1903,7 @@ static const struct baud_rates baud_rate
+ { 4800, B4800 },
+ { 2400, B2400 },
+ { 1200, B1200 },
+- { 0, B38400 }
++ { 0, BOTHER }
+ };
+
+ /**
+@@ -1940,10 +1942,13 @@ uart_set_options(struct uart_port *port,
+ * Construct a cflag setting.
+ */
+ for (i = 0; baud_rates[i].rate; i++)
+- if (baud_rates[i].rate <= baud)
++ if (baud_rates[i].rate == baud)
+ break;
+
+ termios.c_cflag |= baud_rates[i].cflag;
++ if (!baud_rates[i].rate) {
++ termios.c_ospeed = baud;
++ }
+
+ if (bits == 7)
+ termios.c_cflag |= CS7;
+@@ -1973,8 +1978,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
+@@ -127,6 +127,7 @@ struct console {
+ short flags;
+ short index;
+ int cflag;
++ int baud;
+ void *data;
+ struct console *next;
+ };