<br><br><div><span class="gmail_quote">On 9/12/06, <b class="gmail_sendername">Ben Hewson</b> <<a href="mailto:ben@hewson-venieri.com">ben@hewson-venieri.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I have been looking through auto.inc and it would be very helpful if<br>besides<br>printing the line no inside auto.c, it would also print the actual C line.<br><br>Does anyone know how easy this would be to do ?<br><br><br>
The reason I am asking this is because of the problem I am having with<br>the epia code.<br><br><br>There is this bit of C code<br><br> // SDRAM in all banks<br> pci_write_config8(north, 0x60, 0x3F);<br><br> // DRAM timing. I'm suspicious of this
<br> // This is for all banks, 64 is 0,1. 65 is 2,3. 66 is 4,5.<br> // ras precharge 4T, RAS pulse 5T<br> // cas2 is 0xd6, cas3 is 0xe6<br> // we're also backing off write pulse width to 2T, so result is 0xee
<br><br>#if DIMM_CL2<br> pci_write_config8(north, 0x64, 0xd6);<br> pci_write_config8(north, 0x65, 0xd6);<br> pci_write_config8(north, 0x66, 0xd6);<br>#else // CL=3<br> pci_write_config8(north, 0x64, 0xe6);
<br> pci_write_config8(north, 0x65, 0xe6);<br> pci_write_config8(north, 0x66, 0xe6);<br>#endif<br><br><br> print_debug_hex8(pci_read_config8(north, 0x64));<br> print_debug_hex8(pci_read_config8(north, 0x65));<br>
print_debug_hex8(pci_read_config8(north, 0x66));<br><br>ok now loking at the serial output I get the following snippet<br><br>1106 0601<br>ece6e6init 1 done<br><br>the important bit is the ece6e6<br><br>Ok now as you can see it is not writing to the register properly. So I
<br>am now looking<br>through auto.inc and trying to find the relevant code. While I will be<br>honest and say<br>at the moment I do not 100% understand it, I can never the less find the<br>relevant<br>assembler code. Anyway this is it
<br><br><br>**********<br> first bit I think is for this line<br> pci_write_config8(north, 0x60, 0x3F);<br>***********<br><br> mov $63 , %al<br> mov $3324 , %dx<br> outb %al, %dx</blockquote><div><br><br>
3324 is cfc. data. 63 is 3f. You have to look at the code before this, but I expect that it will be for 0x60. <br><br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
/* ,:0.0 */<br> /*<br> * pci_write_config8,romcc_io.h:148.38<br> * sdram_set_registers,raminit.c:164.26<br> * main,auto.c:107.28<br> */<br> /* ,:0.0 */<br> /*<br> * __builtin_outl,<built-in>:
1.0<br> * outl,io.h:25.23<br> * pci_write_config8,romcc_io.h:148.13<br> * sdram_set_registers,raminit.c:164.26<br> * main,auto.c:107.28<br> */<br> mov $-2147483548 , %eax<br> mov $3320 , %dx<br>
outl %eax, %dx</blockquote><div><br>3320 is cf8. $-2147483548 is 64. So set cf8 to x64.<br><br> </div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
/* ,:0.0 */<br> /*<br> * __builtin_outb,<built-in>:1.0<br> * outb,io.h:15.23<br> * pci_write_config8,romcc_io.h:149.13<br> * sdram_set_registers,raminit.c:164.26<br> * main,auto.c:107.28<br>
*/<br><br>********* ok here is 1 write of 0xe6 **********<br><br><br><br> mov $230 , %al<br> mov $3325 , %dx<br> outb %al, %dx</blockquote><div><br>so, write e6 to cfd, i.e. 65. hmm. what happened to 64? <br>
</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> /* ,:0.0 */<br> /*<br> * pci_write_config8,romcc_io.h:148.38<br> * sdram_set_registers,
raminit.c:165.26<br> * main,auto.c:107.28<br> */<br> /* ,:0.0 */<br> /*<br> * __builtin_outl,<built-in>:1.0<br> * outl,io.h:25.23<br> * pci_write_config8,romcc_io.h:148.13<br> * sdram_set_registers,
raminit.c:165.26<br> * main,auto.c:107.28<br> */<br> mov $-2147483548 , %eax<br> mov $3320 , %dx<br> outl %eax, %dx</blockquote><div><br><br>set cfc to 64. <br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
/* ,:0.0 */<br> /*<br> * __builtin_outb,<built-in>:1.0<br> * outb,io.h:15.23<br> * pci_write_config8,romcc_io.h:149.13<br> * sdram_set_registers,raminit.c:165.26<br> * main,auto.c:107.28<br>
*/<br><br>********** here is 2nd write of 0xe6 ************<br><br> mov $230 , %al<br> mov $3326 , %dx<br> outb %al, %dx</blockquote><div><br>Write e6 to 66. <br> <br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
/*<br> * pci_read_config8,romcc_io.h:124.38<br> * sdram_set_registers,raminit.c:169.42<br> * main,auto.c:107.28<br> */<br> /* ,:0.0 */<br> /*<br> * __builtin_outl,<built-in>:1.0<br> * outl,
io.h:25.23<br> * pci_read_config8,romcc_io.h:124.13<br> * sdram_set_registers,raminit.c:169.42<br> * main,auto.c:107.28<br> */<br> mov $-2147483548 , %eax<br> mov $3320 , %dx<br> outl %eax, %dx<br>
/* ,:0.0 */</blockquote><div>set cfc to 64. <br><br><br> </div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> /*<br><br>******** now we get to read back the values ready to print ************
<br><br> * __builtin_inb,<built-in>:1.0<br> * inb,io.h:31.29<br> * pci_read_config8,romcc_io.h:125.19<br> * sdram_set_registers,raminit.c:169.42<br> * main,auto.c:107.28</blockquote><div><br><br>
I don't see a write to 64 either. HMMMMMM. Good detective work. Wonder what's up here?<br><br><br>ron <br></div><br></div><br>