eMMC errors on RK3588 (rock5b)

Jonas Karlman jonas at kwiboo.se
Mon May 29 17:27:59 CEST 2023


Hi Eugen,

On 2023-05-25 11:23, Eugen Hristev wrote:
> Hi Jonas,
> 
> I tried some basic eMMC read/write commands, and in my setup with 
> rock5b, it fails at single/multiple block read/write , even if 
> sometimes, the initial read works fine.
> 
> Here is some log :
> 
> => mmc read 0x50000000 64 1
[snip]
> MMC read: dev # 0, block # 100, count 1 ...
> 1 blocks read: OK
> => mmc write 0x50000000 64 1
> MMC write: dev # 0, block # 100, count 1 ... 
[snip]
> 0 blocks written: ERROR
> => mmc write 0x50000000 64 5
> MMC write: dev # 0, block # 100, count 5 ...
[snip]
> 0 blocks written: ERROR
> => mmc read 0x50000000 64 5
> MMC read: dev # 0, block # 100, count 5 ...
[snip]
> 0 blocks read: ERROR
> => mmc read 0x50000000 64 1
[snip]
> MMC read: dev # 0, block # 100, count 1 ...
> 0 blocks read: ERROR
> =>
> 
> So now after this attempt, there is a timeout when reading too.
> 
> Can you try to reproduce this on your setup as well ?

I was able to reproduce similar issue on rk356x, did not test on rk3588
yet. Also going to try similar write commands on the rk3399 (arasan)
compatible of the rk sdhci driver, guess both rk35xx (dwc) compatible is
affected.

Something odd that I noticed was that write sometime reported OK when
a read command for same blocks was issued, e.g. something similar worked
in some of my testing:

Select eMMC device to reset state:
=> mmc dev 0

Read 256KiB (TPL+SPL) from sector 64 to @512 MiB DRAM:
=> mmc read 20000000 40 40000

Erase 256KiB from sector 64:
=> mmc erase 40 40000

Write 256KiB (TPL+SPL) from @512 MiB DRAM to sector 64:
=> mmc write 20000000 40 40000

After something fails the use of "mmc dev 0" could be used to reset into
a working read state. Some retry/reset handling may be needed in driver
to fully support write commands.

A quick peek at vendor u-boot: rk u-boot include some form of retry
logic for write and hardkernel u-boot implement some sort of sw reset.

Regards,
Jonas

> 
> P.S. booting from eMMC works fine. When I am trying this, I am booting 
> from the eMMC.
> 
> Thanks !



More information about the U-Boot mailing list