serial: 8250_dw: Add DMA support for non-ACPI platforms
authorRay Jui <rjui@broadcom.com>
Wed, 8 Oct 2014 00:35:47 +0000 (17:35 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Nov 2014 03:24:07 +0000 (19:24 -0800)
The dma pointer under struct uart_8250_port is currently left
unassigned for non-ACPI platforms. It should be pointing to the dma
member in struct dw8250_data like how it was done for ACPI, so the core
8250 code will try to request for DMA when registering the port

If DMA is not enabled in device tree, request DMA will fail and the
driver will fall back to PIO

Signed-off-by: Ray Jui <rjui@broadcom.com>
Reviewed-by: JD (Jiandong) Zheng <jdzheng@broadcom.com>
Reviewed-by: Scott Branden <sbranden@broadcom.com>
Tested-by: Scott Branden <sbranden@broadcom.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_dw.c

index beea6ca73ee50c8f18757bb87970b1107733c419..73a14ae8f0ae7ab3a13fd26432f1242157f8d2c9 100644 (file)
@@ -290,6 +290,14 @@ static int dw8250_probe_of(struct uart_port *p,
        if (has_ucv)
                dw8250_setup_port(up);
 
+       /* if we have a valid fifosize, try hooking up DMA here */
+       if (p->fifosize) {
+               up->dma = &data->dma;
+
+               up->dma->rxconf.src_maxburst = p->fifosize / 4;
+               up->dma->txconf.dst_maxburst = p->fifosize / 4;
+       }
+
        if (!of_property_read_u32(np, "reg-shift", &val))
                p->regshift = val;