> I have to admit that I have not read the full thread, so sorry if I'm wrong here.
I don't think I can condense it into 140 characters for you
> Usually controller calibrate this out by a periodic drives strength calibration.
As I detailed above "There are TWENTY TWO different registers for setting the drive strength for the DDR alone." These aren't in the DDR controller.
The controller does support "ZQ Calibration", which is detailed here:
http://www.rampedia.com/index.php/define-zq_calibration
The above document says:
The ZQ calibration short (ZQCS) requires 64 clocks to complete so it is used periodically
when the DRAM is idle to perform calibrations to account for minor variations in voltage and temperature.
I haven't found anything in the manuals that says that the ESDCTL runs these calibrations itself, so it looks like it has to be actively commanded by the software running on the chip. In my reading, this calibration (and only SOME of the other ones) are run once by the Bootstrap, and then are never run again by any of the versions of Linux until the next boot. There aren't any "drivers" supplied that periodically calibrate the memory. If the SOC temperature is 0C on boot and 60C a few hours later, then good luck, as the memory system is on its own. If it corrupts, crashes and reboots it may recalibrate at the new temperature and may run a bit better.
It looks like you're meant to run the "Memory Stress Test", come up with a set of fixed calibration values for one board and then hard-code them.
In fact the code for our board used to run the "Write Levelling" pass, but then the manufacturer changed to a different RAM chip with a different interpretation of that test that their board didn't support, so they simply deleted that calibration pass and reverted to "fixed values".
For instance, as far as I can tell, here's the once-off DDR3 controller setup for the i.MX53 ARD board in U-Boot:
http://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/tree/board/freescale/mx53_ard/flash_header.S...
Edit: ... I'm trying to paste some code in here, but the "automatics" keeps turning it into a spreadsheet or removes the line feeds completely. This shouldn't be this HARD.
/* ESDCTL */
REG_LD_AND_STR_INIT(ESDCTL_BASE_ADDR)
REG_LD_AND_STR_OP(25, 0x088, 0x35343535)
REG_LD_AND_STR_OP(26, 0x090, 0x4d444c44)
REG_LD_AND_STR_OP(27, 0x07c, 0x01370138)
REG_LD_AND_STR_OP(28, 0x080, 0x013b013c)
REG_LD_AND_STR_OP(29, 0x0f8, 0x00000800)
REG_LD_AND_STR_OP(30, 0x018, 0x00001740)
REG_LD_AND_STR_OP(31, 0x000, 0xc3190000)
REG_LD_AND_STR_OP(32, 0x00c, 0x9f5152e3)
REG_LD_AND_STR_OP(33, 0x010, 0xb68e8a63)
REG_LD_AND_STR_OP(34, 0x014, 0x01ff00db)
REG_LD_AND_STR_OP(35, 0x02c, 0x000026d2)
REG_LD_AND_STR_OP(36, 0x030, 0x009f0e21)
REG_LD_AND_STR_OP(37, 0x008, 0x12273030)
REG_LD_AND_STR_OP(38, 0x004, 0x0002002d)
REG_LD_AND_STR_OP(39, 0x01c, 0x00008032)
REG_LD_AND_STR_OP(40, 0x01c, 0x00008033)
REG_LD_AND_STR_OP(41, 0x01c, 0x00028031)
REG_LD_AND_STR_OP(42, 0x01c, 0x052080b0)
REG_LD_AND_STR_OP(43, 0x01c, 0x04008040)
REG_LD_AND_STR_OP(44, 0x01c, 0x0000803a)
REG_LD_AND_STR_OP(45, 0x01c, 0x0000803b)
REG_LD_AND_STR_OP(46, 0x01c, 0x00028039)
REG_LD_AND_STR_OP(47, 0x01c, 0x05208138)
REG_LD_AND_STR_OP(48, 0x01c, 0x04008048)
REG_LD_AND_STR_OP(49, 0x020, 0x00005800)
REG_LD_AND_STR_OP(50, 0x040, 0x04b80003)
REG_LD_AND_STR_OP(51, 0x058, 0x00022227)
REG_LD_AND_STR_OP(52, 0x01C, 0x00000000)
REG_LD_AND_STR_END(ESDCTL_BASE_ADDR)
It is similar, but different to the "MXC_DCD" based "code" we're using with an i.MX53 running from NAND.
It isn't easy to understand, read or validate.
Tom