<div dir="ltr"><div>> <span style="font-size:12.8px">Is that an error ?</span></div><div><br></div>I have looked into the document (BTW did some additional investigation) and tried to find the attributes explanation (found it on page 586):<div><br></div><div><img src="cid:ii_15bd29a69154a4e5" alt="Inline image 1" style="margin-right: 0px;"><br></div><div><br></div><div>The first possibility (my best guess) is: PCH (particular one. please, note that) has numerous of so called HW straps (IO pins which are either strapped to level 0 or level 1). Depending upon what some (Very Important) particular IO is strapped, bit 15 <span style="font-size:12.8px">(</span><span style="font-size:12.8px">Role-based error-reporting in the DEVCAP (offset 0x04)) could be enabled or disabled... So I think this is what this explanation really does mean.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">I would strongly advise you to add one printk() here and recompile Coreboot, something like this:</span></div><div><div style="font-size:12.8px"><span style="font-size:12.8px;white-space:pre-wrap">         </span>/* Enable ASPM role based error reporting. */</div><div style="font-size:12.8px"><span class="gmail-m_4371082674194637721gmail-m_6920781638293347396gmail-m_4420435145451042919gmail-Apple-tab-span" style="white-space:pre-wrap">         </span>devcap = pci_read_config32(endp, endp_cap + PCI_EXP_DEVCAP);</div><div style="font-size:12.8px"><span style="font-size:12.8px;white-space:pre-wrap">         // </span><span style="color:rgb(120,120,120);font-family:monaco,"courier new",courier,monospace;font-size:0.95em;font-weight:bold">#define  </span><a href="http://lxr.free-electrons.com/ident?i=PCI_EXP_DEVCAP_RBER" style="font-family:monaco,"courier new",courier,monospace;font-size:0.95em;font-weight:bold;text-decoration-line:none;border-bottom:1px dotted rgb(153,153,153);color:black">PCI_EXP_DEVCAP_RBER</a><span style="color:rgb(120,120,120);font-family:monaco,"courier new",courier,monospace;font-size:0.95em;font-weight:bold">    0x00008000 </span><b style="color:rgb(120,120,120);font-family:monaco,"courier new",courier,monospace;font-size:0.95em"><i>/* Role-Based Error Reporting */</i></b><br></div><div style="font-size:12.8px"><span class="gmail-m_4371082674194637721gmail-m_6920781638293347396gmail-m_4420435145451042919gmail-Apple-tab-span" style="white-space:pre-wrap">                <b><i><u><font color="#ff0000">if (</font></u></i></b></span><b><i><u><font color="#ff0000">devcap & PCI_EXP_DEVCAP_RBER) printk("<span style="font-size:12.8px">Role-based Error Reporting capability in the DEVCAP (offset 0x04) is ENABLED\n");</span></font></u></i></b></div><div style="font-size:12.8px"><span style="font-size:12.8px;white-space:pre-wrap">                </span><span style="font-size:12.8px">devcap |= PCI_EXP_DEVCAP_RBER;</span><span style="font-size:12.8px"><br></span></div><div style="font-size:12.8px"><span class="gmail-m_4371082674194637721gmail-m_6920781638293347396gmail-m_4420435145451042919gmail-Apple-tab-span" style="white-space:pre-wrap">              </span>pci_write_config32(endp, endp_cap + PCI_EXP_DEVCAP, devcap);</div></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Then, the Truth will reveal itself.</div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">The second possibility is that you are correct. It should be enabled in control register, which is RWable. But this is subject of the implementation by </span><span style="color:rgb(0,0,0);white-space:pre-wrap">Duncan Laurie <</span><a href="http://www.coreboot.org/mailman/listinfo/coreboot" style="white-space:pre-wrap" target="_blank">dlaurie at google.com</a><span style="color:rgb(0,0,0);white-space:pre-wrap">> in the following patch: </span><font color="#000000"><span style="white-space:pre-wrap"><a href="https://mail.coreboot.org/pipermail/coreboot/2012-March/068690.html" target="_blank">https://mail.coreboot.org/<wbr>pipermail/coreboot/2012-March/<wbr>068690.html</a></span></font></div><div><font color="#000000"><span style="white-space:pre-wrap"><br></span></font></div><div><font color="#000000"><span style="white-space:pre-wrap">I'll include also involved (last web pointer is certainly a smoking gun, isn't it?) in this matter.</span></font></div><div><font color="#000000"><span style="white-space:pre-wrap"><br></span></font></div><div><font color="#000000"><span style="white-space:pre-wrap">Zoran</span></font></div><div><font color="#000000"><span style="white-space:pre-wrap">_______</span></font></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 3, 2017 at 11:54 PM, Youness Alaoui <span dir="ltr"><<a href="mailto:kakaroto@kakaroto.homelinux.net" target="_blank">kakaroto@kakaroto.homelinux.<wbr>net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I'm looking at the src/device/pciexp_device.c file trying to understand what it does and I've noticed this in pciexp_enable_aspm :</div><div><div><span class="gmail-m_4371082674194637721m_8945027580687948962gmail-Apple-tab-span" style="white-space:pre-wrap">             </span>/* Enable ASPM role based error reporting. */</div><div><span class="gmail-m_4371082674194637721m_8945027580687948962gmail-Apple-tab-span" style="white-space:pre-wrap">             </span>devcap = pci_read_config32(endp, endp_cap + PCI_EXP_DEVCAP);</div><div><span class="gmail-m_4371082674194637721m_8945027580687948962gmail-Apple-tab-span" style="white-space:pre-wrap">              </span>devcap |= PCI_EXP_DEVCAP_RBER;</div><div><span class="gmail-m_4371082674194637721m_8945027580687948962gmail-Apple-tab-span" style="white-space:pre-wrap">            </span>pci_write_config32(endp, endp_cap + PCI_EXP_DEVCAP, devcap);</div></div><div><br></div><div>This looks like it tries to write a bit to 1 to enable Role-based error-reporting in the DEVCAP (offset 0x04) in the PCIe capability, but according to the spec (looking at page 612 of the spec version 3.0 that I found here  : <a href="http://composter.com.ua/documents/PCI_Express_Base_Specification_Revision_3.0.pdf" target="_blank">http://composter.com.ua/doc<wbr>uments/PCI_Express_Base_Specif<wbr>ication_Revision_3.0.pdf</a>), that structure is read-only (it's the device capabilities register, not the device control register).</div><div>Is that an error ? </div><div>I tracked that code (moved, then moved again) all the way to this change from 2011 : <a href="https://review.coreboot.org/#/c/735/" target="_blank">https://review.coreboot.org/#/<wbr>c/735/</a> but for some reason git blame can't find the file in commits before that.<br></div><div><br></div><div>That code is probably harmless since it's a Read-only field anyways, but I'm wondering if the code that should be there shouldn't instead be enabling the bits 0:3 in the device control register to enable the error reporting. Also, I don't see how this actually relates to ASPM (it only gets called if ASPM is enabled).</div><div><br></div><div>Does anyone know if I'm on the right track in my interpretation or if I misunderstood the spec or what that code is meant to do ?</div><div><br></div><div>Thanks,</div><div>Youness.</div><div><br></div></div>
<br>--<br>
coreboot mailing list: <a href="mailto:coreboot@coreboot.org" target="_blank">coreboot@coreboot.org</a><br>
<a href="https://mail.coreboot.org/mailman/listinfo/coreboot" rel="noreferrer" target="_blank">https://mail.coreboot.org/mail<wbr>man/listinfo/coreboot</a><br></blockquote></div><br></div></div>