All of lore.kernel.org
 help / color / mirror / Atom feed
From: Judith Mendez <jm@ti.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>,
	<linux-mmc@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH v2 6/7] mmc: sdhci_am654: Add ITAPDLYSEL in sdhci_j721e_4bit_set_clock
Date: Tue, 6 Feb 2024 19:15:19 -0600	[thread overview]
Message-ID: <20240207011520.3128382-7-jm@ti.com> (raw)
In-Reply-To: <20240207011520.3128382-1-jm@ti.com>

Add ITAPDLYSEL to sdhci_j721e_4bit_set_clock function.
This allows to set the correct ITAPDLY for timings that
do not carry out tuning.

Fixes: 1accbced1c32 ("mmc: sdhci_am654: Add Support for 4 bit IP on J721E")
Signed-off-by: Judith Mendez <jm@ti.com>
---
 drivers/mmc/host/sdhci_am654.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci_am654.c b/drivers/mmc/host/sdhci_am654.c
index 3755a015f328..f98cce69a286 100644
--- a/drivers/mmc/host/sdhci_am654.c
+++ b/drivers/mmc/host/sdhci_am654.c
@@ -320,6 +320,7 @@ static void sdhci_j721e_4bit_set_clock(struct sdhci_host *host,
 	unsigned char timing = host->mmc->ios.timing;
 	u32 otap_del_sel;
 	u32 itap_del_ena;
+	u32 itap_del_sel;
 	u32 mask, val;
 
 	/* Setup Output TAP delay */
@@ -329,12 +330,18 @@ static void sdhci_j721e_4bit_set_clock(struct sdhci_host *host,
 	val = (0x1 << OTAPDLYENA_SHIFT) |
 	      (otap_del_sel << OTAPDLYSEL_SHIFT);
 
+	/* Setup Input TAP delay */
 	itap_del_ena = sdhci_am654->itap_del_ena[timing];
+	itap_del_sel = sdhci_am654->itap_del_sel[timing];
 
-	mask |= ITAPDLYENA_MASK;
-	val |= (itap_del_ena << ITAPDLYENA_SHIFT);
+	mask |= ITAPDLYENA_MASK | ITAPDLYSEL_MASK;
+	val |= (itap_del_ena << ITAPDLYENA_SHIFT) |
+	       (itap_del_sel << ITAPDLYSEL_SHIFT);
 
+	regmap_update_bits(sdhci_am654->base, PHY_CTRL4, ITAPCHGWIN_MASK,
+			   1 << ITAPCHGWIN_SHIFT);
 	regmap_update_bits(sdhci_am654->base, PHY_CTRL4, mask, val);
+	regmap_update_bits(sdhci_am654->base, PHY_CTRL4, ITAPCHGWIN_MASK, 0);
 
 	regmap_update_bits(sdhci_am654->base, PHY_CTRL5, CLKBUFSEL_MASK,
 			   sdhci_am654->clkbuf_sel);
-- 
2.43.0


  parent reply	other threads:[~2024-02-07  1:15 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-07  1:15 [PATCH v2 0/7] Add tuning algorithm for delay chain Judith Mendez
2024-02-07  1:15 ` [PATCH v2 1/7] mmc: sdhci_am654: " Judith Mendez
2024-02-16 17:09   ` Adrian Hunter
2024-02-20 20:10     ` Judith Mendez
2024-02-28 13:21       ` Adrian Hunter
2024-02-28 15:38         ` Judith Mendez
2024-02-07  1:15 ` [PATCH v2 2/7] mmc: sdhci_am654: Write ITAPDLY for DDR52 timing Judith Mendez
2024-02-12 17:13   ` Andrew Davis
2024-02-12 17:33     ` Judith Mendez
2024-02-16 17:09   ` Adrian Hunter
2024-02-20 21:05     ` Judith Mendez
2024-02-28 13:21       ` Adrian Hunter
2024-02-28 15:40         ` Judith Mendez
2024-02-07  1:15 ` [PATCH v2 3/7] mmc: sdhci_am654: Add missing OTAP/ITAP enable Judith Mendez
2024-02-07  1:15 ` [PATCH v2 4/7] mmc: sdhci_am654: Fix itapdly/otapdly array type Judith Mendez
2024-02-16 17:10   ` Adrian Hunter
2024-02-20 20:14     ` Judith Mendez
2024-02-07  1:15 ` [PATCH v2 5/7] mmc: sdhci_am654: Update comments in sdhci_am654_set_clock Judith Mendez
2024-02-16 17:11   ` Adrian Hunter
2024-02-20 20:14     ` Judith Mendez
2024-02-07  1:15 ` Judith Mendez [this message]
2024-02-07  1:15 ` [PATCH v2 7/7] mmc: sdhci_am654: Fix ITAPDLY for HS400 timing Judith Mendez
2024-02-11 16:02 ` [PATCH v2 0/7] Add tuning algorithm for delay chain Francesco Dolcini
2024-02-12 16:33   ` Judith Mendez
2024-02-12 17:32     ` Francesco Dolcini
2024-02-12 17:56       ` Judith Mendez

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=20240207011520.3128382-7-jm@ti.com \
    --to=jm@ti.com \
    --cc=adrian.hunter@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ulf.hansson@linaro.org \
    /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.