On Wed, Nov 5, 2008 at 3:42 PM, ron minnich <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]>
With this change, my other patch is build tested for qemu, norwich, &
serengeti.
Run-tested on qemu & serengeti.
Thanks,
Myles
Index: include/arch/x86/pci_ops.h
===================================================================
--- include/arch/x86/pci_ops.h (revision 980)
+++ include/arch/x86/pci_ops.h (working copy)
@@ -25,6 +25,6 @@
extern const struct pci_bus_operations pci_ops_mmconf;
#endif
-void pci_set_method(struct device * dev);
+void pci_check_pci_ops(const struct pci_bus_operations * ops);
#endif /* ARCH_X86_PCI_OPS_H */
Index: northbridge/amd/geodelx/geodelx.c
===================================================================
--- northbridge/amd/geodelx/geodelx.c (revision 980)
+++ northbridge/amd/geodelx/geodelx.c (working copy)
@@ -196,7 +196,7 @@
/* print_conf(); */
printk(BIOS_DEBUG, "VRC_VG value: 0x%04x\n", nb_dm->geode_video_mb);
graphics_init((u8)nb_dm->geode_video_mb);
- pci_set_method(dev);
+ pci_check_pci_ops(dev->ops->ops_pci_bus);
}
/**
Index: arch/x86/pci_ops_auto.c
===================================================================
--- arch/x86/pci_ops_auto.c (revision 980)
+++ arch/x86/pci_ops_auto.c (working copy)
@@ -15,7 +15,7 @@
.write8 = pci_conf1_write_config8,
.write16 = pci_conf1_write_config16,
.write32 = pci_conf1_write_config32,
- .find = pci_conf1_find_device,
+ .find = pci_conf1_find_device,
};
@@ -53,36 +53,27 @@
return 0;
}
-const struct pci_bus_operations *pci_check_direct(void)
+void pci_check_pci_ops(const struct pci_bus_operations *ops)
{
unsigned int tmp;
/*
- * Check if configuration type 1 works.
+ * Check if configuration cycles work.
*/
+ if (ops == &pci_cf8_conf1)
{
outb(0x01, 0xCFB);
tmp = inl(0xCF8);
outl(0x80000000, 0xCF8);
if ((inl(0xCF8) == 0x80000000) &&
- pci_sanity_check(&pci_cf8_conf1))
+ pci_sanity_check(ops))
{
outl(tmp, 0xCF8);
printk(BIOS_DEBUG, "PCI: Using configuration type 1\n");
- return &pci_cf8_conf1;
+ return;
}
outl(tmp, 0xCF8);
}
- die("pci_check_direct failed\n");
- return NULL;
+ die("pci_check_pci_ops failed\n");
}
-
-/** 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);
-}
--
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot