diff options
Diffstat (limited to 'drivers/tty/serial/amba-pl011.c')
-rw-r--r-- | drivers/tty/serial/amba-pl011.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index cede93876649..925eb8813a45 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c | |||
@@ -1595,13 +1595,26 @@ pl011_set_termios(struct uart_port *port, struct ktermios *termios, | |||
1595 | old_cr &= ~ST_UART011_CR_OVSFACT; | 1595 | old_cr &= ~ST_UART011_CR_OVSFACT; |
1596 | } | 1596 | } |
1597 | 1597 | ||
1598 | /* | ||
1599 | * Workaround for the ST Micro oversampling variants to | ||
1600 | * increase the bitrate slightly, by lowering the divisor, | ||
1601 | * to avoid delayed sampling of start bit at high speeds, | ||
1602 | * else we see data corruption. | ||
1603 | */ | ||
1604 | if (uap->vendor->oversampling) { | ||
1605 | if ((baud >= 3000000) && (baud < 3250000) && (quot > 1)) | ||
1606 | quot -= 1; | ||
1607 | else if ((baud > 3250000) && (quot > 2)) | ||
1608 | quot -= 2; | ||
1609 | } | ||
1598 | /* Set baud rate */ | 1610 | /* Set baud rate */ |
1599 | writew(quot & 0x3f, port->membase + UART011_FBRD); | 1611 | writew(quot & 0x3f, port->membase + UART011_FBRD); |
1600 | writew(quot >> 6, port->membase + UART011_IBRD); | 1612 | writew(quot >> 6, port->membase + UART011_IBRD); |
1601 | 1613 | ||
1602 | /* | 1614 | /* |
1603 | * ----------v----------v----------v----------v----- | 1615 | * ----------v----------v----------v----------v----- |
1604 | * NOTE: MUST BE WRITTEN AFTER UARTLCR_M & UARTLCR_L | 1616 | * NOTE: lcrh_tx and lcrh_rx MUST BE WRITTEN AFTER |
1617 | * UART011_FBRD & UART011_IBRD. | ||
1605 | * ----------^----------^----------^----------^----- | 1618 | * ----------^----------^----------^----------^----- |
1606 | */ | 1619 | */ |
1607 | writew(lcr_h, port->membase + uap->lcrh_rx); | 1620 | writew(lcr_h, port->membase + uap->lcrh_rx); |