Patchwork [U-Boot,1/1] fsl_esdhc: Fix multi-block read restriction on i.MX53 eSDHCv2

login
register
mail settings
Submitter Jason Liu
Date March 22, 2011, 11:32 a.m.
Message ID <1300793551-12645-1-git-send-email-jason.hui@linaro.org>
Download mbox | patch
Permalink /patch/87893/
State Accepted
Commit 4571de33ee99d746f114d45b78283782adb01a3f
Delegated to: Andy Fleming
Headers show

Comments

Jason Liu - March 22, 2011, 11:32 a.m.
For freescale i.MX53 eSDHCv2, when using CMD12, cmdtype need
to be set to ABORT, otherwise, next read command will hang.

This is a software Software Restrictions in i.MX53 reference manual:

29.7.8 Multi-block Read
For pre-defined multi-block read operation, that is,the number of blocks
to read has been defined by previous CMD23 for MMC, or pre-defined number
of blocks in CMD53 for SDIO/SDCombo,or whatever multi-block read without
abort command at card side, an abort command, either automatic or manual
CMD12/CMD52, is still required by ESDHC after the pre-defined number of
blocks are done, to drive the internal state machine to idle mode. In this
case, the card may not respond to this extra abort command and ESDHC will
get Response Timeout.  It is recommended to manually send an abort command
with RSPTYP[1:0] both bits cleared.

Signed-off-by: Jason Liu <jason.hui@linaro.org>
---
 drivers/mmc/fsl_esdhc.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
Jason Liu - April 11, 2011, 4:43 a.m.
Hi, Kumar Gala

2011/3/22 Jason Liu <jason.hui@linaro.org>:
> For freescale i.MX53 eSDHCv2, when using CMD12, cmdtype need
> to be set to ABORT, otherwise, next read command will hang.
>
> This is a software Software Restrictions in i.MX53 reference manual:
>
> 29.7.8 Multi-block Read
> For pre-defined multi-block read operation, that is,the number of blocks
> to read has been defined by previous CMD23 for MMC, or pre-defined number
> of blocks in CMD53 for SDIO/SDCombo,or whatever multi-block read without
> abort command at card side, an abort command, either automatic or manual
> CMD12/CMD52, is still required by ESDHC after the pre-defined number of
> blocks are done, to drive the internal state machine to idle mode. In this
> case, the card may not respond to this extra abort command and ESDHC will
> get Response Timeout.  It is recommended to manually send an abort command
> with RSPTYP[1:0] both bits cleared.
>
> Signed-off-by: Jason Liu <jason.hui@linaro.org>
> ---
>  drivers/mmc/fsl_esdhc.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
> index f3cccbe..5c3618b 100644
> --- a/drivers/mmc/fsl_esdhc.c
> +++ b/drivers/mmc/fsl_esdhc.c
> @@ -99,6 +99,10 @@ uint esdhc_xfertyp(struct mmc_cmd *cmd, struct mmc_data *data)
>        else if (cmd->resp_type & MMC_RSP_PRESENT)
>                xfertyp |= XFERTYP_RSPTYP_48;
>
> +#ifdef CONFIG_MX53
> +       if (cmd->cmdidx == MMC_CMD_STOP_TRANSMISSION)
> +               xfertyp |= XFERTYP_CMDTYP_ABORT;
> +#endif
>        return XFERTYP_CMD(cmd->cmdidx) | xfertyp;
>  }

Ping, Any comments?

>
> --
> 1.7.1
>
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
Kumar Gala - April 11, 2011, 5:57 a.m.
On Apr 10, 2011, at 11:43 PM, Jason Liu wrote:

> Hi, Kumar Gala
> 
> 2011/3/22 Jason Liu <jason.hui@linaro.org>:
>> For freescale i.MX53 eSDHCv2, when using CMD12, cmdtype need
>> to be set to ABORT, otherwise, next read command will hang.
>> 
>> This is a software Software Restrictions in i.MX53 reference manual:
>> 
>> 29.7.8 Multi-block Read
>> For pre-defined multi-block read operation, that is,the number of blocks
>> to read has been defined by previous CMD23 for MMC, or pre-defined number
>> of blocks in CMD53 for SDIO/SDCombo,or whatever multi-block read without
>> abort command at card side, an abort command, either automatic or manual
>> CMD12/CMD52, is still required by ESDHC after the pre-defined number of
>> blocks are done, to drive the internal state machine to idle mode. In this
>> case, the card may not respond to this extra abort command and ESDHC will
>> get Response Timeout.  It is recommended to manually send an abort command
>> with RSPTYP[1:0] both bits cleared.
>> 
>> Signed-off-by: Jason Liu <jason.hui@linaro.org>
>> ---
>>  drivers/mmc/fsl_esdhc.c |    4 ++++
>>  1 files changed, 4 insertions(+), 0 deletions(-)
>> 
>> diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
>> index f3cccbe..5c3618b 100644
>> --- a/drivers/mmc/fsl_esdhc.c
>> +++ b/drivers/mmc/fsl_esdhc.c
>> @@ -99,6 +99,10 @@ uint esdhc_xfertyp(struct mmc_cmd *cmd, struct mmc_data *data)
>>        else if (cmd->resp_type & MMC_RSP_PRESENT)
>>                xfertyp |= XFERTYP_RSPTYP_48;
>> 
>> +#ifdef CONFIG_MX53
>> +       if (cmd->cmdidx == MMC_CMD_STOP_TRANSMISSION)
>> +               xfertyp |= XFERTYP_CMDTYP_ABORT;
>> +#endif
>>        return XFERTYP_CMD(cmd->cmdidx) | xfertyp;
>>  }
> 
> Ping, Any comments?

No issues as this is protected with a CONFIG_MX53 so will not impact an PPC SoCs

- k
Jason Liu - April 11, 2011, 6:32 a.m.
2011/4/11 Kumar Gala <galak@kernel.crashing.org>:
>
> On Apr 10, 2011, at 11:43 PM, Jason Liu wrote:
>
>> Hi, Kumar Gala
>>
>> 2011/3/22 Jason Liu <jason.hui@linaro.org>:
>>> For freescale i.MX53 eSDHCv2, when using CMD12, cmdtype need
>>> to be set to ABORT, otherwise, next read command will hang.
>>>
>>> This is a software Software Restrictions in i.MX53 reference manual:
>>>
>>> 29.7.8 Multi-block Read
>>> For pre-defined multi-block read operation, that is,the number of blocks
>>> to read has been defined by previous CMD23 for MMC, or pre-defined number
>>> of blocks in CMD53 for SDIO/SDCombo,or whatever multi-block read without
>>> abort command at card side, an abort command, either automatic or manual
>>> CMD12/CMD52, is still required by ESDHC after the pre-defined number of
>>> blocks are done, to drive the internal state machine to idle mode. In this
>>> case, the card may not respond to this extra abort command and ESDHC will
>>> get Response Timeout.  It is recommended to manually send an abort command
>>> with RSPTYP[1:0] both bits cleared.
>>>
>>> Signed-off-by: Jason Liu <jason.hui@linaro.org>
>>> ---
>>>  drivers/mmc/fsl_esdhc.c |    4 ++++
>>>  1 files changed, 4 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
>>> index f3cccbe..5c3618b 100644
>>> --- a/drivers/mmc/fsl_esdhc.c
>>> +++ b/drivers/mmc/fsl_esdhc.c
>>> @@ -99,6 +99,10 @@ uint esdhc_xfertyp(struct mmc_cmd *cmd, struct mmc_data *data)
>>>        else if (cmd->resp_type & MMC_RSP_PRESENT)
>>>                xfertyp |= XFERTYP_RSPTYP_48;
>>>
>>> +#ifdef CONFIG_MX53
>>> +       if (cmd->cmdidx == MMC_CMD_STOP_TRANSMISSION)
>>> +               xfertyp |= XFERTYP_CMDTYP_ABORT;
>>> +#endif
>>>        return XFERTYP_CMD(cmd->cmdidx) | xfertyp;
>>>  }
>>
>> Ping, Any comments?
>
> No issues as this is protected with a CONFIG_MX53 so will not impact an PPC SoCs

Thanks. Kumar,

Who will pick up this patch?

Jason

>
> - k
Wolfgang Denk - April 11, 2011, 10:05 a.m.
Dear Jason Liu,

In message <BANLkTimA8U7dJdBb0sb+An0wSrbWRm5wmA@mail.gmail.com> you wrote:
>
> >>> --- a/drivers/mmc/fsl_esdhc.c
> >>> +++ b/drivers/mmc/fsl_esdhc.c
...
> 
> Who will pick up this patch?

It's MMC code, so that would be MMC custodian.

Maybe you should put the responsible custodian on Cc.

Best regards,

Wolfgang Denk
Jason Liu - April 12, 2011, 9:21 a.m.
Hi, Wolfgang,

2011/4/11 Wolfgang Denk <wd@denx.de>:
> Dear Jason Liu,
>
> In message <BANLkTimA8U7dJdBb0sb+An0wSrbWRm5wmA@mail.gmail.com> you wrote:
>>
>> >>> --- a/drivers/mmc/fsl_esdhc.c
>> >>> +++ b/drivers/mmc/fsl_esdhc.c
> ...
>>
>> Who will pick up this patch?
>
> It's MMC code, so that would be MMC custodian.

From http://www.denx.de/wiki/U-Boot/Custodians:
MMC drivers	 Andy Fleming	 afleming {AT} gmail {DOT} com	u-boot-mmc

So, Andy, could you please pick this patch up. Thanks,

>
> Maybe you should put the responsible custodian on Cc.

Yes,  Thanks,

BR,
Jason

>
> Best regards,
>
> Wolfgang Denk
>
> --
> DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
> All men should freely use those seven words which have the  power  to
> make any marriage run smoothly: You know dear, you may be right.
>

Patch

diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
index f3cccbe..5c3618b 100644
--- a/drivers/mmc/fsl_esdhc.c
+++ b/drivers/mmc/fsl_esdhc.c
@@ -99,6 +99,10 @@  uint esdhc_xfertyp(struct mmc_cmd *cmd, struct mmc_data *data)
 	else if (cmd->resp_type & MMC_RSP_PRESENT)
 		xfertyp |= XFERTYP_RSPTYP_48;
 
+#ifdef CONFIG_MX53
+	if (cmd->cmdidx == MMC_CMD_STOP_TRANSMISSION)
+		xfertyp |= XFERTYP_CMDTYP_ABORT;
+#endif
 	return XFERTYP_CMD(cmd->cmdidx) | xfertyp;
 }