aboutsummaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2014-04-18 17:19:55 -0500
committerShow Liu <show.liu@linaro.org>2014-06-18 12:04:20 +0800
commitbb22975f69756b1630b5c2d516e97768fcc20108 (patch)
tree152f543bac7fff9d92abec4a2f1130a9a4b51096 /include/linux
parentd6b7940d27686b38c14156352a1c5b36d9f49e3d (diff)
tty/serial: add generic serial earlycon
This introduces generic earlycon infrastructure for serial devices based on the 8250 earlycon. This allows for supporting earlycon option with other serial devices. The earlycon output is enabled at the time early_params are processed. Only architectures that have fixmap support or have functional ioremap when early_params are processed are supported. This is the same restriction that the 8250 driver had. Signed-off-by: Rob Herring <robh@kernel.org> Cc: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 9aac5887595b765b6f64b2af08b785e82e095b57) Signed-off-by: Mark Brown <broonie@linaro.org> (cherry picked from commit b523950dbf9b2cc73f66145bd6f0c00b21a73a90) Signed-off-by: Alex Shi <alex.shi@linaro.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/serial_core.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 318f629ce0a..560033b6686 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -286,6 +286,22 @@ static inline int uart_poll_timeout(struct uart_port *port)
/*
* Console helpers.
*/
+struct earlycon_device {
+ struct console *con;
+ struct uart_port port;
+ char options[16]; /* e.g., 115200n8 */
+ unsigned int baud;
+};
+int setup_earlycon(char *buf, const char *match,
+ int (*setup)(struct earlycon_device *, const char *));
+
+#define EARLYCON_DECLARE(name, func) \
+static int __init name ## _setup_earlycon(char *buf) \
+{ \
+ return setup_earlycon(buf, __stringify(name), func); \
+} \
+early_param("earlycon", name ## _setup_earlycon);
+
struct uart_port *uart_get_console(struct uart_port *ports, int nr,
struct console *c);
void uart_parse_options(char *options, int *baud, int *parity, int *bits,