Vladimir Serbinenko | e7e9502 | 2014-01-12 15:26:15 +0100 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2007-2010 coresystems GmbH |
| 5 | * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved. |
Vladimir Serbinenko | b2939f7 | 2014-01-22 17:12:35 +0100 | [diff] [blame] | 6 | * Copyright (C) 2014 Vladimir Serbinenko |
Vladimir Serbinenko | e7e9502 | 2014-01-12 15:26:15 +0100 | [diff] [blame] | 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 <stdint.h> |
| 23 | #include <string.h> |
| 24 | #include <lib.h> |
| 25 | #include <timestamp.h> |
| 26 | #include <arch/byteorder.h> |
| 27 | #include <arch/io.h> |
| 28 | #include <device/pci_def.h> |
| 29 | #include <device/pnp_def.h> |
| 30 | #include <cpu/x86/lapic.h> |
| 31 | #include <pc80/mc146818rtc.h> |
Kyösti Mälkki | 6722f8d | 2014-06-16 09:14:49 +0300 | [diff] [blame] | 32 | #include <arch/acpi.h> |
Vladimir Serbinenko | e7e9502 | 2014-01-12 15:26:15 +0100 | [diff] [blame] | 33 | #include <cbmem.h> |
| 34 | #include <console/console.h> |
Edward O'Callaghan | 77757c2 | 2015-01-04 21:33:39 +1100 | [diff] [blame^] | 35 | #include <northbridge/intel/sandybridge/sandybridge.h> |
| 36 | #include <northbridge/intel/sandybridge/raminit_native.h> |
| 37 | #include <southbridge/intel/bd82x6x/pch.h> |
| 38 | #include <southbridge/intel/bd82x6x/gpio.h> |
Vladimir Serbinenko | e7e9502 | 2014-01-12 15:26:15 +0100 | [diff] [blame] | 39 | #include <arch/cpu.h> |
Vladimir Serbinenko | e7e9502 | 2014-01-12 15:26:15 +0100 | [diff] [blame] | 40 | #include <cpu/x86/msr.h> |
Vladimir Serbinenko | e7e9502 | 2014-01-12 15:26:15 +0100 | [diff] [blame] | 41 | #include <cbfs.h> |
| 42 | |
Vladimir Serbinenko | fa1d688 | 2014-10-19 02:50:45 +0200 | [diff] [blame] | 43 | void pch_enable_lpc(void) |
Vladimir Serbinenko | e7e9502 | 2014-01-12 15:26:15 +0100 | [diff] [blame] | 44 | { |
| 45 | /* X230 EC Decode Range Port60/64, Port62/66 */ |
| 46 | /* Enable EC, PS/2 Keyboard/Mouse */ |
| 47 | pci_write_config16(PCH_LPC_DEV, LPC_EN, |
| 48 | CNF2_LPC_EN | CNF1_LPC_EN | MC_LPC_EN | KBC_LPC_EN | |
| 49 | COMA_LPC_EN); |
| 50 | |
| 51 | pci_write_config32(PCH_LPC_DEV, LPC_GEN1_DEC, 0x7c1601); |
| 52 | pci_write_config32(PCH_LPC_DEV, LPC_GEN2_DEC, 0xc15e1); |
| 53 | pci_write_config32(PCH_LPC_DEV, LPC_GEN4_DEC, 0x0c06a1); |
| 54 | |
| 55 | pci_write_config16(PCH_LPC_DEV, LPC_IO_DEC, 0x10); |
| 56 | |
| 57 | pci_write_config32(PCH_LPC_DEV, 0xac, |
| 58 | 0x80010000); |
| 59 | } |
| 60 | |
Vladimir Serbinenko | fa1d688 | 2014-10-19 02:50:45 +0200 | [diff] [blame] | 61 | void rcba_config(void) |
Vladimir Serbinenko | e7e9502 | 2014-01-12 15:26:15 +0100 | [diff] [blame] | 62 | { |
Vladimir Serbinenko | e7e9502 | 2014-01-12 15:26:15 +0100 | [diff] [blame] | 63 | /* Disable unused devices (board specific) */ |
| 64 | RCBA32(FD) = 0x17f81fe3; |
| 65 | RCBA32(BUC) = 0; |
| 66 | } |
| 67 | |
Vladimir Serbinenko | fa1d688 | 2014-10-19 02:50:45 +0200 | [diff] [blame] | 68 | const struct southbridge_usb_port mainboard_usb_ports[] = { |
| 69 | { 1, 0, 0 }, /* P0 (left, fan side), OC 0 */ |
| 70 | { 1, 0, 1 }, /* P1 (left touchpad side), OC 1 */ |
| 71 | { 1, 1, 3 }, /* P2: dock, OC 3 */ |
| 72 | { 1, 1, -1 }, /* P3: wwan, no OC */ |
| 73 | { 1, 1, -1 }, /* P4: Wacom tablet on X230t, otherwise empty */ |
| 74 | { 1, 1, -1 }, /* P5: Expresscard, no OC */ |
| 75 | { 0, 0, -1 }, /* P6: Empty */ |
| 76 | { 1, 2, -1 }, /* P7: dock, no OC */ |
| 77 | { 1, 0, -1 }, |
| 78 | { 1, 2, 5 }, /* P9: Right (EHCI debug), OC 5 */ |
| 79 | { 1, 1, -1 }, /* P10: fingerprint reader, no OC */ |
| 80 | { 1, 1, -1 }, /* P11: bluetooth, no OC. */ |
| 81 | { 1, 1, -1 }, /* P12: wlan, no OC */ |
| 82 | { 1, 1, -1 }, /* P13: webcam, no OC */ |
| 83 | }; |
Vladimir Serbinenko | e7e9502 | 2014-01-12 15:26:15 +0100 | [diff] [blame] | 84 | |
Vladimir Serbinenko | fa1d688 | 2014-10-19 02:50:45 +0200 | [diff] [blame] | 85 | void mainboard_get_spd(spd_raw_data *spd) { |
Vladimir Serbinenko | 7686a56 | 2014-05-18 11:05:56 +0200 | [diff] [blame] | 86 | read_spd (&spd[0], 0x50); |
| 87 | read_spd (&spd[2], 0x51); |
Vladimir Serbinenko | e7e9502 | 2014-01-12 15:26:15 +0100 | [diff] [blame] | 88 | } |