diff mbox

[U-Boot] mmc erase fails from U-Boot command line

Message ID 566216D9.4030202@nelint.com
State RFC
Headers show

Commit Message

Eric Nelson Dec. 4, 2015, 10:42 p.m. UTC
Hi all,

On 12/04/2015 09:35 AM, Eric Nelson wrote:
> Hi Fabio,
> 
> On 12/02/2015 12:53 PM, Fabio Estevam wrote:
>> On Wed, Dec 2, 2015 at 5:28 PM, Eric Nelson <eric@nelint.com> wrote:
>>
> ...
>>>
>>> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
>>> index 53084a7..8f5d9e1 100644
>>> --- a/drivers/mmc/mmc.c
>>> +++ b/drivers/mmc/mmc.c
>>> @@ -105,6 +105,9 @@ int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd
>>> *cmd, struct mmc_data *data)
>>>  #else
>>>         ret = mmc->cfg->ops->send_cmd(mmc, cmd, data);
>>>  #endif
>>> +       if (ret)
>>> +               printf("error %d from CMD_SEND:%d\n", ret, cmd->cmdidx);
>>> +
>>>         return ret;
>>
>> Applying this change on top of head I get:
>>
>> => mmc erase 4000 1000
>>
>> MMC erase: dev # 2, block # 16384, count 4096 ... Timeout waiting for DAT0 to go
>>  high!
>> error -19 from CMD_SEND:38
>> mmc erase failed
>> 0 blocks erased: ERROR
> 
> How easy is this for you to reproduce?
> 
> I'm only seeing the error sporadically, which makes it difficult to
> test.
> 

I've figured out a way to repeat this on my machine.

If I write 0xff's to the eMMC blocks, then issue an erase for the same,
I get the problem with each MMC_ERASE command.

I've also found something that fixes the issue in my testing.

Changing SECURE_ERASE to 0 from 0x80000000 in include/mmc.h allows
things to function for me.

Page 115 of the JEDEC eMMC 4.5 spec says that bit 31 is obsolete and
should be zero:
	http://www.jedec.org/sites/default/files/docs/jesd84-B45.pdf

Hector and Fabio, can you test that change?

Please advise,


Eric

U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Comments

Fabio Estevam Dec. 5, 2015, 12:19 a.m. UTC | #1
Hi Eric,

On Fri, Dec 4, 2015 at 8:42 PM, Eric Nelson <eric@nelint.com> wrote:

> I've figured out a way to repeat this on my machine.
>
> If I write 0xff's to the eMMC blocks, then issue an erase for the same,
> I get the problem with each MMC_ERASE command.
>
> I've also found something that fixes the issue in my testing.
>
> Changing SECURE_ERASE to 0 from 0x80000000 in include/mmc.h allows
> things to function for me.
>
> Page 115 of the JEDEC eMMC 4.5 spec says that bit 31 is obsolete and
> should be zero:
>         http://www.jedec.org/sites/default/files/docs/jesd84-B45.pdf
>
> Hector and Fabio, can you test that change?
>
> Please advise,

That sounds promising. I will test it on Monday when I get access to a
revC4 board.

Thanks a lot!
Fabio Estevam Dec. 7, 2015, 12:21 a.m. UTC | #2
Hi Eric,

On Fri, Dec 4, 2015 at 8:42 PM, Eric Nelson <eric@nelint.com> wrote:

> I've figured out a way to repeat this on my machine.
>
> If I write 0xff's to the eMMC blocks, then issue an erase for the same,
> I get the problem with each MMC_ERASE command.
>
> I've also found something that fixes the issue in my testing.
>
> Changing SECURE_ERASE to 0 from 0x80000000 in include/mmc.h allows
> things to function for me.
>
> Page 115 of the JEDEC eMMC 4.5 spec says that bit 31 is obsolete and
> should be zero:
>         http://www.jedec.org/sites/default/files/docs/jesd84-B45.pdf
>
> Hector and Fabio, can you test that change?

Managed to get access to a revC2 board and tested your change.

I am happy to say that 'mmc erase' works now :-)

Good job, Eric!

When you send a formal patch then you can add:

Tested-by: Fabio Estevam <fabio.estevam@freescale.com>

Thanks!
Eric Nelson Dec. 7, 2015, 2:36 p.m. UTC | #3
Hi Fabio,

On 12/06/2015 05:21 PM, Fabio Estevam wrote:
> Hi Eric,
> 
> On Fri, Dec 4, 2015 at 8:42 PM, Eric Nelson <eric@nelint.com> wrote:
> 
>> I've figured out a way to repeat this on my machine.
>>
>> If I write 0xff's to the eMMC blocks, then issue an erase for the same,
>> I get the problem with each MMC_ERASE command.
>>
>> I've also found something that fixes the issue in my testing.
>>
>> Changing SECURE_ERASE to 0 from 0x80000000 in include/mmc.h allows
>> things to function for me.
>>
>> Page 115 of the JEDEC eMMC 4.5 spec says that bit 31 is obsolete and
>> should be zero:
>>         http://www.jedec.org/sites/default/files/docs/jesd84-B45.pdf
>>
>> Hector and Fabio, can you test that change?
> 
> Managed to get access to a revC2 board and tested your change.
> 
> I am happy to say that 'mmc erase' works now :-)
> 

Glad to hear it.

> Good job, Eric!
> 
> When you send a formal patch then you can add:
> 
> Tested-by: Fabio Estevam <fabio.estevam@freescale.com>
> 

Will do.
diff mbox

Patch

diff --git a/include/mmc.h b/include/mmc.h
index cda9a19..b1528d4 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -121,7 +121,7 @@ 
 #define OCR_VOLTAGE_MASK       0x007FFF80
 #define OCR_ACCESS_MODE                0x60000000

-#define SECURE_ERASE           0x80000000
+#define SECURE_ERASE           0x00000000

_______________________________________________
U-Boot mailing list