We're using a custom board with i.mx6sl ( MCIMX6L8DVN10AB ) and EDB8132B4PM-1D-F-D LPDDR2 memory.
We found that on some large (maybe 25% or more) of boards we were getting memory test failures in Linux 4.1.15 (bitflip error with memtester). Running DDR calibration and stress test and changing the read/write calibration values did not cause the errors to go away. That's detailed in another post: Bit flip errors on 6sl board with LPDDR2 memory
Currently, our board had ZQPAD resistor value of 240 Ohm and DRAM ZQ of 240 Ohm also. When we changed both values to 120 Ohm, then 2 boards that previously exhibited the bit flip errors stopped exhibiting those errors. That seems to suggest that the problem has to do with ZQ resistor calibration value.
I am wondering what is the correct process to select the ZQPAD resistor value for 6sl and the LPDDR2 ZQ resistor value also.
a) should ZQ SW be set?
In the 6sl datasheet, there is:
Use SW ZQ configured value for I/O pads resistor controls. This bit selects whether ZQ SW value or ZQ
HW value will be driven to the I/O pads resistor controls. By default this bit is cleared and MMDC drives
the HW ZQ status bits on the resistor controls of the I/O pads.
On solace, this bit is set to 0 so it is currently using the ZQ HW value.
root@imx6slevk:~# /unit_tests/memtool -32 0x21B0804 1
Reading 0x1 count starting at address 0x021B0804
I'm wondering if it should be set to use the ZQ SW value instead. If so, should that setting be done in u-boot?
b) how to select the resistor value
In the 6sl datasheet:
10.1 One-Time Forced Hardware ZQ Calibration Sequence
One-time ZQ calibration using hardware loop logic is performed by the following sequence:
• Make sure all accesses to DDR are finished.
• Set MMDC register fields according to Table 1.
Assert the ZQ_HW_FOR bit in MPZQHWCTRL register.
• Wait for ZQ_HW_FOR to be cleared by hardware.
• ZQ resistors are now calibrated. Pull-up, pull-down configured values can be read from
ZQ_HW_PD_RES and ZQ_HW_PU_RES fields of the MPZQHWCTRL register.
ZQ automatic calibration pull-up result. This field holds the pull-up resistor value calculated at the end of
the ZQ automatic calibration process with the i.MX ZQ calibration pad.
NOTE: An offset can be applied to this result, see MMDC_MPPDCMPR2[ZQ_PU_OFFSET]
00000 Min. resistance.
11111 Max. resistance.
That seems to suggest there is an automatic way to determine what the resistor value should be. Is there a tool (sort of like the ddr calibration tool) that I should run on the board in order to get that value?