Angel Pons | 4b42983 | 2020-04-02 23:48:50 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 2 | |
Patrick Rudolph | e56189c | 2018-04-18 10:11:59 +0200 | [diff] [blame] | 3 | #include <device/pci_ops.h> |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 4 | #include "haswell.h" |
| 5 | |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 6 | void intel_northbridge_haswell_finalize_smm(void) |
| 7 | { |
Angel Pons | 385ce9f | 2020-10-23 10:40:23 +0200 | [diff] [blame] | 8 | pci_or_config16(HOST_BRIDGE, GGC, 1 << 0); |
| 9 | pci_or_config32(HOST_BRIDGE, DPR, 1 << 0); |
| 10 | pci_or_config32(HOST_BRIDGE, MESEG_LIMIT, 1 << 10); |
| 11 | pci_or_config32(HOST_BRIDGE, REMAPBASE, 1 << 0); |
| 12 | pci_or_config32(HOST_BRIDGE, REMAPLIMIT, 1 << 0); |
| 13 | pci_or_config32(HOST_BRIDGE, TOM, 1 << 0); |
| 14 | pci_or_config32(HOST_BRIDGE, TOUUD, 1 << 0); |
| 15 | pci_or_config32(HOST_BRIDGE, BDSM, 1 << 0); |
| 16 | pci_or_config32(HOST_BRIDGE, BGSM, 1 << 0); |
| 17 | pci_or_config32(HOST_BRIDGE, TSEG, 1 << 0); |
| 18 | pci_or_config32(HOST_BRIDGE, TOLUD, 1 << 0); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 19 | |
Angel Pons | 6fe3c06 | 2020-10-23 11:02:48 +0200 | [diff] [blame^] | 20 | /* Memory Controller Lockdown */ |
| 21 | MCHBAR32(MC_LOCK) |= 0x8f; |
| 22 | |
Angel Pons | 1db5bc7 | 2020-01-15 00:49:03 +0100 | [diff] [blame] | 23 | MCHBAR32_OR(MMIO_PAVP_MSG, 1 << 0); /* PAVP */ |
Angel Pons | 97f0d81 | 2020-10-23 10:53:31 +0200 | [diff] [blame] | 24 | MCHBAR32_OR(PCU_DDR_PTM_CTL, 1 << 5); /* DDR PTM */ |
Angel Pons | 1db5bc7 | 2020-01-15 00:49:03 +0100 | [diff] [blame] | 25 | MCHBAR32_OR(UMAGFXCTL, 1 << 0); /* UMA GFX */ |
| 26 | MCHBAR32_OR(VTDTRKLCK, 1 << 0); /* VTDTRK */ |
| 27 | MCHBAR32_OR(REQLIM, 1UL << 31); |
| 28 | MCHBAR32_OR(DMIVCLIM, 1UL << 31); |
| 29 | MCHBAR32_OR(CRDTLCK, 1 << 0); |
Angel Pons | 8cc39a5 | 2020-10-23 11:00:14 +0200 | [diff] [blame] | 30 | MCHBAR32_OR(MCARBLCK, 1 << 0); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 31 | |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 32 | /* Read+write the following */ |
Angel Pons | 1db5bc7 | 2020-01-15 00:49:03 +0100 | [diff] [blame] | 33 | MCHBAR32(VDMBDFBARKVM) = MCHBAR32(VDMBDFBARKVM); |
| 34 | MCHBAR32(VDMBDFBARPAVP) = MCHBAR32(VDMBDFBARPAVP); |
| 35 | MCHBAR32(HDAUDRID) = MCHBAR32(HDAUDRID); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 36 | } |