summaryrefslogtreecommitdiff
path: root/drivers/tty/serial/fsl_lpuart.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty/serial/fsl_lpuart.c')
-rw-r--r--drivers/tty/serial/fsl_lpuart.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index bb8316587917..ff9a0a1fc3c5 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -464,11 +464,12 @@ static void lpuart_dma_rx_complete(void *arg)
async_tx_ack(sport->dma_rx_desc);
spin_lock_irqsave(&sport->port.lock, flags);
-
+printk("D\n");
sport->dma_rx_in_progress = 0;
lpuart_copy_rx_to_tty(sport, port, FSL_UART_RX_DMA_BUFFER_SIZE);
tty_flip_buffer_push(port);
lpuart_dma_rx(sport);
+ mod_timer(&sport->lpuart_timer, jiffies + sport->dma_rx_timeout);
spin_unlock_irqrestore(&sport->port.lock, flags);
}
@@ -482,6 +483,8 @@ static void lpuart_timer_func(unsigned long data)
unsigned char temp;
int count;
+ printk("T\n");
+
del_timer(&sport->lpuart_timer);
dmaengine_pause(sport->dma_rx_chan);
dmaengine_tx_status(sport->dma_rx_chan, sport->dma_rx_cookie, &state);
@@ -506,9 +509,11 @@ static inline void lpuart_prepare_rx(struct lpuart_port *sport)
unsigned char temp;
spin_lock_irqsave(&sport->port.lock, flags);
+ if (timer_pending(&sport->lpuart_timer))
+ printk("pend, dma %d\n", sport->dma_rx_in_progress);
- sport->lpuart_timer.expires = jiffies + sport->dma_rx_timeout;
- add_timer(&sport->lpuart_timer);
+ //sport->lpuart_timer.expires = jiffies + sport->dma_rx_timeout;
+ mod_timer(&sport->lpuart_timer, jiffies + sport->dma_rx_timeout);
lpuart_dma_rx(sport);
temp = readb(sport->port.membase + UARTCR5);
@@ -775,7 +780,9 @@ static irqreturn_t lpuart_int(int irq, void *dev_id)
else
lpuart_txint(irq, dev_id);
}
-
+ sts = readb(sport->port.membase + UARTSFIFO);
+ if (sts & UARTSFIFO_RXOF)
+ printk("UARTx_SFIFO %02x\n", sts);
return IRQ_HANDLED;
}
@@ -1102,6 +1109,11 @@ static int lpuart_startup(struct uart_port *port)
temp |= (UARTCR2_RIE | UARTCR2_TIE | UARTCR2_RE | UARTCR2_TE);
writeb(temp, sport->port.membase + UARTCR2);
+ temp = readb(sport->port.membase + UARTCFIFO);
+ temp |= UARTCFIFO_RXOFE;
+ writeb(temp, sport->port.membase + UARTCFIFO);
+
+
spin_unlock_irqrestore(&sport->port.lock, flags);
return 0;
}