mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
serial: 8250: enable Programmable THRE Interrupt for tx
Programmable THRE Interrupt mode in order to increase system performance. Change-Id: Ic1ef9ecae0c6feb00170ad97ee3c6245ca3bf068 Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
This commit is contained in:
@@ -42,6 +42,9 @@ static void __dma_tx_complete(void *param)
|
|||||||
ret = serial8250_tx_dma(p);
|
ret = serial8250_tx_dma(p);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
p->ier |= UART_IER_THRI;
|
p->ier |= UART_IER_THRI;
|
||||||
|
#ifdef CONFIG_ARCH_ROCKCHIP
|
||||||
|
p->ier |= UART_IER_PTIME;
|
||||||
|
#endif
|
||||||
serial_port_out(&p->port, UART_IER, p->ier);
|
serial_port_out(&p->port, UART_IER, p->ier);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,6 +151,9 @@ int serial8250_tx_dma(struct uart_8250_port *p)
|
|||||||
dma->tx_err = 0;
|
dma->tx_err = 0;
|
||||||
if (p->ier & UART_IER_THRI) {
|
if (p->ier & UART_IER_THRI) {
|
||||||
p->ier &= ~UART_IER_THRI;
|
p->ier &= ~UART_IER_THRI;
|
||||||
|
#ifdef CONFIG_ARCH_ROCKCHIP
|
||||||
|
p->ier &= ~UART_IER_PTIME;
|
||||||
|
#endif
|
||||||
serial_out(p, UART_IER, p->ier);
|
serial_out(p, UART_IER, p->ier);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1504,6 +1504,9 @@ static inline void __do_stop_tx(struct uart_8250_port *p)
|
|||||||
{
|
{
|
||||||
if (p->ier & UART_IER_THRI) {
|
if (p->ier & UART_IER_THRI) {
|
||||||
p->ier &= ~UART_IER_THRI;
|
p->ier &= ~UART_IER_THRI;
|
||||||
|
#ifdef CONFIG_ARCH_ROCKCHIP
|
||||||
|
p->ier &= ~UART_IER_PTIME;
|
||||||
|
#endif
|
||||||
serial_out(p, UART_IER, p->ier);
|
serial_out(p, UART_IER, p->ier);
|
||||||
serial8250_rpm_put_tx(p);
|
serial8250_rpm_put_tx(p);
|
||||||
}
|
}
|
||||||
@@ -1562,6 +1565,9 @@ static inline void __start_tx(struct uart_port *port)
|
|||||||
|
|
||||||
if (!(up->ier & UART_IER_THRI)) {
|
if (!(up->ier & UART_IER_THRI)) {
|
||||||
up->ier |= UART_IER_THRI;
|
up->ier |= UART_IER_THRI;
|
||||||
|
#ifdef CONFIG_ARCH_ROCKCHIP
|
||||||
|
up->ier |= UART_IER_PTIME;
|
||||||
|
#endif
|
||||||
serial_port_out(port, UART_IER, up->ier);
|
serial_port_out(port, UART_IER, up->ier);
|
||||||
|
|
||||||
if (up->bugs & UART_BUG_TXEN) {
|
if (up->bugs & UART_BUG_TXEN) {
|
||||||
@@ -1901,7 +1907,7 @@ int serial8250_handle_irq(struct uart_port *port, unsigned int iir)
|
|||||||
|
|
||||||
#ifdef CONFIG_ARCH_ROCKCHIP
|
#ifdef CONFIG_ARCH_ROCKCHIP
|
||||||
if ((!up->dma || (up->dma && (!up->dma->txchan || up->dma->tx_err))) &&
|
if ((!up->dma || (up->dma && (!up->dma->txchan || up->dma->tx_err))) &&
|
||||||
(status & UART_LSR_THRE))
|
((iir & 0xf) == UART_IIR_THRI))
|
||||||
serial8250_tx_chars(up);
|
serial8250_tx_chars(up);
|
||||||
#else
|
#else
|
||||||
if ((!up->dma || (up->dma && up->dma->tx_err)) &&
|
if ((!up->dma || (up->dma && up->dma->tx_err)) &&
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
* Sleep mode for ST16650 and TI16750. For the ST16650, EFR[4]=1
|
* Sleep mode for ST16650 and TI16750. For the ST16650, EFR[4]=1
|
||||||
*/
|
*/
|
||||||
#define UART_IERX_SLEEP 0x10 /* Enable sleep mode */
|
#define UART_IERX_SLEEP 0x10 /* Enable sleep mode */
|
||||||
|
#define UART_IER_PTIME 0x80 /* Enable programmable THRE Interrupt */
|
||||||
|
|
||||||
#define UART_IIR 2 /* In: Interrupt ID Register */
|
#define UART_IIR 2 /* In: Interrupt ID Register */
|
||||||
#define UART_IIR_NO_INT 0x01 /* No interrupts pending */
|
#define UART_IIR_NO_INT 0x01 /* No interrupts pending */
|
||||||
|
|||||||
Reference in New Issue
Block a user