This patch is how I like to use the debugging functions I just committed.
Signed-off-by: Myles Watson <[email protected]>
Thanks,
Myles
Index: cbv2/src/devices/device.c
===================================================================
--- cbv2.orig/src/devices/device.c 2009-05-11 15:02:47.000000000 -0600
+++ cbv2/src/devices/device.c 2009-05-11 15:04:49.000000000 -0600
@@ -618,6 +618,12 @@
unsigned subordinate;
printk_info("Enumerating buses...\n");
root = &dev_root;
+
+ show_all_devs(BIOS_DEBUG, "Before Phase 3.");
+ printk_debug("Compare with tree...\n");
+
+ show_devs_tree(root, BIOS_DEBUG, 0, 0);
+
if (root->chip_ops && root->chip_ops->enable_dev) {
root->chip_ops->enable_dev(root);
}
@@ -651,6 +657,9 @@
printk_info("Allocating resources...\n");
root = &dev_root;
+
+ print_resource_tree(root, BIOS_DEBUG, "Original.");
+
if (!root->ops || !root->ops->read_resources) {
printk_err("dev_root missing read_resources\n");
return;
@@ -664,6 +673,8 @@
root->ops->read_resources(root);
printk_info("Done reading resources.\n");
+ print_resource_tree(root, BIOS_DEBUG, "After reading.");
+
/* Get the resources */
io = &root->resource[0];
mem = &root->resource[1];
@@ -681,6 +692,7 @@
#if CONFIG_CONSOLE_VGA == 1
/* Allocate the VGA I/O resource.. */
allocate_vga_resource();
+ print_resource_tree(root, BIOS_DEBUG, "After VGA.");
#endif
/* Store the computed resource allocations into device registers ... */
@@ -691,6 +703,7 @@
mem->flags |= IORESOURCE_STORED;
report_resource_stored(root, mem, "");
#endif
+ print_resource_tree(root, BIOS_DEBUG, "After assigning values.");
printk_info("Done allocating resources.\n");
}
@@ -737,5 +750,6 @@
}
}
printk_info("Devices initialized\n");
+ show_all_devs(BIOS_DEBUG, "After init.");
}
Index: cbv2/src/include/device/device.h
===================================================================
--- cbv2.orig/src/include/device/device.h 2009-05-11 15:03:48.000000000 -0600
+++ cbv2/src/include/device/device.h 2009-05-11 15:04:49.000000000 -0600
@@ -126,7 +126,6 @@
device_t dev_find_slot_on_smbus (unsigned int bus, unsigned int addr);
/* Debug functions */
-void resource_tree(struct device * root, int debug_level, int depth);
void print_resource_tree(struct device * root, int debug_level,
const char *msg);
void show_devs_tree(struct device *dev, int debug_level, int depth, int linknum);
Index: cbv2/src/devices/pci_device.c
===================================================================
--- cbv2.orig/src/devices/pci_device.c 2009-05-11 15:03:42.000000000 -0600
+++ cbv2/src/devices/pci_device.c 2009-05-11 15:04:47.000000000 -0600
@@ -804,7 +804,7 @@
(driver->device == dev->device))
{
dev->ops = driver->ops;
- printk_spew("%s [%04x/%04x] %sops\n",
+ printk_debug("%s [%04x/%04x] %sops\n",
dev_path(dev),
driver->vendor, driver->device,
(driver->ops->scan_bus?"bus ":""));
--
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot