get the emmc capacity in kernel

get the emmc capacity in kernel

4.19\drivers\mmc\core\Mmc.c

static int mmc_decode_ext_csd(struct mmc_card *card, u8 *ext_csd)

if (card->ext_csd.rev >= 2) {

card->ext_csd.sectors =

ext_csd[EXT_CSD_SEC_CNT + 0] << 0 |

ext_csd[EXT_CSD_SEC_CNT + 1] << 8 |

ext_csd[EXT_CSD_SEC_CNT + 2] << 16 |

ext_csd[EXT_CSD_SEC_CNT + 3] << 24;

 

 

funcs to process mmc core request:

struct mmc_host_ops

 

posted @ 2021-04-15 22:43  aspirs  阅读(90)  评论(0编辑  收藏  举报