HI , I encountered a problem of DDR error in my K2H board with DDR3A 1600MHz setting.
the message is below.
---------------start
U-Boot 2013.01 (Jun 16 2014 - 15:25:28)
I2C: ready
Cannot read DIMM params
Detected SO-DIMM []
Reseting entire DDR3 memory to 0 ...
DRAM: 2 GiB
NAND: 512 MiB...
*** Warning - bad CRC, using default environment
---------------end
uboot read environment parameter from NAND Flash and it calculate CRC and check that the CRC value is correct or not.
after I set DDR3A to 1600MHz, sometimes the CRC value is correct, sometimes the CRC value is incorrect.
but when I set DDR3A to 1333MHz in my K2H board, the CRC value is always normally.
CRC error never appear when DDR3A set to 1333MHz.
I have done one experiment in DDR3A1600MHz. I modify CRC calculating code(copy from Nand Flash and calculate CRC) to uboot command.
if K2H board boot up and the CRC calculating is correct, I usually get the same correct result when I run the same CRC calculating code in uboot.
if K2H board boot up and the CRC calculating is incorrect, I get most incorrect result when I run the same CRC calculating code in uboot.
my K2H board use DDR K4B4G1646D-BCK0 and use below parameter to init DDR3A.
static struct ddr3_phy_config ddr3phy_1600_64A = {
.pllcr = 0x0001C000ul,
.pgcr1_mask = (IODDRM_MASK | ZCKSEL_MASK),
.pgcr1_val = ((1 << 2) | (1 << 7) | (1 << 23)),
.ptr0 = 0x42C21590ul,
.ptr1 = 0xD05612C0ul,
.ptr2 = 0, /* not set in gel */
.ptr3 = 0x0D861A80ul,
.ptr4 = 0x0C827100ul,
.dcr_mask = (PDQ_MASK | MPRDQ_MASK | BYTEMASK_MASK),
.dcr_val = ((1 << 10)),
.dtpr0 = 0xA19DBB66ul,
.dtpr1 = 0x32868300ul,
.dtpr2 = 0x50035200ul,
.mr0 = 0x00001C70ul,
.mr1 = 0x00000006ul,
.mr2 = 0x00000018ul,
.dtcr = 0x710035C7ul,
.pgcr2 = 0x00F07A12ul,
.zq0cr1 = 0x0000005Dul,
.zq1cr1 = 0x0000005Bul,
.zq2cr1 = 0x0000005Bul,
.pir_v1 = 0x00000033ul,
.pir_v2 = 0x0000FF81ul,
};
static struct ddr3_emif_config ddr3_1600_64 = {
//.sdcfg = 0x6200CE6Aul,
.sdcfg = 0x6200CE62ul,// EBANK=0
.sdtim1 = 0x16709C55ul,
.sdtim2 = 0x00001D4Aul,
.sdtim3 = 0x435DFF54ul,
.sdtim4 = 0x553F0CFFul,
.zqcfg = 0xF0073200ul,
.sdrfc = 0x00001869ul,
};
those parameter are in K2H's release uboot code and I only modify .sdcfg's EBANK to 0. if my K2H board set EBANK to 1, it can not boot normally.
I have checked most DDR parameter and they should be fitted to DDR's spec.
and the init_ddr3()'s code is below.
void init_ddr3( void ) {
char dimm_name[32];
if (__raw_readl(TCI6638_PLL_CNTRL_BASE + MAIN_PLL_CTRL_RSTYPE) & 0x1) {
init_pll(&ddr3a_400);
init_pll(&ddr3b_333);
} else
printf("Power-on reset was not the last reset to occur !\n");
get_dimm_params(dimm_name);
printf("Detected SO-DIMM [%s]\n", dimm_name);
init_ddrphy(TCI6638_DDR3A_DDRPHYC, &ddr3phy_1600_64A);
init_ddremif(TCI6638_DDR3A_EMIF_CTRL_BASE, &ddr3_1600_64);
init_ddrphy(TCI6638_DDR3B_DDRPHYC, &ddr3phy_1333_64);
init_ddremif(TCI6638_DDR3B_EMIF_CTRL_BASE, &ddr3_1333_64);
/* Apply the workaround for PG 1.0 and 1.1 Silicons */
if (cpu_revision() <= 1){
ddr_reset_workaround();
}
}
is there any idea about this issue? where should I check in SW and HW?