]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[dwuart] Read input clock frequency from the device tree
authorMichael Brown <mcb30@ipxe.org>
Mon, 23 Jun 2025 21:40:04 +0000 (22:40 +0100)
committerMichael Brown <mcb30@ipxe.org>
Mon, 23 Jun 2025 21:56:38 +0000 (22:56 +0100)
commit9ada09c91966c42b49393307b326ff9b078ed448
tree37567fa8398117cdbd27ae9808b4037059dae8dd
parent0ed1dea7f4f5c5b2b7cd0130eb49c2c5c0b0ea42
[dwuart] Read input clock frequency from the device tree

The 16550 design includes a programmable 16-bit clock divider for an
arbitrary input clock, requiring knowledge of the input clock
frequency in order to calculate the divider value for a given baud
rate.  The 16550 UARTs in an x86 PC will always have a 1.8432 MHz
input clock.  Non-x86 systems may have other input clock frequencies.

Define the input clock frequency as a property of a 16550 UART, and
read the value from the device tree "clock-frequency" property.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/arch/x86/core/x86_uart.c
src/drivers/uart/dwuart.c
src/drivers/uart/ns16550.c
src/include/ipxe/ns16550.h