diff options
author | Werner Zeh <werner.zeh@siemens.com> | 2018-09-19 08:35:50 +0200 |
---|---|---|
committer | Philipp Deppenwiese <zaolin.daisuki@gmail.com> | 2018-09-20 12:38:49 +0000 |
commit | 1a22d3bc7e56e25ef2674bfdfbe6910a9e8a9372 (patch) | |
tree | 645381a14ab498d523b755133b1d36f32bddd578 /src/soc/intel/fsp_broadwell_de/vtd.c | |
parent | ca0c8e75f9106ecd436db87424b6d836a465c0a2 (diff) | |
download | coreboot-1a22d3bc7e56e25ef2674bfdfbe6910a9e8a9372.tar.xz |
soc/intel/fsp_broadwell_de: Add fixed VT-d MMIO range to the resources
FSP initializes the VT-d feature on Broadwell-DE and assigns an address
space to the MMIO range. coreboot's resource allocator needs to be aware
of this fixed resource as otherwise the address can be assigned to a
different PCI device. In this case addresses are overlapped and the VT-d
range is not accessible any more.
To deal with it the right way add a fixed MMIO resource to the resources
list if VT-d BAR is enabled.
TEST=Booted into Linux and checked coreboot log for resource assignment.
Change-Id: I626ac17420eadc0b49031e850f0f40b3b221a098
Signed-off-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-on: https://review.coreboot.org/28672
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Diffstat (limited to 'src/soc/intel/fsp_broadwell_de/vtd.c')
-rw-r--r-- | src/soc/intel/fsp_broadwell_de/vtd.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/soc/intel/fsp_broadwell_de/vtd.c b/src/soc/intel/fsp_broadwell_de/vtd.c index ad4a056dd1..e584cfa636 100644 --- a/src/soc/intel/fsp_broadwell_de/vtd.c +++ b/src/soc/intel/fsp_broadwell_de/vtd.c @@ -17,10 +17,24 @@ #include <device/pci_ids.h> #include <soc/pci_devs.h> #include <soc/acpi.h> +#include <soc/broadwell_de.h> +static void vtd_read_resources(struct device *dev) +{ + uint32_t vtbar; + + /* Add fixed MMIO resource for VT-d which was set up by the FSP. */ + vtbar = pci_read_config32(dev, VTBAR_OFFSET); + if (vtbar & VTBAR_ENABLED) { + mmio_resource(dev, VTBAR_OFFSET, + (vtbar & VTBAR_MASK) / KiB, VTBAR_SIZE / KiB); + } +} + static struct device_operations vtd_ops = { - .write_acpi_tables = vtd_write_acpi_tables, + .read_resources = vtd_read_resources, + .write_acpi_tables = vtd_write_acpi_tables, }; static const struct pci_driver vtd_driver __pci_driver = { |