blob: e1ea7c265fc2a44ca6d203e9768b049498da5d26 [file] [log] [blame]
Angel Pons2e8a4b02020-04-05 13:22:54 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Stefan Reinauerb7ecf6d2013-03-13 17:13:32 -07002
Stefan Reinauerb7ecf6d2013-03-13 17:13:32 -07003#include <device/device.h>
Stefan Reinauerb7ecf6d2013-03-13 17:13:32 -07004#include <device/pci_ops.h>
Vladimir Serbinenkoa2a906e2014-09-01 01:41:37 +02005#include <drivers/intel/gma/int15.h>
Furquan Shaikh76cedd22020-05-02 10:24:23 -07006#include <acpi/acpi.h>
Stefan Reinauerb7ecf6d2013-03-13 17:13:32 -07007#include <southbridge/intel/bd82x6x/pch.h>
Stefan Reinauerb7ecf6d2013-03-13 17:13:32 -07008#include <ec/quanta/it8518/ec.h>
9
Elyes HAOUAS32f48a22019-05-02 21:21:42 +020010#include "ec.h"
11#include "onboard.h"
12
Stefan Reinauerb7ecf6d2013-03-13 17:13:32 -070013void mainboard_suspend_resume(void)
14{
Stefan Reinauerb7ecf6d2013-03-13 17:13:32 -070015 /* Stout EC needs to be put back in ACPI mode */
16 ec_write_cmd(EC_CMD_NOTIFY_ACPI_ENTER);
17}
18
Elyes HAOUASd129d432018-05-04 20:23:33 +020019static void mainboard_init(struct device *dev)
Stefan Reinauerb7ecf6d2013-03-13 17:13:32 -070020{
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
Elyes HAOUASd129d432018-05-04 20:23:33 +020038static void mainboard_enable(struct device *dev)
Stefan Reinauerb7ecf6d2013-03-13 17:13:32 -070039{
40 dev->ops->init = mainboard_init;
Vladimir Serbinenkoa2a906e2014-09-01 01:41:37 +020041 install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
Stefan Reinauerb7ecf6d2013-03-13 17:13:32 -070042}
43
44struct chip_operations mainboard_ops = {
45 .enable_dev = mainboard_enable,
46};