summaryrefslogtreecommitdiff
path: root/src/soc/intel/cannonlake/systemagent.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/intel/cannonlake/systemagent.c')
-rw-r--r--src/soc/intel/cannonlake/systemagent.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/soc/intel/cannonlake/systemagent.c b/src/soc/intel/cannonlake/systemagent.c
index 9c8d761648..d850b15b34 100644
--- a/src/soc/intel/cannonlake/systemagent.c
+++ b/src/soc/intel/cannonlake/systemagent.c
@@ -18,10 +18,12 @@
#include <device/device.h>
#include <delay.h>
#include <device/pci.h>
+#include <device/pci_ops.h>
#include <intelblocks/systemagent.h>
#include <soc/cpu.h>
#include <soc/iomap.h>
#include <soc/systemagent.h>
+#include "chip.h"
/*
* SoC implementation
@@ -31,6 +33,8 @@
*/
void soc_add_fixed_mmio_resources(struct device *dev, int *index)
{
+ const struct soc_intel_cannonlake_config *const config = dev->chip_info;
+
static const struct sa_mmio_descriptor soc_fixed_resources[] = {
{ PCIEXBAR, CONFIG_MMCONF_BASE_ADDRESS, CONFIG_SA_PCIEX_LENGTH,
"PCIEXBAR" },
@@ -54,6 +58,15 @@ void soc_add_fixed_mmio_resources(struct device *dev, int *index)
sa_add_fixed_mmio_resources(dev, index, soc_fixed_resources,
ARRAY_SIZE(soc_fixed_resources));
+
+ /* Add Vt-d resources if VT-d is enabled. */
+ if ((pci_read_config32(dev, CAPID0_A) & VTD_DISABLE))
+ return;
+
+ if (!(config && config->VtdDisable)) {
+ sa_add_fixed_mmio_resources(dev, index, soc_vtd_resources,
+ ARRAY_SIZE(soc_vtd_resources));
+ }
}
/*