blob: 9b41cfab2ad81cb74e7e428cf5bd5c5b22e301e1 [file] [log] [blame]
Stefan Reinauer00636b02012-04-04 00:08:51 +02001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2012 The Chromium OS Authors. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; version 2 of
9 * the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
Paul Menzela46a7122013-02-23 18:37:27 +010018 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Stefan Reinauer00636b02012-04-04 00:08:51 +020019 */
20
21#include <arch/io.h>
Stefan Reinauer00636b02012-04-04 00:08:51 +020022#include <stdlib.h>
Stefan Reinauer00636b02012-04-04 00:08:51 +020023#include "sandybridge.h"
24
25#define PCI_DEV_SNB PCI_DEV(0, 0, 0)
26
27void intel_sandybridge_finalize_smm(void)
28{
29 pcie_or_config16(PCI_DEV_SNB, 0x50, 1 << 0); /* GGC */
30 pcie_or_config32(PCI_DEV_SNB, 0x5c, 1 << 0); /* DPR */
31 pcie_or_config32(PCI_DEV_SNB, 0x78, 1 << 10); /* ME */
32 pcie_or_config32(PCI_DEV_SNB, 0x90, 1 << 0); /* REMAPBASE */
33 pcie_or_config32(PCI_DEV_SNB, 0x98, 1 << 0); /* REMAPLIMIT */
34 pcie_or_config32(PCI_DEV_SNB, 0xa0, 1 << 0); /* TOM */
35 pcie_or_config32(PCI_DEV_SNB, 0xa8, 1 << 0); /* TOUUD */
36 pcie_or_config32(PCI_DEV_SNB, 0xb0, 1 << 0); /* BDSM */
37 pcie_or_config32(PCI_DEV_SNB, 0xb4, 1 << 0); /* BGSM */
38 pcie_or_config32(PCI_DEV_SNB, 0xb8, 1 << 0); /* TSEGMB */
39 pcie_or_config32(PCI_DEV_SNB, 0xbc, 1 << 0); /* TOLUD */
40
41 MCHBAR32_OR(0x5500, 1 << 0); /* PAVP */
42 MCHBAR32_OR(0x5f00, 1 << 31); /* SA PM */
43 MCHBAR32_OR(0x6020, 1 << 0); /* UMA GFX */
44 MCHBAR32_OR(0x63fc, 1 << 0); /* VTDTRK */
45 MCHBAR32_OR(0x6800, 1 << 31);
46 MCHBAR32_OR(0x7000, 1 << 31);
47 MCHBAR32_OR(0x77fc, 1 << 0);
48
49 /* Memory Controller Lockdown */
50 MCHBAR8(0x50fc) = 0x8f;
51
52 /* Read+write the following */
53 MCHBAR32(0x6030) = MCHBAR32(0x6030);
54 MCHBAR32(0x6034) = MCHBAR32(0x6034);
55 MCHBAR32(0x6008) = MCHBAR32(0x6008);
56}