blob: 372c4b6647b19aef0231d0198de726aaf5ec59a6 [file] [log] [blame]
Libra Lic1436932009-12-23 19:16:47 +00001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2009 coresystems GmbH
5 * Copyright (C) 2009 Libra Li <libra.li@technexion.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22#include <stdint.h>
23#include <stdlib.h>
24#include <console/console.h>
25#include <arch/interrupt.h>
26#include "vgabios.h"
27
28
29int tim5690_int15_handler(struct eregs *regs);
30
31static rs690_vbios_regs vbios_regs_local;
32
33/* Initialization interrupt function */
34static void vbios_fun_init(rs690_vbios_regs *vbios_regs)
35{
36 vbios_regs_local.int15_regs.fun00_panel_id = vbios_regs->int15_regs.fun00_panel_id;
37 vbios_regs_local.int15_regs.fun05_tv_standard = vbios_regs->int15_regs.fun05_tv_standard;
38}
Stefan Reinauer23836e22010-04-15 12:39:29 +000039
Libra Lic1436932009-12-23 19:16:47 +000040/* BIOS int15 function */
41int tim5690_int15_handler(struct eregs *regs)
42{
43 int res = -1;
44
45 printk(BIOS_DEBUG, "tim5690_int15_handler\n");
46
47 switch (regs->eax & 0xffff) {
48 case AMD_RS690_INT15:
49 switch (regs->ebx & 0xff) {
50 case 0x00:
51 regs->eax &= ~(0xff);
52 regs->ebx = (regs->ebx & ~(0xff)) | vbios_regs_local.int15_regs.fun00_panel_id;
53 res = 0;
54 break;
55 case 0x05:
56 regs->eax &= ~(0xff);
57 regs->ebx = (regs->ebx & ~(0xff)) | vbios_regs_local.int15_regs.fun05_tv_standard;
58 res = 0;
59 break;
60 }
61 break;
62 default:
63 printk(BIOS_DEBUG, "Unknown INT15 function %04x!\n",
64 regs->eax & 0xffff);
65 break;
66 }
67
68 return res;
69}
70
71/* Initialization VBIOS function */
72void vgabios_init(rs690_vbios_regs *vbios_regs)
73{
74 printk(BIOS_DEBUG, "vgabios_init\n");
75
76 mainboard_interrupt_handlers(0x15, &tim5690_int15_handler);
77 vbios_fun_init(vbios_regs);
78}