Add support for Intel Sandybridge CPU (northbridge part)
[coreboot.git] / src / northbridge / intel / sandybridge / finalize.c
1 /*
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
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
19  */
20
21 #include <arch/io.h>
22 #include <arch/romcc_io.h>
23 #include <stdlib.h>
24 #include "pcie_config.c"
25 #include "sandybridge.h"
26
27 #define PCI_DEV_SNB PCI_DEV(0, 0, 0)
28
29 void intel_sandybridge_finalize_smm(void)
30 {
31         pcie_or_config16(PCI_DEV_SNB, 0x50, 1 << 0);    /* GGC */
32         pcie_or_config32(PCI_DEV_SNB, 0x5c, 1 << 0);    /* DPR */
33         pcie_or_config32(PCI_DEV_SNB, 0x78, 1 << 10);   /* ME */
34         pcie_or_config32(PCI_DEV_SNB, 0x90, 1 << 0);    /* REMAPBASE */
35         pcie_or_config32(PCI_DEV_SNB, 0x98, 1 << 0);    /* REMAPLIMIT */
36         pcie_or_config32(PCI_DEV_SNB, 0xa0, 1 << 0);    /* TOM */
37         pcie_or_config32(PCI_DEV_SNB, 0xa8, 1 << 0);    /* TOUUD */
38         pcie_or_config32(PCI_DEV_SNB, 0xb0, 1 << 0);    /* BDSM */
39         pcie_or_config32(PCI_DEV_SNB, 0xb4, 1 << 0);    /* BGSM */
40         pcie_or_config32(PCI_DEV_SNB, 0xb8, 1 << 0);    /* TSEGMB */
41         pcie_or_config32(PCI_DEV_SNB, 0xbc, 1 << 0);    /* TOLUD */
42
43         MCHBAR32_OR(0x5500, 1 << 0);    /* PAVP */
44         MCHBAR32_OR(0x5f00, 1 << 31);   /* SA PM */
45         MCHBAR32_OR(0x6020, 1 << 0);    /* UMA GFX */
46         MCHBAR32_OR(0x63fc, 1 << 0);    /* VTDTRK */
47         MCHBAR32_OR(0x6800, 1 << 31);
48         MCHBAR32_OR(0x7000, 1 << 31);
49         MCHBAR32_OR(0x77fc, 1 << 0);
50
51         /* Memory Controller Lockdown */
52         MCHBAR8(0x50fc) = 0x8f;
53
54         /* Read+write the following */
55         MCHBAR32(0x6030) = MCHBAR32(0x6030);
56         MCHBAR32(0x6034) = MCHBAR32(0x6034);
57         MCHBAR32(0x6008) = MCHBAR32(0x6008);
58 }