<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Sep 4, 2014 at 2:57 PM, Ricardo Menzer <span dir="ltr"><<a href="mailto:ricardomenzer@gmail.com" target="_blank">ricardomenzer@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi guys,<br>
I'm trying to port an old Intel version of coreboot for tunnelcreek to<br>
a newer version of the coreboot code.<br>
<br>
I'm stuck at a point in which the boot stops at get_pbus(device_t dev)<br>
because dev is NULL (0x0).<br>
<br>
I think the problem is in a function that calls pci_write_config32,<br>
but using PCI_DEV(0,0,0) to access the bus 0, device 0, function 0.<br>
PCI_DEV(0,0,0) evaluates to 0x0, which get_pbus interprets as a NULL<br>
pointer. This is used in the 'dev' parameter of pci_write_config32.</blockquote><div><br></div><div>get_pbus() is only used in ramstage which uses struct device * (device_t).  Depending on where you are wanting to call this you may already have a device_t. If not you'll need to do the lookup using dev_find_slot().</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<br>
<br>
I looked at the source code and in the mailing list, but couldn't find<br>
a way to pass a correct dev parameter to the function.<br>
I'm also not so sure I am in the right path. I may be confusing thing<br>
a little, since I'm no so experienced in x86 hardware and firmware<br>
levels. I'm also learning coreboot at my own, it's a lot of<br>
information at the same time being pushed at my brain! ;)<br>
<br>
I appreciate any help and clarifications!<br>
<br>
Thank you very much!<br>
<span class=""><font color="#888888"><br>
<br>
Ricardo Menzer<br>
<a href="mailto:ricardomenzer@gmail.com">ricardomenzer@gmail.com</a><br>
<a href="tel:%2B55%20%2832%29%208865-8805" value="+553288658805">+55 (32) 8865-8805</a><br>
<br>
--<br>
coreboot mailing list: <a href="mailto:coreboot@coreboot.org">coreboot@coreboot.org</a><br>
<a href="http://www.coreboot.org/mailman/listinfo/coreboot" target="_blank">http://www.coreboot.org/mailman/listinfo/coreboot</a><br>
</font></span></blockquote></div><br></div></div>