* [PATCH] mmc: sirf: update sdhci_sirf_execute_tuning procedure
@ 2015-02-15 15:43 Barry Song
2015-03-05 5:54 ` Barry Song
2015-03-05 13:41 ` Ulf Hansson
0 siblings, 2 replies; 3+ messages in thread
From: Barry Song @ 2015-02-15 15:43 UTC (permalink / raw)
To: linux-arm-kernel
From: weijun yang <york.yang@csr.com>
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>
---
drivers/mmc/host/sdhci-sirf.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/mmc/host/sdhci-sirf.c b/drivers/mmc/host/sdhci-sirf.c
index f6f82ec..4331409 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)
int tuning_seq_cnt = 3;
u8 phase, tuned_phases[SIRF_TUNING_COUNT];
u8 tuned_phase_cnt = 0;
- int rc, longest_range = 0;
+ int rc = 0, longest_range = 0;
int start = -1, end = 0, tuning_value = -1, range = 0;
u16 clock_setting;
struct mmc_host *mmc = host->mmc;
@@ -68,7 +68,7 @@ retry:
phase = 0;
do {
sdhci_writel(host,
- clock_setting | phase | (phase << 7) | (phase << 16),
+ clock_setting | phase,
SDHCI_CLK_DELAY_SETTING);
if (!mmc_send_tuning(mmc)) {
@@ -102,7 +102,7 @@ retry:
*/
phase = tuning_value;
sdhci_writel(host,
- clock_setting | phase | (phase << 7) | (phase << 16),
+ clock_setting | phase,
SDHCI_CLK_DELAY_SETTING);
dev_dbg(mmc_dev(mmc), "%s: Setting the tuning phase to %d\n",
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] mmc: sirf: update sdhci_sirf_execute_tuning procedure
2015-02-15 15:43 [PATCH] mmc: sirf: update sdhci_sirf_execute_tuning procedure Barry Song
@ 2015-03-05 5:54 ` Barry Song
2015-03-05 13:41 ` Ulf Hansson
1 sibling, 0 replies; 3+ messages in thread
From: Barry Song @ 2015-03-05 5:54 UTC (permalink / raw)
To: linux-arm-kernel
ping Ulf....
2015-02-15 23:43 GMT+08:00 Barry Song <21cnbao@gmail.com>:
> From: weijun yang <york.yang@csr.com>
>
> 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>
> ---
> drivers/mmc/host/sdhci-sirf.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-sirf.c b/drivers/mmc/host/sdhci-sirf.c
> index f6f82ec..4331409 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)
> int tuning_seq_cnt = 3;
> u8 phase, tuned_phases[SIRF_TUNING_COUNT];
> u8 tuned_phase_cnt = 0;
> - int rc, longest_range = 0;
> + int rc = 0, longest_range = 0;
> int start = -1, end = 0, tuning_value = -1, range = 0;
> u16 clock_setting;
> struct mmc_host *mmc = host->mmc;
> @@ -68,7 +68,7 @@ retry:
> phase = 0;
> do {
> sdhci_writel(host,
> - clock_setting | phase | (phase << 7) | (phase << 16),
> + clock_setting | phase,
> SDHCI_CLK_DELAY_SETTING);
>
> if (!mmc_send_tuning(mmc)) {
> @@ -102,7 +102,7 @@ retry:
> */
> phase = tuning_value;
> sdhci_writel(host,
> - clock_setting | phase | (phase << 7) | (phase << 16),
> + clock_setting | phase,
> SDHCI_CLK_DELAY_SETTING);
>
> dev_dbg(mmc_dev(mmc), "%s: Setting the tuning phase to %d\n",
> --
> 1.9.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] mmc: sirf: update sdhci_sirf_execute_tuning procedure
2015-02-15 15:43 [PATCH] mmc: sirf: update sdhci_sirf_execute_tuning procedure Barry Song
2015-03-05 5:54 ` Barry Song
@ 2015-03-05 13:41 ` Ulf Hansson
1 sibling, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2015-03-05 13:41 UTC (permalink / raw)
To: linux-arm-kernel
On 15 February 2015 at 16:43, Barry Song <21cnbao@gmail.com> wrote:
> From: weijun yang <york.yang@csr.com>
>
> 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>
Applied, thanks!
Kind regards
Uffe
> ---
> drivers/mmc/host/sdhci-sirf.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-sirf.c b/drivers/mmc/host/sdhci-sirf.c
> index f6f82ec..4331409 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)
> int tuning_seq_cnt = 3;
> u8 phase, tuned_phases[SIRF_TUNING_COUNT];
> u8 tuned_phase_cnt = 0;
> - int rc, longest_range = 0;
> + int rc = 0, longest_range = 0;
> int start = -1, end = 0, tuning_value = -1, range = 0;
> u16 clock_setting;
> struct mmc_host *mmc = host->mmc;
> @@ -68,7 +68,7 @@ retry:
> phase = 0;
> do {
> sdhci_writel(host,
> - clock_setting | phase | (phase << 7) | (phase << 16),
> + clock_setting | phase,
> SDHCI_CLK_DELAY_SETTING);
>
> if (!mmc_send_tuning(mmc)) {
> @@ -102,7 +102,7 @@ retry:
> */
> phase = tuning_value;
> sdhci_writel(host,
> - clock_setting | phase | (phase << 7) | (phase << 16),
> + clock_setting | phase,
> SDHCI_CLK_DELAY_SETTING);
>
> dev_dbg(mmc_dev(mmc), "%s: Setting the tuning phase to %d\n",
> --
> 1.9.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-03-05 13:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-15 15:43 [PATCH] mmc: sirf: update sdhci_sirf_execute_tuning procedure Barry Song
2015-03-05 5:54 ` Barry Song
2015-03-05 13:41 ` Ulf Hansson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).