public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Eric Nelson <eric@nelint.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC PATCH 03/12] imx: mx6: ddr: make calibration optional in config routines
Date: Tue, 21 Jun 2016 11:41:33 -0700	[thread overview]
Message-ID: <1466534502-17233-4-git-send-email-eric@nelint.com> (raw)
In-Reply-To: <1466534502-17233-1-git-send-email-eric@nelint.com>

Signed-off-by: Eric Nelson <eric@nelint.com>
---
 arch/arm/cpu/armv7/mx6/ddr.c | 44 ++++++++++++++++++++++++--------------------
 1 file changed, 24 insertions(+), 20 deletions(-)

diff --git a/arch/arm/cpu/armv7/mx6/ddr.c b/arch/arm/cpu/armv7/mx6/ddr.c
index bde6fe3..eb2d000 100644
--- a/arch/arm/cpu/armv7/mx6/ddr.c
+++ b/arch/arm/cpu/armv7/mx6/ddr.c
@@ -1074,13 +1074,15 @@ void mx6_lpddr2_cfg(const struct mx6_ddr_sysinfo *sysinfo,
 	 * board-specific configuration:
 	 *  These values are determined empirically and vary per board layout
 	 */
-	mmdc0->mpwldectrl0 = calib->p0_mpwldectrl0;
-	mmdc0->mpwldectrl1 = calib->p0_mpwldectrl1;
-	mmdc0->mpdgctrl0 = calib->p0_mpdgctrl0;
-	mmdc0->mpdgctrl1 = calib->p0_mpdgctrl1;
-	mmdc0->mprddlctl = calib->p0_mprddlctl;
-	mmdc0->mpwrdlctl = calib->p0_mpwrdlctl;
-	mmdc0->mpzqlp2ctl = calib->mpzqlp2ctl;
+	if (calib) {
+		mmdc0->mpwldectrl0 = calib->p0_mpwldectrl0;
+		mmdc0->mpwldectrl1 = calib->p0_mpwldectrl1;
+		mmdc0->mpdgctrl0 = calib->p0_mpdgctrl0;
+		mmdc0->mpdgctrl1 = calib->p0_mpdgctrl1;
+		mmdc0->mprddlctl = calib->p0_mprddlctl;
+		mmdc0->mpwrdlctl = calib->p0_mpwrdlctl;
+		mmdc0->mpzqlp2ctl = calib->mpzqlp2ctl;
+	}
 
 	/* Read data DQ Byte0-3 delay */
 	mmdc0->mprddqby0dl = 0x33333333;
@@ -1360,19 +1362,21 @@ void mx6_ddr3_cfg(const struct mx6_ddr_sysinfo *sysinfo,
 	 *  see:
 	 *   appnote, ddr3 spreadsheet
 	 */
-	mmdc0->mpwldectrl0 = calib->p0_mpwldectrl0;
-	mmdc0->mpwldectrl1 = calib->p0_mpwldectrl1;
-	mmdc0->mpdgctrl0 = calib->p0_mpdgctrl0;
-	mmdc0->mpdgctrl1 = calib->p0_mpdgctrl1;
-	mmdc0->mprddlctl = calib->p0_mprddlctl;
-	mmdc0->mpwrdlctl = calib->p0_mpwrdlctl;
-	if (sysinfo->dsize > 1) {
-		MMDC1(mpwldectrl0, calib->p1_mpwldectrl0);
-		MMDC1(mpwldectrl1, calib->p1_mpwldectrl1);
-		MMDC1(mpdgctrl0, calib->p1_mpdgctrl0);
-		MMDC1(mpdgctrl1, calib->p1_mpdgctrl1);
-		MMDC1(mprddlctl, calib->p1_mprddlctl);
-		MMDC1(mpwrdlctl, calib->p1_mpwrdlctl);
+	if (calib) {
+		mmdc0->mpwldectrl0 = calib->p0_mpwldectrl0;
+		mmdc0->mpwldectrl1 = calib->p0_mpwldectrl1;
+		mmdc0->mpdgctrl0 = calib->p0_mpdgctrl0;
+		mmdc0->mpdgctrl1 = calib->p0_mpdgctrl1;
+		mmdc0->mprddlctl = calib->p0_mprddlctl;
+		mmdc0->mpwrdlctl = calib->p0_mpwrdlctl;
+		if (sysinfo->dsize > 1) {
+			MMDC1(mpwldectrl0, calib->p1_mpwldectrl0);
+			MMDC1(mpwldectrl1, calib->p1_mpwldectrl1);
+			MMDC1(mpdgctrl0, calib->p1_mpdgctrl0);
+			MMDC1(mpdgctrl1, calib->p1_mpdgctrl1);
+			MMDC1(mprddlctl, calib->p1_mprddlctl);
+			MMDC1(mpwrdlctl, calib->p1_mpwrdlctl);
+		}
 	}
 
 	/* Read data DQ Byte0-3 delay */
-- 
2.7.4

  parent reply	other threads:[~2016-06-21 18:41 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-21 18:41 [U-Boot] [RFC PATCH 00/12] imx: mx6: add virtual mx6memcal board Eric Nelson
2016-06-21 18:41 ` [U-Boot] [RFC PATCH 01/12] imx: mx6: ddr: return output of calibration routines Eric Nelson
2016-06-22 23:18   ` Marek Vasut
2016-06-22 23:52     ` Eric Nelson
2016-06-22 23:57       ` Marek Vasut
2016-06-23  0:18         ` Eric Nelson
2016-06-21 18:41 ` [U-Boot] [RFC PATCH 02/12] novena: supply calibration parameter to DDR " Eric Nelson
2016-06-21 18:41 ` Eric Nelson [this message]
2016-06-21 18:41 ` [U-Boot] [RFC PATCH 04/12] imx: mx6: ddr: pass sysinfo to " Eric Nelson
2016-06-21 18:41 ` [U-Boot] [RFC PATCH 05/12] novena: pass mx6_ddr_sysinfo " Eric Nelson
2016-06-21 18:41 ` [U-Boot] [RFC PATCH 06/12] imx: mx6: ddr: use Kconfig for inclusion of DDR calibration Eric Nelson
2016-06-21 18:41 ` [U-Boot] [RFC PATCH 07/12] novena_defconfig: select MX6_DDRCAL Eric Nelson
2016-06-21 18:41 ` [U-Boot] [RFC PATCH 08/12] mx6: Add board mx6memcal for use in validating DDR Eric Nelson
2016-06-21 18:41 ` [U-Boot] [RFC PATCH 09/12] mx6memcal: add configuration mx6memcal_mx6slevk_defconfig Eric Nelson
2016-06-21 18:41 ` [U-Boot] [RFC PATCH 10/12] mx6memcal: add configuration mx6memcal_nitrogen6_max_defconfig Eric Nelson
2016-06-21 18:41 ` [U-Boot] [RFC PATCH 11/12] mx6memcal: add configuration mx6memcal_sabrelite_defconfig Eric Nelson
2016-06-21 18:41 ` [U-Boot] [RFC PATCH 12/12] mx6memcal: add configuration mx6memcal_warpboard_defconfig Eric Nelson
2016-06-21 19:48 ` [U-Boot] i.MX SPL tools (was Re: [RFC PATCH 00/12] imx: mx6: add virtual mx6memcal board) Eric Nelson
2016-06-24 23:26   ` Tom Rini
2016-08-26 15:00 ` [U-Boot] [RFC PATCH 00/12] imx: mx6: add virtual mx6memcal board Tim Harvey
2016-08-26 15:33   ` Eric Nelson
2016-08-26 16:46     ` Fabio Estevam
2016-08-26 20:34     ` Tim Harvey

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=1466534502-17233-4-git-send-email-eric@nelint.com \
    --to=eric@nelint.com \
    --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