@@ -1507,10 +1507,19 @@ pl011_set_termios(struct uart_port *port, struct ktermios *termios,
}
/*
- * Ask the core to calculate the divisor for us.
+ * Override baud calculation for very high non-standard baudrates
+ * on the ST Micro oversampling variant. This must override the
+ * uart_get_baud_rate() call, because this function changes
+ * baudrate to the default on these baudrates.
*/
- baud = uart_get_baud_rate(port, termios, old, 0,
- max_baud);
+ if (uap->vendor->oversampling &&
+ ((termios->c_ispeed > 4000000) ||
+ (termios->c_ospeed > 4000000)))
+ baud = termios->c_ispeed;
+ else
+ /* Ask the core to calculate the divisor for us. */
+ baud = uart_get_baud_rate(port, termios, old, 0,
+ max_baud);
if (baud > port->uartclk/16)
quot = DIV_ROUND_CLOSEST(port->uartclk * 8, baud);