From: Siva Durga Prasad Paladugu Date: Wed, 1 Feb 2017 19:40:43 +0000 (+0530) Subject: mmc: sdhci: Add support for platform/board specific tuning X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=999f731068f78f72171e784ed691cc2cb804d9e1;p=thirdparty%2Fu-boot.git mmc: sdhci: Add support for platform/board specific tuning Add support to execute platform/board specific tuning needed for SDR104 and SDR50 UHS modes.This patch adds hook routine to support specific tuning requirements. Signed-off-by: Siva Durga Prasad Paladugu Signed-off-by: Michal Simek --- diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c index 2b6ca06d9ee..20cfdb3e454 100644 --- a/drivers/mmc/sdhci.c +++ b/drivers/mmc/sdhci.c @@ -309,11 +309,19 @@ static int sdhci_execute_tuning(struct mmc *mmc, u8 opcode) struct mmc_cmd cmd; struct mmc_data data; u32 ctrl; + int err; u8 tuning_loop_counter = 40; struct sdhci_host *host = mmc->priv; debug("%s\n", __func__); + if (host->platform_execute_tuning) { + err = host->platform_execute_tuning(mmc, opcode); + if (err) + return err; + return 0; + } + ctrl = sdhci_readw(host, SDHCI_HOST_CTRL2); ctrl |= SDHCI_CTRL_EXEC_TUNING; sdhci_writew(host, ctrl, SDHCI_HOST_CTRL2); diff --git a/include/sdhci.h b/include/sdhci.h index 20138b35d5c..a8b52571988 100644 --- a/include/sdhci.h +++ b/include/sdhci.h @@ -269,6 +269,7 @@ struct sdhci_host { void (*set_control_reg)(struct sdhci_host *host); void (*set_clock)(int dev_index, unsigned int div); + int (*platform_execute_tuning)(struct mmc *host, u8 opcode); uint voltages; struct mmc_config cfg;