|
@@ -1746,6 +1746,45 @@ static struct console lpuart32_console = {
|
|
|
.data = &lpuart_reg,
|
|
|
};
|
|
|
|
|
|
+static void lpuart_early_write(struct console *con, const char *s, unsigned n)
|
|
|
+{
|
|
|
+ struct earlycon_device *dev = con->data;
|
|
|
+
|
|
|
+ uart_console_write(&dev->port, s, n, lpuart_console_putchar);
|
|
|
+}
|
|
|
+
|
|
|
+static void lpuart32_early_write(struct console *con, const char *s, unsigned n)
|
|
|
+{
|
|
|
+ struct earlycon_device *dev = con->data;
|
|
|
+
|
|
|
+ uart_console_write(&dev->port, s, n, lpuart32_console_putchar);
|
|
|
+}
|
|
|
+
|
|
|
+static int __init lpuart_early_console_setup(struct earlycon_device *device,
|
|
|
+ const char *opt)
|
|
|
+{
|
|
|
+ if (!device->port.membase)
|
|
|
+ return -ENODEV;
|
|
|
+
|
|
|
+ device->con->write = lpuart_early_write;
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+static int __init lpuart32_early_console_setup(struct earlycon_device *device,
|
|
|
+ const char *opt)
|
|
|
+{
|
|
|
+ if (!device->port.membase)
|
|
|
+ return -ENODEV;
|
|
|
+
|
|
|
+ device->con->write = lpuart32_early_write;
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+OF_EARLYCON_DECLARE(lpuart, "fsl,vf610-lpuart", lpuart_early_console_setup);
|
|
|
+OF_EARLYCON_DECLARE(lpuart32, "fsl,ls1021a-lpuart", lpuart32_early_console_setup);
|
|
|
+EARLYCON_DECLARE(lpuart, lpuart_early_console_setup);
|
|
|
+EARLYCON_DECLARE(lpuart32, lpuart32_early_console_setup);
|
|
|
+
|
|
|
#define LPUART_CONSOLE (&lpuart_console)
|
|
|
#define LPUART32_CONSOLE (&lpuart32_console)
|
|
|
#else
|