<p>Patrick Rudolph has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/20928">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">nb/intel/sandybridge/early_init: Read Gen3 feature disable fuse<br><br>Read the PCIe Gen3 feature disable fuse and set PCIe target link speed<br>accordingly. This feature is likely used on mobile platforms.<br><br>Needs tests on all platforms.<br><br>Change-Id: Id08f7e52064ae8b550a122b35d918d6d97193b13<br>Signed-off-by: Patrick Rudolph <siro@das-labor.org><br>---<br>M src/northbridge/intel/sandybridge/early_init.c<br>1 file changed, 26 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/28/20928/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/src/northbridge/intel/sandybridge/early_init.c b/src/northbridge/intel/sandybridge/early_init.c<br>index f014e80..a5c6ce2 100644<br>--- a/src/northbridge/intel/sandybridge/early_init.c<br>+++ b/src/northbridge/intel/sandybridge/early_init.c<br>@@ -272,6 +272,7 @@<br> {<br>  u32 tmp;<br>      u32 deven;<br>+   u32 link_mask = (7 << 1);<br> <br>    /* PEG on IvyBridge+ needs a special startup sequence.<br>         * As the MRC has its own initialization code skip it. */<br>@@ -280,22 +281,47 @@<br>              IS_ENABLED(CONFIG_HAVE_MRC))<br>          return;<br> <br>+   /* Read PEG10 Gen3 feature disable fuse */<br>+   if (pci_read_config32(PCI_DEV(0, 0, 0), CAPID0_B) & (1 << 20)) {<br>+           printk(BIOS_DEBUG, "PEG: PCIe Gen3 disabled\n");<br>+           link_mask = (3 << 1);<br>+  } else<br>+               printk(BIOS_DEBUG, "PEG: PCIe Gen3 supported\n");<br>+<br>        /* Configure PEG10/PEG11/PEG12 PHY */<br>         ivybridge_peg_phy();<br> <br>       deven = pci_read_config32(PCI_DEV(0, 0, 0), DEVEN);<br> <br>        if (deven & DEVEN_PEG10) {<br>+               /* Update PEG10 target link speed */<br>+         tmp = pci_read_config32(PCI_DEV(0, 1, 0), LCAP2);<br>+            tmp &= link_mask;<br>+                pci_write_config32(PCI_DEV(0, 1, 0), LCTL2, tmp);<br>+<br>+         /* Start link training */<br>             tmp = pci_read_config32(PCI_DEV(0, 1, 0), 0xC24) & ~(1 << 16);<br>              pci_write_config32(PCI_DEV(0, 1, 0), 0xC24, tmp | (1 << 5));<br>    }<br> <br>  if (deven & DEVEN_PEG11) {<br>+               /* Update PEG11 target link speed */<br>+         tmp = pci_read_config32(PCI_DEV(0, 1, 1), LCAP2);<br>+            tmp &= link_mask;<br>+                pci_write_config32(PCI_DEV(0, 1, 1), LCTL2, tmp);<br>+<br>+         /* Start link training */<br>             tmp = pci_read_config32(PCI_DEV(0, 1, 1), 0xC24) & ~(1 << 16);<br>              pci_write_config32(PCI_DEV(0, 1, 1), 0xC24, tmp | (1 << 5));<br>    }<br> <br>  if (deven & DEVEN_PEG12) {<br>+               /* Update PEG12 target link speed */<br>+         tmp = pci_read_config32(PCI_DEV(0, 1, 2), LCAP2);<br>+            tmp &= link_mask;<br>+                pci_write_config32(PCI_DEV(0, 1, 2), LCTL2, tmp);<br>+<br>+         /* Start link training */<br>             tmp = pci_read_config32(PCI_DEV(0, 1, 2), 0xC24) & ~(1 << 16);<br>              pci_write_config32(PCI_DEV(0, 1, 2), 0xC24, tmp | (1 << 5));<br>    }<br></pre><p>To view, visit <a href="https://review.coreboot.org/20928">change 20928</a>. To unsubscribe, 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/20928"/><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: Id08f7e52064ae8b550a122b35d918d6d97193b13 </div>
<div style="display:none"> Gerrit-Change-Number: 20928 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Patrick Rudolph <siro@das-labor.org> </div>