mirror of
https://github.com/ipxe/ipxe
synced 2026-05-04 03:03:43 +03:00
[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>
This commit is contained in:
@@ -37,6 +37,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||
#define ISA_UART( NAME, BASE ) \
|
||||
static struct ns16550_uart ns16550_ ## NAME = { \
|
||||
.base = ( ( void * ) (BASE) ), \
|
||||
.clock = NS16550_CLK_DEFAULT, \
|
||||
}; \
|
||||
struct uart NAME = { \
|
||||
.refcnt = REF_INIT ( ref_no_free ), \
|
||||
|
||||
Reference in New Issue
Block a user