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. |
Mono | 9b90824 | 2014-03-02 18:40:36 +0100 | [diff] [blame] | 16 | */ |
| 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 Serbinenko | a2a906e | 2014-09-01 01:41:37 +0200 | [diff] [blame] | 30 | #include <drivers/intel/gma/int15.h> |
Mono | 62805e6 | 2015-06-07 13:21:59 +0200 | [diff] [blame] | 31 | #include <ec/acpi/ec.h> |
Mono | 9b90824 | 2014-03-02 18:40:36 +0100 | [diff] [blame] | 32 | #define PANEL INT15_5F35_CL_DISPLAY_DEFAULT |
| 33 | |
Axel Holewa | 1682b8d | 2014-12-25 08:11:54 +0100 | [diff] [blame] | 34 | static 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 | |
Mono | 9b90824 | 2014-03-02 18:40:36 +0100 | [diff] [blame] | 67 | int get_cst_entries(acpi_cstate_t **entries) |
| 68 | { |
Axel Holewa | 1682b8d | 2014-12-25 08:11:54 +0100 | [diff] [blame] | 69 | *entries = cst_entries; |
| 70 | return ARRAY_SIZE(cst_entries); |
Mono | 9b90824 | 2014-03-02 18:40:36 +0100 | [diff] [blame] | 71 | } |
| 72 | |
| 73 | static void mainboard_init(device_t dev) |
| 74 | { |
Vladimir Serbinenko | a2a906e | 2014-09-01 01:41:37 +0200 | [diff] [blame] | 75 | 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] | 76 | } |
| 77 | |
| 78 | static void mainboard_enable(device_t dev) |
| 79 | { |
| 80 | dev->ops->init = mainboard_init; |
Mono | 9b90824 | 2014-03-02 18:40:36 +0100 | [diff] [blame] | 81 | } |
| 82 | |
Mono | 62805e6 | 2015-06-07 13:21:59 +0200 | [diff] [blame] | 83 | static void mainboard_final(void *chip_info) |
| 84 | { |
| 85 | ec_set_bit(0x10, 2); /* switch off led */ |
| 86 | } |
| 87 | |
Mono | 9b90824 | 2014-03-02 18:40:36 +0100 | [diff] [blame] | 88 | struct chip_operations mainboard_ops = { |
| 89 | .enable_dev = mainboard_enable, |
Mono | 62805e6 | 2015-06-07 13:21:59 +0200 | [diff] [blame] | 90 | .final = mainboard_final, |
Mono | 9b90824 | 2014-03-02 18:40:36 +0100 | [diff] [blame] | 91 | }; |