All of lore.kernel.org
 help / color / mirror / Atom feed
From: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [UBOOT PATCH v3 4/7] mmc: sdhci: Invoke platform specific tuning and delay routines
Date: Thu, 19 Apr 2018 12:37:07 +0530	[thread overview]
Message-ID: <1524121630-13933-5-git-send-email-siva.durga.paladugu@xilinx.com> (raw)
In-Reply-To: <1524121630-13933-1-git-send-email-siva.durga.paladugu@xilinx.com>

From: Siva Durga Prasad Paladugu <sivadur@xilinx.com>

This patch adds support to invoke any platform specific tuning
and delay routines if available.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
---
 drivers/mmc/sdhci.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 2ce3b57..c17ab12 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -306,6 +306,24 @@ static int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd,
                return -ECOMM;
 }

+#if defined(CONFIG_DM_MMC) && defined(MMC_SUPPORTS_TUNING)
+static int sdhci_execute_tuning(struct udevice *dev, uint opcode)
+{
+       int err;
+       struct mmc *mmc = mmc_get_mmc_dev(dev);
+       struct sdhci_host *host = mmc->priv;
+
+       debug("%s\n", __func__);
+
+       if (host->ops->platform_execute_tuning) {
+               err = host->ops->platform_execute_tuning(mmc, opcode);
+               if (err)
+                       return err;
+               return 0;
+       }
+       return 0;
+}
+#endif
 static int sdhci_set_clock(struct mmc *mmc, unsigned int clock)
 {
        struct sdhci_host *host = mmc->priv;
@@ -330,6 +348,9 @@ static int sdhci_set_clock(struct mmc *mmc, unsigned int clock)
        if (clock == 0)
                return 0;

+       if (host->ops->set_delay)
+               host->ops->set_delay(host);
+
        if (SDHCI_GET_VERSION(host) >= SDHCI_SPEC_300) {
                /*
                 * Check if the Host Controller supports Programmable Clock
@@ -521,6 +542,9 @@ int sdhci_probe(struct udevice *dev)
 const struct dm_mmc_ops sdhci_ops = {
        .send_cmd       = sdhci_send_command,
        .set_ios        = sdhci_set_ios,
+#ifdef MMC_SUPPORTS_TUNING
+       .execute_tuning = sdhci_execute_tuning,
+#endif
 };
 #else
 static const struct mmc_ops sdhci_ops = {
--
2.7.4

This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.

  parent reply	other threads:[~2018-04-19  7:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-19  7:07 [U-Boot] [UBOOT PATCH v3 0/7] Add support of SD3.0 UHS modes for ZynqMP Siva Durga Prasad Paladugu
2018-04-19  7:07 ` [U-Boot] [UBOOT PATCH v3 1/7] mmc: sdhci: Add support for disabling clock Siva Durga Prasad Paladugu
2018-04-19  7:07 ` [U-Boot] [UBOOT PATCH v3 2/7] mmc: sdhci: Handle execute tuning command in sdhci_send_command Siva Durga Prasad Paladugu
2018-04-19  7:07 ` [U-Boot] [UBOOT PATCH v3 3/7] sdhci: Add new sdhci ops for platform specific tuning and delays Siva Durga Prasad Paladugu
2018-04-19  7:07 ` Siva Durga Prasad Paladugu [this message]
2018-04-19  7:07 ` [U-Boot] [UBOOT PATCH v3 5/7] mmc : sdhci: Read capabilities register1 and update host caps Siva Durga Prasad Paladugu
2018-04-19  7:07 ` [U-Boot] [UBOOT PATCH v3 6/7] mmc: zynq_sdhci: Add support for SD3.0 Siva Durga Prasad Paladugu
2018-04-24 11:46   ` Michal Simek
2018-04-19  7:07 ` [U-Boot] [UBOOT PATCH v3 7/7] zynqmp: zcu102: Enable UHS support for ZCU102 Rev1.0 board Siva Durga Prasad Paladugu
2018-04-24 11:40   ` Michal Simek
2018-04-24 11:09 ` [U-Boot] [UBOOT PATCH v3 0/7] Add support of SD3.0 UHS modes for ZynqMP Michal Simek
2018-04-30  9:02 ` Michal Simek
2018-04-30 14:17   ` Tom Rini
2018-04-30 16:46     ` Michal Simek
2018-04-30 16:56       ` Tom Rini
2018-05-02  2:05   ` Jaehoon Chung
2018-05-09  9:51     ` Michal Simek
2018-05-11 12:56 ` Michal Simek

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=1524121630-13933-5-git-send-email-siva.durga.paladugu@xilinx.com \
    --to=siva.durga.paladugu@xilinx.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 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.