We are wondering if we need to run a shmoo test to find the optimal settings for the DDR3 attached to the DSP on our platform. The DDR3 settings are currently similar to the C6678 EVM – the small differences as marked below. Would you be able to help us on this or help direct the question?
ddr3_setup_auto_lvl_1333()
{
int i,TEMP,startlo, stoplo,starthi, stophi;
KICK0 = KICK0_UNLOCK;
KICK1 = KICK1_UNLOCK;
/***************** 2.2 DDR3 PLL Configuration ************/
DDR3PLLCTL1 |= 0x00000040; //Set ENSAT bit = 1 50-70ms
DDR3PLLCTL1 |= 0x00002000; //Set RESET bit = 1 50-70ms
DDR3PLLCTL0 = 0x090804C0; //Configure CLKR, CLKF, CLKOD, BWADJ ~60ms
//Wait for 5us min. Actual delay in GEL here is in tens of ms
DDR3PLLCTL1 &= ~(0x00002000); //Clear RESET bit
//Wait for PLL to lock = min 500 ref clock cycles. With refclk = 100MHz, = 5000 ns = 5us. Actualy delay between 2 GEL steps = ~6ms
/**************** 3.0 Leveling Register Configuration ********************/
/* Using partial automatic leveling due to errata */
/**************** 3.2 Invert Clock Out ********************/
DDR3_CONFIG_REG_0 &= ~(0x007FE000); // clear ctrl_slave_ratio field
DDR3_CONFIG_REG_0 |= 0x00200000; // set ctrl_slave_ratio to 0x100
DDR3_CONFIG_REG_12 |= 0x08000000; // Set invert_clkout = 1
DDR3_CONFIG_REG_0 |= 0xF; // set dll_lock_diff to 15
DDR3_CONFIG_REG_23 |= 0x00000200; //Set bit 9 = 1 to use forced ratio leveling for read DQS
//Values with invertclkout = 1
/**************** 3.3+3.4 Partial Automatic Leveling ********************/
DATA0_WRLVL_INIT_RATIO = 0x5E;
DATA1_WRLVL_INIT_RATIO = 0x5E;
DATA2_WRLVL_INIT_RATIO = 0x5E;
DATA3_WRLVL_INIT_RATIO = 0x51;
DATA4_WRLVL_INIT_RATIO = 0x38;
DATA5_WRLVL_INIT_RATIO = 0x3A;
DATA6_WRLVL_INIT_RATIO = 0x24;
DATA7_WRLVL_INIT_RATIO = 0x20;
DATA8_WRLVL_INIT_RATIO = 0x44;
DATA0_GTLVL_INIT_RATIO = 0xDD;
DATA1_GTLVL_INIT_RATIO = 0xDD;
DATA2_GTLVL_INIT_RATIO = 0xBE;
DATA3_GTLVL_INIT_RATIO = 0xCA;
DATA4_GTLVL_INIT_RATIO = 0xA9;
DATA5_GTLVL_INIT_RATIO = 0xA7;
DATA6_GTLVL_INIT_RATIO = 0x9E;
DATA7_GTLVL_INIT_RATIO = 0xA1;
DATA8_GTLVL_INIT_RATIO = 0xBA;
//Do a PHY reset. Toggle DDR_PHY_CTRL_1 bit 15 0->1->0
DDR_DDRPHYC &= ~(0x00008000);
DDR_DDRPHYC |= (0x00008000);
DDR_DDRPHYC &= ~(0x00008000);
/***************** 2.3 Basic Controller and DRAM configuration ************/
DDR_SDRFC = 0x00005162; // enable configuration
DDR_SDTIM1 = 0x1113783C; // Same for Cultus Board RAC2
DDR_SDTIM2 = 0x60707FE3; // RAC2 Cultus. For EVM - 0x304F7FE3;
DDR_SDTIM3 = 0x559F86AF; // RAC2 Cultus. For EVM - 0x559F849F;
DDR_DDRPHYC = 0x0010010F;
DDR_ZQCFG = 0x70073214;
DDR_PMCTL = 0x0;
/* DDR_SDCFG = 0x63062A32; */
//New value with DYN_ODT disabled and SDRAM_DRIVE = RZQ/7 //0x63222A32;
// last config write DRAM init occurs
DDR_SDCFG = 0x63062AB2; // Cultus Board RAC2
DDR_SDRFC = 0x00001450; //Refresh rate = (7.8*666MHz]
RDWR_LVL_RMP_CTRL = 0x80000000; //enable full leveling
RDWR_LVL_CTRL = 0x80000000; //Trigger full leveling - This ignores read DQS leveling result and uses ratio forced value //(0x34) instead
//Wait for min 1048576 DDR clock cycles for leveling to complete = 1048576 * 1.5ns = 1572864ns = 1.57ms.
//Actual time = ~10-15 ms
GEL_TextOut("\nDDR3 initialization is complete.\n");
}
Thanks
-Anand