I'm ok to use Base-Class/Sub-Class = 0x07/0x00 to filter out the PCI serial devices and choose the first one as the debug port. However, debug port needs to be enabled early, before seabios scans PCI bus. I think we don't want to scan the pci bus by ourself in src/hw/serialio.c, but it's too late to wait for seabios to scan the bus for us. Please advice a feasible solution.
You've mentioned elsewhere in the thread that the serial port is mapped to the legacy 0x3f8 ioport initially. So can we just use that before the PCI scan happens?