Mono | 9b90824 | 2014-03-02 18:40:36 +0100 | [diff] [blame] | 1 | /* |
| 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 Georgi | b890a12 | 2015-03-26 15:17:45 +0100 | [diff] [blame] | 19 | * Foundation, Inc. |
Mono | 9b90824 | 2014-03-02 18:40:36 +0100 | [diff] [blame] | 20 | */ |
| 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 Serbinenko | a2a906e | 2014-09-01 01:41:37 +0200 | [diff] [blame] | 35 | #include <drivers/intel/gma/int15.h> |
Mono | 62805e6 | 2015-06-07 13:21:59 +0200 | [diff] [blame^] | 36 | #include <ec/acpi/ec.h> |
Mono | 9b90824 | 2014-03-02 18:40:36 +0100 | [diff] [blame] | 37 | #define PANEL INT15_5F35_CL_DISPLAY_DEFAULT |
| 38 | |
Axel Holewa | 1682b8d | 2014-12-25 08:11:54 +0100 | [diff] [blame] | 39 | static 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 | |
Mono | 9b90824 | 2014-03-02 18:40:36 +0100 | [diff] [blame] | 72 | int get_cst_entries(acpi_cstate_t **entries) |
| 73 | { |
Axel Holewa | 1682b8d | 2014-12-25 08:11:54 +0100 | [diff] [blame] | 74 | *entries = cst_entries; |
| 75 | return ARRAY_SIZE(cst_entries); |
Mono | 9b90824 | 2014-03-02 18:40:36 +0100 | [diff] [blame] | 76 | } |
| 77 | |
| 78 | static void mainboard_init(device_t dev) |
| 79 | { |
Vladimir Serbinenko | a2a906e | 2014-09-01 01:41:37 +0200 | [diff] [blame] | 80 | install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, PANEL, 3); |
Mono | 9b90824 | 2014-03-02 18:40:36 +0100 | [diff] [blame] | 81 | } |
| 82 | |
| 83 | static void mainboard_enable(device_t dev) |
| 84 | { |
| 85 | dev->ops->init = mainboard_init; |
Mono | 9b90824 | 2014-03-02 18:40:36 +0100 | [diff] [blame] | 86 | } |
| 87 | |
Mono | 62805e6 | 2015-06-07 13:21:59 +0200 | [diff] [blame^] | 88 | static void mainboard_final(void *chip_info) |
| 89 | { |
| 90 | ec_set_bit(0x10, 2); /* switch off led */ |
| 91 | } |
| 92 | |
Mono | 9b90824 | 2014-03-02 18:40:36 +0100 | [diff] [blame] | 93 | struct chip_operations mainboard_ops = { |
| 94 | .enable_dev = mainboard_enable, |
Mono | 62805e6 | 2015-06-07 13:21:59 +0200 | [diff] [blame^] | 95 | .final = mainboard_final, |
Mono | 9b90824 | 2014-03-02 18:40:36 +0100 | [diff] [blame] | 96 | }; |
| 97 | |