Stefan Reinauer | 00636b0 | 2012-04-04 00:08:51 +0200 | [diff] [blame] | 1 | /* |
| 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 Reinauer | 00636b0 | 2012-04-04 00:08:51 +0200 | [diff] [blame] | 15 | */ |
| 16 | |
Patrick Rudolph | e56189c | 2018-04-18 10:11:59 +0200 | [diff] [blame] | 17 | #include <device/pci_ops.h> |
Stefan Reinauer | 00636b0 | 2012-04-04 00:08:51 +0200 | [diff] [blame] | 18 | #include "sandybridge.h" |
| 19 | |
| 20 | #define PCI_DEV_SNB PCI_DEV(0, 0, 0) |
| 21 | |
| 22 | void intel_sandybridge_finalize_smm(void) |
| 23 | { |
Felix Held | 4902fee | 2019-12-28 18:09:47 +0100 | [diff] [blame] | 24 | 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 Held | f54ae38 | 2019-12-30 18:18:02 +0100 | [diff] [blame] | 27 | pci_or_config32(PCI_DEV_SNB, MESEG_MASK, MELCK); |
Felix Held | 4902fee | 2019-12-28 18:09:47 +0100 | [diff] [blame] | 28 | 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 Reinauer | 00636b0 | 2012-04-04 00:08:51 +0200 | [diff] [blame] | 36 | |
| 37 | MCHBAR32_OR(0x5500, 1 << 0); /* PAVP */ |
| 38 | MCHBAR32_OR(0x5f00, 1 << 31); /* SA PM */ |
| 39 | MCHBAR32_OR(0x6020, 1 << 0); /* UMA GFX */ |
| 40 | MCHBAR32_OR(0x63fc, 1 << 0); /* VTDTRK */ |
| 41 | MCHBAR32_OR(0x6800, 1 << 31); |
| 42 | MCHBAR32_OR(0x7000, 1 << 31); |
| 43 | MCHBAR32_OR(0x77fc, 1 << 0); |
| 44 | |
| 45 | /* Memory Controller Lockdown */ |
| 46 | MCHBAR8(0x50fc) = 0x8f; |
| 47 | |
| 48 | /* Read+write the following */ |
| 49 | MCHBAR32(0x6030) = MCHBAR32(0x6030); |
| 50 | MCHBAR32(0x6034) = MCHBAR32(0x6034); |
| 51 | MCHBAR32(0x6008) = MCHBAR32(0x6008); |
| 52 | } |