console: add qemu debugcon detection
The qemu debugcon port returns 0xe9 on reads in case the device is present. Use that for detection and write console output to the port only in case the device is actually present. Change-Id: I41aabcf11845d24004e4f795dfd799822fd14646 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-on: http://review.coreboot.org/3338 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
This commit is contained in:
parent
d7c6e444ac
commit
22f01e611b
|
@ -21,14 +21,19 @@
|
||||||
#include <console/console.h>
|
#include <console/console.h>
|
||||||
#include <arch/io.h>
|
#include <arch/io.h>
|
||||||
|
|
||||||
|
static unsigned char readback;
|
||||||
|
|
||||||
static void debugcon_init(void)
|
static void debugcon_init(void)
|
||||||
{
|
{
|
||||||
|
readback = inb(CONFIG_CONSOLE_QEMU_DEBUGCON_PORT);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void debugcon_tx_byte(unsigned char data)
|
static void debugcon_tx_byte(unsigned char data)
|
||||||
{
|
{
|
||||||
|
if (readback == 0xe9) {
|
||||||
outb(data, CONFIG_CONSOLE_QEMU_DEBUGCON_PORT);
|
outb(data, CONFIG_CONSOLE_QEMU_DEBUGCON_PORT);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void debugcon_tx_flush(void)
|
static void debugcon_tx_flush(void)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue