opnsense-src/sys/dev/uart
Jessica Clarke fc59fc3c1f uart: Honour clock-frequency in FDT for UART_FDT_CLASS if present
The StarFive VisionFive 2 has a Synopsys DesignWare ABP UART, whose
driver uses UART_FDT_CLASS rather than UART_FDT_CLASS_AND_DEVICE as it
has its own separate newbus driver. This UART is driven by a 24MHz clock
as specified in the FDT, but we don't currently look at the property
here, instead passing down 0 and letting the default value be used in
the 8250 driver (~1.8MHz). As a result the divisor is misconfigured for
the current baud rate for the entire kernel boot process. Once the
newbus driver attaches the correct frequency is saved in the softc, but
that does not take effect until the next time ns8250_param is called and
the divisor is recalculated, namely when userspace runs and /dev/console
is opened (note that ns8250_init does not get called when the newbus
device corresponding to the current console attaches).

Fix this issue by attemmpting to get the current clock frequency as for
the UART_FDT_CLASS_AND_DEVICE_CASE, but falling back to 0 rather than
failing on error.

Reviewed by:	imp, mhorne
Differential Revision:	https://reviews.freebsd.org/D45159
2024-05-15 16:53:33 +01:00
..
uart.h dev/uart: Support 8-byte register access 2024-02-13 11:48:53 +00: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 sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07: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 uart_cpu_acpi_setup to setup the uart 2024-03-18 16:20:52 +00: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 sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -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 dev/uart: name uart_class_set DATA_SET macro UART_CLASS() 2024-02-22 22:43:22 +00: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 dev/uart: name uart_class_set DATA_SET macro UART_CLASS() 2024-02-22 22:43:22 +00: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 dev/uart: name uart_class_set DATA_SET macro UART_CLASS() 2024-02-22 22:43:22 +00: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 dev/uart: Support setting the register io width 2024-02-13 11:48:52 +00:00
uart_tty.c uart(4): Honor hardware state of NS8250-class for tsw_busy 2024-01-14 08:03:59 +01:00