blob: 8bfd66b319a61e6794cf713afbca871d7b1a4bb6 [file] [log] [blame]
Vladimir Serbinenko61ffb4c2014-08-12 22:51:53 +02001/*
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 Serbinenko61ffb4c2014-08-12 22:51:53 +020023#include <device/device.h>
24#include <console/console.h>
Vladimir Serbinenkoa2a906e2014-09-01 01:41:37 +020025#include <drivers/intel/gma/int15.h>
Vladimir Serbinenko61ffb4c2014-08-12 22:51:53 +020026#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 Serbinenko61ffb4c2014-08-12 22:51:53 +020034
Vladimir Serbinenko61ffb4c2014-08-12 22:51:53 +020035#include "cstates.c" /* Include it, as the linker won't find
36 the overloaded weak function in there. */
Vladimir Serbinenko61ffb4c2014-08-12 22:51:53 +020037
Vladimir Serbinenko61ffb4c2014-08-12 22:51:53 +020038const 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 Serbinenko61ffb4c2014-08-12 22:51:53 +020047static 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
55static void mainboard_enable(device_t dev)
56{
Vladimir Serbinenkoa2a906e2014-09-01 01:41:37 +020057 install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_CENTERING, GMA_INT15_BOOT_DISPLAY_DEFAULT, 2);
Vladimir Serbinenko61ffb4c2014-08-12 22:51:53 +020058
Vladimir Serbinenko61ffb4c2014-08-12 22:51:53 +020059 dev->ops->init = mainboard_init;
60}
61
62struct chip_operations mainboard_ops = {
63 .enable_dev = mainboard_enable,
64};
65