Vladimir Serbinenko (phcoder@gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5283
-gerrit
commit 00f6b801383e8eceaa40187289689404ad200ac0 Author: Vladimir Serbinenko phcoder@gmail.com Date: Sat Feb 22 10:35:45 2014 +0100
qemu: Support textmode gfx init.
Change-Id: I8b6b14b4fcf8df21d8bbf988d640b1efa013bd7f Signed-off-by: Vladimir Serbinenko phcoder@gmail.com --- src/drivers/emulation/qemu/Kconfig | 3 +++ src/drivers/emulation/qemu/bochs.c | 9 +++++++++ src/drivers/emulation/qemu/cirrus.c | 10 ++++++++++ src/mainboard/emulation/qemu-i440fx/Kconfig | 1 + src/mainboard/emulation/qemu-q35/Kconfig | 1 + 5 files changed, 24 insertions(+)
diff --git a/src/drivers/emulation/qemu/Kconfig b/src/drivers/emulation/qemu/Kconfig index 56fdaca..168b1c5 100644 --- a/src/drivers/emulation/qemu/Kconfig +++ b/src/drivers/emulation/qemu/Kconfig @@ -3,6 +3,7 @@ config DRIVERS_EMULATION_QEMU_BOCHS default y depends on BOARD_EMULATION_QEMU_X86 depends on MAINBOARD_DO_NATIVE_VGA_INIT + select VGA help VGA driver for qemu emulated vga cards supporting the bochs dispi interface. This includes @@ -13,9 +14,11 @@ config DRIVERS_EMULATION_QEMU_BOCHS config DRIVERS_EMULATION_QEMU_BOCHS_XRES int "bochs vga xres" default 800 + depends on FRAMEBUFFER_KEEP_VESA_MODE depends on DRIVERS_EMULATION_QEMU_BOCHS
config DRIVERS_EMULATION_QEMU_BOCHS_YRES int "bochs vga yres" default 600 + depends on FRAMEBUFFER_KEEP_VESA_MODE depends on DRIVERS_EMULATION_QEMU_BOCHS diff --git a/src/drivers/emulation/qemu/bochs.c b/src/drivers/emulation/qemu/bochs.c index 1e7986c..715c94c 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 = { diff --git a/src/drivers/emulation/qemu/cirrus.c b/src/drivers/emulation/qemu/cirrus.c index b4928fe..5f8a01e 100644 --- a/src/drivers/emulation/qemu/cirrus.c +++ b/src/drivers/emulation/qemu/cirrus.c @@ -36,9 +36,11 @@ #include <pc80/vga.h> #include <pc80/vga_io.h>
+#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; static u32 addr = 0; +#endif
enum { @@ -197,6 +199,7 @@ enum #define CIRRUS_SR_EXTENDED_MODE_32BPP 0x08 #define CIRRUS_HIDDEN_DAC_888COLOR 0xc5
+#if IS_ENABLED(CONFIG_FRAMEBUFFER_KEEP_VESA_MODE) static void write_hidden_dac (uint8_t data) { @@ -207,9 +210,11 @@ write_hidden_dac (uint8_t data) inb (0x3c6); outb (data, 0x3c6); } +#endif
static void cirrus_init(device_t dev) { +#if IS_ENABLED(CONFIG_FRAMEBUFFER_KEEP_VESA_MODE) uint8_t cr_ext, cr_overlay; unsigned pitch = (width * 4) / VGA_CR_PITCH_DIVISOR; uint8_t sr_ext = 0, hidden_dac = 0; @@ -335,6 +340,11 @@ static void cirrus_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_cirrus_graph_ops = { diff --git a/src/mainboard/emulation/qemu-i440fx/Kconfig b/src/mainboard/emulation/qemu-i440fx/Kconfig index 0d4d07a..833dfa1 100644 --- a/src/mainboard/emulation/qemu-i440fx/Kconfig +++ b/src/mainboard/emulation/qemu-i440fx/Kconfig @@ -14,6 +14,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy select EARLY_CBMEM_INIT select MAINBOARD_HAS_NATIVE_VGA_INIT select MAINBOARD_DO_NATIVE_VGA_INIT + select MAINBOARD_NATIVE_VGA_INIT_TEXTMODECFG
config MAINBOARD_DIR string diff --git a/src/mainboard/emulation/qemu-q35/Kconfig b/src/mainboard/emulation/qemu-q35/Kconfig index cd7024b..5ea0c9f 100644 --- a/src/mainboard/emulation/qemu-q35/Kconfig +++ b/src/mainboard/emulation/qemu-q35/Kconfig @@ -17,6 +17,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy select EARLY_CBMEM_INIT select MAINBOARD_HAS_NATIVE_VGA_INIT select MAINBOARD_DO_NATIVE_VGA_INIT + select MAINBOARD_NATIVE_VGA_INIT_TEXTMODECFG
config MAINBOARD_DIR string