coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
int15.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <x86emu/x86emu.h>
4 #include <arch/interrupt.h>
5 #include <console/console.h>
6 
7 #include "int15.h"
8 
10 
12 {
13  int res = 0;
14 
15  printk(BIOS_DEBUG, "%s: AX=%04x BX=%04x CX=%04x DX=%04x\n",
16  __func__, X86_AX, X86_BX, X86_CX, X86_DX);
17 
18  switch (X86_AX) {
19  case 0x5f34:
20  /*
21  * Set Panel Fitting Hook:
22  * bit 2 = Graphics Stretching
23  * bit 1 = Text Stretching
24  * bit 0 = Centering (do not set with bit1 or bit2)
25  * 0 = video BIOS default
26  */
27  X86_AX = 0x005f;
28  X86_CX = pfit;
29  res = 1;
30  break;
31  case 0x5f35:
32  /*
33  * Boot Display Device Hook:
34  * bit 0 = CRT
35  * bit 1 = TV (eDP) *
36  * bit 2 = EFP *
37  * bit 3 = LFP
38  * bit 4 = CRT2
39  * bit 5 = TV2 (eDP) *
40  * bit 6 = EFP2 *
41  * bit 7 = LFP2
42  */
43  X86_AX = 0x005f;
44  X86_CX = display;
45  res = 1;
46  break;
47  case 0x5f40: /* Boot Panel Type */
48  X86_AX = 0x005f; // Success
50  printk(BIOS_DEBUG, "DISPLAY=%x\n", X86_CL);
51  res = 1;
52  break;
53  case 0x5f51:
54  /*
55  * Hook to select active LFP configuration:
56  * 00h = No LVDS, VBIOS does not enable LVDS
57  * 01h = Int-LVDS, LFP driven by integrated LVDS decoder
58  * 02h = SVDO-LVDS, LFP driven by SVDO decoder
59  * 03h = eDP, LFP Driven by Int-DisplayPort encoder
60  */
61  X86_AX = 0x005f;
63  res = 1;
64  break;
65  case 0x5f70:
66  switch ((X86_CX >> 8) & 0xff) {
67  case 0:
68  /* Get Mux */
69  X86_AX = 0x005f;
70  X86_CX = 0x0000;
71  res = 1;
72  break;
73  case 1:
74  /* Set Mux */
75  X86_AX = 0x005f;
76  X86_CX = 0x0000;
77  res = 1;
78  break;
79  case 2:
80  /* Get SG/Non-SG mode */
81  X86_AX = 0x005f;
82  X86_CX = 0x0000;
83  res = 1;
84  break;
85  default:
86  /* Interrupt was not handled */
88  "Unknown INT15 5f70 function: 0x%02x\n",
89  ((X86_CX >> 8) & 0xff));
90  break;
91  }
92  break;
93 
94  default:
95  printk(BIOS_DEBUG, "Unknown INT15 function %04x!\n", X86_AX);
96  break;
97  }
98  return res;
99 }
100 
101 void install_intel_vga_int15_handler(int active_lfp_, int pfit_, int display_, int panel_type_)
102 {
103  active_lfp = active_lfp_;
104  pfit = pfit_;
105  display = display_;
106  panel_type = panel_type_;
108 }
static void mainboard_interrupt_handlers(int intXX, int(*intXX_func)(void))
Definition: interrupt.h:14
#define printk(level,...)
Definition: stdlib.h:16
static int pfit
Definition: int15.c:9
static int active_lfp
Definition: int15.c:9
static int panel_type
Definition: int15.c:9
void install_intel_vga_int15_handler(int active_lfp_, int pfit_, int display_, int panel_type_)
Definition: int15.c:101
int intel_vga_int15_handler(void)
Definition: int15.c:11
static int display
Definition: int15.c:9
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
Definition: loglevel.h:128
#define X86_CX
Definition: regs.h:343
#define X86_BX
Definition: regs.h:342
#define X86_AX
Definition: regs.h:341
#define X86_CL
Definition: regs.h:359
#define X86_DX
Definition: regs.h:344