linux/drivers/tty/serial/8250
Maciej W. Rozycki 6cbe45d8ac serial: 8250: Correct the clock for OxSemi PCIe devices
Oxford Semiconductor PCIe (Tornado) serial port devices are driven by a
fixed 62.5MHz clock input derived from the 100MHz PCI Express clock.

In the enhanced (650) mode, which we select in `autoconfig_has_efr' by
setting the ECB bit in the EFR register, and in the absence of clock
reconfiguration, which we currently don't do, the clock rate is divided
only by the oversampling rate of 16 as it is supplied to the baud rate
generator, yielding the baud base of 3906250.  This comes from the reset
values of the TCR and MCR[7] registers which are both zero[1][2][3][4],
choosing the oversampling rate of 16 and the normal (divide by 1) baud
rate generator prescaler respectively.  This is the rate that is divided
by the value held in the divisor latch to determine the baud rate used.

Replace the incorrect baud base of 4000000 with the right value of
3906250 then.

References:

[1] "OXPCIe200 PCI Express Multi-Port Bridge", Oxford Semiconductor,
    Inc., DS-0045, 10 Nov 2008, Section "Reset Configuration", p. 72

[2] "OXPCIe952 PCI Express Bridge to Dual Serial & Parallel Port",
    Oxford Semiconductor, Inc., DS-0046, Mar 06 08, Section "Reset
    Configuration", p. 27

[3] "OXPCIe954 PCI Express Bridge to Quad Serial Port", Oxford
    Semiconductor, Inc., DS-0047, Feb 08, Section "Reset Configuration",
    p. 28

[4] "OXPCIe958 PCI Express Bridge to Octal Serial Port", Oxford
    Semiconductor, Inc., DS-0048, Feb 08, Section "Reset Configuration",
    p. 28

Fixes: 7106b4e333 ("8250: Oxford Semiconductor Devices")
Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
Link: https://lore.kernel.org/r/alpine.DEB.2.21.2106100203510.5469@angie.orcam.me.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-06-16 09:20:29 +02:00
..
8250_accent.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_acorn.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_aspeed_vuart.c Merge 5.13-rc4 into tty-next 2021-05-31 09:44:28 +02:00
8250_bcm2835aux.c serial: 8250: Simplify with dev_err_probe() 2020-09-04 17:14:29 +02:00
8250_bcm7271.c serial: 8250: Make symbol 'brcmuart_debugfs_root' static 2021-04-02 16:12:27 +02:00
8250_boca.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_core.c tty/serial: make port of serial8250_register_8250_port const 2021-05-20 16:59:14 +02:00
8250_dma.c serial: 8250: factor out serial8250_{set,clear}_THRI() helpers 2019-06-18 09:36:55 +02:00
8250_dw.c serial: 8250_dw: Add device HID for new AMD UART controller 2021-05-13 17:08:42 +02:00
8250_dwlib.c serial: 8250_dw: split Synopsys DesignWare 8250 common functions 2019-09-04 12:43:52 +02:00
8250_dwlib.h tty: serial: Use the correct style for SPDX License Identifier 2020-03-07 09:52:01 +01:00
8250_early.c tty: serial: 8250: 8250_port: Move prototypes to shared location 2020-11-13 15:28:12 +01:00
8250_em.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
8250_exar_st16c554.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_exar.c Linux 5.13-rc6 2021-06-14 09:14:43 +02:00
8250_fintek.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
8250_fourport.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_fsl.c serial: do not restore interrupt state in sysrq helper 2021-04-22 12:04:26 +02:00
8250_gsc.c remove ioremap_nocache and devm_ioremap_nocache 2020-01-06 09:45:59 +01:00
8250_hp300.c tty: add SPDX identifiers to all remaining files in drivers/tty/ 2017-11-08 13:08:12 +01:00
8250_hub6.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_ingenic.c serial: 8250: Simplify with dev_err_probe() 2020-09-04 17:14:29 +02:00
8250_ioc3.c Fix up remaining devm_ioremap_nocache() in SGI IOC3 8250 UART driver 2020-02-08 14:19:39 -08:00
8250_lpc18xx.c tty: Remove dev_err() usage after platform_get_irq() 2019-09-04 12:43:49 +02:00
8250_lpss.c serial: 8250_lpss: Add ->setup() for Elkhart Lake ports 2020-03-06 13:31:19 +01:00
8250_men_mcb.c 8250-men-mcb: fix signed/unsigned confusion 2020-06-27 16:12:45 +02:00
8250_mid.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_mtk.c serial: 8250-mtk: Fix reference leak in mtk8250_probe 2020-11-26 21:19:58 +01:00
8250_of.c serial: 8250: of: Check for CONFIG_SERIAL_8250_BCM7271 2021-05-13 16:22:48 +02:00
8250_omap.c Revert "serial: 8250: 8250_omap: Fix possible interrupt storm" 2021-05-28 10:58:49 +02:00
8250_pci.c serial: 8250: Correct the clock for OxSemi PCIe devices 2021-06-16 09:20:29 +02:00
8250_pnp.c serial: 8250_pnp: Move to struct dev_pm_ops 2019-09-04 12:43:46 +02:00
8250_port.c serial: 8250: Add UART_BUG_TXRACE workaround for Aspeed VUART 2021-05-20 17:14:46 +02:00
8250_pxa.c serial: 8250_pxa: Switch to use platform_get_irq() 2020-06-27 16:12:56 +02:00
8250_tegra.c 8250_tegra: clean up tegra_uart_handle_break 2021-01-07 16:17:31 +01:00
8250_uniphier.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
8250.h serial: 8250: Use BIT(x) for UART_{CAP,BUG}_* 2021-05-20 17:14:50 +02:00
Kconfig serial: extend compile-test coverage 2021-04-22 13:12:13 +02:00
Makefile serial: 8250: Add new 8250-core based Broadcom STB driver 2021-03-26 15:18:30 +01:00
serial_cs.c tty: serial: 8250: serial_cs: Fix a memory leak in error handling path 2021-05-27 15:20:05 +02:00