Matt DeVillier has submitted this change. ( https://review.coreboot.org/c/coreboot/+/82061?usp=email )
Change subject: drivers/qemu/bochs: Use arch-independent data port ......................................................................
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/...
Change-Id: I899beb742d42c26f3e57023f05ff459094fce5f1 Signed-off-by: Alper Nebi Yasak alpernebiyasak@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/82061 Reviewed-by: David Hendricks david.hendricks@gmail.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/drivers/emulation/qemu/bochs.c 1 file changed, 3 insertions(+), 3 deletions(-)
Approvals: build bot (Jenkins): Verified David Hendricks: Looks good to me, approved
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)); }