blob: 6a3156e4bcd76e5fd043fb39b67642a9b4a0dea0 [file] [log] [blame]
Stefan Reinauer00636b02012-04-04 00:08:51 +02001/*
2 * This file is part of the coreboot project.
3 *
Stefan Reinauer00636b02012-04-04 00:08:51 +02004 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; version 2 of
8 * the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
Stefan Reinauer00636b02012-04-04 00:08:51 +020014 */
15
Patrick Rudolphe56189c2018-04-18 10:11:59 +020016#include <device/pci_ops.h>
Stefan Reinauer00636b02012-04-04 00:08:51 +020017#include "sandybridge.h"
18
19#define PCI_DEV_SNB PCI_DEV(0, 0, 0)
20
21void intel_sandybridge_finalize_smm(void)
22{
Felix Held4902fee2019-12-28 18:09:47 +010023 pci_or_config16(PCI_DEV_SNB, GGC, 1 << 0);
24 pci_or_config16(PCI_DEV_SNB, PAVPC, 1 << 2);
25 pci_or_config32(PCI_DEV_SNB, DPR, 1 << 0);
Felix Heldf54ae382019-12-30 18:18:02 +010026 pci_or_config32(PCI_DEV_SNB, MESEG_MASK, MELCK);
Felix Held4902fee2019-12-28 18:09:47 +010027 pci_or_config32(PCI_DEV_SNB, REMAPBASE, 1 << 0);
28 pci_or_config32(PCI_DEV_SNB, REMAPLIMIT, 1 << 0);
29 pci_or_config32(PCI_DEV_SNB, TOM, 1 << 0);
30 pci_or_config32(PCI_DEV_SNB, TOUUD, 1 << 0);
31 pci_or_config32(PCI_DEV_SNB, BDSM, 1 << 0);
32 pci_or_config32(PCI_DEV_SNB, BGSM, 1 << 0);
33 pci_or_config32(PCI_DEV_SNB, TSEGMB, 1 << 0);
34 pci_or_config32(PCI_DEV_SNB, TOLUD, 1 << 0);
Stefan Reinauer00636b02012-04-04 00:08:51 +020035
Angel Pons88521882020-01-05 20:21:20 +010036 MCHBAR32_OR(MMIO_PAVP_CTL, 1 << 0); /* PAVP */
37 MCHBAR32_OR(SAPMCTL, 1 << 31); /* SA PM */
38 MCHBAR32_OR(0x6020, 1 << 0); /* UMA GFX */
39 MCHBAR32_OR(0x63fc, 1 << 0); /* VTDTRK */
Stefan Reinauer00636b02012-04-04 00:08:51 +020040 MCHBAR32_OR(0x6800, 1 << 31);
41 MCHBAR32_OR(0x7000, 1 << 31);
42 MCHBAR32_OR(0x77fc, 1 << 0);
43
44 /* Memory Controller Lockdown */
Angel Pons88521882020-01-05 20:21:20 +010045 MCHBAR8(MC_LOCK) = 0x8f;
Stefan Reinauer00636b02012-04-04 00:08:51 +020046
47 /* Read+write the following */
48 MCHBAR32(0x6030) = MCHBAR32(0x6030);
49 MCHBAR32(0x6034) = MCHBAR32(0x6034);
50 MCHBAR32(0x6008) = MCHBAR32(0x6008);
51}