diff options
author | Jonathan A. Kollasch <jakllsch@kollasch.net> | 2013-10-20 12:48:56 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2013-10-26 10:13:30 -0400 |
commit | e9a3e12c5afd552dda482edd37d845974148f26e (patch) | |
tree | 3ef66e7eec46e9bd86f4039724dabd9251ba3fc2 /src/vgahooks.c | |
parent | 83d60b3c474bf36d7510625911c81c45c9c771cc (diff) | |
download | qemu-seabios-e9a3e12c5afd552dda482edd37d845974148f26e.tar.gz |
vgahooks: add SM720 VGA BIOS hooks for WIN Enterprises MB-60470
Add vgahooks to support the SMI SM720 VGA BIOS used on the
WIN Enterprises MB-60470. The response from smi_157f14() is necessary
for the CRT output to turn on. The response from smi_157f02() is used
to configure which connector(s) output is routed to.
As I lack hardware to test LCD panel output, I've selected CRT-only
output on the MB-60470 as this prevents the CRT output from being scaled
to the resolution of the LCD panel.
Signed-off-by: Jonathan A. Kollasch <jakllsch@kollasch.net>
Diffstat (limited to 'src/vgahooks.c')
-rw-r--r-- | src/vgahooks.c | 66 |
1 files changed, 65 insertions, 1 deletions
diff --git a/src/vgahooks.c b/src/vgahooks.c index dc3085e..6a4acfe 100644 --- a/src/vgahooks.c +++ b/src/vgahooks.c @@ -12,10 +12,11 @@ #include "hw/pci_regs.h" // PCI_VENDOR_ID #include "output.h" // dprintf #include "string.h" // strcmp -#include "util.h" // handle_155f +#include "util.h" // handle_155f, handle_157f #define VH_VIA 1 #define VH_INTEL 2 +#define VH_SMI 3 int VGAHookHandlerType VARFSEG; @@ -25,6 +26,11 @@ handle_155fXX(struct bregs *regs) set_code_unimplemented(regs, RET_EUNSUPPORTED); } +static void +handle_157fXX(struct bregs *regs) +{ + set_code_unimplemented(regs, RET_EUNSUPPORTED); +} /**************************************************************** * Via hooks @@ -248,6 +254,46 @@ getac_setup(struct pci_device *pci) { } +/**************************************************************** + * Silicon Motion hooks + ****************************************************************/ + +u8 SmiBootDisplay VARFSEG; // 1: LCD, 2: CRT, 3: Both */ + +static void +smi_157f02(struct bregs *regs) +{ + /* Boot Display Device Override */ + regs->ax = 0x007f; + regs->bl = GET_GLOBAL(SmiBootDisplay); + set_success(regs); +} + +static void +smi_157f14(struct bregs *regs) +{ + /* ReduceOn support default status */ + regs->ax = 0x007f; + regs->bl = 0x00; + set_success(regs); +} + +static void +smi_157f(struct bregs *regs) +{ + switch (regs->al) { + case 0x02: smi_157f02(regs); break; + case 0x14: smi_157f14(regs); break; + default: handle_157fXX(regs); break; + } +} + +static void +winent_mb6047_setup(struct pci_device *pci) +{ + VGAHookHandlerType = VH_SMI; + SmiBootDisplay = 0x02; +} /**************************************************************** * Entry and setup @@ -270,6 +316,22 @@ handle_155f(struct bregs *regs) } } +// Main 16bit entry point +void +handle_157f(struct bregs *regs) +{ + if (!CONFIG_VGAHOOKS) { + handle_157fXX(regs); + return; + } + + int htype = GET_GLOBAL(VGAHookHandlerType); + switch (htype) { + case VH_SMI: smi_157f(regs); break; + default: handle_157fXX(regs); break; + } +} + // Setup void vgahook_setup(struct pci_device *pci) @@ -283,6 +345,8 @@ vgahook_setup(struct pci_device *pci) getac_setup(pci); else if (strcmp(CBvendor, "RODA") == 0 && strcmp(CBpart, "RK886EX") == 0) roda_setup(pci); + else if (strcmp(CBvendor, "Win Enterprise") == 0 && strcmp(CBpart, "MB6047") == 0) + winent_mb6047_setup(pci); else if (pci->vendor == PCI_VENDOR_ID_VIA) via_setup(pci); else if (pci->vendor == PCI_VENDOR_ID_INTEL) |