]> git.karo-electronics.de Git - linux-beck.git/commitdiff
serial: 8250: pxa: add devicetree earlyconsole
authorRobert Jarzmik <robert.jarzmik@free.fr>
Fri, 21 Oct 2016 22:06:21 +0000 (00:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Oct 2016 14:27:24 +0000 (16:27 +0200)
Transfer the device-tree pxa uart handling from 8250_of to the new
8250_pxa.  As a corollary, add the early console definition into
8250_pxa.

This enables to have the same uart node for the early console and the
normal uart.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_of.c
drivers/tty/serial/8250/8250_pxa.c

index 7a8b5fc81a192f081add58d5a1a212f9c5a41093..d25ab1cd42958cb8f24c00af1d0def1fd0711278 100644 (file)
@@ -332,8 +332,6 @@ static const struct of_device_id of_platform_serial_table[] = {
                .data = (void *)PORT_ALTR_16550_F128, },
        { .compatible = "mrvl,mmp-uart",
                .data = (void *)PORT_XSCALE, },
-       { .compatible = "mrvl,pxa-uart",
-               .data = (void *)PORT_XSCALE, },
        { /* end of list */ },
 };
 MODULE_DEVICE_TABLE(of, of_platform_serial_table);
index 6a14df013754ae622d1d4e1e95dd7d2dedeaadaa..3b08f342851af9cdee4c1524daeb1c5fc608b570 100644 (file)
@@ -172,6 +172,19 @@ static struct platform_driver serial_pxa_driver = {
 
 module_platform_driver(serial_pxa_driver);
 
+static int __init early_serial_pxa_setup(struct earlycon_device *device,
+                                 const char *options)
+{
+       struct uart_port *port = &device->port;
+
+       if (!(device->port.membase || device->port.iobase))
+               return -ENODEV;
+
+       port->regshift = 2;
+       return early_serial8250_setup(device, NULL);
+}
+OF_EARLYCON_DECLARE(early_pxa, "mrvl,pxa-uart", early_serial_pxa_setup);
+
 MODULE_AUTHOR("Sergei Ianovich");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("platform:pxa2xx-uart");