blob: 96bfb37afda2b6d3a9d59b032f91765387ea93be [file] [log] [blame]
Angel Pons6e5aabd2020-03-23 23:44:42 +01001/* SPDX-License-Identifier: GPL-2.0-only */
Stefan Reinauer00636b02012-04-04 00:08:51 +02002
Patrick Rudolphe56189c2018-04-18 10:11:59 +02003#include <device/pci_ops.h>
Stefan Reinauer00636b02012-04-04 00:08:51 +02004#include "sandybridge.h"
5
Stefan Reinauer00636b02012-04-04 00:08:51 +02006void intel_sandybridge_finalize_smm(void)
7{
Angel Pons7c49cb82020-03-16 23:17:32 +01008 pci_or_config16(HOST_BRIDGE, GGC, 1 << 0);
9 pci_or_config16(HOST_BRIDGE, PAVPC, 1 << 2);
10 pci_or_config32(HOST_BRIDGE, DPR, 1 << 0);
11 pci_or_config32(HOST_BRIDGE, MESEG_MASK, MELCK);
12 pci_or_config32(HOST_BRIDGE, REMAPBASE, 1 << 0);
13 pci_or_config32(HOST_BRIDGE, REMAPLIMIT, 1 << 0);
14 pci_or_config32(HOST_BRIDGE, TOM, 1 << 0);
15 pci_or_config32(HOST_BRIDGE, TOUUD, 1 << 0);
16 pci_or_config32(HOST_BRIDGE, BDSM, 1 << 0);
17 pci_or_config32(HOST_BRIDGE, BGSM, 1 << 0);
18 pci_or_config32(HOST_BRIDGE, TSEGMB, 1 << 0);
19 pci_or_config32(HOST_BRIDGE, TOLUD, 1 << 0);
Stefan Reinauer00636b02012-04-04 00:08:51 +020020
Angel Pons66780a02021-03-26 13:33:22 +010021 mchbar_setbits32(PAVP_MSG, 1 << 0); /* PAVP */
22 mchbar_setbits32(SAPMCTL, 1 << 31); /* SA PM */
23 mchbar_setbits32(UMAGFXCTL, 1 << 0); /* UMA GFX */
24 mchbar_setbits32(VTDTRKLCK, 1 << 0); /* VTDTRK */
25 mchbar_setbits32(REQLIM, 1 << 31);
26 mchbar_setbits32(DMIVCLIM, 1 << 31);
27 mchbar_setbits32(CRDTLCK, 1 << 0);
Stefan Reinauer00636b02012-04-04 00:08:51 +020028
29 /* Memory Controller Lockdown */
Angel Pons66780a02021-03-26 13:33:22 +010030 mchbar_write8(MC_LOCK, 0x8f);
Stefan Reinauer00636b02012-04-04 00:08:51 +020031
32 /* Read+write the following */
Angel Pons66780a02021-03-26 13:33:22 +010033 mchbar_setbits32(VDMBDFBARKVM, 0);
34 mchbar_setbits32(VDMBDFBARPAVP, 0);
35 mchbar_setbits32(HDAUDRID, 0);
Stefan Reinauer00636b02012-04-04 00:08:51 +020036}