Patchwork [Fwd:,Re:,[Fwd:,Re:,[Fwd:,Re:,arima,hdama,problem] ]]

login
register
about
Submitter Myles Watson
Date 2009-10-21 18:06:44
Message ID <2831fecf0910211106g2a06187ap82da4abecfbd7711@mail.gmail.com>
Download mbox | patch
Permalink /patch/454/
State Superseded
Headers show

Comments

Myles Watson - 2009-10-21 18:06:44
On Wed, Oct 21, 2009 at 11:37 AM, Hugh Greenberg <hng@lanl.gov> wrote:

> Below is the end of the output.  I have no idea what coreboot_ram.map
> should look like, so I've attached that file.

Thanks.  That was just in case amdk8_scan_chains wasn't being called, so we
could see why.  0010131c matches the value for amdk8_scan_chains, and it got
called, so we're good.


> before scan bus of PCI: 00:18.0
> In scan bus of PCI: 00:18.0
> scan_bus() = 0010131c
> amdk8_scan_chains: PCI: 00:18.0, node 0
> amdk8_scan_chains: PCI: 00:18.0, node 0, link 0
> amdk8_scan_chain: PCI: 00:18.0, node 0, link 0
> connected
> Init Complete
> non coherent
> scan chain
>

Here's the next step.  I took out a few of the print statements that we got
past.

Thanks,
Myles
Hugh Greenberg - 2009-10-21 18:23:47
Here is the new output:

before scan bus of PCI: 00:18.0
amdk8_scan_chains: PCI: 00:18.0, node 0
amdk8_scan_chains: PCI: 00:18.0, node 0, link 0
amdk8_scan_chain: PCI: 00:18.0, node 0, link 0
connected
Init Complete
non coherent
scan chain
ht_collapse_early_enumeration: PCI: 00:18.0 children PCI: 00:18.0 
offset_unitid0
ht_collapse_early_enumeration: ctrl = 20

Patch

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
Index: svn/src/devices/hypertransport.c
===================================================================
--- svn.orig/src/devices/hypertransport.c
+++ svn/src/devices/hypertransport.c
@@ -299,6 +299,11 @@  static void ht_collapse_early_enumeratio
 	prev.freq_off     = PCI_HT_CAP_HOST_FREQ;
 	prev.freq_cap_off = PCI_HT_CAP_HOST_FREQ_CAP;
 
+	printk_debug("%s: %s children %s offset_unitid %d\n", __func__,
+		     dev_path(bus->dev), dev_path(bus->children), offset_unitid);
+	printk_debug("%s: ctrl = %x\n", __func__,
+		     pci_read_config16(prev.dev, prev.pos + prev.ctrl_off));
+
 	/* Wait until the link initialization is complete */
 	do {
 		ctrl = pci_read_config16(prev.dev, prev.pos + prev.ctrl_off);
@@ -401,6 +406,8 @@  unsigned int hypertransport_scan_chain(s
 	/* Restore the hypertransport chain to it's unitialized state */
 	ht_collapse_early_enumeration(bus, offset_unitid);
 
+	printk_debug("%s: %s children %s offset_unitid %d\n", __func__,
+		     dev_path(bus->dev), dev_path(bus->children), offset_unitid);
 	/* See which static device nodes I have */
 	old_devices = bus->children;
 	bus->children = 0;
@@ -449,10 +456,13 @@  unsigned int hypertransport_scan_chain(s
 			}
 		} while((ctrl & (1 << 5)) == 0);
 		
+		printk_debug("%s: link OK\n", __func__);
 
 		/* Get and setup the device_structure */
 		dev = ht_scan_get_devs(&old_devices);
 
+		printk_debug("%s: dev = %s\n", dev_path(dev));
+		printk_debug("%s: old_devs = %s\n", dev_path(old_devices));
 		/* See if a device is present and setup the
 		 * device structure.
 		 */