serial: mvebu-uart: implement support for baudrates higher than 230400 Bd
authorPali Rohár <pali@kernel.org>
Sat, 19 Feb 2022 15:28:17 +0000 (16:28 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Feb 2022 09:27:58 +0000 (10:27 +0100)
commit694b7112473a33a3685e75f6cc45cbe939950753
treed24a34a94f70aab8a772674e35d10c3274ba5319
parentebd7e37a8b7e703555b0ca4796441c3876254773
serial: mvebu-uart: implement support for baudrates higher than 230400 Bd

Implement simple usage of fractional divisor. When main divisor D is too
large to represent requested baudrate then use divisor M from the
fractional divisor feature. All the M prescalers are set to the same and
maximal value 63, so the fractional part of the fractional divisor is not
used at all. We also determine upper limit for possible baudrates.

Experiments show that UART at baudrate 1500000 Bd with this configuration
is stable. So there is no need to implement complicated calculation of
fractional coefficients yet.

To use this feature with higher baudrates, it is required to use UART clock
provided by UART clock driver. Default boot xtal clock is not capable of
higher baudrates.

Reviewed-by: Marek Behún <kabel@kernel.org>
Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Marek Behún <kabel@kernel.org>
Link: https://lore.kernel.org/r/20220219152818.4319-6-kabel@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/mvebu-uart.c