summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBin Meng <bmeng@tinylab.org>2023-05-12 17:55:46 +0800
committerFelix Singer <service+coreboot-gerrit@felixsinger.de>2023-05-21 22:33:39 +0000
commit60ee6fa398a110254235b0f9489b153d70a1ae84 (patch)
tree18e2b4ddf26c163ac9e3cf6d08a6abfd001506b7
parent53b1929e83b56ecc97989b5656896f1886434672 (diff)
drivers/emulation/qemu/bochs: Fix the MMIO access to the VGA ioports
The Bochs graphics adapter remaps the legacy VGA ioports (0x3c0 -> 0x3df) to its MMIO region at offsets 0400 - 041f. Currently bochs_vga_write() calculates a wrong offset when accessing these ioports, which causes the boot splash image not displayed when using the legacy-free pci variant of the Bochs graphics adapter. TEST=Build coreboot for QEMU x86 i440fx with a boot splash image included, boot coreboot.rom with QEMU with '-device secondary-vga' and verify the boot splash image is correctly displayed. Fixes: efaf1b32ba1e ("drivers/emulation/qemu/bochs: Rewrite driver") Signed-off-by: Bin Meng <bmeng@tinylab.org> Change-Id: I4acc71e3d6ef5161ab62e6714c94b7643c4c0972 Reviewed-on: https://review.coreboot.org/c/coreboot/+/75146 Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
-rw-r--r--src/drivers/emulation/qemu/bochs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/drivers/emulation/qemu/bochs.c b/src/drivers/emulation/qemu/bochs.c
index 4634021b67..06504309e0 100644
--- a/src/drivers/emulation/qemu/bochs.c
+++ b/src/drivers/emulation/qemu/bochs.c
@@ -67,7 +67,7 @@ static void bochs_vga_write(struct resource *res, int index, uint8_t val)
if (res->flags & IORESOURCE_IO)
outb(val, index + 0x3c0);
else
- write8(res2mmio(res, (0x400 - 0x3c0) + index, 0), val);
+ write8(res2mmio(res, 0x400 + index, 0), val);
}
static struct resource res_legacy = {