Vladimir Serbinenko | 61ffb4c | 2014-08-12 22:51:53 +0200 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2012 secunet Security Networks AG |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; version 2 of the License. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | */ |
| 19 | |
| 20 | #include <stdint.h> |
| 21 | #include <stdlib.h> |
| 22 | #include <arch/io.h> |
Vladimir Serbinenko | 61ffb4c | 2014-08-12 22:51:53 +0200 | [diff] [blame] | 23 | #include <device/device.h> |
| 24 | #include <console/console.h> |
Vladimir Serbinenko | a2a906e | 2014-09-01 01:41:37 +0200 | [diff] [blame] | 25 | #include <drivers/intel/gma/int15.h> |
Vladimir Serbinenko | 61ffb4c | 2014-08-12 22:51:53 +0200 | [diff] [blame] | 26 | #include <pc80/keyboard.h> |
| 27 | #include <ec/acpi/ec.h> |
| 28 | #include <smbios.h> |
| 29 | #include <string.h> |
| 30 | #include <build.h> |
| 31 | #include <ec/lenovo/pmh7/pmh7.h> |
| 32 | #include <ec/acpi/ec.h> |
| 33 | #include <ec/lenovo/h8/h8.h> |
Vladimir Serbinenko | 61ffb4c | 2014-08-12 22:51:53 +0200 | [diff] [blame] | 34 | |
Vladimir Serbinenko | 61ffb4c | 2014-08-12 22:51:53 +0200 | [diff] [blame] | 35 | #include "cstates.c" /* Include it, as the linker won't find |
| 36 | the overloaded weak function in there. */ |
Vladimir Serbinenko | 61ffb4c | 2014-08-12 22:51:53 +0200 | [diff] [blame] | 37 | |
Vladimir Serbinenko | 61ffb4c | 2014-08-12 22:51:53 +0200 | [diff] [blame] | 38 | const char *smbios_mainboard_bios_version(void) |
| 39 | { |
| 40 | /* Satisfy thinkpad_acpi. */ |
| 41 | if (strlen(CONFIG_LOCALVERSION)) |
| 42 | return "CBET4000 " CONFIG_LOCALVERSION; |
| 43 | else |
| 44 | return "CBET4000 " COREBOOT_VERSION; |
| 45 | } |
| 46 | |
Vladimir Serbinenko | 61ffb4c | 2014-08-12 22:51:53 +0200 | [diff] [blame] | 47 | static void mainboard_init(device_t dev) |
| 48 | { |
| 49 | /* This sneaked in here, because X200 SuperIO chip isn't really |
| 50 | connected to anything and hence we don't init it. |
| 51 | */ |
| 52 | pc_keyboard_init(); |
| 53 | } |
| 54 | |
| 55 | static void mainboard_enable(device_t dev) |
| 56 | { |
Vladimir Serbinenko | a2a906e | 2014-09-01 01:41:37 +0200 | [diff] [blame] | 57 | install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_CENTERING, GMA_INT15_BOOT_DISPLAY_DEFAULT, 2); |
Vladimir Serbinenko | 61ffb4c | 2014-08-12 22:51:53 +0200 | [diff] [blame] | 58 | |
Vladimir Serbinenko | 61ffb4c | 2014-08-12 22:51:53 +0200 | [diff] [blame] | 59 | dev->ops->init = mainboard_init; |
| 60 | } |
| 61 | |
| 62 | struct chip_operations mainboard_ops = { |
| 63 | .enable_dev = mainboard_enable, |
| 64 | }; |
| 65 | |