aboutsummaryrefslogtreecommitdiff
path: root/src/mainboard/lenovo
diff options
context:
space:
mode:
authorVladimir Serbinenko <phcoder@gmail.com>2014-09-01 01:41:37 +0200
committerVladimir Serbinenko <phcoder@gmail.com>2014-09-05 22:48:49 +0200
commita2a906e47a87acc3acdca0ee2790ff96409b9b46 (patch)
tree32bd54895f2c1f199d649ed96a2dd7f2e9a4e722 /src/mainboard/lenovo
parenta4857052f756507e18a54beba704f183f128a057 (diff)
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>
Diffstat (limited to 'src/mainboard/lenovo')
-rw-r--r--src/mainboard/lenovo/t520/Kconfig1
-rw-r--r--src/mainboard/lenovo/t520/mainboard.c94
-rw-r--r--src/mainboard/lenovo/t530/Kconfig1
-rw-r--r--src/mainboard/lenovo/t530/mainboard.c94
-rw-r--r--src/mainboard/lenovo/t60/Kconfig1
-rw-r--r--src/mainboard/lenovo/t60/mainboard.c38
-rw-r--r--src/mainboard/lenovo/x200/Kconfig1
-rw-r--r--src/mainboard/lenovo/x200/mainboard.c74
-rw-r--r--src/mainboard/lenovo/x201/Kconfig1
-rw-r--r--src/mainboard/lenovo/x201/mainboard.c35
-rw-r--r--src/mainboard/lenovo/x220/Kconfig1
-rw-r--r--src/mainboard/lenovo/x220/mainboard.c94
-rw-r--r--src/mainboard/lenovo/x230/Kconfig1
-rw-r--r--src/mainboard/lenovo/x230/mainboard.c94
-rw-r--r--src/mainboard/lenovo/x60/Kconfig1
-rw-r--r--src/mainboard/lenovo/x60/mainboard.c39
16 files changed, 25 insertions, 545 deletions
diff --git a/src/mainboard/lenovo/t520/Kconfig b/src/mainboard/lenovo/t520/Kconfig
index b6c9e0523d..aa4f0a4209 100644
--- a/src/mainboard/lenovo/t520/Kconfig
+++ b/src/mainboard/lenovo/t520/Kconfig
@@ -13,6 +13,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
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 a93ba706bc..afa0ecf2f7 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 @@ void mainboard_suspend_resume(void)
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 @@ enumerate_buses(). */
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 a850e1133c..1a68a6f8a7 100644
--- a/src/mainboard/lenovo/t530/Kconfig
+++ b/src/mainboard/lenovo/t530/Kconfig
@@ -13,6 +13,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
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 e529d452fc..e21dc982f0 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 @@ void mainboard_suspend_resume(void)
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 @@ 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/t60/Kconfig b/src/mainboard/lenovo/t60/Kconfig
index a42699d6f7..c868e2245e 100644
--- a/src/mainboard/lenovo/t60/Kconfig
+++ b/src/mainboard/lenovo/t60/Kconfig
@@ -13,6 +13,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
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 9c6a30a47c..79b3da8747 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 @@ static acpi_cstate_t cst_entries[] = {
{ 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 @@ static void mainboard_init(device_t dev)
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 5f7f87ad1f..73ed75f700 100644
--- a/src/mainboard/lenovo/x200/Kconfig
+++ b/src/mainboard/lenovo/x200/Kconfig
@@ -19,6 +19,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
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 c83ad70630..6c13eed84f 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_init(device_t dev)
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 c82971f568..571f35eb4f 100644
--- a/src/mainboard/lenovo/x201/Kconfig
+++ b/src/mainboard/lenovo/x201/Kconfig
@@ -13,6 +13,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
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 fd11da8326..fdeddd4402 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 @@ int get_cst_entries(acpi_cstate_t ** entries)
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 @@ static void mainboard_enable(device_t dev)
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 3ce4a4796f..4a05f50f89 100644
--- a/src/mainboard/lenovo/x220/Kconfig
+++ b/src/mainboard/lenovo/x220/Kconfig
@@ -13,6 +13,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
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 3656c224e5..ffc99bd4eb 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 @@ void mainboard_suspend_resume(void)
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 @@ 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/x230/Kconfig b/src/mainboard/lenovo/x230/Kconfig
index f835ab45c8..388a1ad555 100644
--- a/src/mainboard/lenovo/x230/Kconfig
+++ b/src/mainboard/lenovo/x230/Kconfig
@@ -13,6 +13,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
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 2df9069672..5da7480492 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 @@ void mainboard_suspend_resume(void)
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 @@ 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/x60/Kconfig b/src/mainboard/lenovo/x60/Kconfig
index c27cad8e8d..1757327205 100644
--- a/src/mainboard/lenovo/x60/Kconfig
+++ b/src/mainboard/lenovo/x60/Kconfig
@@ -13,6 +13,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
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 da17ae2803..9932bcea6f 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 @@ static acpi_cstate_t cst_entries[] = {
{ 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 @@ static void mainboard_init(device_t dev)
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));