linux_dsm_epyc7002/drivers/tty/serial
Gabor Juhos 2dff8ad926 tty/serial/ar933x_uart: fix baud rate calculation
The UART of the AR933x SoC implements a fractional divisor
for generating the desired baud rate.

The current code uses a fixed value for the fractional
part of the divisor, and this leads to improperly
calculated baud rates:

   baud    scale   step  real baud         diff
     300   5207*   8192     17756     17456   5818.66%
     600   2603*   8192     35511     34911   5818.50%
    1200   1301*   8192     71023     69823   5818.58%
    2400    650*   8192     11241      8841    368.37%
    4800    324*   8192     22645     17845    371.77%
    9600    161    8192      9645        45      0.46%
   14400    107    8192     14468        68      0.47%
   19200     80    8192     19290        90      0.46%
   28800     53    8192     28935       135      0.46%
   38400     39    8192     39063       663      1.72%
   57600     26    8192     57870       270      0.46%
  115200     12    8192    120192      4992      4.33%
  230400      5    8192    260417     30017     13.02%
  460800      2    8192    520833     60033     13.02%
  921600      0    8192   1562500    640900     69.93%

After the patch, the integer and fractional parts of the
divisor will be calculated dynamically. This ensures that
the UART will use correct baud rates:

   baud    scale   step  real baud         diff
     300      6      11       300         0      0.00%
     600     54     173       600         0      0.00%
    1200     30     195      1200         0      0.00%
    2400     30     390      2400         0      0.00%
    4800     48    1233      4800         0      0.00%
    9600     78    3976      9600         0      0.00%
   14400     98    7474     14400         0      0.00%
   19200     55    5637     19200         0      0.00%
   28800    130   19780     28800         0      0.00%
   38400     36    7449     38400         0      0.00%
   57600     78   23857     57600         0      0.00%
  115200     43   26575    115200         0      0.00%
  230400     23   28991    230400         0      0.00%
  460800     11   28991    460800         0      0.00%
  921600      5   28991    921599        -1      0.00%

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-15 17:15:02 -08:00
..
8250 serial: 8250_pci: use module_pci_driver to simplify the code 2012-10-30 14:04:52 -07:00
cpm_uart Powerpc 8xx CPM_UART setting MAXIDL register proportionaly to baud rate 2012-09-26 13:39:39 -07:00
jsm serial: jsm: Convert jsm_printk to jsm_dbg 2012-10-30 14:04:52 -07:00
21285.c Disintegrate asm/system.h for ARM 2012-03-28 18:30:01 +01:00
68328serial.c TTY: use tty_port_link_device 2012-08-13 16:50:19 -07:00
altera_jtaguart.c
altera_uart.c tty: serial: altera_uart: Use platform_{get,set}_drvdata 2012-09-05 12:33:39 -07:00
amba-pl010.c drivers/tty/serial/amba-pl0{10,11}.c: use clk_prepare_enable and clk_disable_unprepare 2012-09-05 12:33:39 -07:00
amba-pl011.c serial/amba-pl011: use devm_* managed resources 2012-10-25 11:29:44 -07:00
apbuart.c
apbuart.h
ar933x_uart.c tty/serial/ar933x_uart: fix baud rate calculation 2012-11-15 17:15:02 -08:00
arc_uart.c serial/arc-uart: Add new driver 2012-10-30 14:06:52 -07:00
atmel_serial.c tty/serial: atmel_serial: fix RS485 half-duplex problem 2012-04-09 10:30:39 -07:00
bcm63xx_uart.c
bfin_sport_uart.c
bfin_sport_uart.h
bfin_uart.c serial: bfin-uart: avoid dead lock in rx irq handler in smp kernel 2012-11-15 16:59:58 -08:00
clps711x.c serial: clps711x: Cleanup driver 2012-10-24 11:39:48 -07:00
crisv10.c TTY: use tty_port_link_device 2012-08-13 16:50:19 -07:00
crisv10.h
dz.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
dz.h
efm32-uart.c
icom.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
icom.h
ifx6x60.c serial: ifx6x60: ifx_spi_write don't need to do mrdy_assert when fifo is not empty 2012-11-15 16:51:38 -08:00
ifx6x60.h serial:ifx6x60:Prevent data transfer when IFX6x60 port is shutdown 2012-11-01 08:50:01 -07:00
imx.c ARM: soc: multiplatform enablement 2012-10-01 19:11:38 -07:00
ioc3_serial.c TTY: serial: move the dereference below the NULL test 2012-09-10 16:33:02 -07:00
ioc4_serial.c TTY: serial: move the dereference below the NULL test 2012-09-10 16:33:02 -07:00
ip22zilog.c
ip22zilog.h
Kconfig serial: Unneeded ARCH dependencies are removed 2012-11-15 17:11:42 -08:00
kgdb_nmi.c tty/serial: Add kgdb_nmi driver 2012-09-26 13:52:36 -07:00
kgdboc.c KGDB/KDB fixes and cleanups 2012-10-13 11:16:58 +09:00
lantiq.c SERIAL: MIPS: lantiq: implement OF support 2012-05-21 14:31:54 +01:00
lpc32xx_hs.c serial: Add driver for LPC32xx High Speed UARTs 2012-06-12 15:48:01 -07:00
m32r_sio_reg.h
m32r_sio.c m32r_sio: remove dependency on struct serial_uart_config 2012-09-05 13:15:07 -07:00
m32r_sio.h
Makefile serial/arc-uart: Add new driver 2012-10-30 14:06:52 -07:00
max310x.c tty: serial: max310x: Remove explicit use of devm_kfree 2012-09-05 12:33:40 -07:00
max3100.c tty: serial: max3100: Fix error case 2012-09-17 04:45:29 -07:00
mcf.c
mfd.c serial: mfd: Add nmi_touch_watchdog() into the console write function 2012-11-15 17:06:10 -08:00
mpc52xx_uart.c ARM: soc: non-critical bug fixes 2012-10-01 18:02:07 -07:00
mpsc.c
mrst_max3110.c
mrst_max3110.h
msm_serial_hs.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
msm_serial.c msm_serial: fix clock rate on DMA-based uarts 2012-09-10 16:33:36 -07:00
msm_serial.h
msm_smd_tty.c TTY: use tty_port_register_device 2012-08-13 16:50:19 -07:00
mux.c
mxs-auart.c serial: mxs-auart: put the device in the error path 2012-09-11 12:21:33 -07:00
netx-serial.c
nwpserial.c
of_serial.c tty: of_serial: fix return value check in of_platform_serial_setup() 2012-11-01 08:50:01 -07:00
omap-serial.c Merge 3.7-rc3 into tty-next 2012-10-29 09:00:57 -07:00
pch_uart.c pch_uart: check kzalloc result in dma_handle_tx() 2012-08-16 12:10:16 -07:00
pmac_zilog.c pmac_zilog,kdb: Fix console poll hook to return instead of loop 2012-08-16 12:20:20 -07:00
pmac_zilog.h
pnx8xxx_uart.c
pxa.c tty: serial: KGDB support for PXA 2012-10-24 11:38:28 -07:00
sa1100.c
samsung.c serial: samsung: use clk_prepare_enable and clk_disable_unprepare 2012-10-24 11:29:30 -07:00
samsung.h
sb1250-duart.c SERIAL: MIPS Swarm sb1250-duart.c driver needs module.h 2012-05-15 17:48:50 +02:00
sc26xx.c serial: Add note about migration to driver SCCNXP 2012-09-05 13:24:40 -07:00
sccnxp.c tty: serial: sccnxp: Fix bug with unterminated platform_id list 2012-10-05 09:34:37 -07:00
serial_core.c serial: cast before shifting on port io 2012-11-15 16:59:58 -08:00
serial_ks8695.c serial: ks8695: use __iomem pointers for MMIO 2012-09-19 15:37:13 +02:00
serial_txx9.c serial: fix serial_txx9.c build warning/typo 2012-06-12 15:41:18 -07:00
sh-sci.c sh: Fix up more fallout from pointless ARM __iomem churn. 2012-10-15 14:08:48 +09:00
sh-sci.h serial: sh-sci: use serial_port_in/out vs sci_in/out. 2012-03-30 19:50:15 +09:00
sirfsoc_uart.c drivers/tty/serial/sirfsoc_uart.c: drop frees of devm_ alloc'd data 2012-09-05 12:41:57 -07:00
sirfsoc_uart.h
sn_console.c
suncore.c
sunhv.c Disintegrate asm/system.h for Sparc 2012-03-28 18:30:03 +01:00
sunsab.c Disintegrate asm/system.h for Sparc 2012-03-28 18:30:03 +01:00
sunsab.h
sunsu.c serial: diminish usage of struct serial_uart_config 2012-09-05 13:15:07 -07:00
sunzilog.c serial/sunzilog: fix keyboard on SUN SPARCstation 2012-04-04 00:37:10 -07:00
sunzilog.h
timbuart.c
timbuart.h
uartlite.c uartlite: remove IRQF_SAMPLE_RANDOM which is now a no-op 2012-07-19 10:39:42 -04:00
ucc_uart.c
vr41xx_siu.c
vt8500_serial.c serial: vt8500: fix possible memory leak in vt8500_serial_probe() 2012-10-24 11:34:51 -07:00
xilinx_uartps.c serial: xilinx_uartps: kill CONFIG_OF conditional 2012-11-15 16:58:19 -08:00
zs.c SERIAL: MIPS DECstation zs.c driver needs module.h 2012-05-15 17:48:50 +02:00
zs.h