I wasn't aware of the tool so I tried it but the results where not very convincing:
First of all the MT47H64M16.mem file used for theTWR-K70F120M board has an error:
rowAddr = 14 should be rowAddr = 13
rowAddr = 14 causes the DDR controller to configure a 256Mbyte memory when the memory is only 128Mbytes.
Then there is settings for clkendly and cmddly which both are set to zero. The comment in the memory configuration file states:
"clkendly, if 0, 1 will be provided"
"cmddly, if 0, 2 will be provided"
Both setting should have impact on the DDR_CR57 register but the resulting c-file shows:
DDR_CR57 = 0x01000000; // odtalten
Coming back to the DDR_PAD_CTRL register, yes the SPARE_DLY_CTRL is configured to 10 buffers but the tool generates this code:
DDR_PAD_CTRL = 0x01030203;
According to the RM (K61P256M150SF3RM) bit 16-17 are reserved and so are bit 9, why does the tool set these values??? (Bit 9 should be cleared according to the manual)
What shall I as a developer trust, the tool or the documentation?
Or should I look at Freescale code...
If I take the MQX 4.1 BSP for a reference:
Function _bsp_ddr2_setup() in init_hw.c
Examples:
code: * (vuint_32 *)(0x400Ae1ac) = 0x01030203;
manual: DDR_PAD_CTRL - bits 4-23 are reserved: 'This read-only field is reserved and always has the value zero.'
code: ddr->CR06 = 0x02904002;
manual: DDR_CR06 - bit 25 is reserved: 'This read-only field is reserved and always has the value zero. Must be cleared.'
code: ddr->CR23 = 0x00040302;
manual: DDR_CR23 - bits 0-31 are reserved: 'This read-only field is reserved and always has the value zero.'
code: ddr->CR28 = 0x00000003;
manual: DDR_CR28 - bit 1 is reserved: 'This read-only field is reserved and always has the value zero. Must be cleared.'
code: ddr->CR34 = 0x02020101;
manual: DDR_CR34 - bits 16-31 are reserved: 'This read-only field is reserved and always has the value zero. Must be cleared.'
code: ddr->CR36 = 0x01010201;
manual: DDR_CR36 - bits 0-31 are reserved: 'This read-only field is reserved and always has the value zero.'
It's all very frustrating and it consumes a lot of time. The RM is still in Preliminary status (as it has been the last 2,5 years). I would appreciate some guidance.
Regards Mikael