u-boot/drivers
Pali Rohár 139d081384 serial: a37xx: Fix parent clock rate value and divider calculation
UART parent clock is by default the platform's xtal clock, which is
25 MHz.

The value defined in the driver, though, is 25.8048 MHz. This is a hack
for the suboptimal divisor calculation
  Divisor = UART clock / (16 * baudrate)
which does not use rounding division, resulting in a suboptimal value
for divisor if the correct parent clock rate was used.

Change the code for divisor calculation to round to closest value, i.e.
  Divisor = Round(UART clock / (16 * baudrate))
and change the parent clock rate value to that returned by
get_ref_clk().

This makes A3720 UART stable at standard UART baudrates between 1800 and
230400.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
2021-07-08 16:40:52 +02:00
..
adc dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
ata various minor sandbox improvements 2021-07-07 13:34:42 -04:00
axi dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
bios_emulator treewide: Convert macro and uses of __section(foo) to __section("foo") 2021-05-24 14:21:30 -04:00
block dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
bootcount dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
bus bus: ti-sysc: change in a normal driver 2021-03-22 19:23:27 +13:00
button dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
cache dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
clk various minor sandbox improvements 2021-07-07 13:34:42 -04:00
core remove struct uclass_driver::ops 2021-07-06 10:38:03 -06:00
cpu dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
crypto dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
ddr ppc: Remove T4160RDB board 2021-07-07 19:52:24 -04:00
demo common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
dfu dfu: add error callback 2021-06-18 10:09:41 +02:00
dma dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
fastboot fastboot: Fix possible buffer overrun 2021-04-12 17:44:55 -04:00
firmware dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
fpga arm: socfpga: Move Stratix10 and Agilex to use TARGET_SOCFPGA_SOC64 2021-03-08 10:59:10 +08:00
gpio arm: Remove spear600 boards and the rest of SPEAr support 2021-07-07 22:22:42 -04:00
hwspinlock dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
i2c arm: Remove spear600 boards and the rest of SPEAr support 2021-07-07 22:22:42 -04:00
input dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
led dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
mailbox dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
memory memory: stm32-fmc2: migrate trace to dev and log macro 2021-01-13 09:52:58 +01:00
misc sandbox: cros-ec: Add tests for the Chromium OS EC PWM driver 2021-07-06 10:38:03 -06:00
mmc various minor sandbox improvements 2021-07-07 13:34:42 -04:00
mtd arm: Remove spear600 boards and the rest of SPEAr support 2021-07-07 22:22:42 -04:00
mux dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
net ppc: Remove T4160RDB board 2021-07-07 19:52:24 -04:00
nvme dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
pch dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
pci ppc: Remove caddy2 / vme8349 boards 2021-07-07 19:52:23 -04:00
pci_endpoint dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
phy dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
pinctrl various minor sandbox improvements 2021-07-07 13:34:42 -04:00
power dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
pwm dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
qe ppc: Remove TARGET_T1040QDS references 2021-04-10 08:04:42 -04:00
ram dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
remoteproc dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
reset dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
rng dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
rtc dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
scsi dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
serial serial: a37xx: Fix parent clock rate value and divider calculation 2021-07-08 16:40:52 +02:00
smem dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
soc dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
sound dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
spi various minor sandbox improvements 2021-07-07 13:34:42 -04:00
spmi dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
sysinfo dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
sysreset sysreset: provide type of reset in do_reset cmd 2021-04-20 07:31:12 -04:00
tee dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
thermal dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
timer dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
tpm tpm: Correct warning on 32-bit build 2021-03-13 13:14:52 -05:00
ufs dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
usb arm: Remove spear600 boards and the rest of SPEAr support 2021-07-07 22:22:42 -04:00
video dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
virtio dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
w1 various minor sandbox improvements 2021-07-07 13:34:42 -04:00
w1-eeprom dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
watchdog dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
xen dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
Kconfig board: Rename uclass to sysinfo 2020-11-06 10:18:20 +08:00
Makefile cpu: Rename SPL_CPU_SUPPORT to SPL_CPU 2021-03-27 15:04:31 +13:00