From patchwork Wed Oct 21 17:03:47 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Fwd:,Re:,[Fwd:,Re:,[Fwd:,Re:,arima,hdama,problem] ]] Date: Wed, 21 Oct 2009 17:03:47 -0000 From: Myles Watson X-Patchwork-Id: 453 Message-Id: <2831fecf0910211003p56424eccp51912fd2f09652ce@mail.gmail.com> To: Hugh Greenberg Cc: coreboot@coreboot.org On Wed, Oct 21, 2009 at 10:32 AM, Hugh Greenberg wrote: > Attached is a patch that contains the extra debug statements I added. > Below is the new output: > > before scan bus of PCI: 00:18.0 > In scan bus of PCI: 00:18.0 OK. This next patch prints the location of scan_bus and puts some prints in amdk8_scan_chain(s). Thanks, Myles Index: svn/src/devices/device.c =================================================================== --- svn.orig/src/devices/device.c +++ svn/src/devices/device.c @@ -847,14 +847,21 @@ unsigned int scan_bus(struct device *bus do_scan_bus = 1; while (do_scan_bus) { int link; + printk_debug("In scan bus of %s\n", dev_path(busdev)); + printk_debug("scan_bus() = %p\n", busdev->ops->scan_bus); new_max = busdev->ops->scan_bus(busdev, max); do_scan_bus = 0; for (link = 0; link < busdev->links; link++) { if (busdev->link[link].reset_needed) { + printk_debug("Reset needed for link device: %s\n", + dev_path(busdev->link[link].dev)); + if (reset_bus(&busdev->link[link])) { do_scan_bus = 1; } else { busdev->bus->reset_needed = 1; + printk_debug("Setting reset_needed for %s to 1\n", + dev_path(busdev)); } } } Index: svn/src/devices/pci_device.c =================================================================== --- svn.orig/src/devices/pci_device.c +++ svn/src/devices/pci_device.c @@ -1081,7 +1081,9 @@ unsigned int pci_scan_bus(struct bus *bu * scan the bus behind that child. */ for (child = bus->children; child; child = child->sibling) { + printk_debug("before scan bus of %s\n", dev_path(child)); max = scan_bus(child, max); + printk_debug("after scan bus of %s\n", dev_path(child)); } /* We've scanned the bus and so we know all about what's on the other Index: svn/src/northbridge/amd/amdk8/northbridge.c =================================================================== --- svn.orig/src/northbridge/amd/amdk8/northbridge.c +++ svn/src/northbridge/amd/amdk8/northbridge.c @@ -93,19 +93,29 @@ static unsigned int amdk8_scan_chain(dev unsigned min_bus; unsigned max_devfn; + printk_debug("%s: %s, node %d, link %d\n", __func__, + dev_path(dev), nodeid, link); + dev->link[link].cap = 0x80 + (link *0x20); + if (pci_read_config32(dev, dev->link[link].cap + 0x18) & + ConnectionPending) + printk_debug("%s: connection pending %s link %d\n", + __func__, dev_path(dev), link); do { link_type = pci_read_config32(dev, dev->link[link].cap + 0x18); } while(link_type & ConnectionPending); if (!(link_type & LinkConnected)) { return max; } + printk_debug("connected\n"); do { link_type = pci_read_config32(dev, dev->link[link].cap + 0x18); } while(!(link_type & InitComplete)); + printk_debug("Init Complete\n"); if (!(link_type & NonCoherent)) { return max; } + printk_debug("non coherent\n"); /* See if there is an available configuration space mapping * register in function 1. */ @@ -199,6 +209,7 @@ static unsigned int amdk8_scan_chain(dev else max_devfn = (0x1f<<3) | 7; + printk_debug("scan chain\n"); max = hypertransport_scan_chain(&dev->link[link], 0, max_devfn, max, ht_unitid_base, offset_unitid); /* We know the number of busses behind this bridge. Set the @@ -237,6 +248,8 @@ static unsigned int amdk8_scan_chains(de unsigned offset_unitid = 0; nodeid = amdk8_nodeid(dev); + printk_debug("%s: %s, node %d\n", __func__, + dev_path(dev), nodeid); if(nodeid==0) { sblink = (pci_read_config32(dev, 0x64)>>8) & 3; #if CONFIG_SB_HT_CHAIN_ON_BUS0 > 0 @@ -248,6 +261,8 @@ static unsigned int amdk8_scan_chains(de } for(link = 0; link < dev->links; link++) { + printk_debug("%s: %s, node %d, link %d\n", __func__, + dev_path(dev), nodeid, link); #if CONFIG_SB_HT_CHAIN_ON_BUS0 > 0 if( (nodeid == 0) && (sblink == link) ) continue; //already done #endif