blob: eb74ec16f8e3d78fb99d3f153bbd9ef8201f022b [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.
Mono9b908242014-03-02 18:40:36 +010016 */
17
18#include <console/console.h>
19#include <device/device.h>
20#include <arch/io.h>
21#include <delay.h>
22#include <device/pci_def.h>
23#include <device/pci_ops.h>
24#include <device/pci_ids.h>
25#include <arch/io.h>
26#include <arch/interrupt.h>
27#include <northbridge/intel/i945/i945.h>
28#include <pc80/mc146818rtc.h>
29#include <arch/x86/include/arch/acpigen.h>
Vladimir Serbinenkoa2a906e2014-09-01 01:41:37 +020030#include <drivers/intel/gma/int15.h>
Mono62805e62015-06-07 13:21:59 +020031#include <ec/acpi/ec.h>
Mono9b908242014-03-02 18:40:36 +010032#define PANEL INT15_5F35_CL_DISPLAY_DEFAULT
33
Axel Holewa1682b8d2014-12-25 08:11:54 +010034static acpi_cstate_t cst_entries[] = {
35 {
36 .ctype = 1,
37 .latency = 1,
38 .power = 1000,
39 .resource = {
40 .space_id = ACPI_ADDRESS_SPACE_FIXED,
41 .bit_width = ACPI_FFIXEDHW_VENDOR_INTEL,
42 .bit_offset = ACPI_FFIXEDHW_CLASS_MWAIT,
43 {
44 .resv = 0,
45 },
46 .addrl = 0,
47 .addrh = 0,
48 }
49 },
50 {
51 .ctype = 2,
52 .latency = 1,
53 .power = 500,
54 .resource = {
55 .space_id = ACPI_ADDRESS_SPACE_FIXED,
56 .bit_width = ACPI_FFIXEDHW_VENDOR_INTEL,
57 .bit_offset = ACPI_FFIXEDHW_CLASS_MWAIT,
58 {
59 .resv = 0,
60 },
61 .addrl = 0x10,
62 .addrh = 0,
63 }
64 },
65};
66
Mono9b908242014-03-02 18:40:36 +010067int get_cst_entries(acpi_cstate_t **entries)
68{
Axel Holewa1682b8d2014-12-25 08:11:54 +010069 *entries = cst_entries;
70 return ARRAY_SIZE(cst_entries);
Mono9b908242014-03-02 18:40:36 +010071}
72
73static void mainboard_init(device_t dev)
74{
Vladimir Serbinenkoa2a906e2014-09-01 01:41:37 +020075 install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, PANEL, 3);
Mono9b908242014-03-02 18:40:36 +010076}
77
78static void mainboard_enable(device_t dev)
79{
80 dev->ops->init = mainboard_init;
Mono9b908242014-03-02 18:40:36 +010081}
82
Mono62805e62015-06-07 13:21:59 +020083static void mainboard_final(void *chip_info)
84{
85 ec_set_bit(0x10, 2); /* switch off led */
86}
87
Mono9b908242014-03-02 18:40:36 +010088struct chip_operations mainboard_ops = {
89 .enable_dev = mainboard_enable,
Mono62805e62015-06-07 13:21:59 +020090 .final = mainboard_final,
Mono9b908242014-03-02 18:40:36 +010091};