[coreboot] pci_read_config8 crash in mainboard.c
ron minnich
rminnich at gmail.com
Wed Mar 4 01:57:53 CET 2009
--- LinuxBIOSv2-asus_m2a-vm/src/mainboard/amd/dbm690t/mainboard.c
(Revision 3967)
+++ LinuxBIOSv2-asus_m2a-vm/src/mainboard/amd/dbm690t/mainboard.c
(Arbeitskopie)
@@ -89,6 +89,31 @@
outb(byte, 0xC52);
}
+/*
+ * This is a totally gross hack to be able to use pci_{read,write}_config*
+ * early during boot when the device tree is not yet set up completely.
+ */
+void devicetree_early_fixup(struct device *dev)
+{
+ struct bus *pbus = dev->bus;
+ while(pbus && pbus->dev && !ops_pci_bus(pbus)) {
+ if (pbus == pbus->dev->bus)
+ break;
+ pbus = pbus->dev->bus;
+ }
+ if (ops_pci_bus(pbus)) {
+ printk_info("%s not needed\n", __func__);
+ return;
+ }
+ if (pbus && pbus->dev && pbus->dev->ops) {
+ printk_info("%s fixing up root bus pci ops\n", __func__);
+ pbus->dev->ops->ops_pci_bus = &pci_cf8_conf1;
+ return;
+ }
+ printk_info("%s failed\n", __func__);
+ return;
+}
There has to be a better way to do this than a per-mainboard fix.
ron
More information about the coreboot
mailing list