There is a wait_soft() call at the end of this procedure. Is there a status register that would work more appropriately for DDR2 configuration?
Also, its writing to reserved bits which aren't correct at power on. Is this the M.O. for reserved bits? What should DDR2 reserved bits be set to? they are reserved, but R/W. The gel file touches them which confuses me a bit.
Thanks
// Special reserved bits
// Writes special reserved bits which are not correct at power on
DDR_SDCFG = (iSdcfg | 0x00530000 | TIMUNLOCK);
// Lock DDR Bank timing
DDR_SDCFG = iSdcfg;
// ReadLatency = CAS +1 with default bits in other positions and release rst
DDR_DMCCTL = (DDR_DMCCTL & 0xFFFFFFF8) | ( iCas + 1);
DDR_DMCCTL = (DDR_DMCCTL & 0xFFFFFFDF);
Wait_Soft( 1500 );
GEL_TextOut( "DDR2 Setup... Done.\n" );
}