opnsense-src/sys/dev/uart
Warner Losh b2fd259edd uart: Add a signal to compute rclk from baudrate
With newer, more diverse hardware designs, the rclk can be
unknown. Currently deployed systems have no standard way to discover the
baud-clock generator frequency. However, sometimes we have a fairly good
idea that the firmware programmed the UART to be the baud rate that it's
telling us it's at. Create a way to instruct the uart class drivers to
compute the baud clock frequency the first time their init routines are
called. Usually the 'divisors' are relatively small, meaning we will
likely have a fairly large error (goes as 1 / (divisor + 1). However,
we also know that the baud-generator clock  needs to be divided down
to the baud-rate +/- about 5% (so while the error could be large for
an arbitrary baud-clock, standard baud rates generally will give
an error of 5% or less).

Often, the console speed and the getty-configured speed are the same, so
this heuristic allows boot messages and login sessions to work.

Sponsored by:		Netflix
Reviewed by:		andrew
Differential Revision:	https://reviews.freebsd.org/D47072
2024-10-14 16:03:58 -06:00
..
uart.h uart: Add a signal to compute rclk from baudrate 2024-10-14 16:03:58 -06:00
uart_bus.h dev/uart: name uart_class_set DATA_SET macro UART_CLASS() 2024-02-22 22:43:22 +00:00
uart_bus_acpi.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
uart_bus_fdt.c uart: Honour clock-frequency in FDT for UART_FDT_CLASS if present 2024-05-15 16:53:33 +01:00
uart_bus_isa.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
uart_bus_pci.c Add support for Intel Atom S1200 UART 2024-04-19 16:52:51 -06:00
uart_bus_puc.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
uart_bus_scc.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
uart_core.c uart: export rclk via sysctl 2024-10-14 16:03:58 -06:00
uart_cpu.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
uart_cpu_acpi.c uart: Add a signal to compute rclk from baudrate 2024-10-14 16:03:58 -06:00
uart_cpu_acpi.h uart: Add uart_cpu_acpi_setup to setup the uart 2024-03-18 16:20:52 +00:00
uart_cpu_arm64.c uart: Add uart_cpu_acpi_setup to setup the uart 2024-03-18 16:20:52 +00:00
uart_cpu_fdt.c uart: Small style tweak 2024-10-11 15:27:46 -06:00
uart_cpu_fdt.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
uart_cpu_powerpc.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
uart_cpu_x86.c uart: Add uart_cpu_acpi_setup to setup the uart 2024-03-18 16:20:52 +00:00
uart_dbg.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
uart_dev_imx.c clk: Move clock code in dev/clk 2024-01-10 19:20:26 +01:00
uart_dev_imx.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
uart_dev_lowrisc.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
uart_dev_lowrisc.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
uart_dev_msm.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
uart_dev_msm.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
uart_dev_mu.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
uart_dev_mvebu.c sys: Simplify enabling EARLY_PRINTF uarts 2024-02-13 11:48:52 +00:00
uart_dev_ns8250.c uart: Add entry for an Intel UART 2024-10-02 12:29:24 -06:00
uart_dev_ns8250.h uart(4): Honor hardware state of NS8250-class for tsw_busy 2024-01-14 08:03:59 +01:00
uart_dev_pl011.c dev/uart: name uart_class_set DATA_SET macro UART_CLASS() 2024-02-22 22:43:22 +00:00
uart_dev_quicc.c uart: Use device_set_descf() 2024-06-02 19:38:41 -04:00
uart_dev_snps.c uart_snps: Register a device xref for UARTs 2024-04-12 17:04:23 +00:00
uart_dev_ti8250.c uart(4): Honor hardware state of NS8250-class for tsw_busy 2024-01-14 08:03:59 +01:00
uart_dev_z8530.c uart: Use device_set_descf() 2024-06-02 19:38:41 -04:00
uart_if.m uart(4): Honor hardware state of NS8250-class for tsw_busy 2024-01-14 08:03:59 +01:00
uart_ppstypes.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
uart_subr.c uart: Add a signal to compute rclk from baudrate 2024-10-14 16:03:58 -06:00
uart_tty.c uart(4): Honor hardware state of NS8250-class for tsw_busy 2024-01-14 08:03:59 +01:00