blob: e3383724cddf0f0c19937f292cac645b77096bed [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.
Stefan Reinauer00636b02012-04-04 00:08:51 +020015 */
16
Patrick Rudolphe56189c2018-04-18 10:11:59 +020017#include <device/pci_ops.h>
Stefan Reinauer00636b02012-04-04 00:08:51 +020018#include "sandybridge.h"
19
20#define PCI_DEV_SNB PCI_DEV(0, 0, 0)
21
22void intel_sandybridge_finalize_smm(void)
23{
Felix Held4902fee2019-12-28 18:09:47 +010024 pci_or_config16(PCI_DEV_SNB, GGC, 1 << 0);
25 pci_or_config16(PCI_DEV_SNB, PAVPC, 1 << 2);
26 pci_or_config32(PCI_DEV_SNB, DPR, 1 << 0);
Felix Heldf54ae382019-12-30 18:18:02 +010027 pci_or_config32(PCI_DEV_SNB, MESEG_MASK, MELCK);
Felix Held4902fee2019-12-28 18:09:47 +010028 pci_or_config32(PCI_DEV_SNB, REMAPBASE, 1 << 0);
29 pci_or_config32(PCI_DEV_SNB, REMAPLIMIT, 1 << 0);
30 pci_or_config32(PCI_DEV_SNB, TOM, 1 << 0);
31 pci_or_config32(PCI_DEV_SNB, TOUUD, 1 << 0);
32 pci_or_config32(PCI_DEV_SNB, BDSM, 1 << 0);
33 pci_or_config32(PCI_DEV_SNB, BGSM, 1 << 0);
34 pci_or_config32(PCI_DEV_SNB, TSEGMB, 1 << 0);
35 pci_or_config32(PCI_DEV_SNB, TOLUD, 1 << 0);
Stefan Reinauer00636b02012-04-04 00:08:51 +020036
Angel Pons88521882020-01-05 20:21:20 +010037 MCHBAR32_OR(MMIO_PAVP_CTL, 1 << 0); /* PAVP */
38 MCHBAR32_OR(SAPMCTL, 1 << 31); /* SA PM */
39 MCHBAR32_OR(0x6020, 1 << 0); /* UMA GFX */
40 MCHBAR32_OR(0x63fc, 1 << 0); /* VTDTRK */
Stefan Reinauer00636b02012-04-04 00:08:51 +020041 MCHBAR32_OR(0x6800, 1 << 31);
42 MCHBAR32_OR(0x7000, 1 << 31);
43 MCHBAR32_OR(0x77fc, 1 << 0);
44
45 /* Memory Controller Lockdown */
Angel Pons88521882020-01-05 20:21:20 +010046 MCHBAR8(MC_LOCK) = 0x8f;
Stefan Reinauer00636b02012-04-04 00:08:51 +020047
48 /* Read+write the following */
49 MCHBAR32(0x6030) = MCHBAR32(0x6030);
50 MCHBAR32(0x6034) = MCHBAR32(0x6034);
51 MCHBAR32(0x6008) = MCHBAR32(0x6008);
52}