coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
mainboard.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <console/console.h>
4 #include <device/device.h>
5 #include <arch/io.h>
7 #include <ec/acpi/ec.h>
8 
9 #include "m3885.h"
10 
11 #define DUMP_RUNTIME_REGISTERS 0
12 
13 static void backlight_enable(void)
14 {
15  printk(BIOS_DEBUG, "Display I/O: 0x%02x\n", inb(0x60f));
16 }
17 
18 #if DUMP_RUNTIME_REGISTERS
19 static void dump_runtime_registers(void)
20 {
21  int i;
22 
23  printk(BIOS_DEBUG, "SuperIO runtime register block:\n");
24  for (i = 0; i < 0x10; i++)
25  printk(BIOS_DEBUG, "%02x ", i);
26  printk(BIOS_DEBUG, "\n");
27  for (i = 0; i < 0x10; i++)
28  printk(BIOS_DEBUG, "%02x ", inb(0x600 +i));
29  printk(BIOS_DEBUG, "\n");
30 }
31 #endif
32 
33 static void mainboard_final(struct device *dev)
34 {
35  /* Enable Dummy DCC ON# for DVI */
36  printk(BIOS_DEBUG, "Laptop handling...\n");
37  outb(inb(0x60f) & ~(1 << 5), 0x60f);
38 }
39 
40 static void mainboard_enable(struct device *dev)
41 {
42  /* Configure the MultiKey controller */
43 
44  /* Enable LCD Backlight */
46 
47  /* Disable Dummy DCC -> GP45 = 1 */
48  outb(inb(0x60f) | (1 << 5), 0x60f);
49 
50  /* LCD panel type is SIO GPIO40-43 */
52 
53 #if DUMP_RUNTIME_REGISTERS
54  dump_runtime_registers();
55 #endif
56 
57  dev->ops->final = mainboard_final;
58 }
59 
62 };
struct chip_operations mainboard_ops
Definition: mainboard.c:19
#define printk(level,...)
Definition: stdlib.h:16
u8 inb(u16 port)
void outb(u8 val, u16 port)
void install_intel_vga_int15_handler(int active_lfp_, int pfit_, int display_, int panel_type_)
Definition: int15.c:101
@ GMA_INT15_BOOT_DISPLAY_DEFAULT
Definition: int15.h:6
@ GMA_INT15_ACTIVE_LFP_INT_LVDS
Definition: int15.h:25
@ GMA_INT15_PANEL_FIT_DEFAULT
Definition: int15.h:17
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
Definition: loglevel.h:128
static void backlight_enable(void)
Definition: mainboard.c:13
static void mainboard_final(struct device *dev)
Definition: mainboard.c:33
static void mainboard_enable(struct device *dev)
Definition: mainboard.c:40
void(* enable_dev)(struct device *dev)
Definition: device.h:24
void(* final)(struct device *dev)
Definition: device.h:43
Definition: device.h:107
struct device_operations * ops
Definition: device.h:143