* [PATCH v1] mmc: sdhci-of-esdhc: set the sd clock divisor value above 3
@ 2019-06-14 8:29 Yinbo Zhu
2019-06-14 8:29 ` [PATCH v1] mmc: sdhci-of-esdhc: use 1/2 periperhal clock for ls1028a Yinbo Zhu
2019-06-17 11:35 ` [PATCH v1] mmc: sdhci-of-esdhc: set the sd clock divisor value above 3 Ulf Hansson
0 siblings, 2 replies; 4+ messages in thread
From: Yinbo Zhu @ 2019-06-14 8:29 UTC (permalink / raw)
To: Adrian Hunter, Ulf Hansson
Cc: yinbo.zhu, xiaobo.xie, jiafei.pan, linux-mmc, linux-kernel, yangbo.lu
From: Yangbo Lu <yangbo.lu@nxp.com>
This patch is to set the sd clock divisor value above 3 in tuning mode
Signed-off-by: Yinbo Zhu <yinbo.zhu@nxp.com>
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
---
drivers/mmc/host/sdhci-of-esdhc.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c
index d4ec0a959a75..c4af026c3fba 100644
--- a/drivers/mmc/host/sdhci-of-esdhc.c
+++ b/drivers/mmc/host/sdhci-of-esdhc.c
@@ -824,9 +824,17 @@ static int esdhc_execute_tuning(struct mmc_host *mmc, u32 opcode)
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
struct sdhci_esdhc *esdhc = sdhci_pltfm_priv(pltfm_host);
bool hs400_tuning;
+ unsigned int clk;
u32 val;
int ret;
+ /* For tuning mode, the sd clock divisor value
+ * must be larger than 3 according to reference manual.
+ */
+ clk = esdhc->peripheral_clock / 3;
+ if (host->clock > clk)
+ esdhc_of_set_clock(host, clk);
+
if (esdhc->quirk_limited_clk_division &&
host->flags & SDHCI_HS400_TUNING)
esdhc_of_set_clock(host, host->clock);
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v1] mmc: sdhci-of-esdhc: use 1/2 periperhal clock for ls1028a
2019-06-14 8:29 [PATCH v1] mmc: sdhci-of-esdhc: set the sd clock divisor value above 3 Yinbo Zhu
@ 2019-06-14 8:29 ` Yinbo Zhu
2019-06-17 11:35 ` Ulf Hansson
2019-06-17 11:35 ` [PATCH v1] mmc: sdhci-of-esdhc: set the sd clock divisor value above 3 Ulf Hansson
1 sibling, 1 reply; 4+ messages in thread
From: Yinbo Zhu @ 2019-06-14 8:29 UTC (permalink / raw)
To: Adrian Hunter, Ulf Hansson
Cc: yinbo.zhu, xiaobo.xie, jiafei.pan, linux-mmc, linux-kernel, yangbo.lu
From: Yangbo Lu <yangbo.lu@nxp.com>
LS1028A used 1/2 periperhal clock as one reference clock.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
---
drivers/mmc/host/sdhci-of-esdhc.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c
index c56c7d413a09..4dd43b1adf2c 100644
--- a/drivers/mmc/host/sdhci-of-esdhc.c
+++ b/drivers/mmc/host/sdhci-of-esdhc.c
@@ -1048,11 +1048,12 @@ static void esdhc_init(struct platform_device *pdev, struct sdhci_host *host)
/*
* esdhc->peripheral_clock would be assigned with a value
* which is eSDHC base clock when use periperal clock.
- * For ls1046a, the clock value got by common clk API is
- * peripheral clock while the eSDHC base clock is 1/2
- * peripheral clock.
+ * For some platforms, the clock value got by common clk
+ * API is peripheral clock while the eSDHC base clock is
+ * 1/2 peripheral clock.
*/
- if (of_device_is_compatible(np, "fsl,ls1046a-esdhc"))
+ if (of_device_is_compatible(np, "fsl,ls1046a-esdhc") ||
+ of_device_is_compatible(np, "fsl,ls1028a-esdhc"))
esdhc->peripheral_clock = clk_get_rate(clk) / 2;
else
esdhc->peripheral_clock = clk_get_rate(clk);
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v1] mmc: sdhci-of-esdhc: set the sd clock divisor value above 3
2019-06-14 8:29 [PATCH v1] mmc: sdhci-of-esdhc: set the sd clock divisor value above 3 Yinbo Zhu
2019-06-14 8:29 ` [PATCH v1] mmc: sdhci-of-esdhc: use 1/2 periperhal clock for ls1028a Yinbo Zhu
@ 2019-06-17 11:35 ` Ulf Hansson
1 sibling, 0 replies; 4+ messages in thread
From: Ulf Hansson @ 2019-06-17 11:35 UTC (permalink / raw)
To: Yinbo Zhu
Cc: Adrian Hunter, Xiaobo Xie, Jiafei Pan, linux-mmc,
Linux Kernel Mailing List, Yangbo Lu
On Fri, 14 Jun 2019 at 10:28, Yinbo Zhu <yinbo.zhu@nxp.com> wrote:
>
> From: Yangbo Lu <yangbo.lu@nxp.com>
>
> This patch is to set the sd clock divisor value above 3 in tuning mode
>
> Signed-off-by: Yinbo Zhu <yinbo.zhu@nxp.com>
> Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Applied for next, thanks!
Kind regards
Uffe
> ---
> drivers/mmc/host/sdhci-of-esdhc.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c
> index d4ec0a959a75..c4af026c3fba 100644
> --- a/drivers/mmc/host/sdhci-of-esdhc.c
> +++ b/drivers/mmc/host/sdhci-of-esdhc.c
> @@ -824,9 +824,17 @@ static int esdhc_execute_tuning(struct mmc_host *mmc, u32 opcode)
> struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
> struct sdhci_esdhc *esdhc = sdhci_pltfm_priv(pltfm_host);
> bool hs400_tuning;
> + unsigned int clk;
> u32 val;
> int ret;
>
> + /* For tuning mode, the sd clock divisor value
> + * must be larger than 3 according to reference manual.
> + */
> + clk = esdhc->peripheral_clock / 3;
> + if (host->clock > clk)
> + esdhc_of_set_clock(host, clk);
> +
> if (esdhc->quirk_limited_clk_division &&
> host->flags & SDHCI_HS400_TUNING)
> esdhc_of_set_clock(host, host->clock);
> --
> 2.17.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1] mmc: sdhci-of-esdhc: use 1/2 periperhal clock for ls1028a
2019-06-14 8:29 ` [PATCH v1] mmc: sdhci-of-esdhc: use 1/2 periperhal clock for ls1028a Yinbo Zhu
@ 2019-06-17 11:35 ` Ulf Hansson
0 siblings, 0 replies; 4+ messages in thread
From: Ulf Hansson @ 2019-06-17 11:35 UTC (permalink / raw)
To: Yinbo Zhu
Cc: Adrian Hunter, Xiaobo Xie, Jiafei Pan, linux-mmc,
Linux Kernel Mailing List, Yangbo Lu
On Fri, 14 Jun 2019 at 10:28, Yinbo Zhu <yinbo.zhu@nxp.com> wrote:
>
> From: Yangbo Lu <yangbo.lu@nxp.com>
>
> LS1028A used 1/2 periperhal clock as one reference clock.
>
> Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Applied for next, thanks!
Kind regards
Uffe
> ---
> drivers/mmc/host/sdhci-of-esdhc.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c
> index c56c7d413a09..4dd43b1adf2c 100644
> --- a/drivers/mmc/host/sdhci-of-esdhc.c
> +++ b/drivers/mmc/host/sdhci-of-esdhc.c
> @@ -1048,11 +1048,12 @@ static void esdhc_init(struct platform_device *pdev, struct sdhci_host *host)
> /*
> * esdhc->peripheral_clock would be assigned with a value
> * which is eSDHC base clock when use periperal clock.
> - * For ls1046a, the clock value got by common clk API is
> - * peripheral clock while the eSDHC base clock is 1/2
> - * peripheral clock.
> + * For some platforms, the clock value got by common clk
> + * API is peripheral clock while the eSDHC base clock is
> + * 1/2 peripheral clock.
> */
> - if (of_device_is_compatible(np, "fsl,ls1046a-esdhc"))
> + if (of_device_is_compatible(np, "fsl,ls1046a-esdhc") ||
> + of_device_is_compatible(np, "fsl,ls1028a-esdhc"))
> esdhc->peripheral_clock = clk_get_rate(clk) / 2;
> else
> esdhc->peripheral_clock = clk_get_rate(clk);
> --
> 2.17.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-06-17 11:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-14 8:29 [PATCH v1] mmc: sdhci-of-esdhc: set the sd clock divisor value above 3 Yinbo Zhu
2019-06-14 8:29 ` [PATCH v1] mmc: sdhci-of-esdhc: use 1/2 periperhal clock for ls1028a Yinbo Zhu
2019-06-17 11:35 ` Ulf Hansson
2019-06-17 11:35 ` [PATCH v1] mmc: sdhci-of-esdhc: set the sd clock divisor value above 3 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).