Skip to content

Commit

Permalink
serial: mvebu-uart: add TX interrupt trigger for pulse interrupts
Browse files Browse the repository at this point in the history
Pulse interrupts (extended UART only) needs a change of state to trigger
the TX interrupt. In addition to enabling the TX_READY_INT_EN flag,
produce a FIFO state change from 'empty' to 'not full'. For this, write
only one data byte in TX start, making the TX FIFO not empty, and wait
for the TX interrupt to continue the transfer.

Signed-off-by: Allen Yan <yanwei@marvell.com>
Signed-off-by: Miquel Raynal <miquel.raynal@free-electrons.com>
Reviewed-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Allen Yan authored and Greg Kroah-Hartman committed Oct 20, 2017
1 parent 2ff23c4 commit 30434b0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion drivers/tty/serial/mvebu-uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,16 @@ static void mvebu_uart_stop_tx(struct uart_port *port)

static void mvebu_uart_start_tx(struct uart_port *port)
{
unsigned int ctl = readl(port->membase + UART_INTR(port));
unsigned int ctl;
struct circ_buf *xmit = &port->state->xmit;

if (IS_EXTENDED(port) && !uart_circ_empty(xmit)) {
writel(xmit->buf[xmit->tail], port->membase + UART_TSH(port));
xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
port->icount.tx++;
}

ctl = readl(port->membase + UART_INTR(port));
ctl |= CTRL_TX_RDY_INT(port);
writel(ctl, port->membase + UART_INTR(port));
}
Expand Down

0 comments on commit 30434b0

Please sign in to comment.