All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2] mmc: fsl_esdhc: Add support for DDR mode
@ 2015-01-20 15:16 Volodymyr Riazantsev
  2015-02-25 21:37 ` York Sun
  2015-03-11 23:42 ` Fabio Estevam
  0 siblings, 2 replies; 9+ messages in thread
From: Volodymyr Riazantsev @ 2015-01-20 15:16 UTC (permalink / raw)
  To: u-boot

Add support of the DDR mode for eSDHC driver.
Enable it for i.MX6 SoC family only.

Change-Id: Ie27a945c9fe79d044cc886e269b60747f1744116
Signed-off-by: Volodymyr Riazantsev <volodymyr.riazantsev@globallogic.com>
---
 drivers/mmc/fsl_esdhc.c      | 8 ++++++--
 include/configs/mx6_common.h | 2 ++
 include/fsl_esdhc.h          | 1 +
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
index c55eb28..f5d2ccb 100644
--- a/drivers/mmc/fsl_esdhc.c
+++ b/drivers/mmc/fsl_esdhc.c
@@ -319,7 +319,8 @@ esdhc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
 	esdhc_write32(&regs->cmdarg, cmd->cmdarg);
 #if defined(CONFIG_FSL_USDHC)
 	esdhc_write32(&regs->mixctrl,
-	(esdhc_read32(&regs->mixctrl) & 0xFFFFFF80) | (xfertyp & 0x7F));
+	(esdhc_read32(&regs->mixctrl) & 0xFFFFFF80) | (xfertyp & 0x7F)
+			| (mmc->ddr_mode ? XFERTYP_DDREN : 0));
 	esdhc_write32(&regs->xfertyp, xfertyp & 0xFFFF0000);
 #else
 	esdhc_write32(&regs->xfertyp, xfertyp);
@@ -442,7 +443,7 @@ static void set_sysctl(struct mmc *mmc, uint clock)
 		if ((sdhc_clk / (div * pre_div)) <= clock)
 			break;
 
-	pre_div >>= 1;
+	pre_div >>= mmc->ddr_mode ? 2 : 1;
 	div -= 1;
 
 	clk = (pre_div << 8) | (div << 4);
@@ -601,6 +602,9 @@ int fsl_esdhc_initialize(bd_t *bis, struct fsl_esdhc_cfg *cfg)
 	}
 
 	cfg->cfg.host_caps = MMC_MODE_4BIT | MMC_MODE_8BIT | MMC_MODE_HC;
+#ifdef CONFIG_SYS_FSL_ESDHC_HAS_DDR_MODE
+	cfg->cfg.host_caps |= MMC_MODE_DDR_52MHz;
+#endif
 
 	if (cfg->max_bus_width > 0) {
 		if (cfg->max_bus_width < 8)
diff --git a/include/configs/mx6_common.h b/include/configs/mx6_common.h
index e0528ce..29b72b2 100644
--- a/include/configs/mx6_common.h
+++ b/include/configs/mx6_common.h
@@ -28,6 +28,8 @@
 #define CONFIG_SYS_PL310_BASE	L2_PL310_BASE
 #endif
 
+#define CONFIG_SYS_FSL_ESDHC_HAS_DDR_MODE
+
 #define CONFIG_MP
 #define CONFIG_MXC_GPT_HCLK
 
diff --git a/include/fsl_esdhc.h b/include/fsl_esdhc.h
index c1b6648..313fa1e 100644
--- a/include/fsl_esdhc.h
+++ b/include/fsl_esdhc.h
@@ -108,6 +108,7 @@
 #define XFERTYP_RSPTYP_48_BUSY	0x00030000
 #define XFERTYP_MSBSEL		0x00000020
 #define XFERTYP_DTDSEL		0x00000010
+#define XFERTYP_DDREN		0x00000008
 #define XFERTYP_AC12EN		0x00000004
 #define XFERTYP_BCEN		0x00000002
 #define XFERTYP_DMAEN		0x00000001
-- 
2.2.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH v2] mmc: fsl_esdhc: Add support for DDR mode
  2015-01-20 15:16 [U-Boot] [PATCH v2] mmc: fsl_esdhc: Add support for DDR mode Volodymyr Riazantsev
@ 2015-02-25 21:37 ` York Sun
  2015-03-06 13:43   ` Stefan Roese
  2015-03-11 23:42 ` Fabio Estevam
  1 sibling, 1 reply; 9+ messages in thread
From: York Sun @ 2015-02-25 21:37 UTC (permalink / raw)
  To: u-boot



On 01/20/2015 07:16 AM, Volodymyr Riazantsev wrote:
> Add support of the DDR mode for eSDHC driver.
> Enable it for i.MX6 SoC family only.
> 
> Change-Id: Ie27a945c9fe79d044cc886e269b60747f1744116
> Signed-off-by: Volodymyr Riazantsev <volodymyr.riazantsev@globallogic.com>
> ---

Applied to u-boot-fsl-qoriq master branch, awaiting upstream.

York

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH v2] mmc: fsl_esdhc: Add support for DDR mode
  2015-02-25 21:37 ` York Sun
@ 2015-03-06 13:43   ` Stefan Roese
  2015-03-06 16:08     ` York Sun
  2015-03-10 13:29     ` Fabio Estevam
  0 siblings, 2 replies; 9+ messages in thread
From: Stefan Roese @ 2015-03-06 13:43 UTC (permalink / raw)
  To: u-boot

On 25.02.2015 22:37, York Sun wrote:
> On 01/20/2015 07:16 AM, Volodymyr Riazantsev wrote:
>> Add support of the DDR mode for eSDHC driver.
>> Enable it for i.MX6 SoC family only.
>>
>> Change-Id: Ie27a945c9fe79d044cc886e269b60747f1744116
>> Signed-off-by: Volodymyr Riazantsev <volodymyr.riazantsev@globallogic.com>
>> ---
>
> Applied to u-boot-fsl-qoriq master branch, awaiting upstream.

This patch breaks eMMC on my TQMa6S (i.MX6SOLO). With it I get this 
error upon U-Boot update:

MMC write: dev # 0, block # 2, count 711 ... mmc write failed

With this patch reverted it looks just fine:

MMC write: dev # 0, block # 2, count 711 ... 711 blocks written: OK

Any ideas what might cause this breakage? If this issue can't be solved 
soon I suggest to revert this patch for this release.

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH v2] mmc: fsl_esdhc: Add support for DDR mode
  2015-03-06 13:43   ` Stefan Roese
@ 2015-03-06 16:08     ` York Sun
  2015-03-10 13:29     ` Fabio Estevam
  1 sibling, 0 replies; 9+ messages in thread
From: York Sun @ 2015-03-06 16:08 UTC (permalink / raw)
  To: u-boot

Volodymyr,

On 03/06/2015 05:43 AM, Stefan Roese wrote:
> On 25.02.2015 22:37, York Sun wrote:
>> On 01/20/2015 07:16 AM, Volodymyr Riazantsev wrote:
>>> Add support of the DDR mode for eSDHC driver.
>>> Enable it for i.MX6 SoC family only.
>>>
>>> Change-Id: Ie27a945c9fe79d044cc886e269b60747f1744116
>>> Signed-off-by: Volodymyr Riazantsev <volodymyr.riazantsev@globallogic.com>
>>> ---
>>
>> Applied to u-boot-fsl-qoriq master branch, awaiting upstream.
> 
> This patch breaks eMMC on my TQMa6S (i.MX6SOLO). With it I get this 
> error upon U-Boot update:
> 
> MMC write: dev # 0, block # 2, count 711 ... mmc write failed
> 
> With this patch reverted it looks just fine:
> 
> MMC write: dev # 0, block # 2, count 711 ... 711 blocks written: OK
> 
> Any ideas what might cause this breakage? If this issue can't be solved 
> soon I suggest to revert this patch for this release.

Please look into this issue and post a patch to fix if applicable. Thanks.

York

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH v2] mmc: fsl_esdhc: Add support for DDR mode
  2015-03-06 13:43   ` Stefan Roese
  2015-03-06 16:08     ` York Sun
@ 2015-03-10 13:29     ` Fabio Estevam
  2015-03-10 14:05       ` Stefan Roese
  1 sibling, 1 reply; 9+ messages in thread
From: Fabio Estevam @ 2015-03-10 13:29 UTC (permalink / raw)
  To: u-boot

Hi Stefan,

On Fri, Mar 6, 2015 at 10:43 AM, Stefan Roese <sr@denx.de> wrote:

> This patch breaks eMMC on my TQMa6S (i.MX6SOLO). With it I get this error
> upon U-Boot update:
>
> MMC write: dev # 0, block # 2, count 711 ... mmc write failed
>
> With this patch reverted it looks just fine:
>
> MMC write: dev # 0, block # 2, count 711 ... 711 blocks written: OK
>
> Any ideas what might cause this breakage? If this issue can't be solved soon
> I suggest to revert this patch for this release.

Does this fix from Peng help?
http://lists.denx.de/pipermail/u-boot/2015-March/207632.html

Regards,

Fabio Estevam

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH v2] mmc: fsl_esdhc: Add support for DDR mode
  2015-03-10 13:29     ` Fabio Estevam
@ 2015-03-10 14:05       ` Stefan Roese
  0 siblings, 0 replies; 9+ messages in thread
From: Stefan Roese @ 2015-03-10 14:05 UTC (permalink / raw)
  To: u-boot

Hi Fabio,

On 10.03.2015 14:29, Fabio Estevam wrote:
>> This patch breaks eMMC on my TQMa6S (i.MX6SOLO). With it I get this error
>> upon U-Boot update:
>>
>> MMC write: dev # 0, block # 2, count 711 ... mmc write failed
>>
>> With this patch reverted it looks just fine:
>>
>> MMC write: dev # 0, block # 2, count 711 ... 711 blocks written: OK
>>
>> Any ideas what might cause this breakage? If this issue can't be solved soon
>> I suggest to revert this patch for this release.
>
> Does this fix from Peng help?
> http://lists.denx.de/pipermail/u-boot/2015-March/207632.html

No, it does unfortunately not.

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH v2] mmc: fsl_esdhc: Add support for DDR mode
  2015-01-20 15:16 [U-Boot] [PATCH v2] mmc: fsl_esdhc: Add support for DDR mode Volodymyr Riazantsev
  2015-02-25 21:37 ` York Sun
@ 2015-03-11 23:42 ` Fabio Estevam
  2015-03-11 23:48   ` Volodymyr Riazantsev
  1 sibling, 1 reply; 9+ messages in thread
From: Fabio Estevam @ 2015-03-11 23:42 UTC (permalink / raw)
  To: u-boot

Volodymyr,

On Tue, Jan 20, 2015 at 1:16 PM, Volodymyr Riazantsev
<volodymyr.riazantsev@globallogic.com> wrote:

> diff --git a/include/configs/mx6_common.h b/include/configs/mx6_common.h
> index e0528ce..29b72b2 100644
> --- a/include/configs/mx6_common.h
> +++ b/include/configs/mx6_common.h
> @@ -28,6 +28,8 @@
>  #define CONFIG_SYS_PL310_BASE  L2_PL310_BASE
>  #endif
>
> +#define CONFIG_SYS_FSL_ESDHC_HAS_DDR_MODE

Shouldn't this be defined per board config file instead?

Stefan,

Does your board work if CONFIG_SYS_FSL_ESDHC_HAS_DDR_MODE is removed
from mx6_common.h?

Regards,

Fabio Estevam

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH v2] mmc: fsl_esdhc: Add support for DDR mode
  2015-03-11 23:42 ` Fabio Estevam
@ 2015-03-11 23:48   ` Volodymyr Riazantsev
  2015-03-12  4:55     ` Stefan Roese
  0 siblings, 1 reply; 9+ messages in thread
From: Volodymyr Riazantsev @ 2015-03-11 23:48 UTC (permalink / raw)
  To: u-boot

Fabio,
  Yes, it was too optimistic to enable it for all i.MX6 base devices,
   I'll submit patch for disable it by default.
   Vendors can enable it separately for custom boards.

Stefan,
  Please let me know if you have any results with debug patches.

BR,
?   Volodymyr.
<http://www.globallogic.com/email_disclaimer.txt>

On Wed, Mar 11, 2015 at 7:42 PM, Fabio Estevam <festevam@gmail.com> wrote:

> Volodymyr,
>
> On Tue, Jan 20, 2015 at 1:16 PM, Volodymyr Riazantsev
> <volodymyr.riazantsev@globallogic.com> wrote:
>
> > diff --git a/include/configs/mx6_common.h b/include/configs/mx6_common.h
> > index e0528ce..29b72b2 100644
> > --- a/include/configs/mx6_common.h
> > +++ b/include/configs/mx6_common.h
> > @@ -28,6 +28,8 @@
> >  #define CONFIG_SYS_PL310_BASE  L2_PL310_BASE
> >  #endif
> >
> > +#define CONFIG_SYS_FSL_ESDHC_HAS_DDR_MODE
>
> Shouldn't this be defined per board config file instead?
>
> Stefan,
>
> Does your board work if CONFIG_SYS_FSL_ESDHC_HAS_DDR_MODE is removed
> from mx6_common.h?
>
> Regards,
>
> Fabio Estevam
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH v2] mmc: fsl_esdhc: Add support for DDR mode
  2015-03-11 23:48   ` Volodymyr Riazantsev
@ 2015-03-12  4:55     ` Stefan Roese
  0 siblings, 0 replies; 9+ messages in thread
From: Stefan Roese @ 2015-03-12  4:55 UTC (permalink / raw)
  To: u-boot

Hi Volodymyr,

On 12.03.2015 00:48, Volodymyr Riazantsev wrote:
>    Yes, it was too optimistic to enable it for all i.MX6 base devices,
>     I'll submit patch for disable it by default.
>     Vendors can enable it separately for custom boards.
>
> Stefan,
>    Please let me know if you have any results with debug patches.

I tought that I already send the debug output a few days ago. But here 
again.

Thanks,
Stefan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mmc-trace.log
Type: text/x-log
Size: 11348 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150312/30d69485/attachment.bin>

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-03-12  4:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-20 15:16 [U-Boot] [PATCH v2] mmc: fsl_esdhc: Add support for DDR mode Volodymyr Riazantsev
2015-02-25 21:37 ` York Sun
2015-03-06 13:43   ` Stefan Roese
2015-03-06 16:08     ` York Sun
2015-03-10 13:29     ` Fabio Estevam
2015-03-10 14:05       ` Stefan Roese
2015-03-11 23:42 ` Fabio Estevam
2015-03-11 23:48   ` Volodymyr Riazantsev
2015-03-12  4:55     ` Stefan Roese

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.