summaryrefslogtreecommitdiff
path: root/src/drivers/emulation/qemu/bochs.c
diff options
context:
space:
mode:
authorVladimir Serbinenko <phcoder@gmail.com>2014-02-22 10:35:45 +0100
committerVladimir Serbinenko <phcoder@gmail.com>2014-03-03 23:14:04 +0100
commitdb7d04d1b753eee52448e48ca55b28564d998bf5 (patch)
tree5da00d6d44ff33c86b7b7da0f93b1b433aad7a12 /src/drivers/emulation/qemu/bochs.c
parent160e9a0224890219199f4af7cc79934cfcf45155 (diff)
qemu: Support textmode gfx init.
Change-Id: I8b6b14b4fcf8df21d8bbf988d640b1efa013bd7f Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com> Reviewed-on: http://review.coreboot.org/5283 Tested-by: build bot (Jenkins) Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'src/drivers/emulation/qemu/bochs.c')
-rw-r--r--src/drivers/emulation/qemu/bochs.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/drivers/emulation/qemu/bochs.c b/src/drivers/emulation/qemu/bochs.c
index 1e7986cc62..715c94c6ec 100644
--- a/src/drivers/emulation/qemu/bochs.c
+++ b/src/drivers/emulation/qemu/bochs.c
@@ -11,6 +11,8 @@
#include <device/pci.h>
#include <device/pci_ids.h>
#include <device/pci_ops.h>
+#include <pc80/vga.h>
+#include <pc80/vga_io.h>
/* VGA init. We use the Bochs VESA VBE extensions */
#define VBE_DISPI_IOPORT_INDEX 0x01CE
@@ -39,6 +41,7 @@
#define VBE_DISPI_LFB_ENABLED 0x40
#define VBE_DISPI_NOCLEARMEM 0x80
+#if IS_ENABLED(CONFIG_FRAMEBUFFER_KEEP_VESA_MODE)
static int width = CONFIG_DRIVERS_EMULATION_QEMU_BOCHS_XRES;
static int height = CONFIG_DRIVERS_EMULATION_QEMU_BOCHS_YRES;
@@ -53,9 +56,11 @@ static int bochs_read(int index)
outw(index, VBE_DISPI_IOPORT_INDEX);
return inw(VBE_DISPI_IOPORT_DATA);
}
+#endif
static void bochs_init(device_t dev)
{
+#if IS_ENABLED(CONFIG_FRAMEBUFFER_KEEP_VESA_MODE)
struct edid edid;
int id, mem, bar;
u32 addr;
@@ -111,6 +116,10 @@ static void bochs_init(device_t dev)
edid.bytes_per_line = width * 4;
edid.bpp = 32;
set_vbe_mode_info_valid(&edid, addr);
+#else
+ vga_misc_write(0x1);
+ vga_textmode_init();
+#endif
}
static struct device_operations qemu_graph_ops = {