[U-Boot] [UBOOT v2 05/15] mmc: sdhci: Add support for platform specific delay

Siva Durga Prasad Paladugu siva.durga.paladugu at xilinx.com
Mon Jan 30 11:38:22 CET 2017


Add support for any platform/board specific delays
requirement while setting clocks. Some boards needs
to program tapdelay for setting certain high frequencies
and this patch adds hook for supporting the same.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur at xilinx.com>
---
Changes from v1:
- None
---
 drivers/mmc/sdhci.c | 3 +++
 include/sdhci.h     | 1 +
 2 files changed, 4 insertions(+)

diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index a24cc15..bbb6302 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -405,6 +405,9 @@ static int sdhci_set_clock(struct mmc *mmc, unsigned int clock)
 	if (clock == 0)
 		return 0;
 
+	if (mmc->is_uhs && host->ops->set_delay)
+		host->ops->set_delay(host, mmc->uhsmode);
+
 	if (SDHCI_GET_VERSION(host) >= SDHCI_SPEC_300) {
 		/*
 		 * Check if the Host Controller supports Programmable Clock
diff --git a/include/sdhci.h b/include/sdhci.h
index dbe3836..a0449d9 100644
--- a/include/sdhci.h
+++ b/include/sdhci.h
@@ -251,6 +251,7 @@ struct sdhci_ops {
 	void	(*set_ios_post)(struct sdhci_host *host);
 	void	(*set_clock)(struct sdhci_host *host, u32 div);
 	int	(*platform_execute_tuning)(struct mmc *host, u8 opcode);
+	void	(*set_delay)(struct sdhci_host *host, u8 uhsmode);
 };
 
 struct sdhci_host {
-- 
2.7.4



More information about the U-Boot mailing list