]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[uart] Allow for the existence of non-16550 UARTs
authorMichael Brown <mcb30@ipxe.org>
Tue, 17 Jun 2025 13:28:18 +0000 (14:28 +0100)
committerMichael Brown <mcb30@ipxe.org>
Fri, 20 Jun 2025 11:52:04 +0000 (12:52 +0100)
commit6c8fb4b89d49c40339fe61b7ec549d90f1ce9480
tree7ceb03829323276a6aed637e4d96ae158f43bdbd
parent60e167c00b138fdb162e7b2192e9cbb196ed3cbd
[uart] Allow for the existence of non-16550 UARTs

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>
15 files changed:
src/Makefile
src/arch/x86/core/x86_uart.c
src/arch/x86/include/bits/ns16550.h [new file with mode: 0644]
src/arch/x86/include/bits/uart.h [deleted file]
src/arch/x86/interface/syslinux/comboot_call.c
src/core/gdbserial.c
src/core/serial.c
src/core/uart.c
src/drivers/uart/ns16550.c [new file with mode: 0644]
src/include/bits/ns16550.h [moved from src/include/bits/uart.h with 56% similarity]
src/include/ipxe/errfile.h
src/include/ipxe/gdbserial.h
src/include/ipxe/ns16550.h [new file with mode: 0644]
src/include/ipxe/serial.h
src/include/ipxe/uart.h