}
static int
-getFBSize(u16 bdf)
+getFBSize(struct pci_device *pci)
{
/* FB config */
- u8 reg = pci_config_readb(bdf, 0xa1);
+ u8 reg = pci_config_readb(pci->bdf, 0xa1);
/* GFX disabled ? */
if (!(reg & 0x80))
}
static int
-getViaRamSpeed(u16 bdf)
+getViaRamSpeed(struct pci_device *pci)
{
- return (pci_config_readb(bdf, 0x90) & 0x07) + 3;
+ return (pci_config_readb(pci->bdf, 0x90) & 0x07) + 3;
}
static int
getAMDRamSpeed(void)
{
- int bdf = pci_find_device(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_K8_NB_MEMCTL);
- if (bdf < 0)
+ struct pci_device *pci = pci_find_device(PCI_VENDOR_ID_AMD
+ , PCI_DEVICE_ID_AMD_K8_NB_MEMCTL);
+ if (!pci)
return -1;
/* mem clk 0 = DDR2 400 */
- return (pci_config_readb(bdf, 0x94) & 0x7) + 6;
+ return (pci_config_readb(pci->bdf, 0x94) & 0x7) + 6;
}
/* int 0x15 - 5f18
{
VGAHookHandlerType = VH_VIA;
- int bdf = pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_K8M890CE_3);
- if (bdf >= 0) {
- ViaFBsize = getFBSize(bdf);
+ struct pci_device *d = pci_find_device(PCI_VENDOR_ID_VIA
+ , PCI_DEVICE_ID_VIA_K8M890CE_3);
+ if (d) {
+ ViaFBsize = getFBSize(d);
ViaRamSpeed = getAMDRamSpeed();
return;
}
- bdf = pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VX855_MEMCTRL);
- if (bdf >= 0) {
- ViaFBsize = getFBSize(bdf);
- ViaRamSpeed = getViaRamSpeed(bdf);
+ d = pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VX855_MEMCTRL);
+ if (d) {
+ ViaFBsize = getFBSize(d);
+ ViaRamSpeed = getViaRamSpeed(d);
return;
}
set_success(regs);
}
+static void
+intel_155f50(struct bregs *regs)
+{
+ /* Mandatory hook on some Dell laptops */
+ regs->ax = 0x005f;
+ set_success(regs);
+}
+
static void
intel_155f(struct bregs *regs)
{
switch (regs->al) {
case 0x35: intel_155f35(regs); break;
case 0x40: intel_155f40(regs); break;
+ case 0x50: intel_155f50(regs); break;
default: handle_155fXX(regs); break;
}
}
#define BOOT_DISPLAY_EFP2 (1 << 6)
#define BOOT_DISPLAY_LCD2 (1 << 7)
+static void
+intel_setup(struct pci_device *pci)
+{
+ VGAHookHandlerType = VH_INTEL;
+
+ IntelDisplayType = BOOT_DISPLAY_DEFAULT;
+ IntelDisplayId = 3;
+}
+
static void
roda_setup(struct pci_device *pci)
{
void
vgahook_setup(struct pci_device *pci)
{
- if (!CONFIG_VGAHOOKS || !CBvendor || !CBpart)
+ if (!CONFIG_VGAHOOKS)
return;
if (strcmp(CBvendor, "KONTRON") == 0 && strcmp(CBpart, "986LCD-M") == 0)
roda_setup(pci);
else if (pci->vendor == PCI_VENDOR_ID_VIA)
via_setup(pci);
+ else if (pci->vendor == PCI_VENDOR_ID_INTEL)
+ intel_setup(pci);
}