[U-Boot] generic mmc bug in reading sd card capacity

Romain Izard romain.izard.pro at gmail.com
Tue Nov 6 09:41:06 CET 2012


On 2012-11-02, victor <victor at keyasic.com> wrote:
> Hi All,
>
> Accord to SD spec 2.0, the formula to find out sd card capacity is:
>
> memory capacity = (C_SIZE+1) * 512K byte 
>  	and
> C_SIZE  is from CSD [69:48]
>
> Thus, the code in generic mmc is wrong for the high capacity sd card. My
> patch is below.
>

We should be careful about the fact that this only works for SD cards.
The size parameter is handled differently on MMC devices larger than
2 GiB. What do you think of the following patch:

(Compile tested only, I do not have a board available for testing right now)

8<----------------------------------------------------------------------



More information about the U-Boot mailing list