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

login
register
about
Submitter Myles Watson
Date 2009-11-04 18:21:29
Message ID <2831fecf0911041021j1a32bdb1id4942a4254f647b@mail.gmail.com>
Download mbox | patch
Permalink /patch/534/
State Superseded
Headers show

Comments

Myles Watson - 2009-11-04 18:21:29
On Wed, Nov 4, 2009 at 12:06 PM, Hugh Greenberg <hng@lanl.gov> wrote:

> Myles,
>
> It worked.  Coreboot boots with SB_HT_CHAIN_ON_BUS_0 set to one and the
> previous patch.  Seabios also detects the network devices without setting
> CONFIG_PCI_ROOT1 to 0x02.  Attached is the output.  Seabios was compiled
> with DEBUG_LEVEL set to 8.
>

ERROR - cound not find bus for node 0 chain 0, using defaults
ERROR - could not find PCI 1:01.0, using defaults
ERROR - could not find PCI 1:02.0, using defaults
Wrote the mp table end at: 000f0410 - 000f05e4
Adding CBMEM entry as no. 3
Looking for bad PCIX MHz input
Looking for bad Hot Swap Enable
OK 133MHz & Hot Swap is off
ERROR - cound not find bus for node 0 chain 0, using defaults
ERROR - could not find PCI 1:01.0, using defaults
ERROR - could not find PCI 1:02.0, using defaults
Wrote the mp table end at: 3fff1410 - 3fff15e4

It almost worked.  Can you try the attached patch?

Is it actually booting into Linux?

Thanks,
Myles
Hugh Greenberg - 2009-11-04 21:48:44
Attached is the latest output.  I don't see the errors anymore.  I just 
tried booting Linux with the latest rom and it booted.
Myles Watson - 2009-11-04 21:53:47
On Wed, Nov 4, 2009 at 2:48 PM, Hugh Greenberg <hng@lanl.gov> wrote:

> Attached is the latest output.  I don't see the errors anymore.  I just
> tried booting Linux with the latest rom and it booted.
>
Great!  So is everything finally working, or are you still fighting sporadic
hangs?

We should commit the fixes so they don't get lost.

Thanks,
Myles
Hugh Greenberg - 2009-11-04 22:23:57
Myles,

Everything seems to be working well.  I had one sporadic hang while 
testing at what looked to be at the same place as the initial first 
hang.  That was the only instance since I moved to gcc 3.4. We were 
testing so many things that I don't remember the exact scenario.   I'm 
satisfied though.  If I see it happening again, I'll try to capture it 
and send it to you.

You deserve a medal for this.  Thanks a lot.
Myles Watson - 2009-11-04 22:34:02
On Wed, Nov 4, 2009 at 4:23 PM, Hugh Greenberg <hng@lanl.gov> wrote:

> Myles,
>
> Everything seems to be working well.  I had one sporadic hang while testing
> at what looked to be at the same place as the initial first hang.  That was
> the only instance since I moved to gcc 3.4. We were testing so many things
> that I don't remember the exact scenario.   I'm satisfied though.  If I see
> it happening again, I'll try to capture it and send it to you.
>
Sounds good.  I'd be interested in whether or not it hangs with the newer
gcc still, too.  Since everything else is working, it would be nice to know
if that's really an issue.


> You deserve a medal for this.  Thanks a lot.

No problem.  Would you mind sending svn diff from your working tree so I can
make a patch?  I've lost track of which patches you're using.

Thanks,
Myles
Hugh Greenberg - 2009-11-04 23:52:46
Yes, it is still hanging occasionally with a newer gcc.  I thought I put 
all the debug stuff back in, but I apparently didn't get it all.   Below 
is the output.  I will put the remaining debug statements back in for 
this hang again and send the output.

coreboot-2.3 Wed Nov  4 16:40:23 MST 2009 starting...
Enabling routing table for node 00 done.
Enabling SMP settings
(0,1) link=01
(1,0) link=01
setup_remote_node: done
Renaming current temporary node to 01 done.
Enabling routing table for node 01 done.
02 nodes initialized.
coherent_ht_finalize
done
started ap apicid:
SBLink=00
NC node|link=00
entering ht_optimize_link
pos=0x8a, unfiltered freq_cap=0x8075
pos=0x8a, filtered freq_cap=0x35
pos=0xce, unfiltered freq_cap=0x35
freq_cap1=0x35, freq_cap2=0x15
dev1 old_freq=0x0, freq=0x4, needs_reset=0x1
dev2 old_freq=0x0, freq=0x4, needs_reset=0x1
width_cap1=0x11, width_cap2=0x11
dev1 input ln_width1=0x4, ln_width2=0x4
dev1 input width=0x1
dev1 output ln_width1=0x4, ln_width2=0x4
dev1 input|output width=0x11
old dev1 input|output width=0x11
dev2 input|output width=0x11
old dev2 input|output width=0x11
entering ht_optimize_link
pos=0xd2, unfiltered freq_cap=0x35
pos=0xce, unfiltered freq_cap=0x1
pos=0xce, filtered freq_cap=0x1
freq_cap1=0x15, freq_cap2=0x1
dev1 old_freq=0x0, freq=0x0, needs_reset=0x0
dev2 old_freq=0x0, freq=0x0, needs_reset=0x0
width_cap1=0x0, width_cap2=0x0
dev1 input ln_width1=0x3, ln_width2=0x3
dev1 input width=0x0
dev1 output ln_width1=0x3, ln_width2=0x3
dev1 input|output width=0x0
old dev1 input|output width=0x0
dev2 input|output width=0x0
old dev2 input|output width=0x0
ht reset -


coreboot-2.3 Wed Nov  4 16:40:23 MST 2009 starting...
Enabling routing table for node 00 done.
Enabling SMP settings
(0,1) link=01
(1,0) link=01
setup_remote_node: done
Renaming current temporary node to 01 done.
Enabling routing table for node 01 done.
02 nodes initialized.
coherent_ht_finalize
done
started ap apicid:
SBLink=00
NC node|link=00
entering ht_optimize_link
pos=0x8a, unfiltered freq_cap=0x8075
pos=0x8a, filtered freq_cap=0x35
pos=0xce, unfiltered freq_cap=0x35
freq_cap1=0x35, freq_cap2=0x15
dev1 old_freq=0x4, freq=0x4, needs_reset=0x0
dev2 old_freq=0x4, freq=0x4, needs_reset=0x0
width_cap1=0x11, width_cap2=0x11
dev1 input ln_width1=0x4, ln_width2=0x4
dev1 input width=0x1
dev1 output ln_width1=0x4, ln_width2=0x4
dev1 input|output width=0x11
old dev1 input|output width=0x11
dev2 input|output width=0x11
old dev2 input|output width=0x11
entering ht_optimize_link
pos=0xd2, unfiltered freq_cap=0x35
pos=0xce, unfiltered freq_cap=0x1
pos=0xce, filtered freq_cap=0x1
freq_cap1=0x15, freq_cap2=0x1
dev1 old_freq=0x0, freq=0x0, needs_reset=0x0
dev2 old_freq=0x0, freq=0x0, needs_reset=0x0
width_cap1=0x0, width_cap2=0x0
dev1 input ln_width1=0x3, ln_width2=0x3
dev1 input width=0x0
dev1 output ln_width1=0x3, ln_width2=0x3
dev1 input|output width=0x0
old dev1 input|output width=0x0
dev2 input|output width=0x0
old dev2 input|output width=0x0
SMBus controller enabled
Ram1.00
setting up CPU00 northbridge registers
done.
Ram1.01
setting up CPU01 northbridge registers
done.
Ram2.00
Enabling dual channel memory
Registered
166Mhz
RAM end at 0x00100000 kB
Lower RAM end at 0x00100000 kB
Ram2.01
Enabling dual channel memory
Registered
166Mhz
RAM end at 0x00200000 kB
Lower RAM end at 0x00200000 kB
Ram3
Myles Watson - 2009-11-05 00:06:28
> Yes, it is still hanging occasionally with a newer gcc.  
Too bad.  Occasionally like 1-in-3?  I don't have any idea what the compiler
would have to do with non-deterministic hangs.

> I thought I put
> all the debug stuff back in, but I apparently didn't get it all.   Below
> is the output.  I will put the remaining debug statements back in for
> this hang again and send the output.
OK.  The other thing to find out is if you still need the "Forcing Type 1"
hack.  Everything else is nearly trivial since it only affects your board,
and you've tested it.

Thanks,
Myles
Hugh Greenberg - 2009-11-05 00:16:49
Sometimes it takes a very long time to reproduce.   It is very random.  
I just tried about 30 times and I was not able to reproduce it.  Ok, I 
will see if I still need that.
Hugh Greenberg - 2009-11-05 00:40:47
It doesn't seem like I need the forcing type 1 hack anymore.

I reproduced the hang with some of the debugging statements back in. I 
hope that is all you need. Here is the output:

coreboot-2.3 Wed Nov 4 17:28:13 MST 2009 starting...
Enabling routing table for node 00 done.
Enabling SMP settings
(0,1) link=01
(1,0) link=01
setup_remote_node: done
Renaming current temporary node to 01 done.
Enabling routing table for node 01 done.
02 nodes initialized.
coherent_ht_finalize
done
started ap apicid:
SBLink=00
NC node|link=00
entering ht_optimize_link
pos=0x8a, unfiltered freq_cap=0x8075
pos=0x8a, filtered freq_cap=0x35
pos=0xce, unfiltered freq_cap=0x35
freq_cap1=0x35, freq_cap2=0x15
dev1 old_freq=0x0, freq=0x4, needs_reset=0x1
dev2 old_freq=0x0, freq=0x4, needs_reset=0x1
width_cap1=0x11, width_cap2=0x11
dev1 input ln_width1=0x4, ln_width2=0x4
dev1 input width=0x1
dev1 output ln_width1=0x4, ln_width2=0x4
dev1 input|output width=0x11
old dev1 input|output width=0x11
dev2 input|output width=0x11
old dev2 input|output width=0x11
entering ht_optimize_link
pos=0xd2, unfiltered freq_cap=0x35
pos=0xce, unfiltered freq_cap=0x1
pos=0xce, filtered freq_cap=0x1
freq_cap1=0x15, freq_cap2=0x1
dev1 old_freq=0x0, freq=0x0, needs_reset=0x0
dev2 old_freq=0x0, freq=0x0, needs_reset=0x0
width_cap1=0x0, width_cap2=0x0
dev1 input ln_width1=0x3, ln_width2=0x3
dev1 input width=0x0
dev1 output ln_width1=0x3, ln_width2=0x3
dev1 input|output width=0x0
old dev1 input|output width=0x0
dev2 input|output width=0x0
old dev2 input|output width=0x0
ht reset -


coreboot-2.3 Wed Nov 4 17:28:13 MST 2009 starting...
Enabling routing table for node 00 done.
Enabling SMP settings
(0,1) link=01
(1,0) link=01
setup_remote_node: done
Renaming current temporary node to 01 done.
Enabling routing table for node 01 done.
02 nodes initialized.
coherent_ht_finalize
done
started ap apicid:
SBLink=00
NC node|link=00
entering ht_optimize_link
pos=0x8a, unfiltered freq_cap=0x8075
pos=0x8a, filtered freq_cap=0x35
pos=0xce, unfiltered freq_cap=0x35
freq_cap1=0x35, freq_cap2=0x15
dev1 old_freq=0x4, freq=0x4, needs_reset=0x0
dev2 old_freq=0x4, freq=0x4, needs_reset=0x0
width_cap1=0x11, width_cap2=0x11
dev1 input ln_width1=0x4, ln_width2=0x4
dev1 input width=0x1
dev1 output ln_width1=0x4, ln_width2=0x4
dev1 input|output width=0x11
old dev1 input|output width=0x11
dev2 input|output width=0x11
old dev2 input|output width=0x11
entering ht_optimize_link
pos=0xd2, unfiltered freq_cap=0x35
pos=0xce, unfiltered freq_cap=0x1
pos=0xce, filtered freq_cap=0x1
freq_cap1=0x15, freq_cap2=0x1
dev1 old_freq=0x0, freq=0x0, needs_reset=0x0
dev2 old_freq=0x0, freq=0x0, needs_reset=0x0
width_cap1=0x0, width_cap2=0x0
dev1 input ln_width1=0x3, ln_width2=0x3
dev1 input width=0x0
dev1 output ln_width1=0x3, ln_width2=0x3
dev1 input|output width=0x0
old dev1 input|output width=0x0
dev2 input|output width=0x0
old dev2 input|output width=0x0
SMBus controller enabled
Ram1.00
setting up CPU00 northbridge registers
done.
Ram1.01
setting up CPU01 northbridge registers
done.
Ram2.00
Enabling dual channel memory
Registered
166Mhz
RAM end at 0x00100000 kB
Lower RAM end at 0x00100000 kB
Ram2.01
Enabling dual channel memory
Registered
166Mhz
RAM end at 0x00200000 kB
Lower RAM end at 0x00200000 kB
Ram3
Before starting clocks: Before memreset:
Myles Watson - 2009-11-05 04:47:34
> It doesn't seem like I need the forcing type 1 hack anymore.
Good.

> I reproduced the hang with some of the debugging statements back in.
Thanks.

> I hope that is all you need.
Yeah.  It took a little too long to figure that one out :)  I think we'll
call it good for now.

> Here is the output:
> Ram3
> Before starting clocks: Before memreset:
I guess we should put the timeout back in so that it doesn't hang.  I really
don't understand why that would be compiler dependent.

I'll send the patch to the list tomorrow.

Thanks,
Myles

Patch

Index: svn/src/mainboard/arima/hdama/mptable.c
===================================================================
--- svn.orig/src/mainboard/arima/hdama/mptable.c
+++ svn/src/mainboard/arima/hdama/mptable.c
@@ -65,7 +65,7 @@  static unsigned node_link_to_bus(unsigne
 
 	dev = dev_find_slot(0, PCI_DEVFN(0x18, 1));
 	if (!dev) {
-		return 0;
+		return 0xff;
 	}
 	for(reg = 0xE0; reg < 0xF0; reg += 0x04) {
 		uint32_t config_map;
@@ -89,7 +89,7 @@  static unsigned node_link_to_bus(unsigne
 			return bus_base;
 		}
 	}
-	return 0;
+	return 0xff;
 }
 
 unsigned max_apicid(void)
@@ -152,9 +152,9 @@  void *smp_write_config_table(void *v)
 
 		/* HT chain 0 */
 		bus_chain_0 = node_link_to_bus(0, 0);
-		if (bus_chain_0 == 0) {
+		if (bus_chain_0 == 0xff) {
 			printk_debug("ERROR - cound not find bus for node 0 chain 0, using defaults\n");
-			bus_chain_0 = 1;
+			bus_chain_0 = 0;
 		}
 
 		/* 8111 */
@@ -165,7 +165,7 @@  void *smp_write_config_table(void *v)
 			bus_isa++;
 		}
 		else {
-			printk_debug("ERROR - could not find PCI 1:03.0, using defaults\n");
+			printk_debug("ERROR - could not find PCI %02x:03.0, using defaults\n", bus_chain_0);
 
 			bus_8111_1 = 4;
 			bus_isa = 5;
@@ -177,7 +177,7 @@  void *smp_write_config_table(void *v)
 
 		}
 		else {
-			printk_debug("ERROR - could not find PCI 1:01.0, using defaults\n");
+			printk_debug("ERROR - could not find PCI %02x:01.0, using defaults\n", bus_chain_0);
 
 			bus_8131_1 = 2;
 		}
@@ -188,7 +188,7 @@  void *smp_write_config_table(void *v)
 
 		}
 		else {
-			printk_debug("ERROR - could not find PCI 1:02.0, using defaults\n");
+			printk_debug("ERROR - could not find PCI %02x:02.0, using defaults\n", bus_chain_0);
 
 			bus_8131_2 = 3;
 		}
@@ -327,16 +327,21 @@  void reboot_if_hotswap(void)
 	int reset;
 	int i;
 
+	unsigned char bus_chain_0 = node_link_to_bus(0, 0);
 	reset = 0;
 	printk_debug("Looking for bad PCIX MHz input\n");
-	dev = dev_find_slot(1, PCI_DEVFN(0x02,0));
+	dev = dev_find_slot(bus_chain_0, PCI_DEVFN(0x02,0));
+	if (!dev)
+		printk_debug("Couldn't find %02x:02.0 \n", bus_chain_0);
 	data = pci_read_config32(dev, 0xa0);
 	if(!(((data>>16)&0x03)==0x03)) {
 		reset=1;
 		printk_debug("Bad PCIX MHz - Reset\n");
 	}
 	printk_debug("Looking for bad Hot Swap Enable\n");
-	dev = dev_find_slot(1, PCI_DEVFN(0x01,0));
+	dev = dev_find_slot(bus_chain_0, PCI_DEVFN(0x01,0));
+	if (!dev)
+		printk_debug("Couldn't find %02x:01.0 \n", bus_chain_0);
 	data = pci_read_config32(dev, 0x48);
 	if(data & 0x0c) {
 		reset=1;