All of lore.kernel.org
 help / color / mirror / Atom feed
From: Francesco Dolcini <francesco.dolcini@toradex.com>
To: Stefano Babic <sbabic@denx.de>,
	Fabio Estevam <festevam@gmail.com>, Marek Vasut <marex@denx.de>,
	Marcel Ziswiler <marcel.ziswiler@toradex.com>
Cc: Francesco Dolcini <francesco.dolcini@toradex.com>,
	"NXP i.MX U-Boot Team" <uboot-imx@nxp.com>,
	Tim Harvey <tharvey@gateworks.com>,
	u-boot@lists.denx.de
Subject: [PATCH v1 1/2] mx6: ddr: Fix disabling on-die termination
Date: Fri, 24 Jun 2022 12:33:35 +0200	[thread overview]
Message-ID: <20220624103336.536999-2-francesco.dolcini@toradex.com> (raw)
In-Reply-To: <20220624103336.536999-1-francesco.dolcini@toradex.com>

In case rtt_nom is set to 0 keep ODT disabled (MMDC MPODTCTRL = 0).
No changes required for DDR MR1 Rtt_Nom impedance register, 0 value is
already handled correctly.

No board is currently affected by this change (rtt_nom != 0 on all i.MX6
ddr3 boards), this will be used by a follow-up change.

Fixes: fe0f7f7842e1 ("mx6: add mmdc configuration for MX6Q/MX6DL")
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
 arch/arm/mach-imx/mx6/ddr.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-imx/mx6/ddr.c b/arch/arm/mach-imx/mx6/ddr.c
index 73a637c42d6c..3c87c577737b 100644
--- a/arch/arm/mach-imx/mx6/ddr.c
+++ b/arch/arm/mach-imx/mx6/ddr.c
@@ -1469,8 +1469,17 @@ 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;
+	/*
+	 * MMDC Termination: rtt_nom:2 RZQ/2(120ohm),
+	 *                   rtt_nom:1 RZQ/4(60ohm),
+	 *                   rtt_nom:0 Disabled
+	 */
+	if (sysinfo->rtt_nom == 0)
+		val = 0x00000000;
+	else if (sysinfo->rtt_nom == 2)
+		val = 0x00011117;
+	else
+		val = 0x00022227;
 	mmdc0->mpodtctrl = val;
 	if (sysinfo->dsize > 1)
 		MMDC1(mpodtctrl, val);
-- 
2.25.1


  reply	other threads:[~2022-06-24 10:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-24 10:33 [PATCH v1 0/2] Fix Apalis iMX6 Memory Init Francesco Dolcini
2022-06-24 10:33 ` Francesco Dolcini [this message]
2022-06-24 16:46   ` [PATCH v1 1/2] mx6: ddr: Fix disabling on-die termination Fabio Estevam
2022-06-27  7:02   ` Marcel Ziswiler
2022-06-24 10:33 ` [PATCH v1 2/2] board: apalis_imx6: DDR init using mx6_dram_cfg() Francesco Dolcini
2022-06-24 16:47   ` Fabio Estevam
2022-06-27  7:03   ` Marcel Ziswiler

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=20220624103336.536999-2-francesco.dolcini@toradex.com \
    --to=francesco.dolcini@toradex.com \
    --cc=festevam@gmail.com \
    --cc=marcel.ziswiler@toradex.com \
    --cc=marex@denx.de \
    --cc=sbabic@denx.de \
    --cc=tharvey@gateworks.com \
    --cc=u-boot@lists.denx.de \
    --cc=uboot-imx@nxp.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.