|
@@ -590,13 +590,20 @@ lqasc_console_putchar(struct uart_port *port, int ch)
|
|
ltq_w8(ch, port->membase + LTQ_ASC_TBUF);
|
|
ltq_w8(ch, port->membase + LTQ_ASC_TBUF);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static void lqasc_serial_port_write(struct uart_port *port, const char *s,
|
|
|
|
+ u_int count)
|
|
|
|
+{
|
|
|
|
+ unsigned long flags;
|
|
|
|
+
|
|
|
|
+ spin_lock_irqsave(<q_asc_lock, flags);
|
|
|
|
+ uart_console_write(port, s, count, lqasc_console_putchar);
|
|
|
|
+ spin_unlock_irqrestore(<q_asc_lock, flags);
|
|
|
|
+}
|
|
|
|
|
|
static void
|
|
static void
|
|
lqasc_console_write(struct console *co, const char *s, u_int count)
|
|
lqasc_console_write(struct console *co, const char *s, u_int count)
|
|
{
|
|
{
|
|
struct ltq_uart_port *ltq_port;
|
|
struct ltq_uart_port *ltq_port;
|
|
- struct uart_port *port;
|
|
|
|
- unsigned long flags;
|
|
|
|
|
|
|
|
if (co->index >= MAXPORTS)
|
|
if (co->index >= MAXPORTS)
|
|
return;
|
|
return;
|
|
@@ -605,11 +612,7 @@ lqasc_console_write(struct console *co, const char *s, u_int count)
|
|
if (!ltq_port)
|
|
if (!ltq_port)
|
|
return;
|
|
return;
|
|
|
|
|
|
- port = <q_port->port;
|
|
|
|
-
|
|
|
|
- spin_lock_irqsave(<q_asc_lock, flags);
|
|
|
|
- uart_console_write(port, s, count, lqasc_console_putchar);
|
|
|
|
- spin_unlock_irqrestore(<q_asc_lock, flags);
|
|
|
|
|
|
+ lqasc_serial_port_write(<q_port->port, s, count);
|
|
}
|
|
}
|
|
|
|
|
|
static int __init
|
|
static int __init
|
|
@@ -659,6 +662,27 @@ lqasc_console_init(void)
|
|
}
|
|
}
|
|
console_initcall(lqasc_console_init);
|
|
console_initcall(lqasc_console_init);
|
|
|
|
|
|
|
|
+static void lqasc_serial_early_console_write(struct console *co,
|
|
|
|
+ const char *s,
|
|
|
|
+ u_int count)
|
|
|
|
+{
|
|
|
|
+ struct earlycon_device *dev = co->data;
|
|
|
|
+
|
|
|
|
+ lqasc_serial_port_write(&dev->port, s, count);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static int __init
|
|
|
|
+lqasc_serial_early_console_setup(struct earlycon_device *device,
|
|
|
|
+ const char *opt)
|
|
|
|
+{
|
|
|
|
+ if (!device->port.membase)
|
|
|
|
+ return -ENODEV;
|
|
|
|
+
|
|
|
|
+ device->con->write = lqasc_serial_early_console_write;
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+OF_EARLYCON_DECLARE(lantiq, DRVNAME, lqasc_serial_early_console_setup);
|
|
|
|
+
|
|
static struct uart_driver lqasc_reg = {
|
|
static struct uart_driver lqasc_reg = {
|
|
.owner = THIS_MODULE,
|
|
.owner = THIS_MODULE,
|
|
.driver_name = DRVNAME,
|
|
.driver_name = DRVNAME,
|