<p>Nico Huber has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/29668">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">nb/intel/sandybridge/acpi: Add RMRR for GFX device<br><br>The iGPU always needs access to its stolen memory. For proper IOMMU, we<br>have to make the OS aware of that.<br><br>Directly below TOLUD lies the data stolen memory (BDSM) followed by the<br>GTT stolen memory (BGSM), the iGPU needs access to both.<br><br>Change-Id: I391d0a5f1ea14bc90fbacabce41dddfa12b5bb0d<br>Signed-off-by: Nico Huber <nico.h@gmx.de><br>---<br>M src/northbridge/intel/sandybridge/acpi.c<br>1 file changed, 17 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/68/29668/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/northbridge/intel/sandybridge/acpi.c b/src/northbridge/intel/sandybridge/acpi.c</span><br><span>index 88ac2b1..7089510 100644</span><br><span>--- a/src/northbridge/intel/sandybridge/acpi.c</span><br><span>+++ b/src/northbridge/intel/sandybridge/acpi.c</span><br><span>@@ -67,6 +67,22 @@</span><br><span>      return current;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+static unsigned long acpi_fill_gfx_rmrr(const unsigned long current)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+     const uintptr_t base_mask = ~(MiB - 1);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     struct device *const host = dev_find_slot(0, PCI_DEVFN(0, 0));</span><br><span style="color: hsl(120, 100%, 40%);">+        if (!host)</span><br><span style="color: hsl(120, 100%, 40%);">+            return current;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     const u32 bgsm = pci_read_config32(host, BGSM) & base_mask;</span><br><span style="color: hsl(120, 100%, 40%);">+       const u32 tolud = pci_read_config32(host, TOLUD) & base_mask;</span><br><span style="color: hsl(120, 100%, 40%);">+     if (!bgsm || !tolud)</span><br><span style="color: hsl(120, 100%, 40%);">+          return current;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     return current + acpi_create_dmar_rmrr(current, 0, bgsm, tolud - 1);</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> static unsigned long acpi_fill_dmar(unsigned long current)</span><br><span> {</span><br><span>         const struct device *const igfx = dev_find_slot(0, PCI_DEVFN(2, 0));</span><br><span>@@ -74,6 +90,7 @@</span><br><span>     if (igfx && igfx->enabled) {</span><br><span>              const unsigned long tmp = current;</span><br><span>           current += acpi_create_dmar_drhd(current, 0, 0, IOMMU_BASE1);</span><br><span style="color: hsl(120, 100%, 40%);">+         current = acpi_fill_gfx_rmrr(current);</span><br><span>               current += acpi_create_dmar_ds_pci(current, 0, 2, 0);</span><br><span>                current += acpi_create_dmar_ds_pci(current, 0, 2, 1);</span><br><span>                acpi_dmar_drhd_fixup(tmp, current);</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/29668">change 29668</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/29668"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I391d0a5f1ea14bc90fbacabce41dddfa12b5bb0d </div>
<div style="display:none"> Gerrit-Change-Number: 29668 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Nico Huber <nico.h@gmx.de> </div>