Consolidate intel vga int15 hooks
Change-Id: I9366dded98bf15f6da44ce893dd10698ba09fd55
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-on: http://review.coreboot.org/6820
Tested-by: build bot (Jenkins)
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
diff --git a/src/mainboard/apple/macbook21/Kconfig b/src/mainboard/apple/macbook21/Kconfig
index 871c16c..a01d6b16 100644
--- a/src/mainboard/apple/macbook21/Kconfig
+++ b/src/mainboard/apple/macbook21/Kconfig
@@ -13,6 +13,7 @@
select HAVE_MP_TABLE
select BOARD_ROMSIZE_KB_2048
select CHANNEL_XOR_RANDOMIZATION
+ select INTEL_INT15
select HAVE_ACPI_TABLES
select HAVE_ACPI_RESUME
select USE_OPTION_TABLE
diff --git a/src/mainboard/apple/macbook21/mainboard.c b/src/mainboard/apple/macbook21/mainboard.c
index b537f78..846914c 100644
--- a/src/mainboard/apple/macbook21/mainboard.c
+++ b/src/mainboard/apple/macbook21/mainboard.c
@@ -33,42 +33,11 @@
#include <pc80/mc146818rtc.h>
#include <arch/x86/include/arch/acpigen.h>
#include <smbios.h>
-#include <x86emu/x86emu.h>
+#include <drivers/intel/gma/int15.h>
#include <device/azalia_device.h>
#include "hda_verb.h"
#define PANEL INT15_5F35_CL_DISPLAY_DEFAULT
-#if CONFIG_PCI_OPTION_ROM_RUN_YABEL || CONFIG_PCI_OPTION_ROM_RUN_REALMODE
-static int int15_handler(void)
-{
- /* The right way to do this is to move this handler code into
- * the mainboard or northbridge code.
- * TODO: completely move to mainboards / chipsets.
- */
- printk(BIOS_DEBUG, "%s: AX=%04x BX=%04x CX=%04x DX=%04x\n",
- __func__, X86_AX, X86_BX, X86_CX, X86_DX);
-
- switch (X86_AX) {
- case 0x5f35: /* Boot Display */
- X86_AX = 0x005f; // Success
- X86_CL = PANEL;
- break;
- case 0x5f40: /* Boot Panel Type */
- X86_AX = 0x005f; // Success
- X86_CL = 3;
- printk(BIOS_DEBUG, "DISPLAY=%x\n", X86_CL);
- break;
- default:
- /* Interrupt was not handled */
- printk(BIOS_DEBUG, "Unknown INT15 function %04x!\n", X86_AX);
- return 0;
- }
-
- /* Interrupt handled */
- return 1;
-}
-#endif
-
int get_cst_entries(acpi_cstate_t **entries)
{
return 0;
@@ -76,10 +45,7 @@
static void mainboard_init(device_t dev)
{
-#if CONFIG_PCI_OPTION_ROM_RUN_YABEL || CONFIG_PCI_OPTION_ROM_RUN_REALMODE
- /* Install custom int15 handler for VGA OPROM */
- mainboard_interrupt_handlers(0x15, &int15_handler);
-#endif
+ install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, PANEL, 3);
}
static void mainboard_enable(device_t dev)
diff --git a/src/mainboard/google/bolt/Kconfig b/src/mainboard/google/bolt/Kconfig
index 25c85d0..7a756cc 100644
--- a/src/mainboard/google/bolt/Kconfig
+++ b/src/mainboard/google/bolt/Kconfig
@@ -18,6 +18,7 @@
select MAINBOARD_HAS_CHROMEOS
select EXTERNAL_MRC_BLOB
select MONOTONIC_TIMER_MSR
+ select INTEL_INT15
config VBOOT_RAMSTAGE_INDEX
hex
diff --git a/src/mainboard/google/bolt/mainboard.c b/src/mainboard/google/bolt/mainboard.c
index dd5dc03..961f58d 100644
--- a/src/mainboard/google/bolt/mainboard.c
+++ b/src/mainboard/google/bolt/mainboard.c
@@ -26,9 +26,7 @@
#include <device/pci_def.h>
#include <device/pci_ops.h>
#include <console/console.h>
-#if CONFIG_VGA_ROM_RUN
-#include <x86emu/x86emu.h>
-#endif
+#include <drivers/intel/gma/int15.h>
#include <pc80/mc146818rtc.h>
#include <arch/acpi.h>
#include <arch/io.h>
@@ -46,92 +44,6 @@
outb(0xcb, 0xb2);
}
-#if CONFIG_VGA_ROM_RUN
-static int int15_handler(void)
-{
- int res = 0;
-
- printk(BIOS_DEBUG, "%s: AX=%04x BX=%04x CX=%04x DX=%04x\n",
- __func__, X86_AX, X86_BX, X86_CX, X86_DX);
-
- switch (X86_AX) {
- case 0x5f34:
- /*
- * Set Panel Fitting Hook:
- * bit 2 = Graphics Stretching
- * bit 1 = Text Stretching
- * bit 0 = Centering (do not set with bit1 or bit2)
- * 0 = video bios default
- */
- X86_AX = 0x005f;
- X86_CX = 0x0001;
- res = 1;
- break;
- case 0x5f35:
- /*
- * Boot Display Device Hook:
- * bit 0 = CRT
- * bit 1 = TV (eDP) *
- * bit 2 = EFP *
- * bit 3 = LFP
- * bit 4 = CRT2
- * bit 5 = TV2 (eDP) *
- * bit 6 = EFP2 *
- * bit 7 = LFP2
- */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 0x5f51:
- /*
- * Hook to select active LFP configuration:
- * 00h = No LVDS, VBIOS does not enable LVDS
- * 01h = Int-LVDS, LFP driven by integrated LVDS decoder
- * 02h = SVDO-LVDS, LFP driven by SVDO decoder
- * 03h = eDP, LFP Driven by Int-DisplayPort encoder
- */
- X86_AX = 0x005f;
- X86_CX = 0x0003;
- res = 1;
- break;
- case 0x5f70:
- switch ((X86_CX >> 8) & 0xff) {
- case 0:
- /* Get Mux */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 1:
- /* Set Mux */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 2:
- /* Get SG/Non-SG mode */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- default:
- /* Interrupt was not handled */
- printk(BIOS_DEBUG,
- "Unknown INT15 5f70 function: 0x%02x\n",
- ((X86_CX >> 8) & 0xff));
- break;
- }
- break;
-
- default:
- printk(BIOS_DEBUG, "Unknown INT15 function %04x!\n", X86_AX);
- break;
- }
- return res;
-}
-#endif
-
/* Audio Setup */
static void verb_setup(void)
@@ -187,10 +99,7 @@
{
dev->ops->init = mainboard_init;
dev->ops->get_smbios_data = mainboard_smbios_data;
-#if CONFIG_VGA_ROM_RUN
- /* Install custom int15 handler for VGA OPROM */
- mainboard_interrupt_handlers(0x15, &int15_handler);
-#endif
+ install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_EDP, GMA_INT15_PANEL_FIT_CENTERING, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
verb_setup();
}
diff --git a/src/mainboard/google/butterfly/Kconfig b/src/mainboard/google/butterfly/Kconfig
index dda4e7c2..08870fa 100644
--- a/src/mainboard/google/butterfly/Kconfig
+++ b/src/mainboard/google/butterfly/Kconfig
@@ -13,6 +13,7 @@
select HAVE_ACPI_RESUME
select HAVE_SMI_HANDLER
select MAINBOARD_HAS_CHROMEOS
+ select INTEL_INT15
# Workaround for EC/KBC IRQ1.
select SERIRQ_CONTINUOUS_MODE
diff --git a/src/mainboard/google/butterfly/mainboard.c b/src/mainboard/google/butterfly/mainboard.c
index 19e7926..909ba8c 100644
--- a/src/mainboard/google/butterfly/mainboard.c
+++ b/src/mainboard/google/butterfly/mainboard.c
@@ -24,9 +24,7 @@
#include <device/pci_def.h>
#include <device/pci_ops.h>
#include <console/console.h>
-#if CONFIG_VGA_ROM_RUN
-#include <x86emu/x86emu.h>
-#endif
+#include <drivers/intel/gma/int15.h>
#include <pc80/mc146818rtc.h>
#include <arch/acpi.h>
#include <arch/io.h>
@@ -196,91 +194,6 @@
outb(0xcb, 0xb2);
}
-#if CONFIG_VGA_ROM_RUN
-static int int15_handler(void)
-{
- int res = 0;
-
- printk(BIOS_DEBUG, "%s: INT15 function %04x!\n",
- __func__, X86_AX);
-
- switch (X86_AX) {
- case 0x5f34:
- /*
- * Set Panel Fitting Hook:
- * bit 2 = Graphics Stretching
- * bit 1 = Text Stretching
- * bit 0 = Centering (do not set with bit1 or bit2)
- * 0 = video bios default
- */
- X86_AX = 0x005f;
- X86_CL = 0x00; /* Use video bios default */
- res = 1;
- break;
- case 0x5f35:
- /*
- * Boot Display Device Hook:
- * bit 0 = CRT
- * bit 1 = TV (eDP)
- * bit 2 = EFP
- * bit 3 = LFP
- * bit 4 = CRT2
- * bit 5 = TV2 (eDP)
- * bit 6 = EFP2
- * bit 7 = LFP2
- */
- X86_AX = 0x005f;
- X86_CX = 0x0000; /* Use video bios default */
- res = 1;
- break;
- case 0x5f51:
- /*
- * Hook to select active LFP configuration:
- * 00h = No LVDS, VBIOS does not enable LVDS
- * 01h = Int-LVDS, LFP driven by integrated LVDS decoder
- * 02h = SVDO-LVDS, LFP driven by SVDO decoder
- * 03h = eDP, LFP Driven by Int-DisplayPort encoder
- */
- X86_AX = 0x005f;
- X86_CX = 0x0001; /* Int-LVDS */
- res = 1;
- break;
- case 0x5f70:
- switch (X86_CH) {
- case 0:
- /* Get Mux */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 1:
- /* Set Mux */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 2:
- /* Get SG/Non-SG mode */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- default:
- /* Interrupt was not handled */
- printk(BIOS_DEBUG, "Unknown INT15 5f70 function: 0x%02x\n",
- X86_CH);
- break;
- }
- break;
-
- default:
- printk(BIOS_DEBUG, "Unknown INT15 function %04x!\n", X86_AX);
- break;
- }
- return res;
-}
-#endif
-
/* Audio Setup */
static void verb_setup(void)
@@ -380,10 +293,7 @@
{
dev->ops->init = mainboard_init;
dev->ops->get_smbios_data = butterfly_onboard_smbios_data;
-#if CONFIG_VGA_ROM_RUN
- /* Install custom int15 handler for VGA OPROM */
- mainboard_interrupt_handlers(0x15, &int15_handler);
-#endif
+ install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
verb_setup();
}
diff --git a/src/mainboard/google/falco/Kconfig b/src/mainboard/google/falco/Kconfig
index 9a62efa..3323fc2 100644
--- a/src/mainboard/google/falco/Kconfig
+++ b/src/mainboard/google/falco/Kconfig
@@ -19,6 +19,7 @@
select EXTERNAL_MRC_BLOB
select MONOTONIC_TIMER_MSR
select MAINBOARD_HAS_NATIVE_VGA_INIT
+ select INTEL_INT15
config VBOOT_RAMSTAGE_INDEX
hex
diff --git a/src/mainboard/google/falco/mainboard.c b/src/mainboard/google/falco/mainboard.c
index 824b1ff..acb9750 100644
--- a/src/mainboard/google/falco/mainboard.c
+++ b/src/mainboard/google/falco/mainboard.c
@@ -26,9 +26,7 @@
#include <device/pci_def.h>
#include <device/pci_ops.h>
#include <console/console.h>
-#if CONFIG_VGA_ROM_RUN
-#include <x86emu/x86emu.h>
-#endif
+#include <drivers/intel/gma/int15.h>
#include <pc80/mc146818rtc.h>
#include <arch/acpi.h>
#include <arch/io.h>
@@ -46,92 +44,6 @@
outb(0xcb, 0xb2);
}
-#if CONFIG_VGA_ROM_RUN
-static int int15_handler(void)
-{
- int res = 0;
-
- printk(BIOS_DEBUG, "%s: AX=%04x BX=%04x CX=%04x DX=%04x\n",
- __func__, X86_AX, X86_BX, X86_CX, X86_DX);
-
- switch (X86_AX) {
- case 0x5f34:
- /*
- * Set Panel Fitting Hook:
- * bit 2 = Graphics Stretching
- * bit 1 = Text Stretching
- * bit 0 = Centering (do not set with bit1 or bit2)
- * 0 = video bios default
- */
- X86_AX = 0x005f;
- X86_CX = 0x0001;
- res = 1;
- break;
- case 0x5f35:
- /*
- * Boot Display Device Hook:
- * bit 0 = CRT
- * bit 1 = TV (eDP) *
- * bit 2 = EFP *
- * bit 3 = LFP
- * bit 4 = CRT2
- * bit 5 = TV2 (eDP) *
- * bit 6 = EFP2 *
- * bit 7 = LFP2
- */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 0x5f51:
- /*
- * Hook to select active LFP configuration:
- * 00h = No LVDS, VBIOS does not enable LVDS
- * 01h = Int-LVDS, LFP driven by integrated LVDS decoder
- * 02h = SVDO-LVDS, LFP driven by SVDO decoder
- * 03h = eDP, LFP Driven by Int-DisplayPort encoder
- */
- X86_AX = 0x005f;
- X86_CX = 0x0003;
- res = 1;
- break;
- case 0x5f70:
- switch ((X86_CX >> 8) & 0xff) {
- case 0:
- /* Get Mux */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 1:
- /* Set Mux */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 2:
- /* Get SG/Non-SG mode */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- default:
- /* Interrupt was not handled */
- printk(BIOS_DEBUG,
- "Unknown INT15 5f70 function: 0x%02x\n",
- ((X86_CX >> 8) & 0xff));
- break;
- }
- break;
-
- default:
- printk(BIOS_DEBUG, "Unknown INT15 function %04x!\n", X86_AX);
- break;
- }
- return res;
-}
-#endif
-
/* Audio Setup */
static void verb_setup(void)
@@ -190,10 +102,7 @@
{
dev->ops->init = mainboard_init;
dev->ops->get_smbios_data = mainboard_smbios_data;
-#if CONFIG_VGA_ROM_RUN
- /* Install custom int15 handler for VGA OPROM */
- mainboard_interrupt_handlers(0x15, &int15_handler);
-#endif
+ install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_EDP, GMA_INT15_PANEL_FIT_CENTERING, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
verb_setup();
}
diff --git a/src/mainboard/google/panther/Kconfig b/src/mainboard/google/panther/Kconfig
index db44396..e96746f 100644
--- a/src/mainboard/google/panther/Kconfig
+++ b/src/mainboard/google/panther/Kconfig
@@ -17,6 +17,7 @@
select MAINBOARD_HAS_CHROMEOS
select EXTERNAL_MRC_BLOB
select MONOTONIC_TIMER_MSR
+ select INTEL_INT15
config VBOOT_RAMSTAGE_INDEX
hex
diff --git a/src/mainboard/google/panther/mainboard.c b/src/mainboard/google/panther/mainboard.c
index e4fd95b..60baf99 100644
--- a/src/mainboard/google/panther/mainboard.c
+++ b/src/mainboard/google/panther/mainboard.c
@@ -32,8 +32,8 @@
#include <device/pci_ops.h>
#include <pc80/mc146818rtc.h>
#include <southbridge/intel/lynxpoint/pch.h>
-#include <x86emu/x86emu.h>
#include <device/azalia_device.h>
+#include <drivers/intel/gma/int15.h>
#include "hda_verb.h"
#include "onboard.h"
@@ -44,92 +44,6 @@
outb(0xcb, 0xb2);
}
-#if CONFIG_VGA_ROM_RUN
-static int int15_handler(void)
-{
- int res = 0;
-
- printk(BIOS_DEBUG, "%s: AX=%04x BX=%04x CX=%04x DX=%04x\n",
- __func__, X86_AX, X86_BX, X86_CX, X86_DX);
-
- switch (X86_AX) {
- case 0x5f34:
- /*
- * Set Panel Fitting Hook:
- * bit 2 = Graphics Stretching
- * bit 1 = Text Stretching
- * bit 0 = Centering (do not set with bit1 or bit2)
- * 0 = video bios default
- */
- X86_AX = 0x005f;
- X86_CX = 0x0001;
- res = 1;
- break;
- case 0x5f35:
- /*
- * Boot Display Device Hook:
- * bit 0 = CRT
- * bit 1 = TV (eDP) *
- * bit 2 = EFP *
- * bit 3 = LFP
- * bit 4 = CRT2
- * bit 5 = TV2 (eDP) *
- * bit 6 = EFP2 *
- * bit 7 = LFP2
- */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 0x5f51:
- /*
- * Hook to select active LFP configuration:
- * 00h = No LVDS, VBIOS does not enable LVDS
- * 01h = Int-LVDS, LFP driven by integrated LVDS decoder
- * 02h = SVDO-LVDS, LFP driven by SVDO decoder
- * 03h = eDP, LFP Driven by Int-DisplayPort encoder
- */
- X86_AX = 0x005f;
- X86_CX = 0x0003;
- res = 1;
- break;
- case 0x5f70:
- switch ((X86_CX >> 8) & 0xff) {
- case 0:
- /* Get Mux */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 1:
- /* Set Mux */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 2:
- /* Get SG/Non-SG mode */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- default:
- /* Interrupt was not handled */
- printk(BIOS_DEBUG,
- "Unknown INT15 5f70 function: 0x%02x\n",
- ((X86_CX >> 8) & 0xff));
- break;
- }
- break;
-
- default:
- printk(BIOS_DEBUG, "Unknown INT15 function %04x!\n", X86_AX);
- break;
- }
- return res;
-}
-#endif /* CONFIG_VGA_ROM_RUN */
-
/* Audio Setup */
static void verb_setup(void)
@@ -152,10 +66,7 @@
static void mainboard_enable(device_t dev)
{
dev->ops->init = mainboard_init;
-#if CONFIG_VGA_ROM_RUN
- /* Install custom int15 handler for VGA OPROM */
- mainboard_interrupt_handlers(0x15, &int15_handler);
-#endif
+ install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_EDP, GMA_INT15_PANEL_FIT_CENTERING, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
verb_setup();
}
diff --git a/src/mainboard/google/parrot/Kconfig b/src/mainboard/google/parrot/Kconfig
index cd7faa0..ad8c620 100644
--- a/src/mainboard/google/parrot/Kconfig
+++ b/src/mainboard/google/parrot/Kconfig
@@ -12,6 +12,7 @@
select HAVE_ACPI_RESUME
select HAVE_SMI_HANDLER
select MAINBOARD_HAS_CHROMEOS
+ select INTEL_INT15
# Workaround for EC/KBC IRQ1.
select SERIRQ_CONTINUOUS_MODE
diff --git a/src/mainboard/google/parrot/mainboard.c b/src/mainboard/google/parrot/mainboard.c
index 3e0c052..440596f 100644
--- a/src/mainboard/google/parrot/mainboard.c
+++ b/src/mainboard/google/parrot/mainboard.c
@@ -24,9 +24,7 @@
#include <device/pci_def.h>
#include <device/pci_ops.h>
#include <console/console.h>
-#if CONFIG_VGA_ROM_RUN
-#include <x86emu/x86emu.h>
-#endif
+#include <drivers/intel/gma/int15.h>
#include <pc80/mc146818rtc.h>
#include <arch/acpi.h>
#include <arch/io.h>
@@ -50,91 +48,6 @@
outb(0xe1, 0xb2);
}
-#if CONFIG_VGA_ROM_RUN
-static int int15_handler(void)
-{
- int res = 0;
-
- printk(BIOS_DEBUG, "%s: INT15 function %04x!\n",
- __func__, X86_AX);
-
- switch(X86_AX) {
- case 0x5f34:
- /*
- * Set Panel Fitting Hook:
- * bit 2 = Graphics Stretching
- * bit 1 = Text Stretching
- * bit 0 = Centering (do not set with bit1 or bit2)
- * 0 = video bios default
- */
- X86_AX = 0x005f;
- X86_CL = 0x00; /* Use video bios default */
- res = 1;
- break;
- case 0x5f35:
- /*
- * Boot Display Device Hook:
- * bit 0 = CRT
- * bit 1 = TV (eDP)
- * bit 2 = EFP
- * bit 3 = LFP
- * bit 4 = CRT2
- * bit 5 = TV2 (eDP)
- * bit 6 = EFP2
- * bit 7 = LFP2
- */
- X86_AX = 0x005f;
- X86_CX = 0x0000; /* Use video bios default */
- res = 1;
- break;
- case 0x5f51:
- /*
- * Hook to select active LFP configuration:
- * 00h = No LVDS, VBIOS does not enable LVDS
- * 01h = Int-LVDS, LFP driven by integrated LVDS decoder
- * 02h = SVDO-LVDS, LFP driven by SVDO decoder
- * 03h = eDP, LFP Driven by Int-DisplayPort encoder
- */
- X86_AX = 0x005f;
- X86_CX = 0x0003; /* eDP */
- res = 1;
- break;
- case 0x5f70:
- switch (X86_CH) {
- case 0:
- /* Get Mux */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 1:
- /* Set Mux */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 2:
- /* Get SG/Non-SG mode */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- default:
- /* Interrupt was not handled */
- printk(BIOS_DEBUG, "Unknown INT15 5f70 function: 0x%02x\n",
- X86_CH);
- break;
- }
- break;
-
- default:
- printk(BIOS_DEBUG, "Unknown INT15 function %04x!\n", X86_AX);
- break;
- }
- return res;
-}
-#endif
-
/* Audio Setup */
static void verb_setup(void)
@@ -187,10 +100,7 @@
{
dev->ops->init = mainboard_init;
dev->ops->get_smbios_data = parrot_onboard_smbios_data;
-#if CONFIG_VGA_ROM_RUN
- /* Install custom int15 handler for VGA OPROM */
- mainboard_interrupt_handlers(0x15, &int15_handler);
-#endif
+ install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_EDP, GMA_INT15_PANEL_FIT_DEFAULT, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
verb_setup();
}
diff --git a/src/mainboard/google/peppy/Kconfig b/src/mainboard/google/peppy/Kconfig
index 548cd17..2343b8d 100644
--- a/src/mainboard/google/peppy/Kconfig
+++ b/src/mainboard/google/peppy/Kconfig
@@ -21,6 +21,7 @@
select MAINBOARD_HAS_NATIVE_VGA_INIT
select INTEL_DP
select INTEL_DDI
+ select INTEL_INT15
config VBOOT_RAMSTAGE_INDEX
hex
diff --git a/src/mainboard/google/peppy/mainboard.c b/src/mainboard/google/peppy/mainboard.c
index ec3322a..3fbec40 100644
--- a/src/mainboard/google/peppy/mainboard.c
+++ b/src/mainboard/google/peppy/mainboard.c
@@ -26,9 +26,7 @@
#include <device/pci_def.h>
#include <device/pci_ops.h>
#include <console/console.h>
-#if CONFIG_VGA_ROM_RUN
-#include <x86emu/x86emu.h>
-#endif
+#include <drivers/intel/gma/int15.h>
#include <pc80/mc146818rtc.h>
#include <arch/acpi.h>
#include <arch/io.h>
@@ -46,92 +44,6 @@
outb(0xcb, 0xb2);
}
-#if CONFIG_VGA_ROM_RUN
-static int int15_handler(void)
-{
- int res = 0;
-
- printk(BIOS_DEBUG, "%s: AX=%04x BX=%04x CX=%04x DX=%04x\n",
- __func__, X86_AX, X86_BX, X86_CX, X86_DX);
-
- switch (X86_AX) {
- case 0x5f34:
- /*
- * Set Panel Fitting Hook:
- * bit 2 = Graphics Stretching
- * bit 1 = Text Stretching
- * bit 0 = Centering (do not set with bit1 or bit2)
- * 0 = video bios default
- */
- X86_AX = 0x005f;
- X86_CX = 0x0001;
- res = 1;
- break;
- case 0x5f35:
- /*
- * Boot Display Device Hook:
- * bit 0 = CRT
- * bit 1 = TV (eDP) *
- * bit 2 = EFP *
- * bit 3 = LFP
- * bit 4 = CRT2
- * bit 5 = TV2 (eDP) *
- * bit 6 = EFP2 *
- * bit 7 = LFP2
- */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 0x5f51:
- /*
- * Hook to select active LFP configuration:
- * 00h = No LVDS, VBIOS does not enable LVDS
- * 01h = Int-LVDS, LFP driven by integrated LVDS decoder
- * 02h = SVDO-LVDS, LFP driven by SVDO decoder
- * 03h = eDP, LFP Driven by Int-DisplayPort encoder
- */
- X86_AX = 0x005f;
- X86_CX = 0x0003;
- res = 1;
- break;
- case 0x5f70:
- switch ((X86_CX >> 8) & 0xff) {
- case 0:
- /* Get Mux */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 1:
- /* Set Mux */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 2:
- /* Get SG/Non-SG mode */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- default:
- /* Interrupt was not handled */
- printk(BIOS_DEBUG,
- "Unknown INT15 5f70 function: 0x%02x\n",
- ((X86_CX >> 8) & 0xff));
- break;
- }
- break;
-
- default:
- printk(BIOS_DEBUG, "Unknown INT15 function %04x!\n", X86_AX);
- break;
- }
- return res;
-}
-#endif
-
/* Audio Setup */
static void verb_setup(void)
@@ -190,10 +102,7 @@
{
dev->ops->init = mainboard_init;
dev->ops->get_smbios_data = mainboard_smbios_data;
-#if CONFIG_VGA_ROM_RUN
- /* Install custom int15 handler for VGA OPROM */
- mainboard_interrupt_handlers(0x15, &int15_handler);
-#endif
+ install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_EDP, GMA_INT15_PANEL_FIT_CENTERING, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
verb_setup();
}
diff --git a/src/mainboard/google/samus/Kconfig b/src/mainboard/google/samus/Kconfig
index 2483a56..c6cbd18 100644
--- a/src/mainboard/google/samus/Kconfig
+++ b/src/mainboard/google/samus/Kconfig
@@ -19,6 +19,7 @@
select EXTERNAL_MRC_BLOB
select MONOTONIC_TIMER_MSR
select MAINBOARD_HAS_NATIVE_VGA_INIT
+ select INTEL_INT15
config VBOOT_RAMSTAGE_INDEX
hex
diff --git a/src/mainboard/google/samus/mainboard.c b/src/mainboard/google/samus/mainboard.c
index 641d331..e595632 100644
--- a/src/mainboard/google/samus/mainboard.c
+++ b/src/mainboard/google/samus/mainboard.c
@@ -26,9 +26,7 @@
#include <device/pci_def.h>
#include <device/pci_ops.h>
#include <console/console.h>
-#if CONFIG_VGA_ROM_RUN
-#include <x86emu/x86emu.h>
-#endif
+#include <drivers/intel/gma/int15.h>
#include <pc80/mc146818rtc.h>
#include <arch/acpi.h>
#include <arch/io.h>
@@ -44,92 +42,6 @@
outb(0xcb, 0xb2);
}
-#if CONFIG_VGA_ROM_RUN
-static int int15_handler(void)
-{
- int res = 0;
-
- printk(BIOS_DEBUG, "%s: AX=%04x BX=%04x CX=%04x DX=%04x\n",
- __func__, X86_AX, X86_BX, X86_CX, X86_DX);
-
- switch (X86_AX) {
- case 0x5f34:
- /*
- * Set Panel Fitting Hook:
- * bit 2 = Graphics Stretching
- * bit 1 = Text Stretching
- * bit 0 = Centering (do not set with bit1 or bit2)
- * 0 = video bios default
- */
- X86_AX = 0x005f;
- X86_CX = 0x0001;
- res = 1;
- break;
- case 0x5f35:
- /*
- * Boot Display Device Hook:
- * bit 0 = CRT
- * bit 1 = TV (eDP) *
- * bit 2 = EFP *
- * bit 3 = LFP
- * bit 4 = CRT2
- * bit 5 = TV2 (eDP) *
- * bit 6 = EFP2 *
- * bit 7 = LFP2
- */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 0x5f51:
- /*
- * Hook to select active LFP configuration:
- * 00h = No LVDS, VBIOS does not enable LVDS
- * 01h = Int-LVDS, LFP driven by integrated LVDS decoder
- * 02h = SVDO-LVDS, LFP driven by SVDO decoder
- * 03h = eDP, LFP Driven by Int-DisplayPort encoder
- */
- X86_AX = 0x005f;
- X86_CX = 0x0003;
- res = 1;
- break;
- case 0x5f70:
- switch ((X86_CX >> 8) & 0xff) {
- case 0:
- /* Get Mux */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 1:
- /* Set Mux */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 2:
- /* Get SG/Non-SG mode */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- default:
- /* Interrupt was not handled */
- printk(BIOS_DEBUG,
- "Unknown INT15 5f70 function: 0x%02x\n",
- ((X86_CX >> 8) & 0xff));
- break;
- }
- break;
-
- default:
- printk(BIOS_DEBUG, "Unknown INT15 function %04x!\n", X86_AX);
- break;
- }
- return res;
-}
-#endif
-
static void mainboard_init(device_t dev)
{
mainboard_ec_init();
@@ -168,10 +80,7 @@
{
dev->ops->init = mainboard_init;
dev->ops->get_smbios_data = mainboard_smbios_data;
-#if CONFIG_VGA_ROM_RUN
- /* Install custom int15 handler for VGA OPROM */
- mainboard_interrupt_handlers(0x15, &int15_handler);
-#endif
+ install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_EDP, GMA_INT15_PANEL_FIT_CENTERING, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
}
struct chip_operations mainboard_ops = {
diff --git a/src/mainboard/google/slippy/Kconfig b/src/mainboard/google/slippy/Kconfig
index 2536eaf..341e5bf 100644
--- a/src/mainboard/google/slippy/Kconfig
+++ b/src/mainboard/google/slippy/Kconfig
@@ -22,6 +22,7 @@
select MAINBOARD_DO_NATIVE_VGA_INIT
select INTEL_DP
select INTEL_DDI
+ select INTEL_INT15
config VBOOT_RAMSTAGE_INDEX
hex
diff --git a/src/mainboard/google/slippy/mainboard.c b/src/mainboard/google/slippy/mainboard.c
index a0e6ffa..4ccb5f9 100644
--- a/src/mainboard/google/slippy/mainboard.c
+++ b/src/mainboard/google/slippy/mainboard.c
@@ -26,9 +26,7 @@
#include <device/pci_def.h>
#include <device/pci_ops.h>
#include <console/console.h>
-#if CONFIG_VGA_ROM_RUN
-#include <x86emu/x86emu.h>
-#endif
+#include <drivers/intel/gma/int15.h>
#include <pc80/mc146818rtc.h>
#include <arch/acpi.h>
#include <arch/io.h>
@@ -46,92 +44,6 @@
outb(0xcb, 0xb2);
}
-#if CONFIG_VGA_ROM_RUN
-static int int15_handler(void)
-{
- int res = 0;
-
- printk(BIOS_DEBUG, "%s: AX=%04x BX=%04x CX=%04x DX=%04x\n",
- __func__, X86_AX, X86_BX, X86_CX, X86_DX);
-
- switch (X86_AX) {
- case 0x5f34:
- /*
- * Set Panel Fitting Hook:
- * bit 2 = Graphics Stretching
- * bit 1 = Text Stretching
- * bit 0 = Centering (do not set with bit1 or bit2)
- * 0 = video bios default
- */
- X86_AX = 0x005f;
- X86_CX = 0x0001;
- res = 1;
- break;
- case 0x5f35:
- /*
- * Boot Display Device Hook:
- * bit 0 = CRT
- * bit 1 = TV (eDP) *
- * bit 2 = EFP *
- * bit 3 = LFP
- * bit 4 = CRT2
- * bit 5 = TV2 (eDP) *
- * bit 6 = EFP2 *
- * bit 7 = LFP2
- */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 0x5f51:
- /*
- * Hook to select active LFP configuration:
- * 00h = No LVDS, VBIOS does not enable LVDS
- * 01h = Int-LVDS, LFP driven by integrated LVDS decoder
- * 02h = SVDO-LVDS, LFP driven by SVDO decoder
- * 03h = eDP, LFP Driven by Int-DisplayPort encoder
- */
- X86_AX = 0x005f;
- X86_CX = 0x0003;
- res = 1;
- break;
- case 0x5f70:
- switch ((X86_CX >> 8) & 0xff) {
- case 0:
- /* Get Mux */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 1:
- /* Set Mux */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 2:
- /* Get SG/Non-SG mode */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- default:
- /* Interrupt was not handled */
- printk(BIOS_DEBUG,
- "Unknown INT15 5f70 function: 0x%02x\n",
- ((X86_CX >> 8) & 0xff));
- break;
- }
- break;
-
- default:
- printk(BIOS_DEBUG, "Unknown INT15 function %04x!\n", X86_AX);
- break;
- }
- return res;
-}
-#endif
-
/* Audio Setup */
static void verb_setup(void)
@@ -190,10 +102,7 @@
{
dev->ops->init = mainboard_init;
dev->ops->get_smbios_data = mainboard_smbios_data;
-#if CONFIG_VGA_ROM_RUN
- /* Install custom int15 handler for VGA OPROM */
- mainboard_interrupt_handlers(0x15, &int15_handler);
-#endif
+ install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_EDP, GMA_INT15_PANEL_FIT_CENTERING, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
verb_setup();
}
diff --git a/src/mainboard/google/stout/Kconfig b/src/mainboard/google/stout/Kconfig
index 79e3c9c..f127a9f 100644
--- a/src/mainboard/google/stout/Kconfig
+++ b/src/mainboard/google/stout/Kconfig
@@ -13,6 +13,7 @@
select HAVE_ACPI_RESUME
select HAVE_SMI_HANDLER
select MAINBOARD_HAS_CHROMEOS
+ select INTEL_INT15
config MAINBOARD_DIR
string
diff --git a/src/mainboard/google/stout/mainboard.c b/src/mainboard/google/stout/mainboard.c
index aaa78e9..7562b5f 100644
--- a/src/mainboard/google/stout/mainboard.c
+++ b/src/mainboard/google/stout/mainboard.c
@@ -24,9 +24,7 @@
#include <device/pci_def.h>
#include <device/pci_ops.h>
#include <console/console.h>
-#if CONFIG_VGA_ROM_RUN
-#include <x86emu/x86emu.h>
-#endif
+#include <drivers/intel/gma/int15.h>
#include <pc80/mc146818rtc.h>
#include <arch/acpi.h>
#include <arch/io.h>
@@ -50,91 +48,6 @@
ec_write_cmd(EC_CMD_NOTIFY_ACPI_ENTER);
}
-#if CONFIG_VGA_ROM_RUN
-static int int15_handler(void)
-{
- int res = 0;
-
- printk(BIOS_DEBUG, "%s: INT15 function %04x!\n",
- __func__, X86_AX);
-
- switch(X86_AX) {
- case 0x5f34:
- /*
- * Set Panel Fitting Hook:
- * bit 2 = Graphics Stretching
- * bit 1 = Text Stretching
- * bit 0 = Centering (do not set with bit1 or bit2)
- * 0 = video bios default
- */
- X86_AX = 0x005f;
- X86_CL = 0x00; /* Use video bios default */
- res = 1;
- break;
- case 0x5f35:
- /*
- * Boot Display Device Hook:
- * bit 0 = CRT
- * bit 1 = TV (eDP)
- * bit 2 = EFP
- * bit 3 = LFP
- * bit 4 = CRT2
- * bit 5 = TV2 (eDP)
- * bit 6 = EFP2
- * bit 7 = LFP2
- */
- X86_AX = 0x005f;
- X86_CX = 0x0000; /* Use video bios default */
- res = 1;
- break;
- case 0x5f51:
- /*
- * Hook to select active LFP configuration:
- * 00h = No LVDS, VBIOS does not enable LVDS
- * 01h = Int-LVDS, LFP driven by integrated LVDS decoder
- * 02h = SVDO-LVDS, LFP driven by SVDO decoder
- * 03h = eDP, LFP Driven by Int-DisplayPort encoder
- */
- X86_AX = 0x005f;
- X86_CX = 0x0001;
- res = 1;
- break;
- case 0x5f70:
- switch (X86_CH) {
- case 0:
- /* Get Mux */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 1:
- /* Set Mux */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 2:
- /* Get SG/Non-SG mode */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- default:
- /* Interrupt was not handled */
- printk(BIOS_DEBUG, "Unknown INT15 5f70 function: 0x%02x\n",
- X86_CH);
- break;
- }
- break;
-
- default:
- printk(BIOS_DEBUG, "Unknown INT15 function %04x!\n", X86_AX);
- break;
- }
- return res;
-}
-#endif
-
/* Audio Setup */
static void verb_setup(void)
@@ -170,10 +83,7 @@
static void mainboard_enable(device_t dev)
{
dev->ops->init = mainboard_init;
-#if CONFIG_VGA_ROM_RUN
- /* Install custom int15 handler for VGA OPROM */
- mainboard_interrupt_handlers(0x15, &int15_handler);
-#endif
+ install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
verb_setup();
}
diff --git a/src/mainboard/ibase/mb899/Kconfig b/src/mainboard/ibase/mb899/Kconfig
index 0c939ef..4f646ac 100644
--- a/src/mainboard/ibase/mb899/Kconfig
+++ b/src/mainboard/ibase/mb899/Kconfig
@@ -15,6 +15,7 @@
select HAVE_ACPI_RESUME
select BOARD_ROMSIZE_KB_512
select CHANNEL_XOR_RANDOMIZATION
+ select INTEL_INT15
config MAINBOARD_DIR
string
diff --git a/src/mainboard/ibase/mb899/mainboard.c b/src/mainboard/ibase/mb899/mainboard.c
index f78a118..6c80b42 100644
--- a/src/mainboard/ibase/mb899/mainboard.c
+++ b/src/mainboard/ibase/mb899/mainboard.c
@@ -20,51 +20,13 @@
#include <types.h>
#include <device/device.h>
#include <console/console.h>
-#if CONFIG_VGA_ROM_RUN
-#include <x86emu/x86emu.h>
-#endif
+#include <drivers/intel/gma/int15.h>
#include <pc80/mc146818rtc.h>
#include <arch/io.h>
#include <arch/interrupt.h>
#include <device/azalia_device.h>
#include "superio_hwm.h"
-#if CONFIG_VGA_ROM_RUN
-static int int15_handler(void)
-{
-#define BOOT_DISPLAY_DEFAULT 0
-#define BOOT_DISPLAY_CRT (1 << 0)
-#define BOOT_DISPLAY_TV (1 << 1)
-#define BOOT_DISPLAY_EFP (1 << 2)
-#define BOOT_DISPLAY_LCD (1 << 3)
-#define BOOT_DISPLAY_CRT2 (1 << 4)
-#define BOOT_DISPLAY_TV2 (1 << 5)
-#define BOOT_DISPLAY_EFP2 (1 << 6)
-#define BOOT_DISPLAY_LCD2 (1 << 7)
-
- printk(BIOS_DEBUG, "%s: AX=%04x BX=%04x CX=%04x DX=%04x\n",
- __func__, X86_AX, X86_BX, X86_CX, X86_DX);
-
- switch (X86_AX) {
- case 0x5f35: /* Boot Display */
- X86_AX = 0x005f; // Success
- X86_CL = BOOT_DISPLAY_DEFAULT;
- break;
- case 0x5f40: /* Boot Panel Type */
- // M.x86.R_AX = 0x015f; // Supported but failed
- X86_AX = 0x005f; // Success
- X86_CL = 3; // Display ID
- break;
- default:
- /* Interrupt was not handled */
- return 0;
- }
-
- /* Interrupt handled */
- return 1;
-}
-#endif
-
/* Audio Setup */
static void verb_setup(void)
@@ -79,10 +41,7 @@
static void mainboard_enable(device_t dev)
{
-#if CONFIG_VGA_ROM_RUN
- /* Install custom int15 handler for VGA OPROM */
- mainboard_interrupt_handlers(0x15, &int15_handler);
-#endif
+ install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, GMA_INT15_BOOT_DISPLAY_DEFAULT, 3);
verb_setup();
hwm_setup();
}
diff --git a/src/mainboard/intel/baskingridge/Kconfig b/src/mainboard/intel/baskingridge/Kconfig
index 8d32c5a..512591e 100644
--- a/src/mainboard/intel/baskingridge/Kconfig
+++ b/src/mainboard/intel/baskingridge/Kconfig
@@ -12,6 +12,7 @@
select HAVE_SMI_HANDLER
select MAINBOARD_HAS_CHROMEOS
select MONOTONIC_TIMER_MSR
+ select INTEL_INT15
config MAINBOARD_DIR
string
diff --git a/src/mainboard/intel/baskingridge/mainboard.c b/src/mainboard/intel/baskingridge/mainboard.c
index d1f5405..b4982f8 100644
--- a/src/mainboard/intel/baskingridge/mainboard.c
+++ b/src/mainboard/intel/baskingridge/mainboard.c
@@ -25,9 +25,7 @@
#include <device/pci_def.h>
#include <device/pci_ops.h>
#include <console/console.h>
-#if CONFIG_VGA_ROM_RUN
-#include <x86emu/x86emu.h>
-#endif
+#include <drivers/intel/gma/int15.h>
#include <pc80/mc146818rtc.h>
#include <arch/acpi.h>
#include <arch/io.h>
@@ -43,92 +41,6 @@
outb(0xcb, 0xb2);
}
-#if CONFIG_VGA_ROM_RUN
-static int int15_handler(void)
-{
- int res = 0;
-
- printk(BIOS_DEBUG, "%s: AX=%04x BX=%04x CX=%04x DX=%04x\n",
- __func__, X86_AX, X86_BX, X86_CX, X86_DX);
-
- switch (X86_AX) {
- case 0x5f34:
- /*
- * Set Panel Fitting Hook:
- * bit 2 = Graphics Stretching
- * bit 1 = Text Stretching
- * bit 0 = Centering (do not set with bit1 or bit2)
- * 0 = video bios default
- */
- X86_AX = 0x005f;
- X86_CX = 0x0001;
- res = 1;
- break;
- case 0x5f35:
- /*
- * Boot Display Device Hook:
- * bit 0 = CRT
- * bit 1 = TV (eDP) *
- * bit 2 = EFP *
- * bit 3 = LFP
- * bit 4 = CRT2
- * bit 5 = TV2 (eDP) *
- * bit 6 = EFP2 *
- * bit 7 = LFP2
- */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 0x5f51:
- /*
- * Hook to select active LFP configuration:
- * 00h = No LVDS, VBIOS does not enable LVDS
- * 01h = Int-LVDS, LFP driven by integrated LVDS decoder
- * 02h = SVDO-LVDS, LFP driven by SVDO decoder
- * 03h = eDP, LFP Driven by Int-DisplayPort encoder
- */
- X86_AX = 0x005f;
- X86_CX = 0x0003;
- res = 1;
- break;
- case 0x5f70:
- switch ((X86_CX >> 8) & 0xff) {
- case 0:
- /* Get Mux */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 1:
- /* Set Mux */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 2:
- /* Get SG/Non-SG mode */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- default:
- /* Interrupt was not handled */
- printk(BIOS_DEBUG,
- "Unknown INT15 5f70 function: 0x%02x\n",
- ((X86_CX >> 8) & 0xff));
- break;
- }
- break;
-
- default:
- printk(BIOS_DEBUG, "Unknown INT15 function %04x!\n", X86_AX);
- break;
- }
- return res;
-}
-#endif
-
/* Audio Setup */
static void verb_setup(void)
@@ -142,10 +54,7 @@
static void mainboard_enable(device_t dev)
{
-#if CONFIG_VGA_ROM_RUN
- /* Install custom int15 handler for VGA OPROM */
- mainboard_interrupt_handlers(0x15, &int15_handler);
-#endif
+ install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_EDP, GMA_INT15_PANEL_FIT_CENTERING, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
verb_setup();
}
diff --git a/src/mainboard/intel/cougar_canyon2/Kconfig b/src/mainboard/intel/cougar_canyon2/Kconfig
index 389a13c..3b25161 100644
--- a/src/mainboard/intel/cougar_canyon2/Kconfig
+++ b/src/mainboard/intel/cougar_canyon2/Kconfig
@@ -13,6 +13,7 @@
select ENABLE_VMX
select EARLY_CBMEM_INIT
select BROKEN_CAR_MIGRATE
+ select INTEL_INT15
select VGA
config MAINBOARD_DIR
diff --git a/src/mainboard/intel/cougar_canyon2/mainboard.c b/src/mainboard/intel/cougar_canyon2/mainboard.c
index e9277d0..bb4806a 100644
--- a/src/mainboard/intel/cougar_canyon2/mainboard.c
+++ b/src/mainboard/intel/cougar_canyon2/mainboard.c
@@ -25,7 +25,7 @@
#include <device/pci_def.h>
#include <device/pci_ops.h>
#include <console/console.h>
-#include <x86emu/x86emu.h>
+#include <drivers/intel/gma/int15.h>
#include <pc80/mc146818rtc.h>
#include <arch/acpi.h>
#include <arch/io.h>
@@ -43,104 +43,6 @@
}
#endif
-#if CONFIG_VGA_ROM_RUN
-static int int15_handler(void)
-{
- int res=0;
-
- printk(BIOS_DEBUG, "%s: AX=%04x BX=%04x CX=%04x DX=%04x\n",
- __func__, X86_AX, X86_BX, X86_CX, X86_DX);
-
- switch(X86_EAX & 0xffff) {
- case 0x5f34:
- /*
- * Set Panel Fitting Hook:
- * bit 2 = Graphics Stretching
- * bit 1 = Text Stretching
- * bit 0 = Centering (do not set with bit1 or bit2)
- * 0 = video bios default
- */
- X86_EAX &= 0xffff0000;
- X86_EAX |= 0x005f;
- X86_ECX &= 0xffffff00;
- X86_ECX |= 0x01;
- res = 1;
- break;
- case 0x5f35:
- /*
- * Boot Display Device Hook:
- * bit 0 = CRT
- * bit 1 = TV (eDP) *
- * bit 2 = EFP *
- * bit 3 = LFP
- * bit 4 = CRT2
- * bit 5 = TV2 (eDP) *
- * bit 6 = EFP2 *
- * bit 7 = LFP2
- */
- X86_EAX &= 0xffff0000;
- X86_EAX |= 0x005f;
- X86_ECX &= 0xffff0000;
- X86_ECX |= 0x0000;
- res = 1;
- break;
- case 0x5f51:
- /*
- * Hook to select active LFP configuration:
- * 00h = No LVDS, VBIOS does not enable LVDS
- * 01h = Int-LVDS, LFP driven by integrated LVDS decoder
- * 02h = SVDO-LVDS, LFP driven by SVDO decoder
- * 03h = eDP, LFP Driven by Int-DisplayPort encoder
- */
- X86_EAX &= 0xffff0000;
- X86_EAX |= 0x005f;
- X86_ECX &= 0xffff0000;
- X86_ECX |= 0x0003;
- res = 1;
- break;
- case 0x5f70:
- switch ((X86_ECX >> 8) & 0xff) {
- case 0:
- /* Get Mux */
- X86_EAX &= 0xffff0000;
- X86_EAX |= 0x005f;
- X86_ECX &= 0xffff0000;
- X86_ECX |= 0x0000;
- res = 1;
- break;
- case 1:
- /* Set Mux */
- X86_EAX &= 0xffff0000;
- X86_EAX |= 0x005f;
- X86_ECX &= 0xffff0000;
- X86_ECX |= 0x0000;
- res = 1;
- break;
- case 2:
- /* Get SG/Non-SG mode */
- X86_EAX &= 0xffff0000;
- X86_EAX |= 0x005f;
- X86_ECX &= 0xffff0000;
- X86_ECX |= 0x0000;
- res = 1;
- break;
- default:
- /* FIXME: Interrupt was not handled, but return success? */
- printk(BIOS_DEBUG, "Unknown INT15 5f70 function: 0x%02x\n",
- ((X86_ECX >> 8) & 0xff));
- return 1;
- }
- break;
-
- default:
- printk(BIOS_DEBUG, "Unknown INT15 function %04x!\n",
- X86_EAX & 0xffff);
- break;
- }
- return res;
-}
-#endif
-
/* Audio Setup */
static void verb_setup(void)
@@ -154,10 +56,7 @@
static void mainboard_enable(device_t dev)
{
-#if CONFIG_PCI_OPTION_ROM_RUN_YABEL || CONFIG_PCI_OPTION_ROM_RUN_REALMODE
- /* Install custom int15 handler for VGA OPROM */
- mainboard_interrupt_handlers(0x15, &int15_handler);
-#endif
+ install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_EDP, GMA_INT15_PANEL_FIT_CENTERING, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
verb_setup();
}
diff --git a/src/mainboard/intel/emeraldlake2/Kconfig b/src/mainboard/intel/emeraldlake2/Kconfig
index d6928f4..dc04631 100644
--- a/src/mainboard/intel/emeraldlake2/Kconfig
+++ b/src/mainboard/intel/emeraldlake2/Kconfig
@@ -10,6 +10,7 @@
select HAVE_ACPI_TABLES
select HAVE_OPTION_TABLE
select HAVE_ACPI_RESUME
+ select INTEL_INT15
#select MAINBOARD_HAS_CHROMEOS
config MAINBOARD_DIR
diff --git a/src/mainboard/intel/emeraldlake2/mainboard.c b/src/mainboard/intel/emeraldlake2/mainboard.c
index fc948cb..3dc8594 100644
--- a/src/mainboard/intel/emeraldlake2/mainboard.c
+++ b/src/mainboard/intel/emeraldlake2/mainboard.c
@@ -25,9 +25,7 @@
#include <device/pci_def.h>
#include <device/pci_ops.h>
#include <console/console.h>
-#if CONFIG_VGA_ROM_RUN
-#include <x86emu/x86emu.h>
-#endif
+#include <drivers/intel/gma/int15.h>
#include <pc80/mc146818rtc.h>
#include <arch/acpi.h>
#include <arch/io.h>
@@ -43,104 +41,6 @@
outb(0xcb, 0xb2);
}
-#if CONFIG_VGA_ROM_RUN
-static int int15_handler(void)
-{
- int res=0;
-
- printk(BIOS_DEBUG, "%s: AX=%04x BX=%04x CX=%04x DX=%04x\n",
- __func__, X86_AX, X86_BX, X86_CX, X86_DX);
-
- switch(X86_EAX & 0xffff) {
- case 0x5f34:
- /*
- * Set Panel Fitting Hook:
- * bit 2 = Graphics Stretching
- * bit 1 = Text Stretching
- * bit 0 = Centering (do not set with bit1 or bit2)
- * 0 = video bios default
- */
- X86_EAX &= 0xffff0000;
- X86_EAX |= 0x005f;
- X86_ECX &= 0xffffff00;
- X86_ECX |= 0x01;
- res = 1;
- break;
- case 0x5f35:
- /*
- * Boot Display Device Hook:
- * bit 0 = CRT
- * bit 1 = TV (eDP) *
- * bit 2 = EFP *
- * bit 3 = LFP
- * bit 4 = CRT2
- * bit 5 = TV2 (eDP) *
- * bit 6 = EFP2 *
- * bit 7 = LFP2
- */
- X86_EAX &= 0xffff0000;
- X86_EAX |= 0x005f;
- X86_ECX &= 0xffff0000;
- X86_ECX |= 0x0000;
- res = 1;
- break;
- case 0x5f51:
- /*
- * Hook to select active LFP configuration:
- * 00h = No LVDS, VBIOS does not enable LVDS
- * 01h = Int-LVDS, LFP driven by integrated LVDS decoder
- * 02h = SVDO-LVDS, LFP driven by SVDO decoder
- * 03h = eDP, LFP Driven by Int-DisplayPort encoder
- */
- X86_EAX &= 0xffff0000;
- X86_EAX |= 0x005f;
- X86_ECX &= 0xffff0000;
- X86_ECX |= 0x0003;
- res = 1;
- break;
- case 0x5f70:
- switch ((X86_ECX >> 8) & 0xff) {
- case 0:
- /* Get Mux */
- X86_EAX &= 0xffff0000;
- X86_EAX |= 0x005f;
- X86_ECX &= 0xffff0000;
- X86_ECX |= 0x0000;
- res = 1;
- break;
- case 1:
- /* Set Mux */
- X86_EAX &= 0xffff0000;
- X86_EAX |= 0x005f;
- X86_ECX &= 0xffff0000;
- X86_ECX |= 0x0000;
- res = 1;
- break;
- case 2:
- /* Get SG/Non-SG mode */
- X86_EAX &= 0xffff0000;
- X86_EAX |= 0x005f;
- X86_ECX &= 0xffff0000;
- X86_ECX |= 0x0000;
- res = 1;
- break;
- default:
- /* FIXME: Interrupt was not handled, but return success? */
- printk(BIOS_DEBUG, "Unknown INT15 5f70 function: 0x%02x\n",
- ((X86_ECX >> 8) & 0xff));
- return 1;
- }
- break;
-
- default:
- printk(BIOS_DEBUG, "Unknown INT15 function %04x!\n",
- X86_EAX & 0xffff);
- break;
- }
- return res;
-}
-#endif
-
/* Audio Setup */
static void verb_setup(void)
@@ -154,10 +54,7 @@
static void mainboard_enable(device_t dev)
{
-#if CONFIG_VGA_ROM_RUN
- /* Install custom int15 handler for VGA OPROM */
- mainboard_interrupt_handlers(0x15, &int15_handler);
-#endif
+ install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_EDP, GMA_INT15_PANEL_FIT_CENTERING, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
verb_setup();
}
diff --git a/src/mainboard/intel/wtm2/Kconfig b/src/mainboard/intel/wtm2/Kconfig
index 9dfed49..353279a 100644
--- a/src/mainboard/intel/wtm2/Kconfig
+++ b/src/mainboard/intel/wtm2/Kconfig
@@ -14,6 +14,7 @@
select MAINBOARD_HAS_CHROMEOS
select MAINBOARD_HAS_NATIVE_VGA_INIT
select MONOTONIC_TIMER_MSR
+ select INTEL_INT15
config MAINBOARD_DIR
string
diff --git a/src/mainboard/intel/wtm2/mainboard.c b/src/mainboard/intel/wtm2/mainboard.c
index cd61a4a..b4982f8 100644
--- a/src/mainboard/intel/wtm2/mainboard.c
+++ b/src/mainboard/intel/wtm2/mainboard.c
@@ -25,9 +25,7 @@
#include <device/pci_def.h>
#include <device/pci_ops.h>
#include <console/console.h>
-#if CONFIG_VGA_ROM_RUN
-#include <x86emu/x86emu.h>
-#endif
+#include <drivers/intel/gma/int15.h>
#include <pc80/mc146818rtc.h>
#include <arch/acpi.h>
#include <arch/io.h>
@@ -43,92 +41,6 @@
outb(0xcb, 0xb2);
}
-#if CONFIG_VGA_ROM_RUN
-static int int15_handler(void)
-{
- int res = 1;
-
- printk(BIOS_DEBUG, "%s: AX=%04x BX=%04x CX=%04x DX=%04x\n",
- __func__, X86_AX, X86_BX, X86_CX, X86_DX);
-
- switch (X86_AX) {
- case 0x5f34:
- /*
- * Set Panel Fitting Hook:
- * bit 2 = Graphics Stretching
- * bit 1 = Text Stretching
- * bit 0 = Centering (do not set with bit1 or bit2)
- * 0 = video bios default
- */
- X86_AX = 0x005f;
- X86_CX = 0x0001;
- res = 1;
- break;
- case 0x5f35:
- /*
- * Boot Display Device Hook:
- * bit 0 = CRT
- * bit 1 = TV (eDP) *
- * bit 2 = EFP *
- * bit 3 = LFP
- * bit 4 = CRT2
- * bit 5 = TV2 (eDP) *
- * bit 6 = EFP2 *
- * bit 7 = LFP2
- */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 0x5f51:
- /*
- * Hook to select active LFP configuration:
- * 00h = No LVDS, VBIOS does not enable LVDS
- * 01h = Int-LVDS, LFP driven by integrated LVDS decoder
- * 02h = SVDO-LVDS, LFP driven by SVDO decoder
- * 03h = eDP, LFP Driven by Int-DisplayPort encoder
- */
- X86_AX = 0x005f;
- X86_CX = 0x0003;
- res = 1;
- break;
- case 0x5f70:
- switch ((X86_CX >> 8) & 0xff) {
- case 0:
- /* Get Mux */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 1:
- /* Set Mux */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 2:
- /* Get SG/Non-SG mode */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- default:
- /* Interrupt was not handled */
- printk(BIOS_DEBUG,
- "Unknown INT15 5f70 function: 0x%02x\n",
- ((X86_CX >> 8) & 0xff));
- break;
- }
- break;
-
- default:
- printk(BIOS_DEBUG, "Unknown INT15 function %04x!\n", X86_AX);
- break;
- }
- return res;
-}
-#endif
-
/* Audio Setup */
static void verb_setup(void)
@@ -142,10 +54,7 @@
static void mainboard_enable(device_t dev)
{
-#if CONFIG_VGA_ROM_RUN
- /* Install custom int15 handler for VGA OPROM */
- mainboard_interrupt_handlers(0x15, &int15_handler);
-#endif
+ install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_EDP, GMA_INT15_PANEL_FIT_CENTERING, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
verb_setup();
}
diff --git a/src/mainboard/kontron/986lcd-m/Kconfig b/src/mainboard/kontron/986lcd-m/Kconfig
index 6d880e5..2a3cfe2 100644
--- a/src/mainboard/kontron/986lcd-m/Kconfig
+++ b/src/mainboard/kontron/986lcd-m/Kconfig
@@ -15,6 +15,7 @@
select HAVE_ACPI_RESUME
select BOARD_ROMSIZE_KB_1024
select CHANNEL_XOR_RANDOMIZATION
+ select INTEL_INT15
select OVERRIDE_CLOCK_DISABLE
config MAINBOARD_DIR
diff --git a/src/mainboard/kontron/986lcd-m/mainboard.c b/src/mainboard/kontron/986lcd-m/mainboard.c
index 346546a..10bba69af 100644
--- a/src/mainboard/kontron/986lcd-m/mainboard.c
+++ b/src/mainboard/kontron/986lcd-m/mainboard.c
@@ -20,57 +20,12 @@
#include <types.h>
#include <device/device.h>
#include <console/console.h>
-#if CONFIG_VGA_ROM_RUN
-#include <x86emu/x86emu.h>
-#endif
+#include <drivers/intel/gma/int15.h>
#include <pc80/mc146818rtc.h>
#include <arch/io.h>
#include <arch/interrupt.h>
#include <device/azalia_device.h>
-#define BOOT_DISPLAY_DEFAULT 0
-#define BOOT_DISPLAY_CRT (1 << 0)
-#define BOOT_DISPLAY_TV (1 << 1)
-#define BOOT_DISPLAY_EFP (1 << 2)
-#define BOOT_DISPLAY_LCD (1 << 3)
-#define BOOT_DISPLAY_CRT2 (1 << 4)
-#define BOOT_DISPLAY_TV2 (1 << 5)
-#define BOOT_DISPLAY_EFP2 (1 << 6)
-#define BOOT_DISPLAY_LCD2 (1 << 7)
-
-#if CONFIG_VGA_ROM_RUN
-static int int15_handler(void)
-{
- /* This int15 handler is Intel IGD. specific. Other chipsets need other
- * handlers. The right way to do this is to move this handler code into
- * the mainboard or northbridge code.
- * TODO: completely move to mainboards / chipsets.
- */
- printk(BIOS_DEBUG, "%s: AX=%04x BX=%04x CX=%04x DX=%04x\n",
- __func__, X86_AX, X86_BX, X86_CX, X86_DX);
-
- switch (X86_AX) {
- case 0x5f35: /* Boot Display */
- X86_AX = 0x005f; // Success
- X86_CL = BOOT_DISPLAY_CRT;
- break;
- case 0x5f40: /* Boot Panel Type */
- // X86_AX = 0x015f; // Supported but failed
- X86_AX = 0x005f; // Success
- X86_CL = 3; // Display ID
- printk(BIOS_DEBUG, "DISPLAY=%x\n", X86_CL);
- break;
- default:
- /* Interrupt was not handled */
- printk(BIOS_DEBUG, "Unknown INT15 function %04x!\n", X86_AX);
- return 0;
- }
-
- /* Interrupt handled */
- return 1;
-}
-#endif
-
/* Hardware Monitor */
static u16 hwm_base = 0xa00;
@@ -219,10 +174,7 @@
static void mainboard_enable(device_t dev)
{
-#if CONFIG_VGA_ROM_RUN
- /* Install custom int15 handler for VGA OPROM */
- mainboard_interrupt_handlers(0x15, &int15_handler);
-#endif
+ install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, GMA_INT15_BOOT_DISPLAY_DEFAULT, 3);
verb_setup();
hwm_setup();
}
diff --git a/src/mainboard/lenovo/t520/Kconfig b/src/mainboard/lenovo/t520/Kconfig
index b6c9e05..aa4f0a4 100644
--- a/src/mainboard/lenovo/t520/Kconfig
+++ b/src/mainboard/lenovo/t520/Kconfig
@@ -13,6 +13,7 @@
select HAVE_CMOS_DEFAULT
select HAVE_ACPI_RESUME
select HAVE_SMI_HANDLER
+ select INTEL_INT15
# Workaround for EC/KBC IRQ1.
select SERIRQ_CONTINUOUS_MODE
diff --git a/src/mainboard/lenovo/t520/mainboard.c b/src/mainboard/lenovo/t520/mainboard.c
index a93ba70..afa0ecf 100644
--- a/src/mainboard/lenovo/t520/mainboard.c
+++ b/src/mainboard/lenovo/t520/mainboard.c
@@ -25,9 +25,7 @@
#include <device/pci_def.h>
#include <device/pci_ops.h>
#include <console/console.h>
-#if CONFIG_VGA_ROM_RUN
-#include <x86emu/x86emu.h>
-#endif
+#include <drivers/intel/gma/int15.h>
#include <pc80/mc146818rtc.h>
#include <arch/acpi.h>
#include <arch/io.h>
@@ -48,91 +46,6 @@
outb(0xcb, 0xb2);
}
-#if CONFIG_VGA_ROM_RUN
-static int int15_handler(void)
-{
- int res = 0;
-
- printk(BIOS_DEBUG, "%s: INT15 function %04x!\n",
- __func__, X86_AX);
-
- switch (X86_AX) {
- case 0x5f34:
- /*
- * Set Panel Fitting Hook:
- * bit 2 = Graphics Stretching
- * bit 1 = Text Stretching
- * bit 0 = Centering (do not set with bit1 or bit2)
- * 0 = video bios default
- */
- X86_AX = 0x005f;
- X86_CL = 0x00; /* Use video bios default */
- res = 1;
- break;
- case 0x5f35:
- /*
- * Boot Display Device Hook:
- * bit 0 = CRT
- * bit 1 = TV (eDP)
- * bit 2 = EFP
- * bit 3 = LFP
- * bit 4 = CRT2
- * bit 5 = TV2 (eDP)
- * bit 6 = EFP2
- * bit 7 = LFP2
- */
- X86_AX = 0x005f;
- X86_CX = 0x0000; /* Use video bios default */
- res = 1;
- break;
- case 0x5f51:
- /*
- * Hook to select active LFP configuration:
- * 00h = No LVDS, VBIOS does not enable LVDS
- * 01h = Int-LVDS, LFP driven by integrated LVDS decoder
- * 02h = SVDO-LVDS, LFP driven by SVDO decoder
- * 03h = eDP, LFP Driven by Int-DisplayPort encoder
- */
- X86_AX = 0x005f;
- X86_CX = 0x0001; /* Int-LVDS */
- res = 1;
- break;
- case 0x5f70:
- switch (X86_CH) {
- case 0:
- /* Get Mux */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 1:
- /* Set Mux */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 2:
- /* Get SG/Non-SG mode */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- default:
- /* Interrupt was not handled */
- printk(BIOS_DEBUG, "Unknown INT15 5f70 function: 0x%02x\n",
- X86_CH);
- break;
- }
- break;
-
- default:
- printk(BIOS_DEBUG, "Unknown INT15 function %04x!\n", X86_AX);
- break;
- }
- return res;
-}
-#endif
-
/* Audio Setup */
static void verb_setup(void)
@@ -166,10 +79,7 @@
static void mainboard_enable(device_t dev)
{
dev->ops->init = mainboard_init;
-#if CONFIG_VGA_ROM_RUN
- /* Install custom int15 handler for VGA OPROM */
- mainboard_interrupt_handlers(0x15, &int15_handler);
-#endif
+ install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
verb_setup();
}
diff --git a/src/mainboard/lenovo/t530/Kconfig b/src/mainboard/lenovo/t530/Kconfig
index a850e11..1a68a6f 100644
--- a/src/mainboard/lenovo/t530/Kconfig
+++ b/src/mainboard/lenovo/t530/Kconfig
@@ -13,6 +13,7 @@
select HAVE_CMOS_DEFAULT
select HAVE_ACPI_RESUME
select HAVE_SMI_HANDLER
+ select INTEL_INT15
# Workaround for EC/KBC IRQ1.
select SERIRQ_CONTINUOUS_MODE
diff --git a/src/mainboard/lenovo/t530/mainboard.c b/src/mainboard/lenovo/t530/mainboard.c
index e529d45..e21dc98 100644
--- a/src/mainboard/lenovo/t530/mainboard.c
+++ b/src/mainboard/lenovo/t530/mainboard.c
@@ -25,9 +25,7 @@
#include <device/pci_def.h>
#include <device/pci_ops.h>
#include <console/console.h>
-#if CONFIG_VGA_ROM_RUN
-#include <x86emu/x86emu.h>
-#endif
+#include <drivers/intel/gma/int15.h>
#include <pc80/mc146818rtc.h>
#include <arch/acpi.h>
#include <arch/io.h>
@@ -48,91 +46,6 @@
outb(0xcb, 0xb2);
}
-#if CONFIG_VGA_ROM_RUN
-static int int15_handler(void)
-{
- int res = 0;
-
- printk(BIOS_DEBUG, "%s: INT15 function %04x!\n",
- __func__, X86_AX);
-
- switch (X86_AX) {
- case 0x5f34:
- /*
- * Set Panel Fitting Hook:
- * bit 2 = Graphics Stretching
- * bit 1 = Text Stretching
- * bit 0 = Centering (do not set with bit1 or bit2)
- * 0 = video bios default
- */
- X86_AX = 0x005f;
- X86_CL = 0x00; /* Use video bios default */
- res = 1;
- break;
- case 0x5f35:
- /*
- * Boot Display Device Hook:
- * bit 0 = CRT
- * bit 1 = TV (eDP)
- * bit 2 = EFP
- * bit 3 = LFP
- * bit 4 = CRT2
- * bit 5 = TV2 (eDP)
- * bit 6 = EFP2
- * bit 7 = LFP2
- */
- X86_AX = 0x005f;
- X86_CX = 0x0000; /* Use video bios default */
- res = 1;
- break;
- case 0x5f51:
- /*
- * Hook to select active LFP configuration:
- * 00h = No LVDS, VBIOS does not enable LVDS
- * 01h = Int-LVDS, LFP driven by integrated LVDS decoder
- * 02h = SVDO-LVDS, LFP driven by SVDO decoder
- * 03h = eDP, LFP Driven by Int-DisplayPort encoder
- */
- X86_AX = 0x005f;
- X86_CX = 0x0001; /* Int-LVDS */
- res = 1;
- break;
- case 0x5f70:
- switch (X86_CH) {
- case 0:
- /* Get Mux */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 1:
- /* Set Mux */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 2:
- /* Get SG/Non-SG mode */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- default:
- /* Interrupt was not handled */
- printk(BIOS_DEBUG, "Unknown INT15 5f70 function: 0x%02x\n",
- X86_CH);
- break;
- }
- break;
-
- default:
- printk(BIOS_DEBUG, "Unknown INT15 function %04x!\n", X86_AX);
- break;
- }
- return res;
-}
-#endif
-
/* Audio Setup */
static void verb_setup(void)
@@ -171,10 +84,7 @@
{
dev->ops->init = mainboard_init;
-#if CONFIG_VGA_ROM_RUN
- /* Install custom int15 handler for VGA OPROM */
- mainboard_interrupt_handlers(0x15, &int15_handler);
-#endif
+ install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
verb_setup();
}
diff --git a/src/mainboard/lenovo/t60/Kconfig b/src/mainboard/lenovo/t60/Kconfig
index a42699d6..c868e22 100644
--- a/src/mainboard/lenovo/t60/Kconfig
+++ b/src/mainboard/lenovo/t60/Kconfig
@@ -13,6 +13,7 @@
select EC_LENOVO_H8
select DRIVERS_ICS_954309
select HAVE_OPTION_TABLE
+ select INTEL_INT15
select HAVE_PIRQ_TABLE
select HAVE_MP_TABLE
select BOARD_ROMSIZE_KB_2048
diff --git a/src/mainboard/lenovo/t60/mainboard.c b/src/mainboard/lenovo/t60/mainboard.c
index 9c6a30a..79b3da8 100644
--- a/src/mainboard/lenovo/t60/mainboard.c
+++ b/src/mainboard/lenovo/t60/mainboard.c
@@ -37,7 +37,7 @@
#include <arch/interrupt.h>
#include <smbios.h>
#include <build.h>
-#include <x86emu/x86emu.h>
+#include <drivers/intel/gma/int15.h>
#define PANEL INT15_5F35_CL_DISPLAY_DEFAULT
static acpi_cstate_t cst_entries[] = {
@@ -46,37 +46,6 @@
{ 2, 17, 250, { 0x01, 8, 0, { 0 }, DEFAULT_PMBASE + LV3, 0 } },
};
-#if CONFIG_PCI_OPTION_ROM_RUN_YABEL || CONFIG_PCI_OPTION_ROM_RUN_REALMODE
-static int int15_handler(void)
-{
- /* The right way to do this is to move this handler code into
- * the mainboard or northbridge code.
- * TODO: completely move to mainboards / chipsets.
- */
- printk(BIOS_DEBUG, "%s: AX=%04x BX=%04x CX=%04x DX=%04x\n",
- __func__, X86_AX, X86_BX, X86_CX, X86_DX);
-
- switch (X86_AX) {
- case 0x5f35: /* Boot Display */
- X86_AX = 0x005f; // Success
- X86_CL = PANEL;
- break;
- case 0x5f40: /* Boot Panel Type */
- X86_AX = 0x005f; // Success
- X86_CL = 3;
- printk(BIOS_DEBUG, "DISPLAY=%x\n", X86_CL);
- break;
- default:
- /* Interrupt was not handled */
- printk(BIOS_DEBUG, "Unknown INT15 function %04x!\n", X86_AX);
- return 0;
- }
-
- /* Interrupt handled */
- return 1;
-}
-#endif
-
int get_cst_entries(acpi_cstate_t **entries)
{
*entries = cst_entries;
@@ -97,10 +66,7 @@
struct southbridge_intel_i82801gx_config *config;
device_t dev0, idedev;
-#if CONFIG_PCI_OPTION_ROM_RUN_YABEL || CONFIG_PCI_OPTION_ROM_RUN_REALMODE
- /* Install custom int15 handler for VGA OPROM */
- mainboard_interrupt_handlers(0x15, &int15_handler);
-#endif
+ install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, PANEL, 3);
/* If we're resuming from suspend, blink suspend LED */
dev0 = dev_find_slot(0, PCI_DEVFN(0,0));
diff --git a/src/mainboard/lenovo/x200/Kconfig b/src/mainboard/lenovo/x200/Kconfig
index 5f7f87a..73ed75f 100644
--- a/src/mainboard/lenovo/x200/Kconfig
+++ b/src/mainboard/lenovo/x200/Kconfig
@@ -19,6 +19,7 @@
select HAVE_ACPI_RESUME
select MAINBOARD_HAS_NATIVE_VGA_INIT
select MAINBOARD_HAS_NATIVE_VGA_INIT_TEXTMODECFG
+ select INTEL_INT15
config MAINBOARD_DIR
string
diff --git a/src/mainboard/lenovo/x200/mainboard.c b/src/mainboard/lenovo/x200/mainboard.c
index c83ad70..6c13eed 100644
--- a/src/mainboard/lenovo/x200/mainboard.c
+++ b/src/mainboard/lenovo/x200/mainboard.c
@@ -23,10 +23,7 @@
//#include <pc80/mc146818rtc.h>
#include <device/device.h>
#include <console/console.h>
-#if CONFIG_VGA_ROM_RUN
-#include <arch/interrupt.h>
-#include <x86emu/x86emu.h>
-#endif
+#include <drivers/intel/gma/int15.h>
#include <pc80/keyboard.h>
#include <ec/acpi/ec.h>
#include <smbios.h>
@@ -44,70 +41,6 @@
the overloaded weak function in there. */
#endif
-
-#if CONFIG_VGA_ROM_RUN
-static int int15_handler(void)
-{
- enum {
- BOOT_DISPLAY_DEFAULT = 0,
- BOOT_DISPLAY_CRT = (1 << 0),
- BOOT_DISPLAY_TV = (1 << 1),
- BOOT_DISPLAY_EFP = (1 << 2),
- BOOT_DISPLAY_LFP = (1 << 3),
- BOOT_DISPLAY_CRT2 = (1 << 4),
- BOOT_DISPLAY_TV2 = (1 << 5),
- BOOT_DISPLAY_EFP2 = (1 << 6),
- BOOT_DISPLAY_LFP2 = (1 << 7),
- };
- enum {
- PANEL_FIT_DEFAULT = 0,
- PANEL_FIT_CENTERING = (1 << 0),
- PANEL_FIT_TXT_STRETCH = (1 << 1),
- PANEL_FIT_GFX_STRETCH = (1 << 2),
- };
-
- switch (X86_AX) {
- case 0x5f34:
- /* Set Panel Fitting Hook */
- X86_AX = 0x005f;
- X86_CX = PANEL_FIT_CENTERING;
- break;
- case 0x5f35:
- /* Boot Display Device Hook */
- X86_AX = 0x005f;
- X86_CX = BOOT_DISPLAY_DEFAULT; /* Select automatically. */
- break;
- case 0x5f40:
- /* Boot Panel Type Hook */
- /* Contrary to what EMGD's user's guide says,
- this _alters_ the behavior of the Video BIOS. */
- /* LCD panel type is SIO GPIO40-43.
- It's controlled by a DIP switch but was always
- set to 4 while only values of 5 and 6 worked. */
- X86_AX = 0x005f;
- X86_CX = 0x2;
- break;
- case 0x5f70:
- /* Sandybridge boards return 0 here. */
- case 0x5f14:
- case 0x5f21:
- case 0x5f22:
- case 0x5f49:
- /* No documentation found. */
- default:
- /* Interrupt was not handled. */
- printk(BIOS_DEBUG,
- "%s: AX=%04x BX=%04x CX=%04x DX=%04x\n", __func__,
- X86_AX, X86_BX, X86_CX, X86_DX);
- return 0;
- }
-
- /* Interrupt handled. */
- return 1;
-}
-
-#endif
-
static void verb_setup(void)
{
cim_verb_data = mainboard_cim_verb_data;
@@ -136,10 +69,7 @@
static void mainboard_enable(device_t dev)
{
verb_setup();
-#if CONFIG_VGA_ROM_RUN
- /* Install custom int15 handler for VGA OPROM */
- mainboard_interrupt_handlers(0x15, &int15_handler);
-#endif
+ install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_CENTERING, GMA_INT15_BOOT_DISPLAY_DEFAULT, 2);
dev->ops->init = mainboard_init;
}
diff --git a/src/mainboard/lenovo/x201/Kconfig b/src/mainboard/lenovo/x201/Kconfig
index c82971f..571f35e 100644
--- a/src/mainboard/lenovo/x201/Kconfig
+++ b/src/mainboard/lenovo/x201/Kconfig
@@ -13,6 +13,7 @@
select HAVE_MP_TABLE
select BOARD_ROMSIZE_KB_8192
select HAVE_ACPI_TABLES
+ select INTEL_INT15
select HAVE_ACPI_RESUME
select MAINBOARD_HAS_NATIVE_VGA_INIT
select MAINBOARD_HAS_NATIVE_VGA_INIT_TEXTMODECFG
diff --git a/src/mainboard/lenovo/x201/mainboard.c b/src/mainboard/lenovo/x201/mainboard.c
index fd11da8..fdeddd4 100644
--- a/src/mainboard/lenovo/x201/mainboard.c
+++ b/src/mainboard/lenovo/x201/mainboard.c
@@ -41,7 +41,7 @@
#include "dock.h"
#include "hda_verb.h"
#include <arch/x86/include/arch/acpigen.h>
-#include <x86emu/regs.h>
+#include <drivers/intel/gma/int15.h>
#include <arch/interrupt.h>
#include <pc80/keyboard.h>
#include <cpu/x86/lapic.h>
@@ -61,34 +61,6 @@
return ARRAY_SIZE(cst_entries);
}
-#if CONFIG_PCI_OPTION_ROM_RUN_YABEL || CONFIG_PCI_OPTION_ROM_RUN_REALMODE
-
-static int int15_handler(void)
-{
- switch ((X86_EAX & 0xffff)) {
- /* Get boot display. */
- case 0x5f35:
- X86_EAX = 0x5f;
- /* The flags are:
- 1 - VGA
- 4 - DisplayPort
- 8 - LCD
- */
- X86_ECX = 0x8;
-
- return 1;
- case 0x5f40:
- X86_EAX = 0x5f;
- X86_ECX = 0x2;
- return 1;
- default:
- printk(BIOS_WARNING, "Unknown INT15 function %04x!\n",
- X86_EAX & 0xffff);
- return 0;
- }
-}
-#endif
-
const char *smbios_mainboard_bios_version(void)
{
/* Satisfy thinkpad_acpi. */
@@ -172,10 +144,7 @@
if (dev0 && pci_read_config32(dev0, SKPAD) == SKPAD_ACPI_S3_MAGIC)
ec_write(0x0c, 0xc7);
-#if CONFIG_PCI_OPTION_ROM_RUN_YABEL || CONFIG_PCI_OPTION_ROM_RUN_REALMODE
- /* Install custom int15 handler for VGA OPROM */
- mainboard_interrupt_handlers(0x15, &int15_handler);
-#endif
+ install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, GMA_INT15_BOOT_DISPLAY_LFP, 2);
verb_setup();
}
diff --git a/src/mainboard/lenovo/x220/Kconfig b/src/mainboard/lenovo/x220/Kconfig
index 3ce4a47..4a05f50 100644
--- a/src/mainboard/lenovo/x220/Kconfig
+++ b/src/mainboard/lenovo/x220/Kconfig
@@ -13,6 +13,7 @@
select HAVE_CMOS_DEFAULT
select HAVE_ACPI_RESUME
select HAVE_SMI_HANDLER
+ select INTEL_INT15
select EARLY_CBMEM_INIT
select VGA
select INTEL_EDID
diff --git a/src/mainboard/lenovo/x220/mainboard.c b/src/mainboard/lenovo/x220/mainboard.c
index 3656c22..ffc99bd 100644
--- a/src/mainboard/lenovo/x220/mainboard.c
+++ b/src/mainboard/lenovo/x220/mainboard.c
@@ -25,9 +25,7 @@
#include <device/pci_def.h>
#include <device/pci_ops.h>
#include <console/console.h>
-#if CONFIG_VGA_ROM_RUN
-#include <x86emu/x86emu.h>
-#endif
+#include <drivers/intel/gma/int15.h>
#include <pc80/mc146818rtc.h>
#include <arch/acpi.h>
#include <arch/io.h>
@@ -49,91 +47,6 @@
outb(0xcb, 0xb2);
}
-#if CONFIG_VGA_ROM_RUN
-static int int15_handler(void)
-{
- int res = 0;
-
- printk(BIOS_DEBUG, "%s: INT15 function %04x!\n",
- __func__, X86_AX);
-
- switch (X86_AX) {
- case 0x5f34:
- /*
- * Set Panel Fitting Hook:
- * bit 2 = Graphics Stretching
- * bit 1 = Text Stretching
- * bit 0 = Centering (do not set with bit1 or bit2)
- * 0 = video bios default
- */
- X86_AX = 0x005f;
- X86_CL = 0x00; /* Use video bios default */
- res = 1;
- break;
- case 0x5f35:
- /*
- * Boot Display Device Hook:
- * bit 0 = CRT
- * bit 1 = TV (eDP)
- * bit 2 = EFP
- * bit 3 = LFP
- * bit 4 = CRT2
- * bit 5 = TV2 (eDP)
- * bit 6 = EFP2
- * bit 7 = LFP2
- */
- X86_AX = 0x005f;
- X86_CX = 0x0000; /* Use video bios default */
- res = 1;
- break;
- case 0x5f51:
- /*
- * Hook to select active LFP configuration:
- * 00h = No LVDS, VBIOS does not enable LVDS
- * 01h = Int-LVDS, LFP driven by integrated LVDS decoder
- * 02h = SVDO-LVDS, LFP driven by SVDO decoder
- * 03h = eDP, LFP Driven by Int-DisplayPort encoder
- */
- X86_AX = 0x005f;
- X86_CX = 0x0001; /* Int-LVDS */
- res = 1;
- break;
- case 0x5f70:
- switch (X86_CH) {
- case 0:
- /* Get Mux */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 1:
- /* Set Mux */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 2:
- /* Get SG/Non-SG mode */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- default:
- /* Interrupt was not handled */
- printk(BIOS_DEBUG, "Unknown INT15 5f70 function: 0x%02x\n",
- X86_CH);
- break;
- }
- break;
-
- default:
- printk(BIOS_DEBUG, "Unknown INT15 function %04x!\n", X86_AX);
- break;
- }
- return res;
-}
-#endif
-
const char *smbios_mainboard_bios_version(void)
{
/* Satisfy thinkpad_acpi. */
@@ -181,10 +94,7 @@
{
dev->ops->init = mainboard_init;
-#if CONFIG_VGA_ROM_RUN
- /* Install custom int15 handler for VGA OPROM */
- mainboard_interrupt_handlers(0x15, &int15_handler);
-#endif
+ install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
verb_setup();
}
diff --git a/src/mainboard/lenovo/x230/Kconfig b/src/mainboard/lenovo/x230/Kconfig
index f835ab4..388a1ad 100644
--- a/src/mainboard/lenovo/x230/Kconfig
+++ b/src/mainboard/lenovo/x230/Kconfig
@@ -13,6 +13,7 @@
select HAVE_CMOS_DEFAULT
select HAVE_ACPI_RESUME
select HAVE_SMI_HANDLER
+ select INTEL_INT15
select EARLY_CBMEM_INIT
select VGA
select INTEL_EDID
diff --git a/src/mainboard/lenovo/x230/mainboard.c b/src/mainboard/lenovo/x230/mainboard.c
index 2df9069..5da7480 100644
--- a/src/mainboard/lenovo/x230/mainboard.c
+++ b/src/mainboard/lenovo/x230/mainboard.c
@@ -25,9 +25,7 @@
#include <device/pci_def.h>
#include <device/pci_ops.h>
#include <console/console.h>
-#if CONFIG_VGA_ROM_RUN
-#include <x86emu/x86emu.h>
-#endif
+#include <drivers/intel/gma/int15.h>
#include <pc80/mc146818rtc.h>
#include <arch/acpi.h>
#include <arch/io.h>
@@ -49,91 +47,6 @@
outb(0xcb, 0xb2);
}
-#if CONFIG_VGA_ROM_RUN
-static int int15_handler(void)
-{
- int res = 0;
-
- printk(BIOS_DEBUG, "%s: INT15 function %04x!\n",
- __func__, X86_AX);
-
- switch (X86_AX) {
- case 0x5f34:
- /*
- * Set Panel Fitting Hook:
- * bit 2 = Graphics Stretching
- * bit 1 = Text Stretching
- * bit 0 = Centering (do not set with bit1 or bit2)
- * 0 = video bios default
- */
- X86_AX = 0x005f;
- X86_CL = 0x00; /* Use video bios default */
- res = 1;
- break;
- case 0x5f35:
- /*
- * Boot Display Device Hook:
- * bit 0 = CRT
- * bit 1 = TV (eDP)
- * bit 2 = EFP
- * bit 3 = LFP
- * bit 4 = CRT2
- * bit 5 = TV2 (eDP)
- * bit 6 = EFP2
- * bit 7 = LFP2
- */
- X86_AX = 0x005f;
- X86_CX = 0x0000; /* Use video bios default */
- res = 1;
- break;
- case 0x5f51:
- /*
- * Hook to select active LFP configuration:
- * 00h = No LVDS, VBIOS does not enable LVDS
- * 01h = Int-LVDS, LFP driven by integrated LVDS decoder
- * 02h = SVDO-LVDS, LFP driven by SVDO decoder
- * 03h = eDP, LFP Driven by Int-DisplayPort encoder
- */
- X86_AX = 0x005f;
- X86_CX = 0x0001; /* Int-LVDS */
- res = 1;
- break;
- case 0x5f70:
- switch (X86_CH) {
- case 0:
- /* Get Mux */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 1:
- /* Set Mux */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 2:
- /* Get SG/Non-SG mode */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- default:
- /* Interrupt was not handled */
- printk(BIOS_DEBUG, "Unknown INT15 5f70 function: 0x%02x\n",
- X86_CH);
- break;
- }
- break;
-
- default:
- printk(BIOS_DEBUG, "Unknown INT15 function %04x!\n", X86_AX);
- break;
- }
- return res;
-}
-#endif
-
const char *smbios_mainboard_bios_version(void)
{
/* Satisfy thinkpad_acpi. */
@@ -181,10 +94,7 @@
{
dev->ops->init = mainboard_init;
-#if CONFIG_VGA_ROM_RUN
- /* Install custom int15 handler for VGA OPROM */
- mainboard_interrupt_handlers(0x15, &int15_handler);
-#endif
+ install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
verb_setup();
}
diff --git a/src/mainboard/lenovo/x60/Kconfig b/src/mainboard/lenovo/x60/Kconfig
index c27cad8..1757327 100644
--- a/src/mainboard/lenovo/x60/Kconfig
+++ b/src/mainboard/lenovo/x60/Kconfig
@@ -13,6 +13,7 @@
select EC_LENOVO_H8
select DRIVERS_ICS_954309
select HAVE_OPTION_TABLE
+ select INTEL_INT15
select HAVE_CMOS_DEFAULT
select HAVE_PIRQ_TABLE
select HAVE_MP_TABLE
diff --git a/src/mainboard/lenovo/x60/mainboard.c b/src/mainboard/lenovo/x60/mainboard.c
index da17ae2..9932bce 100644
--- a/src/mainboard/lenovo/x60/mainboard.c
+++ b/src/mainboard/lenovo/x60/mainboard.c
@@ -39,7 +39,8 @@
#include <arch/x86/include/arch/acpigen.h>
#include <smbios.h>
#include <build.h>
-#include <x86emu/x86emu.h>
+#include <drivers/intel/gma/int15.h>
+
#define PANEL INT15_5F35_CL_DISPLAY_DEFAULT
static acpi_cstate_t cst_entries[] = {
@@ -48,37 +49,6 @@
{ 2, 17, 250, { 0x01, 8, 0, { 0 }, DEFAULT_PMBASE + LV3, 0 } },
};
-#if CONFIG_PCI_OPTION_ROM_RUN_YABEL || CONFIG_PCI_OPTION_ROM_RUN_REALMODE
-static int int15_handler(void)
-{
- /* The right way to do this is to move this handler code into
- * the mainboard or northbridge code.
- * TODO: completely move to mainboards / chipsets.
- */
- printk(BIOS_DEBUG, "%s: AX=%04x BX=%04x CX=%04x DX=%04x\n",
- __func__, X86_AX, X86_BX, X86_CX, X86_DX);
-
- switch (X86_AX) {
- case 0x5f35: /* Boot Display */
- X86_AX = 0x005f; // Success
- X86_CL = PANEL;
- break;
- case 0x5f40: /* Boot Panel Type */
- X86_AX = 0x005f; // Success
- X86_CL = 3;
- printk(BIOS_DEBUG, "DISPLAY=%x\n", X86_CL);
- break;
- default:
- /* Interrupt was not handled */
- printk(BIOS_DEBUG, "Unknown INT15 function %04x!\n", X86_AX);
- return 0;
- }
-
- /* Interrupt handled */
- return 1;
-}
-#endif
-
int get_cst_entries(acpi_cstate_t **entries)
{
*entries = cst_entries;
@@ -96,10 +66,7 @@
ec_write(0x0c, 0x88);
}
-#if CONFIG_PCI_OPTION_ROM_RUN_YABEL || CONFIG_PCI_OPTION_ROM_RUN_REALMODE
- /* Install custom int15 handler for VGA OPROM */
- mainboard_interrupt_handlers(0x15, &int15_handler);
-#endif
+ install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, PANEL, 3);
/* If we're resuming from suspend, blink suspend LED */
dev0 = dev_find_slot(0, PCI_DEVFN(0,0));
diff --git a/src/mainboard/packardbell/ms2290/Kconfig b/src/mainboard/packardbell/ms2290/Kconfig
index 20768d8..f0b7538 100644
--- a/src/mainboard/packardbell/ms2290/Kconfig
+++ b/src/mainboard/packardbell/ms2290/Kconfig
@@ -13,6 +13,7 @@
select HAVE_ACPI_TABLES
select HAVE_ACPI_RESUME
select MAINBOARD_HAS_NATIVE_VGA_INIT
+ select INTEL_INT15
select EC_ACPI
select MAINBOARD_HAS_NATIVE_VGA_INIT_TEXTMODECFG
diff --git a/src/mainboard/packardbell/ms2290/mainboard.c b/src/mainboard/packardbell/ms2290/mainboard.c
index 62e7fd9..5fff98d 100644
--- a/src/mainboard/packardbell/ms2290/mainboard.c
+++ b/src/mainboard/packardbell/ms2290/mainboard.c
@@ -36,7 +36,7 @@
#include <pc80/mc146818rtc.h>
#include <arch/x86/include/arch/acpigen.h>
#if CONFIG_PCI_OPTION_ROM_RUN_YABEL || CONFIG_PCI_OPTION_ROM_RUN_REALMODE
-#include <x86emu/regs.h>
+#include <drivers/intel/gma/int15.h>
#include <arch/interrupt.h>
#endif
#include <pc80/keyboard.h>
@@ -58,34 +58,6 @@
return ARRAY_SIZE(cst_entries);
}
-#if CONFIG_PCI_OPTION_ROM_RUN_YABEL || CONFIG_PCI_OPTION_ROM_RUN_REALMODE
-
-static int int15_handler(void)
-{
- switch ((X86_EAX & 0xffff)) {
- /* Get boot display. */
- case 0x5f35:
- X86_EAX = 0x5f;
- /* The flags are:
- 1 - VGA
- 4 - DisplayPort
- 8 - LCD
- */
- X86_ECX = 0x8;
-
- return 1;
- case 0x5f40:
- X86_EAX = 0x5f;
- X86_ECX = 0x2;
- return 1;
- default:
- printk(BIOS_WARNING, "Unknown INT15 function %04x!\n",
- X86_EAX & 0xffff);
- return 0;
- }
-}
-#endif
-
/* Audio Setup */
static void verb_setup(void)
@@ -160,10 +132,7 @@
pci_write_config8(dev_find_slot(0, PCI_DEVFN(0x1f, 0)), GPIO_CNTL,
0x10);
-#if CONFIG_PCI_OPTION_ROM_RUN_YABEL || CONFIG_PCI_OPTION_ROM_RUN_REALMODE
- /* Install custom int15 handler for VGA OPROM */
- mainboard_interrupt_handlers(0x15, &int15_handler);
-#endif
+ install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, GMA_INT15_BOOT_DISPLAY_LFP, 2);
/* This sneaked in here, because EasyNote has no SuperIO chip.
*/
diff --git a/src/mainboard/roda/rk886ex/Kconfig b/src/mainboard/roda/rk886ex/Kconfig
index 7f2b5b9..bbb5d9b 100644
--- a/src/mainboard/roda/rk886ex/Kconfig
+++ b/src/mainboard/roda/rk886ex/Kconfig
@@ -17,6 +17,7 @@
select HAVE_ACPI_RESUME
select BOARD_ROMSIZE_KB_1024
select CHANNEL_XOR_RANDOMIZATION
+ select INTEL_INT15
config MAINBOARD_DIR
string
diff --git a/src/mainboard/roda/rk886ex/mainboard.c b/src/mainboard/roda/rk886ex/mainboard.c
index 7158dca..ba7ed23 100644
--- a/src/mainboard/roda/rk886ex/mainboard.c
+++ b/src/mainboard/roda/rk886ex/mainboard.c
@@ -24,9 +24,7 @@
#include <arch/io.h>
#include <arch/interrupt.h>
#include <delay.h>
-#if CONFIG_VGA_ROM_RUN
-#include <x86emu/x86emu.h>
-#endif
+#include <drivers/intel/gma/int15.h>
#include <ec/acpi/ec.h>
#include "m3885.h"
@@ -50,54 +48,6 @@
printk(BIOS_DEBUG, "Display I/O: 0x%02x\n", inb(0x60f));
}
-#define BOOT_DISPLAY_DEFAULT 0
-#define BOOT_DISPLAY_CRT (1 << 0)
-#define BOOT_DISPLAY_TV (1 << 1)
-#define BOOT_DISPLAY_EFP (1 << 2)
-#define BOOT_DISPLAY_LCD (1 << 3)
-#define BOOT_DISPLAY_CRT2 (1 << 4)
-#define BOOT_DISPLAY_TV2 (1 << 5)
-#define BOOT_DISPLAY_EFP2 (1 << 6)
-#define BOOT_DISPLAY_LCD2 (1 << 7)
-
-#if CONFIG_VGA_ROM_RUN
-static int int15_handler(void)
-{
- /* This int15 handler is Intel IGD. specific. Other chipsets need other
- * handlers. The right way to do this is to move this handler code into
- * the mainboard or northbridge code.
- * TODO: completely move to mainboards / chipsets.
- */
- u8 display_id;
-
- printk(BIOS_DEBUG, "%s: AX=%04x BX=%04x CX=%04x DX=%04x\n",
- __func__, X86_AX, X86_BX, X86_CX, X86_DX);
-
- switch (X86_AX) {
- case 0x5f35: /* Boot Display */
- X86_AX = 0x005f; // Success
- X86_CL = BOOT_DISPLAY_DEFAULT;
- break;
- case 0x5f40: /* Boot Panel Type */
- /* LCD panel type is SIO GPIO40-43 */
- // display_id = inb(0x60f) & 0x0f;
- display_id = 3;
- // M.x86.R_AX = 0x015f; // Supported but failed
- X86_AX = 0x005f; // Success
- X86_CL = display_id;
- printk(BIOS_DEBUG, "DISPLAY=%x\n", X86_CL);
- break;
- default:
- /* Interrupt was not handled */
- printk(BIOS_DEBUG, "Unknown INT15 function %04x!\n", X86_AX);
- return 0;
- }
-
- /* Interrupt handled */
- return 1;
-}
-#endif
-
#if DUMP_RUNTIME_REGISTERS
static void dump_runtime_registers(void)
{
@@ -124,10 +74,10 @@
/* Disable Dummy DCC -> GP45 = 1 */
outb(inb(0x60f) | (1 << 5), 0x60f);
-#if CONFIG_VGA_ROM_RUN
- /* Install custom int15 handler for VGA OPROM */
- mainboard_interrupt_handlers(0x15, &int15_handler);
-#endif
+ /* LCD panel type is SIO GPIO40-43 */
+ // display_id = inb(0x60f) & 0x0f;
+ install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, GMA_INT15_BOOT_DISPLAY_DEFAULT, 3);
+
#if DUMP_RUNTIME_REGISTERS
dump_runtime_registers();
#endif
diff --git a/src/mainboard/roda/rk9/Kconfig b/src/mainboard/roda/rk9/Kconfig
index 6ed85ff..271b0e4 100644
--- a/src/mainboard/roda/rk9/Kconfig
+++ b/src/mainboard/roda/rk9/Kconfig
@@ -13,6 +13,7 @@
select HAVE_ACPI_TABLES
select EC_ACPI
select HAVE_OPTION_TABLE
+ select INTEL_INT15
config MAINBOARD_DIR
string
diff --git a/src/mainboard/roda/rk9/mainboard.c b/src/mainboard/roda/rk9/mainboard.c
index 4744415..49db15f 100644
--- a/src/mainboard/roda/rk9/mainboard.c
+++ b/src/mainboard/roda/rk9/mainboard.c
@@ -23,10 +23,7 @@
//#include <pc80/mc146818rtc.h>
#include <device/device.h>
#include <console/console.h>
-#if CONFIG_VGA_ROM_RUN
-#include <arch/interrupt.h>
-#include <x86emu/x86emu.h>
-#endif
+#include <drivers/intel/gma/int15.h>
#include <pc80/keyboard.h>
#include <ec/acpi/ec.h>
#include <device/azalia_device.h>
@@ -37,70 +34,6 @@
the overloaded weak function in there. */
#endif
-
-#if CONFIG_VGA_ROM_RUN
-static int int15_handler(void)
-{
- enum {
- BOOT_DISPLAY_DEFAULT = 0,
- BOOT_DISPLAY_CRT = (1 << 0),
- BOOT_DISPLAY_TV = (1 << 1),
- BOOT_DISPLAY_EFP = (1 << 2),
- BOOT_DISPLAY_LFP = (1 << 3),
- BOOT_DISPLAY_CRT2 = (1 << 4),
- BOOT_DISPLAY_TV2 = (1 << 5),
- BOOT_DISPLAY_EFP2 = (1 << 6),
- BOOT_DISPLAY_LFP2 = (1 << 7),
- };
- enum {
- PANEL_FIT_DEFAULT = 0,
- PANEL_FIT_CENTERING = (1 << 0),
- PANEL_FIT_TXT_STRETCH = (1 << 1),
- PANEL_FIT_GFX_STRETCH = (1 << 2),
- };
-
- switch (X86_AX) {
- case 0x5f34:
- /* Set Panel Fitting Hook */
- X86_AX = 0x005f;
- X86_CX = PANEL_FIT_CENTERING;
- break;
- case 0x5f35:
- /* Boot Display Device Hook */
- X86_AX = 0x005f;
- X86_CX = BOOT_DISPLAY_DEFAULT; /* Select automatically. */
- break;
- case 0x5f40:
- /* Boot Panel Type Hook */
- /* Contrary to what EMGD's user's guide says,
- this _alters_ the behavior of the Video BIOS. */
- /* LCD panel type is SIO GPIO40-43.
- It's controlled by a DIP switch but was always
- set to 4 while only values of 5 and 6 worked. */
- X86_AX = 0x005f;
- X86_CX = (inb(0x60f) & 0x0f) + 1;
- break;
- case 0x5f70:
- /* Sandybridge boards return 0 here. */
- case 0x5f14:
- case 0x5f21:
- case 0x5f22:
- case 0x5f49:
- /* No documentation found. */
- default:
- /* Interrupt was not handled. */
- printk(BIOS_DEBUG,
- "%s: AX=%04x BX=%04x CX=%04x DX=%04x\n", __func__,
- X86_AX, X86_BX, X86_CX, X86_DX);
- return 0;
- }
-
- /* Interrupt handled. */
- return 1;
-}
-
-#endif
-
static void verb_setup(void)
{
cim_verb_data = mainboard_cim_verb_data;
@@ -127,10 +60,10 @@
{
ec_setup();
verb_setup();
-#if CONFIG_VGA_ROM_RUN
- /* Install custom int15 handler for VGA OPROM */
- mainboard_interrupt_handlers(0x15, &int15_handler);
-#endif
+ /* LCD panel type is SIO GPIO40-43.
+ It's controlled by a DIP switch but was always
+ set to 4 while only values of 5 and 6 worked. */
+ install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_CENTERING, GMA_INT15_BOOT_DISPLAY_DEFAULT, (inb(0x60f) & 0x0f) + 1);
/* We have no driver for the embedded controller since the firmware
does most of the job. Hence, initialize keyboards here. */
diff --git a/src/mainboard/samsung/lumpy/Kconfig b/src/mainboard/samsung/lumpy/Kconfig
index 63c78d3..68f3058 100644
--- a/src/mainboard/samsung/lumpy/Kconfig
+++ b/src/mainboard/samsung/lumpy/Kconfig
@@ -13,6 +13,7 @@
select SOUTHBRIDGE_INTEL_BD82X6X
select SUPERIO_SMSC_MEC1308
select DRIVERS_GENERIC_IOAPIC
+ select INTEL_INT15
select HAVE_MRC
config MAINBOARD_DIR
diff --git a/src/mainboard/samsung/lumpy/mainboard.c b/src/mainboard/samsung/lumpy/mainboard.c
index bce20d6..803761c 100644
--- a/src/mainboard/samsung/lumpy/mainboard.c
+++ b/src/mainboard/samsung/lumpy/mainboard.c
@@ -24,9 +24,7 @@
#include <device/pci_def.h>
#include <device/pci_ops.h>
#include <console/console.h>
-#if CONFIG_VGA_ROM_RUN
-#include <x86emu/x86emu.h>
-#endif
+#include <drivers/intel/gma/int15.h>
#include <pc80/mc146818rtc.h>
#include <arch/acpi.h>
#include <arch/io.h>
@@ -50,91 +48,6 @@
send_ec_command(EC_ACPI_ENABLE);
}
-#if CONFIG_VGA_ROM_RUN
-static int int15_handler(void)
-{
- int res=0;
-
- printk(BIOS_DEBUG, "%s: INT15 function %04x!\n",
- __func__, X86_AX);
-
- switch(X86_AX) {
- case 0x5f34:
- /*
- * Set Panel Fitting Hook:
- * bit 2 = Graphics Stretching
- * bit 1 = Text Stretching
- * bit 0 = Centering (do not set with bit1 or bit2)
- * 0 = video bios default
- */
- X86_AX = 0x005f;
- X86_CL = 0x00;
- res = 1;
- break;
- case 0x5f35:
- /*
- * Boot Display Device Hook:
- * bit 0 = CRT
- * bit 1 = TV
- * bit 2 = EFP *
- * bit 3 = LFP
- * bit 4 = CRT2
- * bit 5 = TV2
- * bit 6 = EFP2 *
- * bit 7 = LFP2
- */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 0x5f51:
- /*
- * Hook to select active LFP configuration:
- * 00h = No LVDS, VBIOS does not enable LVDS
- * 01h = Int-LVDS, LFP driven by integrated LVDS decoder
- * 02h = SVDO-LVDS, LFP driven by SVDO decoder
- * 03h = eDP, LFP Driven by Int-DisplayPort encoder
- */
- X86_AX = 0x005f;
- X86_CX = 0x0001;
- res = 1;
- break;
- case 0x5f70:
- switch (X86_CH) {
- case 0:
- /* Get Mux */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 1:
- /* Set Mux */
- X86_EAX = 0x005f;
- X86_ECX = 0x0000;
- res = 1;
- break;
- case 2:
- /* Get SG/Non-SG mode */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- default:
- /* FIXME: Interrupt was not handled, but return success? */
- printk(BIOS_DEBUG, "Unknown INT15 5f70 function: 0x%02x\n",
- X86_CH);
- return 1;
- }
- break;
-
- default:
- printk(BIOS_DEBUG, "Unknown INT15 function %04x!\n", X86_AX);
- break;
- }
- return res;
-}
-#endif
-
/* Audio Setup */
static void verb_setup(void)
@@ -202,10 +115,7 @@
{
dev->ops->init = mainboard_init;
dev->ops->get_smbios_data = lumpy_onboard_smbios_data;
-#if CONFIG_VGA_ROM_RUN
- /* Install custom int15 handler for VGA OPROM */
- mainboard_interrupt_handlers(0x15, &int15_handler);
-#endif
+ install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
verb_setup();
}
diff --git a/src/mainboard/samsung/stumpy/Kconfig b/src/mainboard/samsung/stumpy/Kconfig
index 1ec107f..eee3755 100644
--- a/src/mainboard/samsung/stumpy/Kconfig
+++ b/src/mainboard/samsung/stumpy/Kconfig
@@ -13,6 +13,7 @@
select SUPERIO_ITE_IT8772F
select HAVE_MRC
+ select INTEL_INT15
config MAINBOARD_DIR
string
default samsung/stumpy
diff --git a/src/mainboard/samsung/stumpy/mainboard.c b/src/mainboard/samsung/stumpy/mainboard.c
index 2256b41..d61b808 100644
--- a/src/mainboard/samsung/stumpy/mainboard.c
+++ b/src/mainboard/samsung/stumpy/mainboard.c
@@ -25,9 +25,7 @@
#include <device/pci_def.h>
#include <device/pci_ops.h>
#include <console/console.h>
-#if CONFIG_VGA_ROM_RUN
-#include <x86emu/x86emu.h>
-#endif
+#include <drivers/intel/gma/int15.h>
#include <pc80/mc146818rtc.h>
#include <arch/acpi.h>
#include <arch/io.h>
@@ -43,91 +41,6 @@
outb(0xcb, 0xb2);
}
-#if CONFIG_VGA_ROM_RUN
-static int int15_handler(void)
-{
- int res=0;
-
- printk(BIOS_DEBUG, "%s: INT15 function %04x!\n",
- __func__, X86_AX);
-
- switch(X86_AX) {
- case 0x5f34:
- /*
- * Set Panel Fitting Hook:
- * bit 2 = Graphics Stretching
- * bit 1 = Text Stretching
- * bit 0 = Centering (do not set with bit1 or bit2)
- * 0 = video bios default
- */
- X86_AX = 0x005f;
- X86_CL = 0x01;
- res = 1;
- break;
- case 0x5f35:
- /*
- * Boot Display Device Hook:
- * bit 0 = CRT
- * bit 1 = TV (eDP) *
- * bit 2 = EFP *
- * bit 3 = LFP
- * bit 4 = CRT2
- * bit 5 = TV2 (eDP) *
- * bit 6 = EFP2 *
- * bit 7 = LFP2
- */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 0x5f51:
- /*
- * Hook to select active LFP configuration:
- * 00h = No LVDS, VBIOS does not enable LVDS
- * 01h = Int-LVDS, LFP driven by integrated LVDS decoder
- * 02h = SVDO-LVDS, LFP driven by SVDO decoder
- * 03h = eDP, LFP Driven by Int-DisplayPort encoder
- */
- X86_AX = 0x005f;
- X86_CX = 0x0003;
- res = 1;
- break;
- case 0x5f70:
- switch (X86_CH) {
- case 0:
- /* Get Mux */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 1:
- /* Set Mux */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- case 2:
- /* Get SG/Non-SG mode */
- X86_AX = 0x005f;
- X86_CX = 0x0000;
- res = 1;
- break;
- default:
- /* FIXME: Interrupt was not handled, but return sucess? */
- printk(BIOS_DEBUG, "Unknown INT15 5f70 function: 0x%02x\n",
- X86_CH);
- return 1;
- }
- break;
-
- default:
- printk(BIOS_DEBUG, "Unknown INT15 function %04x!\n", X86_AX);
- break;
- }
- return res;
-}
-#endif
-
/* Audio Setup */
static void verb_setup(void)
@@ -143,10 +56,7 @@
static void mainboard_enable(device_t dev)
{
-#if CONFIG_VGA_ROM_RUN
- /* Install custom int15 handler for VGA OPROM */
- mainboard_interrupt_handlers(0x15, &int15_handler);
-#endif
+ install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_EDP, GMA_INT15_PANEL_FIT_CENTERING, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
verb_setup();
}
diff --git a/src/mainboard/thomson/ip1000/Kconfig b/src/mainboard/thomson/ip1000/Kconfig
index a68c72a..80d365c 100644
--- a/src/mainboard/thomson/ip1000/Kconfig
+++ b/src/mainboard/thomson/ip1000/Kconfig
@@ -9,6 +9,7 @@
select HAVE_PIRQ_TABLE
select UDELAY_TSC
select BOARD_ROMSIZE_KB_512
+ select INTEL_INT15
config MAINBOARD_DIR
string
diff --git a/src/mainboard/thomson/ip1000/mainboard.c b/src/mainboard/thomson/ip1000/mainboard.c
index 705c427..7267696 100644
--- a/src/mainboard/thomson/ip1000/mainboard.c
+++ b/src/mainboard/thomson/ip1000/mainboard.c
@@ -21,9 +21,7 @@
#include <console/console.h>
#include <device/device.h>
#include <delay.h>
-#if CONFIG_VGA_ROM_RUN
-#include <x86emu/x86emu.h>
-#endif
+#include <drivers/intel/gma/int15.h>
#include <arch/io.h>
#include <arch/interrupt.h>
@@ -86,53 +84,6 @@
}
}
-
-#if CONFIG_VGA_ROM_RUN
-static int int15_handler(void)
-{
-#define BOOT_DISPLAY_DEFAULT 0
-#define BOOT_DISPLAY_CRT (1 << 0)
-#define BOOT_DISPLAY_TV (1 << 1)
-#define BOOT_DISPLAY_EFP (1 << 2)
-#define BOOT_DISPLAY_LCD (1 << 3)
-#define BOOT_DISPLAY_CRT2 (1 << 4)
-#define BOOT_DISPLAY_TV2 (1 << 5)
-#define BOOT_DISPLAY_EFP2 (1 << 6)
-#define BOOT_DISPLAY_LCD2 (1 << 7)
-
- printk(BIOS_DEBUG, "%s: AX=%04x BX=%04x CX=%04x DX=%04x\n",
- __func__, X86_AX, X86_BX, X86_CX, X86_DX);
-
- switch (X86_AX) {
- case 0x5f35: /* Boot Display */
- X86_AX = 0x005f; // Success
- //M.x86.R_CL = BOOT_DISPLAY_TV2;
- X86_CL = BOOT_DISPLAY_DEFAULT;
- break;
- case 0x5f36: /* Boot TV Format Hook */
- printk(BIOS_DEBUG, "Boot TV Format Hook. TODO\n");
- /* Interrupt was not handled */
- return 0;
- case 0x5f31: /* Post Completion Hook */
- case 0x5f33: /* Hook After Mode Set */
- case 0x5f34: /* Set Panel Fitting Hook */
- case 0x5f38: /* Hook Before Mode Set */
- case 0x5f45: /* Hook Before VESA VBE/DDC */
- case 0x5f46: /* Hook Before VESA VBE/PM */
- case 0x5f47: /* Notif Display Switch Hook */
- case 0x5f65: /* Local Memory Initialization Hook */
- /* Interrupt was not handled */
- return 0;
- default:
- /* Interrupt was not handled */
- return 0;
- }
-
- /* Interrupt handled */
- return 1;
-}
-#endif
-
static void mainboard_init(device_t dev)
{
parport_gpios();
@@ -142,10 +93,7 @@
static void mainboard_enable(device_t dev)
{
dev->ops->init = mainboard_init;
-#if CONFIG_VGA_ROM_RUN
- /* Install custom int15 handler for VGA OPROM */
- mainboard_interrupt_handlers(0x15, &int15_handler);
-#endif
+ install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
}
struct chip_operations mainboard_ops = {