No subject
Sun Dec 9 17:34:17 CET 2012
const struct pci_bus_operations *pci_check_direct(void)
{
unsigned int tmp;
/*
* Check if configuration type 1 works.
*/
{
outb(0x01, 0xCFB);
tmp = inl(0xCF8);
outl(0x80000000, 0xCF8);
if ((inl(0xCF8) == 0x80000000) &&
pci_sanity_check(&pci_cf8_conf1))
{
outl(tmp, 0xCF8);
printk(BIOS_DEBUG, "PCI: Using configuration type 1\n");
return &pci_cf8_conf1;
}
outl(tmp, 0xCF8);
}
die("pci_check_direct failed\n");
return NULL;
}
/** Set the method to be used for PCI, type I or type II
*/
void pci_set_method(struct device * dev)
{
printk(BIOS_INFO, "Finding PCI configuration type.\n");
dev->ops->ops_pci_bus = pci_check_direct();
post_code(POST_STAGE2_PHASE2_PCI_SET_METHOD);
}
Here are the interesting things:
1. pci_check_direct either returns pci_cfg8_conf1 or dies
2. This code is only used by geodelx
I think the const struct is the right way to do this. Can we change these
functions?
Two solutions:
1. Set the entire ops
2. Initialize it correctly and die if the check fails
Comments?
Thanks,
Myles
------=_Part_15249_19644244.1225916673157
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
<br><br><div class="gmail_quote">On Wed, Nov 5, 2008 at 1:24 PM, Myles Watson <span dir="ltr"><<a href="mailto:mylesgw at gmail.com">mylesgw at gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">> Are you testing these on qemu I assume?<br>
<br>
</div>I can. I don't think I've made any functional changes, but it's probably<br>
good to check.<br>
<br>
Most of this patch isn't exercised by qemu, though. There are no bridges<br>
which are not in the dts.<font color="#888888"><br>
</font></blockquote></div><br>It turns out that I forgot the importance of make clean for build testing. I wish I knew better how to fix the dependencies.<br><br>This breaks the build now that I made the change for the pci_ops structs to be const.<br>
<br>From pci_ops_auto.c:<br>const struct pci_bus_operations *pci_check_direct(void)<br>{<br> unsigned int tmp;<br><br> /*<br> * Check if configuration type 1 works.<br> */<br> {<br> outb(0x01, 0xCFB);<br>
tmp = inl(0xCF8);<br> outl(0x80000000, 0xCF8);<br> if ((inl(0xCF8) == 0x80000000) && <br> pci_sanity_check(&pci_cf8_conf1)) <br> {<br> outl(tmp, 0xCF8);<br> printk(BIOS_DEBUG, "PCI: Using configuration type 1\n");<br>
return &pci_cf8_conf1;<br> }<br> outl(tmp, 0xCF8);<br> }<br><br> die("pci_check_direct failed\n");<br> return NULL;<br>}<br><br>/** Set the method to be used for PCI, type I or type II<br>
*/<br>void pci_set_method(struct device * dev)<br>{<br> printk(BIOS_INFO, "Finding PCI configuration type.\n");<br> dev->ops->ops_pci_bus = pci_check_direct();<br> post_code(POST_STAGE2_PHASE2_PCI_SET_METHOD);<br>
}<br><br>Here are the interesting things:<br>1. pci_check_direct either returns pci_cfg8_conf1 or dies<br>2. This code is only used by geodelx<br><br>I think the const struct is the right way to do this. Can we change these functions?<br>
<br>Two solutions:<br>1. Set the entire ops<br>2. Initialize it correctly and die if the check fails<br><br>Comments?<br><br>Thanks,<br>Myles<br>
------=_Part_15249_19644244.1225916673157--
More information about the coreboot
mailing list