blob: 3fb0aa6deee13690f659a2309ad1b0ee2eee385f [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
17#include <arch/io.h>
Stefan Reinauer00636b02012-04-04 00:08:51 +020018#include <stdlib.h>
Patrick Rudolphe56189c2018-04-18 10:11:59 +020019#include <device/pci_ops.h>
Stefan Reinauer00636b02012-04-04 00:08:51 +020020#include "sandybridge.h"
21
22#define PCI_DEV_SNB PCI_DEV(0, 0, 0)
23
24void intel_sandybridge_finalize_smm(void)
25{
Kyösti Mälkkifd98c652013-07-26 08:50:53 +030026 pci_or_config16(PCI_DEV_SNB, 0x50, 1 << 0); /* GGC */
Dennis Wassenbergbd202bc2016-11-02 08:12:52 +010027 pci_or_config16(PCI_DEV_SNB, 0x58, 1 << 2); /* PAVP Lock */
Kyösti Mälkkifd98c652013-07-26 08:50:53 +030028 pci_or_config32(PCI_DEV_SNB, 0x5c, 1 << 0); /* DPR */
29 pci_or_config32(PCI_DEV_SNB, 0x78, 1 << 10); /* ME */
30 pci_or_config32(PCI_DEV_SNB, 0x90, 1 << 0); /* REMAPBASE */
31 pci_or_config32(PCI_DEV_SNB, 0x98, 1 << 0); /* REMAPLIMIT */
32 pci_or_config32(PCI_DEV_SNB, 0xa0, 1 << 0); /* TOM */
33 pci_or_config32(PCI_DEV_SNB, 0xa8, 1 << 0); /* TOUUD */
34 pci_or_config32(PCI_DEV_SNB, 0xb0, 1 << 0); /* BDSM */
35 pci_or_config32(PCI_DEV_SNB, 0xb4, 1 << 0); /* BGSM */
36 pci_or_config32(PCI_DEV_SNB, 0xb8, 1 << 0); /* TSEGMB */
37 pci_or_config32(PCI_DEV_SNB, 0xbc, 1 << 0); /* TOLUD */
Stefan Reinauer00636b02012-04-04 00:08:51 +020038
39 MCHBAR32_OR(0x5500, 1 << 0); /* PAVP */
40 MCHBAR32_OR(0x5f00, 1 << 31); /* SA PM */
41 MCHBAR32_OR(0x6020, 1 << 0); /* UMA GFX */
42 MCHBAR32_OR(0x63fc, 1 << 0); /* VTDTRK */
43 MCHBAR32_OR(0x6800, 1 << 31);
44 MCHBAR32_OR(0x7000, 1 << 31);
45 MCHBAR32_OR(0x77fc, 1 << 0);
46
47 /* Memory Controller Lockdown */
48 MCHBAR8(0x50fc) = 0x8f;
49
50 /* Read+write the following */
51 MCHBAR32(0x6030) = MCHBAR32(0x6030);
52 MCHBAR32(0x6034) = MCHBAR32(0x6034);
53 MCHBAR32(0x6008) = MCHBAR32(0x6008);
54}