From: Kumar Gala <galak@kernel.crashing.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/4] fsl-ddr: add override for the Rtt_WR
Date: Wed, 16 Dec 2009 10:24:38 -0600 [thread overview]
Message-ID: <1260980679-13236-3-git-send-email-galak@kernel.crashing.org> (raw)
In-Reply-To: <1260980679-13236-2-git-send-email-galak@kernel.crashing.org>
From: Dave Liu <daveliu@freescale.com>
It may be different settings of Rtt_nom and Rtt_WR
for different boards, adding the override provide the
capability.
Signed-off-by: Dave Liu <daveliu@freescale.com>
---
cpu/mpc8xxx/ddr/ctrl_regs.c | 10 +++++++---
include/asm-ppc/fsl_ddr_sdram.h | 1 +
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/cpu/mpc8xxx/ddr/ctrl_regs.c b/cpu/mpc8xxx/ddr/ctrl_regs.c
index 5e37ca6..3be7e22 100644
--- a/cpu/mpc8xxx/ddr/ctrl_regs.c
+++ b/cpu/mpc8xxx/ddr/ctrl_regs.c
@@ -576,18 +576,22 @@ static void set_ddr_sdram_cfg_2(fsl_ddr_cfg_regs_t *ddr,
}
/* DDR SDRAM Mode configuration 2 (DDR_SDRAM_MODE_2) */
-static void set_ddr_sdram_mode_2(fsl_ddr_cfg_regs_t *ddr)
+static void set_ddr_sdram_mode_2(fsl_ddr_cfg_regs_t *ddr,
+ const memctl_options_t *popts)
{
unsigned short esdmode2 = 0; /* Extended SDRAM mode 2 */
unsigned short esdmode3 = 0; /* Extended SDRAM mode 3 */
#if defined(CONFIG_FSL_DDR3)
- unsigned int rtt_wr = 2; /* 120 ohm Rtt_WR */
+ unsigned int rtt_wr = 0; /* Rtt_WR - dynamic ODT off */
unsigned int srt = 0; /* self-refresh temerature, normal range */
unsigned int asr = 0; /* auto self-refresh disable */
unsigned int cwl = compute_cas_write_latency() - 5;
unsigned int pasr = 0; /* partial array self refresh disable */
+ if (popts->rtt_override)
+ rtt_wr = popts->rtt_wr_override_value;
+
esdmode2 = (0
| ((rtt_wr & 0x3) << 9)
| ((srt & 0x1) << 7)
@@ -1330,7 +1334,7 @@ compute_fsl_memctl_config_regs(const memctl_options_t *popts,
set_ddr_sdram_cfg_2(ddr, popts);
set_ddr_sdram_mode(ddr, popts, common_dimm,
cas_latency, additive_latency);
- set_ddr_sdram_mode_2(ddr);
+ set_ddr_sdram_mode_2(ddr, popts);
set_ddr_sdram_interval(ddr, popts, common_dimm);
set_ddr_data_init(ddr);
set_ddr_sdram_clk_cntl(ddr, popts);
diff --git a/include/asm-ppc/fsl_ddr_sdram.h b/include/asm-ppc/fsl_ddr_sdram.h
index 15ab675..3216a50 100644
--- a/include/asm-ppc/fsl_ddr_sdram.h
+++ b/include/asm-ppc/fsl_ddr_sdram.h
@@ -192,6 +192,7 @@ typedef struct memctl_options_s {
/* Rtt impedance */
unsigned int rtt_override; /* rtt_override enable */
unsigned int rtt_override_value; /* that is Rtt_Nom for DDR3 */
+ unsigned int rtt_wr_override_value; /* this is Rtt_WR for DDR3 */
/* Automatic self refresh */
unsigned int auto_self_refresh_en;
--
1.6.0.6
next prev parent reply other threads:[~2009-12-16 16:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-16 16:24 [U-Boot] [PATCH 1/4] fsl-ddr: Fix power-down timing settings Kumar Gala
2009-12-16 16:24 ` [U-Boot] [PATCH 2/4] fsl-ddr: add the override for write leveling Kumar Gala
2009-12-16 16:24 ` Kumar Gala [this message]
2009-12-16 16:24 ` [U-Boot] [PATCH 4/4] fsl-ddr: setup ODT_RD_CFG & ODT_WR_CFG when we interleave Kumar Gala
2009-12-16 16:29 ` Kumar Gala
2009-12-16 16:29 ` [U-Boot] [PATCH 3/4] fsl-ddr: add override for the Rtt_WR Kumar Gala
2009-12-17 21:20 ` Wolfgang Denk
2010-01-04 17:37 ` Kumar Gala
2009-12-16 16:29 ` [U-Boot] [PATCH 2/4] fsl-ddr: add the override for write leveling Kumar Gala
2009-12-16 16:27 ` [U-Boot] [PATCH 1/4] fsl-ddr: Fix power-down timing settings Kumar Gala
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=1260980679-13236-3-git-send-email-galak@kernel.crashing.org \
--to=galak@kernel.crashing.org \
--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