blob: fe4b41cde9ddafe6f0c99a4a3672f973d86e9dd2 [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.
Libra Lic1436932009-12-23 19:16:47 +000016 */
17
18#include <stdint.h>
19#include <stdlib.h>
20#include <console/console.h>
21#include <arch/interrupt.h>
22#include "vgabios.h"
Patrick Georgi199b09c2012-11-22 12:46:12 +010023#include <x86emu/regs.h>
Libra Lic1436932009-12-23 19:16:47 +000024
25
Patrick Georgi199b09c2012-11-22 12:46:12 +010026int tim5690_int15_handler(void);
Libra Lic1436932009-12-23 19:16:47 +000027
28static rs690_vbios_regs vbios_regs_local;
29
30/* Initialization interrupt function */
31static void vbios_fun_init(rs690_vbios_regs *vbios_regs)
32{
Elyes HAOUAS8f372d02016-09-27 21:36:55 +020033 vbios_regs_local.int15_regs.fun00_panel_id = vbios_regs->int15_regs.fun00_panel_id;
34 vbios_regs_local.int15_regs.fun05_tv_standard = vbios_regs->int15_regs.fun05_tv_standard;
Libra Lic1436932009-12-23 19:16:47 +000035}
Stefan Reinauer23836e22010-04-15 12:39:29 +000036
Libra Lic1436932009-12-23 19:16:47 +000037/* BIOS int15 function */
Patrick Georgi199b09c2012-11-22 12:46:12 +010038int tim5690_int15_handler(void)
Libra Lic1436932009-12-23 19:16:47 +000039{
Elyes HAOUAS8f372d02016-09-27 21:36:55 +020040 int res = 0;
Libra Lic1436932009-12-23 19:16:47 +000041
Elyes HAOUAS8f372d02016-09-27 21:36:55 +020042 printk(BIOS_DEBUG, "tim5690_int15_handler\n");
Libra Lic1436932009-12-23 19:16:47 +000043
Elyes HAOUAS8f372d02016-09-27 21:36:55 +020044 switch (X86_EAX & 0xffff) {
45 case AMD_RS690_INT15:
46 switch (X86_EBX & 0xff) {
47 case 0x00:
48 X86_EAX &= ~(0xff);
49 X86_EBX = (X86_EBX & ~(0xff)) | vbios_regs_local.int15_regs.fun00_panel_id;
50 res = 1;
51 break;
52 case 0x05:
53 X86_EAX &= ~(0xff);
54 X86_EBX = (X86_EBX & ~(0xff)) | vbios_regs_local.int15_regs.fun05_tv_standard;
55 res = 1;
56 break;
57 }
Libra Lic1436932009-12-23 19:16:47 +000058 break;
Elyes HAOUAS8f372d02016-09-27 21:36:55 +020059 default:
60 printk(BIOS_DEBUG, "Unknown INT15 function %04x!\n",
61 X86_EAX & 0xffff);
62 break;
63 }
Libra Lic1436932009-12-23 19:16:47 +000064
Elyes HAOUAS8f372d02016-09-27 21:36:55 +020065 return res;
Libra Lic1436932009-12-23 19:16:47 +000066}
67
68/* Initialization VBIOS function */
69void vgabios_init(rs690_vbios_regs *vbios_regs)
70{
71 printk(BIOS_DEBUG, "vgabios_init\n");
72
73 mainboard_interrupt_handlers(0x15, &tim5690_int15_handler);
74 vbios_fun_init(vbios_regs);
75}