Add SCIF DMA rx support for RZ/G2L alike SoCs. RZ/G2L alike SoCs use the same signal for both interrupt and DMA transfer requests, so we must disable line interrupt while transferring DMA. We must set FIFO trigger to 1 so that SCIF will request DMA when there is a character as SCIF DMA request is based on FIFO data full RDF. Based on a patch in the BSP by Long Luu <long.luu.ur@xxxxxxxxxxx> Signed-off-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx> --- v1->v2: * No change --- drivers/tty/serial/sh-sci.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 81797eb722cb..ce3d6af47759 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -1312,9 +1312,13 @@ static void sci_dma_rx_reenable_irq(struct sci_port *s) /* Direct new serial port interrupts back to CPU */ scr = serial_port_in(port, SCSCR); - if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) { - scr &= ~SCSCR_RDRQE; + if (port->type == PORT_SCIFA || port->type == PORT_SCIFB || + is_rz_scif_port(port, s)) { enable_irq(s->irqs[SCIx_RXI_IRQ]); + if (port->type == PORT_SCIF) + scif_set_rtrg(port, s->rx_trigger); + else + scr &= ~SCSCR_RDRQE; } serial_port_out(port, SCSCR, scr | SCSCR_RIE); } @@ -1735,7 +1739,15 @@ static irqreturn_t sci_rx_interrupt(int irq, void *ptr) if (sci_dma_rx_submit(s, false) < 0) goto handle_pio; - scr &= ~SCSCR_RIE; + if (is_rz_scif_port(port, s)) { + /* Switch irq from SCIF to DMA */ + disable_irq_nosync(s->irqs[SCIx_RXI_IRQ]); + scif_set_rtrg(port, 1); + /* DMA need RIE enable */ + scr |= SCSCR_RIE; + } else { + scr &= ~SCSCR_RIE; + } } serial_port_out(port, SCSCR, scr); /* Clear current interrupt */ -- 2.25.1