blob: ef914ec5cafc129468375fbceb0d94066f80c7a6 [file] [log] [blame]
Mono9b908242014-03-02 18:40:36 +01001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2007-2009 coresystems GmbH
5 * Copyright (C) 2011 Sven Schnelle <svens@stackframe.org>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; version 2 of
10 * the License.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
Patrick Georgib890a122015-03-26 15:17:45 +010019 * Foundation, Inc.
Mono9b908242014-03-02 18:40:36 +010020 */
21
22#include <console/console.h>
23#include <device/device.h>
24#include <arch/io.h>
25#include <delay.h>
26#include <device/pci_def.h>
27#include <device/pci_ops.h>
28#include <device/pci_ids.h>
29#include <arch/io.h>
30#include <arch/interrupt.h>
31#include <northbridge/intel/i945/i945.h>
32#include <pc80/mc146818rtc.h>
33#include <arch/x86/include/arch/acpigen.h>
34#include <smbios.h>
Vladimir Serbinenkoa2a906e2014-09-01 01:41:37 +020035#include <drivers/intel/gma/int15.h>
Mono62805e62015-06-07 13:21:59 +020036#include <ec/acpi/ec.h>
Mono9b908242014-03-02 18:40:36 +010037#define PANEL INT15_5F35_CL_DISPLAY_DEFAULT
38
Axel Holewa1682b8d2014-12-25 08:11:54 +010039static acpi_cstate_t cst_entries[] = {
40 {
41 .ctype = 1,
42 .latency = 1,
43 .power = 1000,
44 .resource = {
45 .space_id = ACPI_ADDRESS_SPACE_FIXED,
46 .bit_width = ACPI_FFIXEDHW_VENDOR_INTEL,
47 .bit_offset = ACPI_FFIXEDHW_CLASS_MWAIT,
48 {
49 .resv = 0,
50 },
51 .addrl = 0,
52 .addrh = 0,
53 }
54 },
55 {
56 .ctype = 2,
57 .latency = 1,
58 .power = 500,
59 .resource = {
60 .space_id = ACPI_ADDRESS_SPACE_FIXED,
61 .bit_width = ACPI_FFIXEDHW_VENDOR_INTEL,
62 .bit_offset = ACPI_FFIXEDHW_CLASS_MWAIT,
63 {
64 .resv = 0,
65 },
66 .addrl = 0x10,
67 .addrh = 0,
68 }
69 },
70};
71
Mono9b908242014-03-02 18:40:36 +010072int get_cst_entries(acpi_cstate_t **entries)
73{
Axel Holewa1682b8d2014-12-25 08:11:54 +010074 *entries = cst_entries;
75 return ARRAY_SIZE(cst_entries);
Mono9b908242014-03-02 18:40:36 +010076}
77
78static void mainboard_init(device_t dev)
79{
Vladimir Serbinenkoa2a906e2014-09-01 01:41:37 +020080 install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, PANEL, 3);
Mono9b908242014-03-02 18:40:36 +010081}
82
83static void mainboard_enable(device_t dev)
84{
85 dev->ops->init = mainboard_init;
Mono9b908242014-03-02 18:40:36 +010086}
87
Mono62805e62015-06-07 13:21:59 +020088static void mainboard_final(void *chip_info)
89{
90 ec_set_bit(0x10, 2); /* switch off led */
91}
92
Mono9b908242014-03-02 18:40:36 +010093struct chip_operations mainboard_ops = {
94 .enable_dev = mainboard_enable,
Mono62805e62015-06-07 13:21:59 +020095 .final = mainboard_final,
Mono9b908242014-03-02 18:40:36 +010096};
97