summaryrefslogtreecommitdiff
path: root/src/mainboard/roda/rk886ex
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainboard/roda/rk886ex')
-rw-r--r--src/mainboard/roda/rk886ex/mainboard.c49
1 files changed, 48 insertions, 1 deletions
diff --git a/src/mainboard/roda/rk886ex/mainboard.c b/src/mainboard/roda/rk886ex/mainboard.c
index 2c5b5e3d71..d87d712259 100644
--- a/src/mainboard/roda/rk886ex/mainboard.c
+++ b/src/mainboard/roda/rk886ex/mainboard.c
@@ -22,6 +22,7 @@
#include <console/console.h>
#include <device/device.h>
#include <arch/io.h>
+#include <arch/interrupt.h>
#include <boot/tables.h>
#include <delay.h>
#if CONFIG_PCI_OPTION_ROM_RUN_YABEL
@@ -99,6 +100,52 @@ static void int15_install(void)
}
#endif
+#if CONFIG_PCI_OPTION_ROM_RUN_REALMODE
+static int int15_handler(struct eregs *regs)
+{
+ int res = -1;
+
+ /* 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.
+ */
+ switch (regs->eax & 0xffff) {
+ /* And now Intel IGD code */
+#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)
+ case 0x5f35:
+ regs->eax = 0x5f;
+ regs->ecx = BOOT_DISPLAY_DEFAULT;
+ res = 0;
+ break;
+ case 0x5f40:
+ regs->eax = 0x5f;
+ regs->ecx = 3; // This is mainboard specific
+ printk(BIOS_DEBUG, "DISPLAY=%x\n", regs->ecx);
+ res = 0;
+ break;
+ default:
+ printk(BIOS_DEBUG, "Unknown INT15 function %04x!\n",
+ regs->eax & 0xffff);
+ }
+
+ return res;
+}
+
+static void int15_install(void)
+{
+ mainboard_interrupt_handlers(0x15, &int15_handler);
+}
+#endif
+
#if DUMP_RUNTIME_REGISTERS
static void dump_runtime_registers(void)
{
@@ -125,7 +172,7 @@ static void mainboard_enable(device_t dev)
/* Disable Dummy DCC -> GP45 = 1 */
outb(inb(0x60f) | (1 << 5), 0x60f);
-#if CONFIG_PCI_OPTION_ROM_RUN_YABEL
+#if CONFIG_PCI_OPTION_ROM_RUN_YABEL || CONFIG_PCI_OPTION_ROM_RUN_REALMODE
/* Install custom int15 handler for VGA OPROM */
int15_install();
#endif