75平台下Hynix eMMC电流大处理方法:
在platform下的sd.c中修改如下:
1.增加
extern int mmc_send_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr);
extern int mmc_all_send_cid(struct mmc_host *host, u32 *cid);
typedef enum EMMC_CHIP_TAG{
SAMSUNG_EMMC_CHIP = 0x15,
SANDISK_EMMC_CHIP = 0x45,
HYNIX_EMMC_CHIP = 0x90,
} EMMC_VENDOR_T;
2.msdc_sleep_enter()函数中
mmc_go_idle(mmc); // Infinity: Ask eMMC into open-drain mode下面增加:
// add for hynix emcp chip
if (host->mmc->card->cid.manfid == HYNIX_EMMC_CHIP){
{
u32 l_ocr = mmc->ocr;
u32 l_cid[4];
u32 l_rocr;
u32 l_ret;
// clk freq down, 26kHz for emmc card init
msdc_set_mclk(host, 0, 400000);
//send CMD1, will loop for card's busy state
l_ret = mmc_send_op_cond(mmc, l_ocr | (1 << 30), &l_rocr);
if (l_ret != 0){
ERR_MSG("send cmd1 error while emmc card enter low power state\n"); /* won't happen. */
}
//send CMD2
l_cid[0] = 0;
l_cid[1] = 0;
l_cid[2] = 0;
l_cid[3] = 0;
l_ret = mmc_all_send_cid(mmc, l_cid);
if (l_ret != 0){
ERR_MSG("send cmd2 error while emmc card enter low power state\n"); /* won't happen. */
}
}
}
|