All of lore.kernel.org
 help / color / mirror / Atom feed
From: Faiz Abbas <faiz_abbas@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v5 12/15] mmc: am654_sdhci: Add a platform specific set_control_reg() callback
Date: Wed, 29 May 2019 15:15:12 +0530	[thread overview]
Message-ID: <20190529094515.13517-13-faiz_abbas@ti.com> (raw)
In-Reply-To: <20190529094515.13517-1-faiz_abbas@ti.com>

Add a platform specific set_control_reg() callback to help switch to
UHS speed modes.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
---
 drivers/mmc/am654_sdhci.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/am654_sdhci.c b/drivers/mmc/am654_sdhci.c
index 8e07baa74f..8e4147c165 100644
--- a/drivers/mmc/am654_sdhci.c
+++ b/drivers/mmc/am654_sdhci.c
@@ -75,6 +75,21 @@ struct am654_sdhci_plat {
 	bool dll_on;
 };
 
+static void am654_sdhci_set_control_reg(struct sdhci_host *host)
+{
+	struct mmc *mmc = (struct mmc *)host->mmc;
+	u32 reg;
+
+	if (IS_SD(host->mmc) &&
+	    mmc->signal_voltage == MMC_SIGNAL_VOLTAGE_180) {
+		reg = sdhci_readw(host, SDHCI_HOST_CONTROL2);
+		reg |= SDHCI_CTRL_VDD_180;
+		sdhci_writew(host, reg, SDHCI_HOST_CONTROL2);
+	}
+
+	sdhci_set_uhs_timing(host);
+}
+
 static int am654_sdhci_set_ios_post(struct sdhci_host *host)
 {
 	struct udevice *dev = host->mmc->dev;
@@ -155,7 +170,8 @@ static int am654_sdhci_set_ios_post(struct sdhci_host *host)
 }
 
 const struct sdhci_ops am654_sdhci_ops = {
-	.set_ios_post = &am654_sdhci_set_ios_post,
+	.set_ios_post		= &am654_sdhci_set_ios_post,
+	.set_control_reg	= &am654_sdhci_set_control_reg,
 };
 
 int am654_sdhci_init(struct am654_sdhci_plat *plat)
-- 
2.19.2

  parent reply	other threads:[~2019-05-29  9:45 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-29  9:45 [U-Boot] [PATCH v5 00/15] Add Support for eMMC in Am65x-evm Faiz Abbas
2019-05-29  9:45 ` [U-Boot] [PATCH v5 01/15] arm64: dts: k3: Sync sdhci0 node from kernel and change driver name Faiz Abbas
2019-06-04  5:28   ` Lokesh Vutla
2019-06-04 13:12     ` Faiz Abbas
2019-05-29  9:45 ` [U-Boot] [PATCH v5 02/15] mmc: am654_sdhci: Remove quirks Faiz Abbas
2019-05-29  9:45 ` [U-Boot] [PATCH v5 03/15] regmap: Add API regmap_init_mem_index() Faiz Abbas
2019-05-29  9:45 ` [U-Boot] [PATCH v5 04/15] mmc: sdhci: Add support for sdhci-caps-mask Faiz Abbas
2019-05-29  9:45 ` [U-Boot] [PATCH v5 05/15] mmc: sdhci: Make sdhci_set_clock() non static Faiz Abbas
2019-05-29  9:45 ` [U-Boot] [PATCH v5 06/15] arm: dts: k3: Add phy specific properties to SD card node Faiz Abbas
2019-05-29  9:45 ` [U-Boot] [PATCH v5 07/15] mmc: sdhci: Make set_ios_post() return int Faiz Abbas
2019-05-29  9:45 ` [U-Boot] [PATCH v5 08/15] mmc: am654_sdhci: Add Support for PHY Faiz Abbas
2019-05-29  9:45 ` [U-Boot] [PATCH v5 09/15] configs: am65x_evm: Enable CONFIG_REGMAP Faiz Abbas
2019-05-29  9:45 ` [U-Boot] [PATCH v5 10/15] mmc: am654_sdhci: Use f_max in mmc_config Faiz Abbas
2019-05-29  9:45 ` [U-Boot] [PATCH v5 11/15] mmc: sdhci: Add support for HOST_CONTROL2 and setting UHS timings Faiz Abbas
2019-05-29  9:45 ` Faiz Abbas [this message]
2019-05-29  9:45 ` [U-Boot] [PATCH v5 13/15] configs: am65x: Add configs to support environment in eMMC Faiz Abbas
2019-05-29  9:45 ` [U-Boot] [PATCH v5 14/15] am65x_evm: Add Support for creating a filesystem GPT partition " Faiz Abbas
2019-05-29  9:45 ` [U-Boot] [PATCH v5 15/15] configs: am65x_evm_a53: Add Support for creating GPT partitions Faiz Abbas

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=20190529094515.13517-13-faiz_abbas@ti.com \
    --to=faiz_abbas@ti.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.