Nicolas Reinecke | 29d358e | 2015-01-31 19:20:50 +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-2012 Google Inc. |
| 6 | * Copyright (C) 2014 Vladimir Serbinenko |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by |
| 10 | * the Free Software Foundation; version 2 of 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 |
| 19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 20 | */ |
| 21 | |
| 22 | #include <types.h> |
| 23 | #include <string.h> |
| 24 | #include <device/device.h> |
| 25 | #include <device/pci_def.h> |
| 26 | #include <device/pci_ops.h> |
| 27 | #include <console/console.h> |
| 28 | #include <drivers/intel/gma/int15.h> |
| 29 | #include <arch/acpi.h> |
| 30 | #include <southbridge/intel/bd82x6x/pch.h> |
| 31 | #include <smbios.h> |
| 32 | #include <device/pci.h> |
| 33 | #include <pc80/keyboard.h> |
| 34 | #include <ec/lenovo/h8/h8.h> |
| 35 | #include <version.h> |
| 36 | |
| 37 | void mainboard_suspend_resume(void) |
| 38 | { |
| 39 | /* Call SMM finalize() handlers before resume */ |
| 40 | outb(0xcb, 0xb2); |
| 41 | } |
| 42 | |
| 43 | const char *smbios_mainboard_bios_version(void) |
| 44 | { |
| 45 | static char *s = NULL; |
| 46 | |
| 47 | /* Satisfy thinkpad_acpi. */ |
| 48 | if (strlen(CONFIG_LOCALVERSION)) |
| 49 | return "CBET4000 " CONFIG_LOCALVERSION; |
| 50 | |
| 51 | if (s != NULL) |
| 52 | return s; |
| 53 | s = strconcat("CBET4000 ", coreboot_version); |
| 54 | return s; |
| 55 | } |
| 56 | |
| 57 | static void mainboard_init(device_t dev) |
| 58 | { |
| 59 | /* init spi */ |
| 60 | RCBA32(0x38c8) = 0x00002005; |
| 61 | RCBA32(0x38c4) = 0x00802005; |
| 62 | RCBA32(0x38c0) = 0x00000007; |
| 63 | |
| 64 | pc_keyboard_init(); |
| 65 | } |
| 66 | |
| 67 | static void mainboard_enable(device_t dev) |
| 68 | { |
| 69 | dev->ops->init = mainboard_init; |
| 70 | |
| 71 | install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, |
| 72 | GMA_INT15_PANEL_FIT_DEFAULT, |
| 73 | GMA_INT15_BOOT_DISPLAY_DEFAULT, 0); |
| 74 | } |
| 75 | |
| 76 | void h8_mainboard_init_dock(void) |
| 77 | { |
| 78 | } |
| 79 | |
| 80 | struct chip_operations mainboard_ops = { |
| 81 | .enable_dev = mainboard_enable, |
| 82 | }; |