summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSubhash Jadavani <subhashj@codeaurora.org>2017-03-31 16:50:59 -0700
committerSubhash Jadavani <subhashj@codeaurora.org>2017-04-03 10:42:30 -0700
commita4b36d773babd517b8208d487ea6beb060aab610 (patch)
treec4a6041f5ecbcb75111b11681dc0a376a727081c
parent0820ed55248b4dec2a05d48764b7350e7171e99f (diff)
mmc: sdhci-msm: add SDR104 CRC workaround enablement control
On Certain chipsets, SDR104 mode might be unstable causing CRC error on the interface. So we need a workaround which would skip printing register dumps on CRC errors and also downgrade bus speed mode to SDR50/DDR50 in case of continuous CRC errors. This patch adds "qcom,sdr104-wa" property to enable this workaround if required. Change-Id: I626d8ef45a97e8e6558e7f20be496de1f5a2a438 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
-rw-r--r--Documentation/devicetree/bindings/mmc/sdhci-msm.txt5
-rw-r--r--drivers/mmc/host/sdhci-msm.c3
-rw-r--r--drivers/mmc/host/sdhci-msm.h1
-rw-r--r--include/linux/mmc/host.h1
4 files changed, 10 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/mmc/sdhci-msm.txt b/Documentation/devicetree/bindings/mmc/sdhci-msm.txt
index 0b46fd3d8ebf..d00e26b4d5ed 100644
--- a/Documentation/devicetree/bindings/mmc/sdhci-msm.txt
+++ b/Documentation/devicetree/bindings/mmc/sdhci-msm.txt
@@ -75,6 +75,11 @@ Optional Properties:
during clock scaling. If this property is not
defined, then it falls back to the default HS
bus speed mode to maintain backward compatibility.
+ - qcom,sdr104-wa: On Certain chipsets, SDR104 mode might be unstable causing CRC errors
+ on the interface. So there is a workaround implemented to skip printing
+ register dumps on CRC errors and also downgrade bus speed mode to
+ SDR50/DDR50 in case of continuous CRC errors. Set this flag to enable
+ this workaround.
In the following, <supply> can be vdd (flash core voltage) or vdd-io (I/O voltage).
- qcom,<supply>-always-on - specifies whether supply should be kept "on" always.
diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
index 2eaac11ec8ba..987d61bdda2d 100644
--- a/drivers/mmc/host/sdhci-msm.c
+++ b/drivers/mmc/host/sdhci-msm.c
@@ -1960,6 +1960,8 @@ struct sdhci_msm_pltfm_data *sdhci_msm_populate_pdata(struct device *dev,
if (of_get_property(np, "qcom,core_3_0v_support", NULL))
pdata->core_3_0v_support = true;
+ pdata->sdr104_wa = of_property_read_bool(np, "qcom,sdr104-wa");
+
return pdata;
out:
return NULL;
@@ -4579,6 +4581,7 @@ static int sdhci_msm_probe(struct platform_device *pdev)
if (msm_host->pdata->nonhotplug)
msm_host->mmc->caps2 |= MMC_CAP2_NONHOTPLUG;
+ msm_host->mmc->sdr104_wa = msm_host->pdata->sdr104_wa;
/* Initialize ICE if present */
if (msm_host->ice.pdev) {
diff --git a/drivers/mmc/host/sdhci-msm.h b/drivers/mmc/host/sdhci-msm.h
index 2e4f2179378e..92f61708001e 100644
--- a/drivers/mmc/host/sdhci-msm.h
+++ b/drivers/mmc/host/sdhci-msm.h
@@ -153,6 +153,7 @@ struct sdhci_msm_pltfm_data {
u32 ice_clk_min;
struct sdhci_msm_pm_qos_data pm_qos_data;
bool core_3_0v_support;
+ bool sdr104_wa;
};
struct sdhci_msm_bus_vote {
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 055b879dfa6b..37069eb12861 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -595,6 +595,7 @@ struct mmc_host {
struct io_latency_state io_lat_s;
#endif
+ bool sdr104_wa;
unsigned long private[0] ____cacheline_aligned;
};