From da538cb38f559052cce2879ad8b96a6014390af6 Mon Sep 17 00:00:00 2001 From: Jonathan Zhang Date: Mon, 19 Dec 2022 15:49:33 -0800 Subject: [PATCH] soc/intel/xeon_sp: Setup DPR for all VT-d devices The Data Protected Range (DPR) needs to be set for all DPR devices, not only the root device. Separate the setup from the memory resource map reservation. Change-Id: I7e49db23960e3938e8e158082be3c5ecf3cf95f3 Signed-off-by: Marc Jones Reviewed-on: https://review.coreboot.org/c/coreboot/+/71143 Tested-by: build bot (Jenkins) Reviewed-by: David Hendricks --- src/soc/intel/xeon_sp/uncore.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/soc/intel/xeon_sp/uncore.c b/src/soc/intel/xeon_sp/uncore.c index d4cf4bcc29..380b7e7b9c 100644 --- a/src/soc/intel/xeon_sp/uncore.c +++ b/src/soc/intel/xeon_sp/uncore.c @@ -196,8 +196,7 @@ static void mc_add_dram_resources(struct device *dev, int *res_count) res = ram_from_to(dev, index++, top_of_ram, (uintptr_t)cbmem_top()); LOG_RESOURCE("cbmem_ram", dev, res); - /* Reserve and set up DPR */ - configure_dpr(dev); + /* Reserve DPR region */ union dpr_register dpr = { .raw = pci_read_config32(dev, VTD_LTDPR) }; if (dpr.size) { /* @@ -262,6 +261,9 @@ static void mmapvtd_read_resources(struct device *dev) /* Read standard PCI resources. */ pci_dev_read_resources(dev); + /* set up DPR */ + configure_dpr(dev); + /* Calculate and add DRAM resources. */ mc_add_dram_resources(dev, &index); }