
These patches are addressing two issues that I had after activating enhanced user area feature for a 4GB card so the capacity was less than 2 GB afterwards.
1. The capacity for a high density device is calculated in a wrong way. I was not able to find any hints for this implementation in JEDEC 4.41. Anyhow, if we have ext_csd revision >= 2 we can use SEC_COUNT field to calculate the size.
2. If we have a partitioned device, e.g. enhanced user area, the ERASE_GROUP_DEF bit in ext_csd shall be set (see JEDEC 4.41, chapter 7.2.3 Configure partitions). This bit defaults to "0" on power on.
Oliver Metz (2): When using a high capacity card with a density less than 2 GB a wrong size is shown. According to JEDEC 4.41 there is no differentiation for C_SIZE register between low and high capacity cards EXT_CSD_ERASE_GROUP_DEF is lost every time after a reset or reboot. Set it if device has enhanced partitions.
drivers/mmc/mmc.c | 49 +++++++++++++++++++++++-------------------------- include/mmc.h | 2 ++ 2 files changed, 25 insertions(+), 26 deletions(-)