From: jxnuxdy <jxnuxdy@163.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] DDR2 (Moduel 512M) work unstablely when enable the ECC
Date: Wed, 26 Sep 2007 09:17:17 +0800 (CST) [thread overview]
Message-ID: <18751105.449881190769437228.JavaMail.coremail@bj163app46.163.com> (raw)
In-Reply-To: <20060717133235.E7FE7353B10@atlas.denx.de>
Hi, 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. Is there someone also encounter this issue? My code AS below:long int sequoia_sdram_init (int board_type)
{
#if !defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_NAND_SPL)
u32 val = 0;
ulong speed = get_bus_freq(0); mtsdram(DDR0_02, 0x00000000); mtsdram(DDR0_00, 0x0000190A);
mtsdram(DDR0_01, 0x01000000);
mtsdram(DDR0_03, 0x02030602); //CASLAT = 3, CLATLN = 3
//mtsdram(DDR0_03, 0x02040802); //CASLAT = 4, CLATLN = 4 //mtsdram(DDR0_04, 0x0A020200);
mtsdram(DDR0_04, 0x0C020200); mtsdram(DDR0_05, 0x02020308);
mtsdram(DDR0_06, 0x0102C812);
mtsdram(DDR0_07, 0x000D0100);
// mtsdram(DDR0_08, 0x02430001); //WR = 2 (far CAS 3)
mtsdram(DDR0_08, 0x02C80001); //when in doubt set tcpd to 200cycles 08/28/07
//mtsdram(DDR0_08, 0x03430001); //WR = 2 (far CAS 4) //mtsdram(DDR0_09, 0x00011D5F); // 75ohm RTT //mtsdram(DDR0_09, 0x00001D5F); // Termination disabled /* for tuning WDS */
//mtsdram(DDR0_09, 0x00011D50);
//mtsdram(DDR0_09, 0x00011D4F);
mtsdram(DDR0_09, 0x00011D40); //mtsdram(DDR0_10, 0x00000300); // dual rank mtsdram(DDR0_10, 0x00000100); // single rank mtsdram(DDR0_11, 0x0027C800);
mtsdram(DDR0_12, 0x00000003);
//mtsdram(DDR0_14, 0x00000000);
mtsdram(DDR0_14, 0x00000100);
mtsdram(DDR0_17, 0x19000000);
mtsdram(DDR0_18, 0x19191919);
mtsdram(DDR0_19, 0x19191919);
mtsdram(DDR0_20, 0x0B0B0B0B);
mtsdram(DDR0_21, 0x0B0B0B0B);
//mtsdram(DDR0_22, 0x00267F0B); // no ECC
//mtsdram(DDR0_22, 0x03267F0B); // enable ECC /* for tuning DQSOSH */
//mtsdram(DDR0_22, 0x0026700B); // no ECC
//mtsdram(DDR0_22, 0x03266F0B); // ECC
mtsdram(DDR0_22, 0x0026600B); // ECC mtsdram(DDR0_23, 0x00000000);
//mtsdram(DDR0_24, 0x01010002); //ODT_WR_MAP_CS0 =
mtsdram(DDR0_24, 0x01010001); //ODT_WR_MAP_CS0 = printf("DDR Init: speed = %d \n", speed);
if (speed > 133333334) {
mtsdram(DDR0_26, 0x5B26050C);
}
else {
mtsdram(DDR0_26, 0x5B260408);
} mtsdram(DDR0_27, 0x0000682B);
mtsdram(DDR0_28, 0x00000000);
mtsdram(DDR0_31, 0x00000000);
//mtsdram(DDR0_42, 0x01000006);
mtsdram(DDR0_42, 0x00000006);
mtsdram(DDR0_43, 0x030A0200);
mtsdram(DDR0_44, 0x00000003);
mtsdram(DDR0_02, 0x00000001); wait_for_dlllock();
#endif /* #ifndef CONFIG_NAND_U_BOOT */#ifdef CONFIG_DDR_DATA_EYE
/* -----------------------------------------------------------+
* Perform data eye search if requested.
* ----------------------------------------------------------*/
denali_core_search_data_eye(CFG_MBYTES_SDRAM << 20);
#endif#ifdef CONFIG_DDR_ECC{
unsigned long write_addr;
unsigned long registerVal;
unsigned long memory_size = (CFG_MBYTES_SDRAM << 20); /* 0- Enable ECC */
mtdcr(ddrcfga, DDR0_22);
registerVal = mfdcr(ddrcfgd);
registerVal = (registerVal &~ DDR0_22_CTRL_RAW_MASK) | DDR0_22_CTRL_RAW_ECC_ENABLE;
mtdcr(ddrcfgd, registerVal); /* 1- Clear entire memory content */
write_addr = CFG_SDRAM_BASE;
printf("ECC Enabling\n");
printf("Start memory clearing @ 0x%08x size = 0x%08x...", write_addr, memory_size);
while (write_addr < memory_size) {
*((unsigned long*)write_addr) = write_addr;
write_addr += 8;
#ifdef DDR_DEBUG_SIZE
if ( (write_addr % 0x10000000 ) == 0)
printf("addr = 0x%08x \n", write_addr );
#endif
}
printf(" DONE\n"); /* 2- Clear error status */
mtdcr(ddrcfga, DDR0_00);
registerVal = mfdcr(ddrcfgd);
mtdcr(ddrcfgd, (registerVal | DDR0_00_INT_ACK_ALL)); /* 3- Set 'int_mask' parameter to functionnal value */
#ifdef DDR_DEBUG
printf("Set 'int_mask' parameter to functionnal value\n");
#endif
mtdcr(ddrcfga, DDR0_01);
registerVal = mfdcr(ddrcfgd); mtdcr(ddrcfgd, ((registerVal &~ DDR0_01_INT_MASK_MASK)
| DDR0_01_INT_MASK_ALL_OFF));
}
#endif mtdcr(ddrcfga, DDR0_02);
val = mfdcr(ddrcfgd); //dump_ddr2_regs(); return (CFG_MBYTES_SDRAM << 20);
} - Denny
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20070926/6488c092/attachment.htm
next prev parent reply other threads:[~2007-09-26 1:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-17 13:23 [U-Boot-Users] adding support to new board Jeff Mann
2006-07-17 13:32 ` Wolfgang Denk
2007-09-26 1:17 ` jxnuxdy [this message]
2007-09-26 13:43 ` [U-Boot-Users] DDR2 (Moduel 512M) work unstablely when enable the ECC Stefan Roese
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=18751105.449881190769437228.JavaMail.coremail@bj163app46.163.com \
--to=jxnuxdy@163.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.