2 * This file is part of the coreboot project.
4 * Copyright (C) 2007-2009 coresystems GmbH
5 * Copyright (C) 2011 Google Inc.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
18 #include <device/device.h>
19 #include <device/pci_ops.h>
20 #include <drivers/intel/gma/int15.h>
21 #include <arch/acpi.h>
22 #include <southbridge/intel/bd82x6x/pch.h>
23 #include <device/pci.h>
24 #include <ec/quanta/it8518/ec.h>
25 #include <vendorcode/google/chromeos/chromeos.h>
30 void mainboard_suspend_resume(void)
32 /* Stout EC needs to be put back in ACPI mode */
33 ec_write_cmd(EC_CMD_NOTIFY_ACPI_ENTER
);
38 static void mainboard_init(struct device
*dev
)
40 struct device
*ethernet_dev
= NULL
;
42 /* Initialize the Embedded Controller */
46 * Battery life time - LAN PCIe should enter ASPM L1 to save
47 * power when LAN connection is idle.
48 * enable CLKREQ: LAN pci config space 0x81h=01
50 ethernet_dev
= dev_find_device(STOUT_NIC_VENDOR_ID
,
51 STOUT_NIC_DEVICE_ID
, dev
);
53 if (ethernet_dev
!= NULL
)
54 pci_write_config8(ethernet_dev
, 0x81, 0x01);
57 // mainboard_enable is executed as first thing after
60 static void mainboard_enable(struct device
*dev
)
62 dev
->ops
->init
= mainboard_init
;
63 dev
->ops
->acpi_inject_dsdt_generator
= chromeos_dsdt_generator
;
64 install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS
, GMA_INT15_PANEL_FIT_DEFAULT
, GMA_INT15_BOOT_DISPLAY_DEFAULT
, 0);
67 struct chip_operations mainboard_ops
= {
68 .enable_dev
= mainboard_enable
,