aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorweijun yang <york.yang@csr.com>2015-02-15 10:43:51 -0500
committerUlf Hansson <ulf.hansson@linaro.org>2015-03-23 09:13:32 -0400
commitb36ac1b43ebcd8b63cbfb35c54edb7bd577ad15b (patch)
treeeca54d63b68d60bd242fe9cb069df2ba3d6f63e2
parented2540effa70097f8e74aeaa83525dea7ccfc47a (diff)
mmc: sirf: update sdhci_sirf_execute_tuning procedure
For the original tuning code, delay value is set to SD Bus Clock Delay Register (SD_CLK_DELAY_SETTING) as (val | (Val << 7) | (val << 16)), which means CLK_DELAY_IN1, CLK_DELAY_IN2 and CLK_DELAY_OUT are the same and with 128 steps. This is doubtful. In CSR design specification documents CS-304575-DR-3H, this issue is clarified, the delay[13:0] in SD_CLK_DELAY_SETTING is simplied to the concatenation of {CLK_DELAY_IN2, CLK_DELAY_IN1}. Besides, for CMD19 tuning, no need to set CLK_DELAY_OUT([22,16] of SD_CLK_DELAY_SETTING). Signed-off-by: weijun yang <york.yang@csr.com> Signed-off-by: Barry Song <baohua.song@csr.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r--drivers/mmc/host/sdhci-sirf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mmc/host/sdhci-sirf.c b/drivers/mmc/host/sdhci-sirf.c
index f6f82ec3618d..43314094699f 100644
--- a/drivers/mmc/host/sdhci-sirf.c
+++ b/drivers/mmc/host/sdhci-sirf.c
@@ -56,7 +56,7 @@ static int sdhci_sirf_execute_tuning(struct sdhci_host *host, u32 opcode)
56 int tuning_seq_cnt = 3; 56 int tuning_seq_cnt = 3;
57 u8 phase, tuned_phases[SIRF_TUNING_COUNT]; 57 u8 phase, tuned_phases[SIRF_TUNING_COUNT];
58 u8 tuned_phase_cnt = 0; 58 u8 tuned_phase_cnt = 0;
59 int rc, longest_range = 0; 59 int rc = 0, longest_range = 0;
60 int start = -1, end = 0, tuning_value = -1, range = 0; 60 int start = -1, end = 0, tuning_value = -1, range = 0;
61 u16 clock_setting; 61 u16 clock_setting;
62 struct mmc_host *mmc = host->mmc; 62 struct mmc_host *mmc = host->mmc;
@@ -68,7 +68,7 @@ retry:
68 phase = 0; 68 phase = 0;
69 do { 69 do {
70 sdhci_writel(host, 70 sdhci_writel(host,
71 clock_setting | phase | (phase << 7) | (phase << 16), 71 clock_setting | phase,
72 SDHCI_CLK_DELAY_SETTING); 72 SDHCI_CLK_DELAY_SETTING);
73 73
74 if (!mmc_send_tuning(mmc)) { 74 if (!mmc_send_tuning(mmc)) {
@@ -102,7 +102,7 @@ retry:
102 */ 102 */
103 phase = tuning_value; 103 phase = tuning_value;
104 sdhci_writel(host, 104 sdhci_writel(host,
105 clock_setting | phase | (phase << 7) | (phase << 16), 105 clock_setting | phase,
106 SDHCI_CLK_DELAY_SETTING); 106 SDHCI_CLK_DELAY_SETTING);
107 107
108 dev_dbg(mmc_dev(mmc), "%s: Setting the tuning phase to %d\n", 108 dev_dbg(mmc_dev(mmc), "%s: Setting the tuning phase to %d\n",