diff options
author | Grant Likely <grant.likely@linaro.org> | 2014-03-27 21:29:46 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@linaro.org> | 2014-06-26 12:12:22 -0400 |
commit | a208ffd251d08ed7ba6bdf3ae1e423373fb12d3d (patch) | |
tree | 48b2c17200d2f81b0be8ad1d8e8c0f8ef383877b | |
parent | 3482f2c52b77bf6596e24aae82e204a0603eba66 (diff) |
of: Enable console on serial ports specified by /chosen/stdout-path
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>
-rw-r--r-- | drivers/tty/serial/serial_core.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index fbf6c5ad222f..3ce68f962c92 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/slab.h> | 26 | #include <linux/slab.h> |
27 | #include <linux/init.h> | 27 | #include <linux/init.h> |
28 | #include <linux/console.h> | 28 | #include <linux/console.h> |
29 | #include <linux/of.h> | ||
29 | #include <linux/proc_fs.h> | 30 | #include <linux/proc_fs.h> |
30 | #include <linux/seq_file.h> | 31 | #include <linux/seq_file.h> |
31 | #include <linux/device.h> | 32 | #include <linux/device.h> |
@@ -2615,6 +2616,8 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *uport) | |||
2615 | spin_lock_init(&uport->lock); | 2616 | spin_lock_init(&uport->lock); |
2616 | lockdep_set_class(&uport->lock, &port_lock_key); | 2617 | lockdep_set_class(&uport->lock, &port_lock_key); |
2617 | } | 2618 | } |
2619 | if (uport->cons && uport->dev) | ||
2620 | of_console_check(uport->dev->of_node, uport->cons->name, uport->line); | ||
2618 | 2621 | ||
2619 | uart_configure_port(drv, state, uport); | 2622 | uart_configure_port(drv, state, uport); |
2620 | 2623 | ||