[U-Boot] Allowing rtt_nom to be configurable to all possible values
Fabio Estevam
festevam at gmail.com
Tue Jan 5 16:07:49 CET 2016
Hi,
Currently we have in arch/arm/cpu/armv7/mx6/ddr.c:
/* MMDC Termination: rtt_nom:2 RZQ/2(120ohm), rtt_nom:1 RZQ/4(60ohm) */
val = (sysinfo->rtt_nom == 2) ? 0x00011117 : 0x00022227;
,but the mx6 reference manual states
rtt_nom = 1 ---> 120 ohm
rtt_nom = 2 ---> 60 ohm
which is the opposite of what the code and comment do.
Also, it is currently not possible to set rtt_nom to any other values
other than 1 and 2.
On mx6sl evk, for example, we need rtt_nom = 0, which is not possible
to be achieved currently.
Shouldn't we do like this instead?
--- a/arch/arm/cpu/armv7/mx6/ddr.c
+++ b/arch/arm/cpu/armv7/mx6/ddr.c
@@ -834,11 +834,12 @@ void mx6_ddr3_cfg(const struct mx6_ddr_sysinfo *sysinfo,
MMDC1(mprddqby3dl, 0x33333333);
}
- /* MMDC Termination: rtt_nom:2 RZQ/2(120ohm), rtt_nom:1 RZQ/4(60ohm) */
- val = (sysinfo->rtt_nom == 2) ? 0x00011117 : 0x00022227;
- mmdc0->mpodtctrl = val;
+ /* MMDC Termination */
+ val = sysinfo->rtt_nom;
+ mmdc0->mpodtctrl = (val << 16) | (val << 12) | (val << 8) | (val << 4) |
+ 0x7;
if (sysinfo->dsize > 1)
- MMDC1(mpodtctrl, val);
+ MMDC1(mpodtctrl, mmdc0->mpodtctrl);
Regards,
Fabio Estevam
More information about the U-Boot
mailing list