opnsense-src/sys/dev/uart
John Baldwin b47c1eda0c Correct baud rate error calculation.
Shifting right by 1 is not the same as dividing by 2 for signed
values.  In particular, dividing a signed value by 2 gives the integer
ceiling of the (e.g. -5 / 2 == -2) whereas shifting right by 1 always
gives the floor (-5 >> 1 == -3).

An embedded board with a 25 Mhz base clock results in an error of
-30.5% when used with a baud rate of 115200.  Using division, this
truncates to -30% and is permitted.  Using the shift, this fails and
is rejected causing TIOCSETA requests to fail with EINVAL and breaking
getty(8).

Using division gives the same error range for both over and under baud
rates and also makes the code match the behavior documented in the
existing comment about supporting boards with 25 Mhz clocks.

Reported by:	imp
MFC after:	2 weeks
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D24367
2020-04-13 20:43:57 +00:00
..
uart.h Add busy detect quirk to list of console options 2018-07-22 23:32:21 +00:00
uart_bus.h Add quirk for ignoring SPCR AccessWidth values on the PL011 UART 2019-04-15 13:41:53 +00:00
uart_bus_acpi.c Regularize my copyright notice 2019-12-04 16:56:11 +00:00
uart_bus_fdt.c add snps IP uart support / genaralize UART 2018-08-19 21:10:21 +00:00
uart_bus_isa.c Regularize my copyright notice 2019-12-04 16:56:11 +00:00
uart_bus_pccard.c Regularize my copyright notice 2019-12-04 16:56:11 +00:00
uart_bus_pci.c Add Denverton UART PCI ID 2020-02-28 15:59:35 +00:00
uart_bus_puc.c Regularize my copyright notice 2019-12-04 16:56:11 +00:00
uart_bus_scc.c add snps IP uart support / genaralize UART 2018-08-19 21:10:21 +00:00
uart_core.c Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
uart_cpu.h
uart_cpu_acpi.c uart_cpu_acpi: Fix GCC build break from r348195 2019-05-23 20:18:46 +00:00
uart_cpu_acpi.h Use ACPI SPCR on x86 2019-05-23 19:55:53 +00:00
uart_cpu_arm64.c Use ACPI SPCR on x86 2019-05-23 19:55:53 +00:00
uart_cpu_fdt.c
uart_cpu_fdt.h
uart_cpu_powerpc.c
uart_cpu_x86.c Use ACPI SPCR on x86 2019-05-23 19:55:53 +00:00
uart_dbg.c
uart_dev_imx.c
uart_dev_imx.h
uart_dev_lowrisc.c Add support for the UART device found in lowRISC system-on-a-chip. 2018-10-12 15:19:41 +00:00
uart_dev_lowrisc.h Add support for the UART device found in lowRISC system-on-a-chip. 2018-10-12 15:19:41 +00:00
uart_dev_msm.c
uart_dev_msm.h
uart_dev_mu.c Add a driver for the BCM2835 Mini-UART as seen on the RPi3 2018-06-12 13:26:31 +00:00
uart_dev_mvebu.c Disable EARLY_PRINTF from the Armada 3700 uart, it breaks when we want 2018-02-01 15:05:17 +00:00
uart_dev_ns8250.c Correct baud rate error calculation. 2020-04-13 20:43:57 +00:00
uart_dev_ns8250.h
uart_dev_pl011.c Add quirk for ignoring SPCR AccessWidth values on the PL011 UART 2019-04-15 13:41:53 +00:00
uart_dev_quicc.c
uart_dev_sab82532.c
uart_dev_snps.c Remove "all rights reserved" from copyright for the file that Jared McNeill 2019-12-03 21:05:33 +00:00
uart_dev_ti8250.c
uart_dev_z8530.c
uart_if.m
uart_ppstypes.h
uart_subr.c Add busy detect quirk to list of console options 2018-07-22 23:32:21 +00:00
uart_tty.c Some devices take undesired actions when RTS and DTR are 2019-06-12 18:07:04 +00:00