blob: ab2a21c37fd098130de782230876975c2504e050 [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
Stefan Reinauer00636b02012-04-04 00:08:51 +020019void intel_sandybridge_finalize_smm(void)
20{
Angel Pons7c49cb82020-03-16 23:17:32 +010021 pci_or_config16(HOST_BRIDGE, GGC, 1 << 0);
22 pci_or_config16(HOST_BRIDGE, PAVPC, 1 << 2);
23 pci_or_config32(HOST_BRIDGE, DPR, 1 << 0);
24 pci_or_config32(HOST_BRIDGE, MESEG_MASK, MELCK);
25 pci_or_config32(HOST_BRIDGE, REMAPBASE, 1 << 0);
26 pci_or_config32(HOST_BRIDGE, REMAPLIMIT, 1 << 0);
27 pci_or_config32(HOST_BRIDGE, TOM, 1 << 0);
28 pci_or_config32(HOST_BRIDGE, TOUUD, 1 << 0);
29 pci_or_config32(HOST_BRIDGE, BDSM, 1 << 0);
30 pci_or_config32(HOST_BRIDGE, BGSM, 1 << 0);
31 pci_or_config32(HOST_BRIDGE, TSEGMB, 1 << 0);
32 pci_or_config32(HOST_BRIDGE, TOLUD, 1 << 0);
Stefan Reinauer00636b02012-04-04 00:08:51 +020033
Angel Pons7c49cb82020-03-16 23:17:32 +010034 MCHBAR32_OR(PAVP_MSG, 1 << 0); /* PAVP */
35 MCHBAR32_OR(SAPMCTL, 1 << 31); /* SA PM */
36 MCHBAR32_OR(UMAGFXCTL, 1 << 0); /* UMA GFX */
37 MCHBAR32_OR(VTDTRKLCK, 1 << 0); /* VTDTRK */
38 MCHBAR32_OR(REQLIM, 1 << 31);
39 MCHBAR32_OR(DMIVCLIM, 1 << 31);
40 MCHBAR32_OR(CRDTLCK, 1 << 0);
Stefan Reinauer00636b02012-04-04 00:08:51 +020041
42 /* Memory Controller Lockdown */
Angel Pons88521882020-01-05 20:21:20 +010043 MCHBAR8(MC_LOCK) = 0x8f;
Stefan Reinauer00636b02012-04-04 00:08:51 +020044
45 /* Read+write the following */
Angel Pons7c49cb82020-03-16 23:17:32 +010046 MCHBAR32(VDMBDFBARKVM) = MCHBAR32(VDMBDFBARKVM);
47 MCHBAR32(VDMBDFBARPAVP) = MCHBAR32(VDMBDFBARPAVP);
48 MCHBAR32(HDAUDRID) = MCHBAR32(HDAUDRID);
Stefan Reinauer00636b02012-04-04 00:08:51 +020049}