diff options
author | Diego Santa Cruz <Diego.SantaCruz@spinetix.com> | 2014-12-23 10:50:22 +0100 |
---|---|---|
committer | Pantelis Antoniou <pantelis.antoniou@konsulko.com> | 2015-01-19 17:02:29 +0200 |
commit | a7f852b6885dc7b89741b1e76921e160b9c9877b (patch) | |
tree | 4df36b554ec37f5eaf625265d739ef1296ba43d2 /drivers/mmc | |
parent | f8e89d67166bbcd34a3144b8001b3819b58d02c9 (diff) | |
download | u-boot-imx-a7f852b6885dc7b89741b1e76921e160b9c9877b.zip u-boot-imx-a7f852b6885dc7b89741b1e76921e160b9c9877b.tar.gz u-boot-imx-a7f852b6885dc7b89741b1e76921e160b9c9877b.tar.bz2 |
mmc: read the size of eMMC enhanced user data area
This modification reads the size of the eMMC enhanced user data area
upon initialization of an mmc device, it will be used later by
mmcinfo.
Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/mmc.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 86c4db9..f07505f 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -1031,6 +1031,21 @@ static int mmc_startup(struct mmc *mmc) has_parts = true; } + mmc->enh_user_size = + (ext_csd[EXT_CSD_ENH_SIZE_MULT+2] << 16) + + (ext_csd[EXT_CSD_ENH_SIZE_MULT+1] << 8) + + ext_csd[EXT_CSD_ENH_SIZE_MULT]; + mmc->enh_user_size *= ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE]; + mmc->enh_user_size *= ext_csd[EXT_CSD_HC_WP_GRP_SIZE]; + mmc->enh_user_size <<= 19; + mmc->enh_user_start = + (ext_csd[EXT_CSD_ENH_START_ADDR+3] << 24) + + (ext_csd[EXT_CSD_ENH_START_ADDR+2] << 16) + + (ext_csd[EXT_CSD_ENH_START_ADDR+1] << 8) + + ext_csd[EXT_CSD_ENH_START_ADDR]; + if (mmc->high_capacity) + mmc->enh_user_start <<= 9; + /* * Host needs to enable ERASE_GRP_DEF bit if device is * partitioned. This bit will be lost every time after a reset |