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 <
device/device.h
>
4
#include <
device/pci_ops.h
>
5
#include <
drivers/intel/gma/int15.h
>
6
#include <
acpi/acpi.h
>
7
#include <
southbridge/intel/bd82x6x/pch.h
>
8
#include <
ec/quanta/it8518/ec.h
>
9
10
#include "
ec.h
"
11
#include "
onboard.h
"
12
13
void
mainboard_suspend_resume
(
void
)
14
{
15
/* Stout EC needs to be put back in ACPI mode */
16
ec_write_cmd
(
EC_CMD_NOTIFY_ACPI_ENTER
);
17
}
18
19
static
void
mainboard_init
(
struct
device
*dev)
20
{
21
struct
device
*ethernet_dev =
NULL
;
22
23
/* Initialize the Embedded Controller */
24
stout_ec_init
();
25
26
/*
27
* Battery life time - LAN PCIe should enter ASPM L1 to save
28
* power when LAN connection is idle.
29
* enable CLKREQ: LAN pci config space 0x81h=01
30
*/
31
ethernet_dev =
dev_find_device
(
STOUT_NIC_VENDOR_ID
,
32
STOUT_NIC_DEVICE_ID
, dev);
33
34
if
(ethernet_dev !=
NULL
)
35
pci_write_config8
(ethernet_dev, 0x81, 0x01);
36
}
37
38
// mainboard_enable is executed as first thing after
39
// enumerate_buses().
40
41
static
void
mainboard_enable
(
struct
device
*dev)
42
{
43
dev->
ops
->
init
=
mainboard_init
;
44
install_intel_vga_int15_handler
(
GMA_INT15_ACTIVE_LFP_INT_LVDS
,
GMA_INT15_PANEL_FIT_DEFAULT
,
GMA_INT15_BOOT_DISPLAY_DEFAULT
, 0);
45
}
46
47
struct
chip_operations
mainboard_ops
= {
48
.
enable_dev
=
mainboard_enable
,
49
};
mainboard_ops
struct chip_operations mainboard_ops
Definition:
mainboard.c:19
dev_find_device
struct device * dev_find_device(u16 vendor, u16 device, struct device *from)
Find a device of a given vendor and type.
Definition:
device_util.c:42
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_write_cmd
void ec_write_cmd(u8 cmd)
Definition:
ec.c:79
ec.h
EC_CMD_NOTIFY_ACPI_ENTER
#define EC_CMD_NOTIFY_ACPI_ENTER
Definition:
ec.h:45
mainboard_suspend_resume
void mainboard_suspend_resume(void)
Definition:
mainboard.c:10
mainboard_init
static void mainboard_init(struct device *dev)
Definition:
mainboard.c:19
mainboard_enable
static void mainboard_enable(struct device *dev)
Definition:
mainboard.c:41
STOUT_NIC_VENDOR_ID
#define STOUT_NIC_VENDOR_ID
Definition:
onboard.h:6
STOUT_NIC_DEVICE_ID
#define STOUT_NIC_DEVICE_ID
Definition:
onboard.h:7
acpi.h
device.h
pci_ops.h
pci_write_config8
static __always_inline void pci_write_config8(const struct device *dev, u16 reg, u8 val)
Definition:
pci_ops.h:64
stout_ec_init
void stout_ec_init(void)
Definition:
ec.c:12
ec.h
onboard.h
pch.h
NULL
#define NULL
Definition:
stddef.h:19
chip_operations
Definition:
device.h:23
chip_operations::enable_dev
void(* enable_dev)(struct device *dev)
Definition:
device.h:24
device_operations::init
void(* init)(struct device *dev)
Definition:
device.h:42
device
Definition:
device.h:107
device::ops
struct device_operations * ops
Definition:
device.h:143
src
mainboard
google
stout
mainboard.c
Generated by
1.9.1