Nico Huber has uploaded this change for review. ( https://review.coreboot.org/29668
Change subject: nb/intel/sandybridge/acpi: Add RMRR for GFX device ......................................................................
nb/intel/sandybridge/acpi: Add RMRR for GFX device
The iGPU always needs access to its stolen memory. For proper IOMMU, we have to make the OS aware of that.
Directly below TOLUD lies the data stolen memory (BDSM) followed by the GTT stolen memory (BGSM), the iGPU needs access to both.
Change-Id: I391d0a5f1ea14bc90fbacabce41dddfa12b5bb0d Signed-off-by: Nico Huber nico.h@gmx.de --- M src/northbridge/intel/sandybridge/acpi.c 1 file changed, 17 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/68/29668/1
diff --git a/src/northbridge/intel/sandybridge/acpi.c b/src/northbridge/intel/sandybridge/acpi.c index 88ac2b1..7089510 100644 --- a/src/northbridge/intel/sandybridge/acpi.c +++ b/src/northbridge/intel/sandybridge/acpi.c @@ -67,6 +67,22 @@ return current; }
+static unsigned long acpi_fill_gfx_rmrr(const unsigned long current) +{ + const uintptr_t base_mask = ~(MiB - 1); + + struct device *const host = dev_find_slot(0, PCI_DEVFN(0, 0)); + if (!host) + return current; + + const u32 bgsm = pci_read_config32(host, BGSM) & base_mask; + const u32 tolud = pci_read_config32(host, TOLUD) & base_mask; + if (!bgsm || !tolud) + return current; + + return current + acpi_create_dmar_rmrr(current, 0, bgsm, tolud - 1); +} + static unsigned long acpi_fill_dmar(unsigned long current) { const struct device *const igfx = dev_find_slot(0, PCI_DEVFN(2, 0)); @@ -74,6 +90,7 @@ if (igfx && igfx->enabled) { const unsigned long tmp = current; current += acpi_create_dmar_drhd(current, 0, 0, IOMMU_BASE1); + current = acpi_fill_gfx_rmrr(current); current += acpi_create_dmar_ds_pci(current, 0, 2, 0); current += acpi_create_dmar_ds_pci(current, 0, 2, 1); acpi_dmar_drhd_fixup(tmp, current);