s5pc110: mmc: calculated mmc0 capacity
[kernel/u-boot.git] / drivers / mmc / mmc.c
index b69ce15..26f6995 100644 (file)
@@ -395,6 +395,10 @@ int mmc_change_freq(struct mmc *mmc)
        if (ext_csd[212] || ext_csd[213] || ext_csd[214] || ext_csd[215])
                mmc->high_capacity = 1;
 
+       if (mmc->high_capacity)
+               mmc->capacity = (((ext_csd[215] << 24) | (ext_csd[214] << 16) |
+                       (ext_csd[213] << 8) | (ext_csd[21])) / (2 * 1024));
+
        cardtype = ext_csd[196] & 0xf;
 
        err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_HS_TIMING, 1);