Package: linux / 3.16.56-1+deb8u1

features/all/of-Enable-console-on-serial-ports-specified-by-chose.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
From a208ffd251d08ed7ba6bdf3ae1e423373fb12d3d Mon Sep 17 00:00:00 2001
From: Grant Likely <grant.likely@linaro.org>
Date: Thu, 27 Mar 2014 18:29:46 -0700
Subject: [PATCH] of: Enable console on serial ports specified by
 /chosen/stdout-path
Origin: https://git.kernel.org/linus/a208ffd251d08ed7ba6bdf3ae1e423373fb12d3d

If the devicetree specifies a serial port as a stdout device, then the
kernel can use it as the default console if nothing else was selected on
the command line. For any serial port that uses the uart_add_one_port()
feature, the uart_add_one_port() has all the information needed to
automatically enable the console device, which is what this patch does.

With this change applied, a device tree platform can be booted without
any console= parameters on the command line and the kernel will still be
able to determine its console.

Tested on QEMU Versatile model and i.MX

Signed-off-by: Grant Likely <grant.likely@linaro.org>
Tested-by: Sascha Hauer <s.hauer@pengutronix.de>
[bwh: Avoid ABI change]
---
 drivers/tty/serial/serial_core.c | 3 +++
 1 file changed, 3 insertions(+)

--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -26,6 +26,9 @@
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/console.h>
+#ifndef __GENKSYMS__
+#include <linux/of.h>
+#endif
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
 #include <linux/device.h>
@@ -2618,6 +2621,8 @@ int uart_add_one_port(struct uart_driver
 		spin_lock_init(&uport->lock);
 		lockdep_set_class(&uport->lock, &port_lock_key);
 	}
+	if (uport->cons && uport->dev)
+		of_console_check(uport->dev->of_node, uport->cons->name, uport->line);
 
 	uart_configure_port(drv, state, uport);