1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <console/console.h>
4 #include <console/qemu_debugcon.h>
7 static int qemu_debugcon_detected
;
9 void qemu_debugcon_init(void)
11 int detected
= (inb(CONFIG_CONSOLE_QEMU_DEBUGCON_PORT
) == 0xe9);
12 qemu_debugcon_detected
= detected
;
13 printk(BIOS_INFO
, "QEMU debugcon %s [port 0x%x]\n",
14 detected
? "detected" : "not found",
15 CONFIG_CONSOLE_QEMU_DEBUGCON_PORT
);
18 void qemu_debugcon_tx_byte(unsigned char data
)
20 if (qemu_debugcon_detected
!= 0)
21 outb(data
, CONFIG_CONSOLE_QEMU_DEBUGCON_PORT
);