public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Joakim Tjernlund <joakim.tjernlund@transmode.se>
To: u-boot@lists.denx.de
Subject: [U-Boot] FSL DDR3/4 wrlvl_override question
Date: Thu, 3 Sep 2015 14:55:57 +0000	[thread overview]
Message-ID: <1441292157.3349.297.camel@transmode.se> (raw)

in drivers/ddr/fsl/options.c we have:

#if defined(CONFIG_SYS_FSL_DDR3) || defined(CONFIG_SYS_FSL_DDR4)
	/*
	 * due to ddr3 dimm is fly-by topology
	 * we suggest to enable write leveling to
	 * meet the tQDSS under different loading.
	 */
	popts->wrlvl_en = 1;
	popts->zq_en = 1;
	popts->wrlvl_override = 0;
#endif

Here one disable wrlvl_override no matter what board code wants.
However board code still sets wrlvl_override as it needs specify
a good start value for WRLVL_START DQS[0], just like one do for
the other DQS[X] in WRLVL_CNTL_2/3

How about remove the above popts->wrlvl_override = 0; line?



Furthermore drivers/ddr/fsl/ctrl_regs.c I think set_ddr_wrlvl_cntl()
should be adjusted to(or similar):

--- a/drivers/ddr/fsl/ctrl_regs.c
+++ b/drivers/ddr/fsl/ctrl_regs.c
@@ -2098,7 +2098,7 @@ static void set_ddr_wrlvl_cntl(fsl_ddr_cfg_regs_t *ddr, unsigned int wrlvl_en,
        /* WRLVL_WLR: Write leveling repeition time */
        unsigned int wrlvl_wlr = 0;
        /* WRLVL_START: Write leveling start time */
-       unsigned int wrlvl_start = 0;
+       unsigned int wrlvl_start = 8;
 
        /* suggest enable write leveling for DDR3 due to fly-by topology */
        if (wrlvl_en) {
@@ -2131,10 +2131,11 @@ static void set_ddr_wrlvl_cntl(fsl_ddr_cfg_regs_t *ddr, unsigned int wrlvl_en,
                 * Override the write leveling sample and start time
                 * according to specific board
                 */
-               if (popts->wrlvl_override) {
-                       wrlvl_smpl = popts->wrlvl_sample;
-                       wrlvl_start = popts->wrlvl_start;
-               }
+       }
+
+       if (popts->wrlvl_override) {
+               wrlvl_smpl = popts->wrlvl_sample;
+               wrlvl_start = popts->wrlvl_start;
        }


so that board not using auto WRLVL a chance to specify these parameters.

I am no expert on DDR so I might be totally off here ...

 Jocke

             reply	other threads:[~2015-09-03 14:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-03 14:55 Joakim Tjernlund [this message]
2015-09-03 15:44 ` [U-Boot] FSL DDR3/4 wrlvl_override question York Sun
2015-09-03 16:09   ` Joakim Tjernlund
2015-09-03 16:23     ` York Sun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1441292157.3349.297.camel@transmode.se \
    --to=joakim.tjernlund@transmode.se \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox