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>
6
#include <
drivers/intel/gma/int15.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 */
45
backlight_enable
();
46
47
/* Disable Dummy DCC -> GP45 = 1 */
48
outb
(
inb
(0x60f) | (1 << 5), 0x60f);
49
50
/* LCD panel type is SIO GPIO40-43 */
51
install_intel_vga_int15_handler
(
GMA_INT15_ACTIVE_LFP_INT_LVDS
,
GMA_INT15_PANEL_FIT_DEFAULT
,
GMA_INT15_BOOT_DISPLAY_DEFAULT
, 3);
52
53
#if DUMP_RUNTIME_REGISTERS
54
dump_runtime_registers();
55
#endif
56
57
dev->
ops
->
final
=
mainboard_final
;
58
}
59
60
struct
chip_operations
mainboard_ops
= {
61
.
enable_dev
=
mainboard_enable
,
62
};
mainboard_ops
struct chip_operations mainboard_ops
Definition:
mainboard.c:19
printk
#define printk(level,...)
Definition:
stdlib.h:16
console.h
inb
u8 inb(u16 port)
outb
void outb(u8 val, u16 port)
install_intel_vga_int15_handler
void install_intel_vga_int15_handler(int active_lfp_, int pfit_, int display_, int panel_type_)
Definition:
int15.c:101
int15.h
GMA_INT15_BOOT_DISPLAY_DEFAULT
@ GMA_INT15_BOOT_DISPLAY_DEFAULT
Definition:
int15.h:6
GMA_INT15_ACTIVE_LFP_INT_LVDS
@ GMA_INT15_ACTIVE_LFP_INT_LVDS
Definition:
int15.h:25
GMA_INT15_PANEL_FIT_DEFAULT
@ GMA_INT15_PANEL_FIT_DEFAULT
Definition:
int15.h:17
ec.h
device.h
BIOS_DEBUG
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
Definition:
loglevel.h:128
m3885.h
backlight_enable
static void backlight_enable(void)
Definition:
mainboard.c:13
mainboard_final
static void mainboard_final(struct device *dev)
Definition:
mainboard.c:33
mainboard_enable
static void mainboard_enable(struct device *dev)
Definition:
mainboard.c:40
chip_operations
Definition:
device.h:23
chip_operations::enable_dev
void(* enable_dev)(struct device *dev)
Definition:
device.h:24
device_operations::final
void(* final)(struct device *dev)
Definition:
device.h:43
device
Definition:
device.h:107
device::ops
struct device_operations * ops
Definition:
device.h:143
src
mainboard
roda
rk886ex
mainboard.c
Generated by
1.9.1