Alper Nebi Yasak has uploaded this change for review.

View Change

drivers/qemu/bochs: Use arch-independent data port

The QEMU Bochs display driver uses 0x1CF as its VBE DISPI data port, but
this is only present on x86. Instead, use the port at 0x1D0 [1] which is
available on both x86 and non-x86 architectures. The data port is also
calculated inline based on the VBE DISPI index port while reading and
writing, update those expressions as well.

[1] https://web.archive.org/web/20240404032816/https://www.qemu.org/docs/master/specs/standard-vga.html#io-ports-used

Change-Id: I899beb742d42c26f3e57023f05ff459094fce5f1
Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
---
M src/drivers/emulation/qemu/bochs.c
1 file changed, 3 insertions(+), 3 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/61/82061/1
diff --git a/src/drivers/emulation/qemu/bochs.c b/src/drivers/emulation/qemu/bochs.c
index 2e0526f..70d17cb 100644
--- a/src/drivers/emulation/qemu/bochs.c
+++ b/src/drivers/emulation/qemu/bochs.c
@@ -14,7 +14,7 @@

/* VGA init. We use the Bochs VESA VBE extensions */
#define VBE_DISPI_IOPORT_INDEX 0x01CE
-#define VBE_DISPI_IOPORT_DATA 0x01CF
+#define VBE_DISPI_IOPORT_DATA 0x01D0

#define VBE_DISPI_INDEX_ID 0x0
#define VBE_DISPI_INDEX_XRES 0x1
@@ -46,7 +46,7 @@
{
if (res->flags & IORESOURCE_IO) {
outw(index, res->base);
- outw(val, res->base + 1);
+ outw(val, res->base + 2);
} else {
write16(res2mmio(res, 0x500 + index * 2, 0), val);
}
@@ -56,7 +56,7 @@
{
if (res->flags & IORESOURCE_IO) {
outw(index, res->base);
- return inw(res->base + 1);
+ return inw(res->base + 2);
} else {
return read16(res2mmio(res, 0x500 + index * 2, 0));
}

To view, visit change 82061. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: I899beb742d42c26f3e57023f05ff459094fce5f1
Gerrit-Change-Number: 82061
Gerrit-PatchSet: 1
Gerrit-Owner: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Gerrit-MessageType: newchange