2 * This file is part of the coreboot project.
4 * Copyright (C) 2009 coresystems GmbH
5 * Copyright (C) 2009 Libra Li <libra.li@technexion.com>
6 * Copyright (C) 2010 Siemens AG, Inc.
7 * (Written by Josef Kellermann <joseph.kellermann@heitec.de> for Siemens AG, Inc.)
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 #include <console/console.h>
27 #include <arch/interrupt.h>
28 #include "int15_func.h"
30 int sbios_INT15_handler(struct eregs *);
31 /*extern*/ unsigned long vgainfo_addr;
33 static INT15_function_extensions __int15_func;
35 /* System BIOS int15 function */
36 int sbios_INT15_handler(struct eregs *regs)
40 printk(BIOS_DEBUG, "System BIOS INT 15h\n");
42 switch (regs->eax & 0xffff) {
43 #define BOOT_DISPLAY_DEFAULT 0
44 #define BOOT_DISPLAY_CRT (1 << 0)
45 #define BOOT_DISPLAY_TV (1 << 1)
46 #define BOOT_DISPLAY_EFP (1 << 2)
47 #define BOOT_DISPLAY_LCD (1 << 3)
48 #define BOOT_DISPLAY_CRT2 (1 << 4)
49 #define BOOT_DISPLAY_TV2 (1 << 5)
50 #define BOOT_DISPLAY_EFP2 (1 << 6)
51 #define BOOT_DISPLAY_LCD2 (1 << 7)
54 regs->ecx = BOOT_DISPLAY_DEFAULT;
59 regs->ecx = 3; // This is mainboard specific
60 printk(BIOS_DEBUG, "DISPLAY=%x\n", regs->ecx);
64 switch (regs->ebx & 0xff) {
67 regs->ebx = (regs->ebx & ~(0xff)) | __int15_func.regs.func00_LCD_panel_id;
68 printk(BIOS_DEBUG, "DISPLAY = %x\n", regs->ebx & 0xff);
75 regs->ebx = (regs->ebx & ~(0xff)) | __int15_func.regs.func05_TV_standard;
76 printk(BIOS_DEBUG, "TV = %x\n", regs->ebx & 0xff);
82 printk(BIOS_DEBUG, "Integrated System Information = %x:%x\n", regs->edx, regs->edi);
83 vgainfo_addr = (regs->edx * 16) + regs->edi;
89 printk(BIOS_DEBUG, "Get supported display device information\n");
97 printk(BIOS_DEBUG, "Unknown INT15 function %04x!\n", regs->eax & 0xffff);
104 /* Initialization VBIOS function extensions */
105 void install_INT15_function_extensions(INT15_function_extensions *int15_func)
107 printk(BIOS_DEBUG, "Initialize function extensions for Callback function number 04E08h ..\n");
108 __int15_func.regs.func00_LCD_panel_id = int15_func->regs.func00_LCD_panel_id;
109 __int15_func.regs.func05_TV_standard = int15_func->regs.func05_TV_standard;
110 mainboard_interrupt_handlers(0x15, &sbios_INT15_handler);