blob: fa52778608d4c9a42d08e9eb5752cd0e8eb2faa0 [file] [log] [blame]
Vladimir Serbinenko94930e22014-08-24 22:40:33 +02001/*
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.
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.
Vladimir Serbinenko94930e22014-08-24 22:40:33 +020016 */
17
18#include <stdint.h>
19#include <string.h>
20#include <lib.h>
21#include <timestamp.h>
22#include <arch/byteorder.h>
23#include <arch/io.h>
24#include <device/pci_def.h>
25#include <device/pnp_def.h>
26#include <cpu/x86/lapic.h>
Vladimir Serbinenko94930e22014-08-24 22:40:33 +020027#include <arch/acpi.h>
Vladimir Serbinenko94930e22014-08-24 22:40:33 +020028#include <console/console.h>
Edward O'Callaghan77757c22015-01-04 21:33:39 +110029#include <northbridge/intel/sandybridge/sandybridge.h>
30#include <northbridge/intel/sandybridge/raminit_native.h>
31#include <southbridge/intel/bd82x6x/pch.h>
Patrick Rudolphe8e66f42016-02-06 17:42:42 +010032#include <southbridge/intel/common/gpio.h>
Vladimir Serbinenko94930e22014-08-24 22:40:33 +020033#include <arch/cpu.h>
Vladimir Serbinenko94930e22014-08-24 22:40:33 +020034#include <cpu/x86/msr.h>
Vladimir Serbinenko94930e22014-08-24 22:40:33 +020035
Vladimir Serbinenkofa1d6882014-10-19 02:50:45 +020036void pch_enable_lpc(void)
Vladimir Serbinenko94930e22014-08-24 22:40:33 +020037{
38 /* X230 EC Decode Range Port60/64, Port62/66 */
39 /* Enable EC, PS/2 Keyboard/Mouse */
40 pci_write_config16(PCH_LPC_DEV, LPC_EN,
Patrick Rudolph93eac6a2017-05-04 19:10:50 +020041 CNF2_LPC_EN | CNF1_LPC_EN | MC_LPC_EN | KBC_LPC_EN);
Vladimir Serbinenko94930e22014-08-24 22:40:33 +020042
43 pci_write_config32(PCH_LPC_DEV, LPC_GEN1_DEC, 0x7c1601);
44 pci_write_config32(PCH_LPC_DEV, LPC_GEN2_DEC, 0xc15e1);
45 pci_write_config32(PCH_LPC_DEV, LPC_GEN4_DEC, 0x0c06a1);
46
Patrick Rudolphac27d362017-05-04 19:00:33 +020047 pci_write_config32(PCH_LPC_DEV, ETR3, 0x10000);
Vladimir Serbinenko94930e22014-08-24 22:40:33 +020048}
49
Vladimir Serbinenkofa1d6882014-10-19 02:50:45 +020050void rcba_config(void)
Vladimir Serbinenko94930e22014-08-24 22:40:33 +020051{
Vladimir Serbinenko94930e22014-08-24 22:40:33 +020052 /* Disable unused devices (board specific) */
Marian Tietz7c6c4df2016-01-09 18:18:47 +010053 RCBA32(FD) = 0x1fa41fe3;
Vladimir Serbinenko94930e22014-08-24 22:40:33 +020054 RCBA32(BUC) = 0;
55}
56
Vladimir Serbinenkofa1d6882014-10-19 02:50:45 +020057const struct southbridge_usb_port mainboard_usb_ports[] = {
58 { 1, 0, 0 },
59 { 1, 1, 1 },
60 { 1, 1, 3 },
61 { 1, 1, 3 },
62 { 1, 1, -1 },
63 { 1, 1, -1 },
64 { 1, 0, 2 },
65 { 1, 0, 2 },
66 { 1, 1, 6 },
67 { 1, 1, 5 },
68 { 1, 1, 6 },
69 { 1, 1, 6 },
70 { 1, 1, 7 },
71 { 1, 1, 6 },
72};
Vladimir Serbinenko94930e22014-08-24 22:40:33 +020073
Kyösti Mälkkie258b9a2016-11-18 19:59:23 +020074void mainboard_get_spd(spd_raw_data *spd, bool id_only)
Jan Tatjeb8743082016-06-04 19:29:03 +020075{
Kyösti Mälkkie258b9a2016-11-18 19:59:23 +020076 read_spd (&spd[0], 0x50, id_only);
77 read_spd (&spd[2], 0x51, id_only);
Vladimir Serbinenko94930e22014-08-24 22:40:33 +020078}
Vladimir Serbinenko609bd942016-01-31 14:00:54 +010079
Jan Tatjeb8743082016-06-04 19:29:03 +020080void mainboard_early_init(int s3resume)
81{
Vladimir Serbinenko609bd942016-01-31 14:00:54 +010082}
Vladimir Serbinenkoffbb3c02016-02-10 01:36:25 +010083
84void mainboard_config_superio(void)
85{
86}