Compare commits
1 Commits
fee12cf9e3
...
jetson_38.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2a4430812e |
@@ -2173,11 +2173,15 @@ pl011_set_termios(struct uart_port *port, struct ktermios *termios,
|
|||||||
else
|
else
|
||||||
clkdiv = 16;
|
clkdiv = 16;
|
||||||
|
|
||||||
/*
|
if (uap->vendor->enable_car) {
|
||||||
* Ask the core to calculate the divisor for us.
|
baud = tty_termios_baud_rate(termios);
|
||||||
*/
|
clk_set_rate(uap->clk, baud * clkdiv);
|
||||||
|
}
|
||||||
|
else {
|
||||||
baud = uart_get_baud_rate(port, termios, old, 0,
|
baud = uart_get_baud_rate(port, termios, old, 0,
|
||||||
port->uartclk / clkdiv);
|
port->uartclk / clkdiv);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_DMA_ENGINE
|
#ifdef CONFIG_DMA_ENGINE
|
||||||
/*
|
/*
|
||||||
* Adjust RX DMA polling rate with baud rate if not specified.
|
* Adjust RX DMA polling rate with baud rate if not specified.
|
||||||
@@ -2186,10 +2190,12 @@ pl011_set_termios(struct uart_port *port, struct ktermios *termios,
|
|||||||
uap->dmarx.poll_rate = DIV_ROUND_UP(10000000, baud);
|
uap->dmarx.poll_rate = DIV_ROUND_UP(10000000, baud);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (!uap->vendor->enable_car) {
|
||||||
if (baud > port->uartclk / 16)
|
if (baud > port->uartclk / 16)
|
||||||
quot = DIV_ROUND_CLOSEST(port->uartclk * 8, baud);
|
quot = DIV_ROUND_CLOSEST(port->uartclk * 8, baud);
|
||||||
else
|
else
|
||||||
quot = DIV_ROUND_CLOSEST(port->uartclk * 4, baud);
|
quot = DIV_ROUND_CLOSEST(port->uartclk * 4, baud);
|
||||||
|
}
|
||||||
|
|
||||||
switch (termios->c_cflag & CSIZE) {
|
switch (termios->c_cflag & CSIZE) {
|
||||||
case CS5:
|
case CS5:
|
||||||
@@ -2261,6 +2267,7 @@ pl011_set_termios(struct uart_port *port, struct ktermios *termios,
|
|||||||
old_cr &= ~ST_UART011_CR_OVSFACT;
|
old_cr &= ~ST_UART011_CR_OVSFACT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!uap->vendor->enable_car) {
|
||||||
/*
|
/*
|
||||||
* Workaround for the ST Micro oversampling variants to
|
* Workaround for the ST Micro oversampling variants to
|
||||||
* increase the bitrate slightly, by lowering the divisor,
|
* increase the bitrate slightly, by lowering the divisor,
|
||||||
@@ -2276,7 +2283,7 @@ pl011_set_termios(struct uart_port *port, struct ktermios *termios,
|
|||||||
/* Set baud rate */
|
/* Set baud rate */
|
||||||
pl011_write(quot & 0x3f, uap, REG_FBRD);
|
pl011_write(quot & 0x3f, uap, REG_FBRD);
|
||||||
pl011_write(quot >> 6, uap, REG_IBRD);
|
pl011_write(quot >> 6, uap, REG_IBRD);
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
* ----------v----------v----------v----------v-----
|
* ----------v----------v----------v----------v-----
|
||||||
* NOTE: REG_LCRH_TX and REG_LCRH_RX MUST BE WRITTEN AFTER
|
* NOTE: REG_LCRH_TX and REG_LCRH_RX MUST BE WRITTEN AFTER
|
||||||
|
|||||||
Reference in New Issue
Block a user