This patch continues the device code cleanup.
The largest changes are to get_pci_bridge_ops, and related changes to make it compile and use correct declarations. I'd appreciate someone else checking my const usage for sanity.
While I was doing that I moved the checks for CONFIG_<BUS>_PLUGIN_SUPPORT to the Makefile.
The only functional difference is a possible NULL dereference in a debug statement.
Signed-off-by: Myles Watson mylesgw@gmail.com
Thanks, Myles
On Wed, Nov 5, 2008 at 12:27 PM, Myles Watson mylesgw@gmail.com wrote:
This patch continues the device code cleanup.
I forgot the include/device/ changes in the first patch.
Thanks, Myles
The largest changes are to get_pci_bridge_ops, and related changes to make it compile and use correct declarations. I'd appreciate someone else checking my const usage for sanity.
While I was doing that I moved the checks for CONFIG_<BUS>_PLUGIN_SUPPORT to the Makefile.
The only functional difference is a possible NULL dereference in a debug statement.
Signed-off-by: Myles Watson mylesgw@gmail.com
Thanks, Myles
Are you testing these on qemu I assume?
ron
Are you testing these on qemu I assume?
I can. I don't think I've made any functional changes, but it's probably good to check.
Most of this patch isn't exercised by qemu, though. There are no bridges which are not in the dts.
Thanks, Myles
On Wed, Nov 5, 2008 at 1:24 PM, Myles Watson mylesgw@gmail.com wrote:
Are you testing these on qemu I assume?
I can. I don't think I've made any functional changes, but it's probably good to check.
Most of this patch isn't exercised by qemu, though. There are no bridges which are not in the dts.
It turns out that I forgot the importance of make clean for build testing. I wish I knew better how to fix the dependencies.
This breaks the build now that I made the change for the pci_ops structs to be const.
From pci_ops_auto.c:
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
/** 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); }
yeah, just set it. This is historical from when we supported type i or type ii, but nobody uses type ii
ron
On Wed, Nov 5, 2008 at 3:42 PM, ron minnich rminnich@gmail.com wrote:
/** 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); }
yeah, just set it. This is historical from when we supported type i or type ii, but nobody uses type ii
I left the infrastructure there so that it could be easily used for memory-mapped checking. Otherwise the whole file needs to die.
I also changed the function call, since it was only using the device pointer to set the operations. Now it uses the device pointer to tell it which ops to check.
Signed-off-by: Myles Watson mylesgw@gmail.com
With this change, my other patch is build tested for qemu, norwich, & serengeti.
Run-tested on qemu & serengeti.
Thanks, Myles
On Wed, Nov 5, 2008 at 4:14 PM, ron minnich rminnich@gmail.com wrote:
Acked-by: Ronald G. Minnich rminnich@gmail.com
Rev 982.
Thanks, Myles
On Wed, Nov 5, 2008 at 1:23 PM, ron minnich rminnich@gmail.com wrote:
looks good, not build or boot tested.
Acked-by: Ronald G. Minnich rminnich@gmail.com
Rev 983.
Thanks, Myles
Challenge: get via or k8 working by rev 1000. I used to think we'd make it :-)
ron