Stefan Reinauer | 00636b0 | 2012-04-04 00:08:51 +0200 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
Stefan Reinauer | 00636b0 | 2012-04-04 00:08:51 +0200 | [diff] [blame] | 4 | * |
| 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 Reinauer | 00636b0 | 2012-04-04 00:08:51 +0200 | [diff] [blame] | 14 | */ |
| 15 | |
Patrick Rudolph | e56189c | 2018-04-18 10:11:59 +0200 | [diff] [blame] | 16 | #include <device/pci_ops.h> |
Stefan Reinauer | 00636b0 | 2012-04-04 00:08:51 +0200 | [diff] [blame] | 17 | #include "sandybridge.h" |
| 18 | |
Stefan Reinauer | 00636b0 | 2012-04-04 00:08:51 +0200 | [diff] [blame] | 19 | void intel_sandybridge_finalize_smm(void) |
| 20 | { |
Angel Pons | 7c49cb8 | 2020-03-16 23:17:32 +0100 | [diff] [blame] | 21 | 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 Reinauer | 00636b0 | 2012-04-04 00:08:51 +0200 | [diff] [blame] | 33 | |
Angel Pons | 7c49cb8 | 2020-03-16 23:17:32 +0100 | [diff] [blame] | 34 | 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 Reinauer | 00636b0 | 2012-04-04 00:08:51 +0200 | [diff] [blame] | 41 | |
| 42 | /* Memory Controller Lockdown */ |
Angel Pons | 8852188 | 2020-01-05 20:21:20 +0100 | [diff] [blame] | 43 | MCHBAR8(MC_LOCK) = 0x8f; |
Stefan Reinauer | 00636b0 | 2012-04-04 00:08:51 +0200 | [diff] [blame] | 44 | |
| 45 | /* Read+write the following */ |
Angel Pons | 7c49cb8 | 2020-03-16 23:17:32 +0100 | [diff] [blame] | 46 | MCHBAR32(VDMBDFBARKVM) = MCHBAR32(VDMBDFBARKVM); |
| 47 | MCHBAR32(VDMBDFBARPAVP) = MCHBAR32(VDMBDFBARPAVP); |
| 48 | MCHBAR32(HDAUDRID) = MCHBAR32(HDAUDRID); |
Stefan Reinauer | 00636b0 | 2012-04-04 00:08:51 +0200 | [diff] [blame] | 49 | } |