pci stuff: too much hax now, trying rd890 patch (not merged yet)
[coreboot.git] / src / devices / pci_device.c
index 0a870b84cfe63ee5e57e24a0ec1f122be34853fe..cc15f3bffeb84687138ff3bb199d7f91499dcdb7 100644 (file)
@@ -54,6 +54,9 @@
 #if CONFIG_HAVE_ACPI_RESUME && !CONFIG_S3_VGA_ROM_RUN
 #include <arch/acpi.h>
 #endif
+#if CONFIG_CHROMEOS
+#include <vendorcode/google/chromeos/chromeos.h>
+#endif
 
 u8 pci_moving_config8(struct device *dev, unsigned int reg)
 {
@@ -667,6 +670,15 @@ void pci_dev_init(struct device *dev)
            ((dev->class >> 8) == PCI_CLASS_DISPLAY_VGA))
                return;
 
+#if CONFIG_CHROMEOS
+       /* In ChromeOS we want to boot blazingly fast. Therefore
+        * we don't run (VGA) option ROMs, unless we have to print
+        * something on the screen before the kernel is loaded.
+        */
+       if (!developer_mode_enabled() && !recovery_mode_enabled())
+               return;
+#endif
+
        rom = pci_rom_probe(dev);
        if (rom == NULL)
                return;
@@ -937,6 +949,7 @@ device_t pci_probe_dev(device_t dev, struct bus *bus, unsigned devfn)
                }
                dev = alloc_dev(bus, &dummy.path);
        } else {
+               printk(BIOS_INFO, "%s: ohai, non-dummy stuff!\n", __func__);
                /*
                 * Enable/disable the device. Once we have found the device-
                 * specific operations this operations we will disable the
@@ -949,11 +962,16 @@ device_t pci_probe_dev(device_t dev, struct bus *bus, unsigned devfn)
                 * it may be absent and enable_dev() must cope.
                 */
                /* Run the magic enable sequence for the device. */
-               if (dev->chip_ops && dev->chip_ops->enable_dev)
+               printk(BIOS_INFO, "%s: before enable! 0x%08x\n", __func__, (unsigned int) dev->chip_ops->enable_dev);
+               if (dev->chip_ops && dev->chip_ops->enable_dev) {
+                       printk(BIOS_INFO, "%s: we're going to call enable stuff?\n", __func__);
                        dev->chip_ops->enable_dev(dev);
+               }
 
+               printk(BIOS_INFO, "%s: before read!\n", __func__);
                /* Now read the vendor and device ID. */
                id = pci_read_config32(dev, PCI_VENDOR_ID);
+               printk(BIOS_INFO, "%s: after  read: 0x%08x\n", __func__, id);
 
                /*
                 * If the device does not have a PCI ID disable it. Possibly
@@ -969,6 +987,7 @@ device_t pci_probe_dev(device_t dev, struct bus *bus, unsigned devfn)
                                       "found, disabling it.\n", dev_path(dev));
                                dev->enabled = 0;
                        }
+                       printk(BIOS_INFO, "%s: non-static stuff!\n", __func__);
                        return dev;
                }
        }
@@ -1059,10 +1078,14 @@ unsigned int pci_scan_bus(struct bus *bus, unsigned min_devfn,
                struct device *dev;
 
                /* First thing setup the device structure. */
+               printk(BIOS_INFO, "%s: before pci_scan_get_dev! devfn: %d\n", __func__, devfn);
                dev = pci_scan_get_dev(&old_devices, devfn);
+               printk(BIOS_INFO, "%s: after  pci_scan_get_dev!\n", __func__);
 
                /* See if a device is present and setup the device structure. */
+               printk(BIOS_INFO, "%s: before pci_probe_dev!\n", __func__);
                dev = pci_probe_dev(dev, bus, devfn);
+               printk(BIOS_INFO, "%s: after  pci_probe_dev!\n", __func__);
 
                /*
                 * If this is not a multi function device, or the device is
@@ -1072,7 +1095,9 @@ unsigned int pci_scan_bus(struct bus *bus, unsigned min_devfn,
                if ((PCI_FUNC(devfn) == 0x00) && (!dev
                     || (dev->enabled && ((dev->hdr_type & 0x80) != 0x80)))) {
                        devfn += 0x07;
+                       printk(BIOS_INFO, "%s: ohai, +7\n", __func__);
                }
+               printk(BIOS_INFO, "\n");
        }
 
        post_code(0x25);