<DIV>Hi,</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; I bring up the u-boot in my 440EPx based on board successfully, it work fine when I disable the ECC, however when I enable the ECC I found it work unstablely in u-boot, for example it sometimes crashed in 'tftp' download.</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; Is there someone also encounter this issue?</DIV>
<DIV>&nbsp;</DIV>
<DIV>My code AS below:</DIV>
<DIV>long int sequoia_sdram_init (int board_type)<BR>{<BR>#if !defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_NAND_SPL)<BR>&nbsp;u32 val = 0;<BR>&nbsp;ulong speed = get_bus_freq(0);</DIV>
<DIV>&nbsp;mtsdram(DDR0_02, 0x00000000);</DIV>
<DIV>&nbsp;mtsdram(DDR0_00, 0x0000190A);<BR>&nbsp;mtsdram(DDR0_01, 0x01000000);<BR>&nbsp;mtsdram(DDR0_03, 0x02030602); //CASLAT = 3, CLATLN = 3<BR>&nbsp;//mtsdram(DDR0_03, 0x02040802); //CASLAT = 4, CLATLN = 4</DIV>
<DIV>&nbsp;//mtsdram(DDR0_04, 0x0A020200);<BR>&nbsp;mtsdram(DDR0_04, 0x0C020200);</DIV>
<DIV>&nbsp;mtsdram(DDR0_05, 0x02020308);<BR>&nbsp;mtsdram(DDR0_06, 0x0102C812);<BR>&nbsp;mtsdram(DDR0_07, 0x000D0100);<BR>&nbsp;// mtsdram(DDR0_08, 0x02430001); //WR = 2 (far CAS 3)<BR>&nbsp;mtsdram(DDR0_08, 0x02C80001); //when in doubt set tcpd to 200cycles 08/28/07<BR>&nbsp;//mtsdram(DDR0_08, 0x03430001); //WR = 2 (far CAS 4)</DIV>
<DIV>&nbsp;//mtsdram(DDR0_09, 0x00011D5F); // 75ohm RTT</DIV>
<DIV>&nbsp;//mtsdram(DDR0_09, 0x00001D5F); // Termination disabled</DIV>
<DIV>&nbsp;/* for tuning WDS */<BR>&nbsp;//mtsdram(DDR0_09, 0x00011D50);<BR>&nbsp;//mtsdram(DDR0_09, 0x00011D4F);<BR>&nbsp;mtsdram(DDR0_09, 0x00011D40);</DIV>
<DIV>&nbsp;//mtsdram(DDR0_10, 0x00000300); // dual rank</DIV>
<DIV>&nbsp;mtsdram(DDR0_10, 0x00000100); // single rank</DIV>
<DIV>&nbsp;mtsdram(DDR0_11, 0x0027C800);<BR>&nbsp;mtsdram(DDR0_12, 0x00000003);<BR>&nbsp;//mtsdram(DDR0_14, 0x00000000);<BR>&nbsp;mtsdram(DDR0_14, 0x00000100);<BR>&nbsp;mtsdram(DDR0_17, 0x19000000);<BR>&nbsp;mtsdram(DDR0_18, 0x19191919);<BR>&nbsp;mtsdram(DDR0_19, 0x19191919);<BR>&nbsp;mtsdram(DDR0_20, 0x0B0B0B0B);<BR>&nbsp;mtsdram(DDR0_21, 0x0B0B0B0B);<BR>&nbsp;//mtsdram(DDR0_22, 0x00267F0B); // no ECC<BR>&nbsp;//mtsdram(DDR0_22, 0x03267F0B); // enable ECC</DIV>
<DIV>&nbsp;/* for tuning DQSOSH */<BR>&nbsp;//mtsdram(DDR0_22, 0x0026700B); // no ECC<BR>&nbsp;//mtsdram(DDR0_22, 0x03266F0B); // ECC<BR>&nbsp;mtsdram(DDR0_22, 0x0026600B); // ECC</DIV>
<DIV>&nbsp;mtsdram(DDR0_23, 0x00000000);<BR>&nbsp;//mtsdram(DDR0_24, 0x01010002); //ODT_WR_MAP_CS0 = <BR>&nbsp;mtsdram(DDR0_24, 0x01010001); //ODT_WR_MAP_CS0 = </DIV>
<DIV>&nbsp;printf("DDR Init: speed = %d \n", speed);<BR>&nbsp;if (speed &gt; 133333334) {<BR>&nbsp;&nbsp;mtsdram(DDR0_26, 0x5B26050C);<BR>&nbsp;}<BR>&nbsp;else {<BR>&nbsp;&nbsp;mtsdram(DDR0_26, 0x5B260408);<BR>&nbsp;}</DIV>
<DIV>&nbsp;mtsdram(DDR0_27, 0x0000682B);<BR>&nbsp;mtsdram(DDR0_28, 0x00000000);<BR>&nbsp;mtsdram(DDR0_31, 0x00000000);<BR>&nbsp;//mtsdram(DDR0_42, 0x01000006);<BR>&nbsp;mtsdram(DDR0_42, 0x00000006);<BR>&nbsp;mtsdram(DDR0_43, 0x030A0200);<BR>&nbsp;mtsdram(DDR0_44, 0x00000003);<BR>&nbsp;mtsdram(DDR0_02, 0x00000001);</DIV>
<DIV>&nbsp;wait_for_dlllock();<BR>#endif /* #ifndef CONFIG_NAND_U_BOOT */</DIV>
<DIV>#ifdef CONFIG_DDR_DATA_EYE<BR>&nbsp;/* -----------------------------------------------------------+<BR>&nbsp; * Perform data eye search if requested.<BR>&nbsp; * ----------------------------------------------------------*/<BR>&nbsp;denali_core_search_data_eye(CFG_MBYTES_SDRAM &lt;&lt; 20);<BR>#endif</DIV>
<DIV>#ifdef CONFIG_DDR_ECC</DIV>
<DIV>{<BR>&nbsp;unsigned long write_addr;<BR>&nbsp;unsigned long registerVal;<BR>&nbsp;unsigned long memory_size = (CFG_MBYTES_SDRAM &lt;&lt; 20);</DIV>
<DIV>&nbsp;/* 0- Enable ECC */<BR>&nbsp;mtdcr(ddrcfga, DDR0_22);<BR>&nbsp;registerVal = mfdcr(ddrcfgd);<BR>&nbsp;registerVal = (registerVal &amp;~ DDR0_22_CTRL_RAW_MASK) | DDR0_22_CTRL_RAW_ECC_ENABLE;<BR>&nbsp;mtdcr(ddrcfgd, registerVal);</DIV>
<DIV>&nbsp;/* 1- Clear entire memory content */<BR>&nbsp;write_addr = CFG_SDRAM_BASE;<BR>&nbsp;printf("ECC Enabling\n");<BR>&nbsp;printf("Start memory clearing @ 0x%08x size = 0x%08x...", write_addr, memory_size);<BR>&nbsp;while (write_addr &lt; memory_size) {<BR>&nbsp;&nbsp;*((unsigned long*)write_addr) = write_addr;<BR>&nbsp;&nbsp;write_addr += 8;<BR>#ifdef DDR_DEBUG_SIZE<BR>&nbsp;&nbsp;if ( (write_addr % 0x10000000 ) == 0)<BR>&nbsp;&nbsp;&nbsp;printf("addr = 0x%08x \n", write_addr );<BR>#endif<BR>&nbsp;}<BR>&nbsp;printf("&nbsp;&nbsp; DONE\n");</DIV>
<DIV>&nbsp;/* 2- Clear error status */<BR>&nbsp;mtdcr(ddrcfga, DDR0_00);<BR>&nbsp;registerVal = mfdcr(ddrcfgd);<BR>&nbsp;mtdcr(ddrcfgd, (registerVal | DDR0_00_INT_ACK_ALL));</DIV>
<DIV>&nbsp;/* 3- Set 'int_mask' parameter to functionnal value */<BR>&nbsp;#ifdef DDR_DEBUG<BR>&nbsp;printf("Set 'int_mask' parameter to functionnal value\n");<BR>&nbsp;#endif<BR>&nbsp;mtdcr(ddrcfga, DDR0_01);<BR>&nbsp;registerVal = mfdcr(ddrcfgd);</DIV>
<DIV>&nbsp;mtdcr(ddrcfgd, ((registerVal &amp;~ DDR0_01_INT_MASK_MASK)<BR>&nbsp;&nbsp;| DDR0_01_INT_MASK_ALL_OFF));<BR>}<BR>#endif</DIV>
<DIV>&nbsp;mtdcr(ddrcfga, DDR0_02);<BR>&nbsp;val = mfdcr(ddrcfgd);</DIV>
<DIV>&nbsp;//dump_ddr2_regs();</DIV>
<DIV>&nbsp;return (CFG_MBYTES_SDRAM &lt;&lt; 20);<BR>}</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>- Denny</DIV>
<DIV>&nbsp;</DIV>
<DIV ></DIV><BR><br><!-- footer --><br> 
<hr>
<font style="font-size:12px;line-height:15px;">ɱ70ÍòÖÖľÂí²¡¶¾£¬</font><a style="font-size:12px;line-height:15px; color:blue; text-decoration:underline;" href="http://pro.163.com/event.ng/Type=click&FlightID=96648&AdID=98138&TargetID=635&Values=31,43,51,60,72,82,91,100,110,312,330,332,499,587,702,733,734&Redirect=http://ad.cn.doubleclick.net/clk;134682177;20226578;k%3Fhttp://www.rising.com.cn/2008/trial/index.htm">ÈðÐÇ2008°æÃâ·Ñ</a>