summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2013-05-30 10:33:38 +0200
committerRonald G. Minnich <rminnich@gmail.com>2013-06-05 18:24:08 +0200
commit22f01e611be6fbd3ee5a70b27b96478ff1f4e93a (patch)
tree5c07114e40071065c33f0de56865c29bd5f3132a
parentd7c6e444acfc3284c4a9ff49dd138cd0c37545e2 (diff)
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>
-rw-r--r--src/console/qemu_debugcon_console.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/console/qemu_debugcon_console.c b/src/console/qemu_debugcon_console.c
index 3037e3651c..e2591baa15 100644
--- a/src/console/qemu_debugcon_console.c
+++ b/src/console/qemu_debugcon_console.c
@@ -21,13 +21,18 @@
#include <console/console.h>
#include <arch/io.h>
+static unsigned char readback;
+
static void debugcon_init(void)
{
+ readback = inb(CONFIG_CONSOLE_QEMU_DEBUGCON_PORT);
}
static void debugcon_tx_byte(unsigned char data)
{
- outb(data, CONFIG_CONSOLE_QEMU_DEBUGCON_PORT);
+ if (readback == 0xe9) {
+ outb(data, CONFIG_CONSOLE_QEMU_DEBUGCON_PORT);
+ }
}
static void debugcon_tx_flush(void)