summaryrefslogtreecommitdiffstats
path: root/src/drivers/uart
Commit message (Collapse)AuthorAgeFilesLines
* [uart] Make baud rate a property of the UARTMichael Brown2025-11-051-4/+3Star
| | | | | | | | Make the current baud rate (if specified) a property of the UART, to allow the default_serial_console() function to specify the default baud rate as well as the default UART device. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dwuart] Read input clock frequency from the device treeMichael Brown2025-06-232-1/+10
| | | | | | | | | | | | | 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>
* [uart] Wait for 16550 UART to become idle before modifying LCRMichael Brown2025-06-231-0/+3
| | | | | | | | | | | Some implementations of 16550-compatible UARTs (e.g. the DesignWare UART) are known to ignore writes to the line control register while the transmitter is active. Wait for the transmitter to become empty before attempting to write to the line control register. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dwuart] Add "ns16550a" compatible device IDMichael Brown2025-06-231-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dwuart] Add a basic driver for the Synopsys DesignWare UARTMichael Brown2025-06-221-0/+120
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [uart] Allow for dynamically registered 16550 UARTsMichael Brown2025-06-221-10/+5Star
| | | | | | | Use the generic UART driver-private data pointer, rather than embedding the generic UART within the 16550 UART structure. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [uart] Allow for the existence of non-16550 UARTsMichael Brown2025-06-201-0/+179
Remove the assumption that all platforms use a fixed number of 16550 UARTs identifiable by a simple numeric index. Create an abstraction allowing for dynamic instantiation and registration of any number of arbitrary UART models. The common case of the serial console on x86 uses a single fixed UART specified at compile time. Avoid unnecessarily dragging in the dynamic instantiation code in this use case by allowing COMCONSOLE to refer to a single static UART object representing the relevant port. When selecting a UART by command-line argument (as used in the "gdbstub serial <port>" command), allow the UART to be specified as either a numeric index (to retain backwards compatiblity) or a case-insensitive port name such as "COM2". Signed-off-by: Michael Brown <mcb30@ipxe.org>