emmc的上电流程、上电稳定性

2019-04-13 12:55发布

power on流程: <4>[    0.688753] (2)[5:kworker/u:0][] (dump_stack+0x0/0x1c) from [] (msdc_emmc_power+0x98/0x160)
<4>[    0.688789] (2)[5:kworker/u:0][] (msdc_emmc_power+0x0/0x160) from [] (msdc_set_power_mode+0xdc/0x210)
<4>[    0.688836] (2)[5:kworker/u:0][] (msdc_set_power_mode+0x0/0x210) from [] (msdc_ops_set_ios+0x88/0xb8c)
<4>[    0.688895] (2)[5:kworker/u:0][] (msdc_ops_set_ios+0x0/0xb8c) from [] (mmc_power_up+0x74/0xa8)
<4>[    0.688940] (2)[5:kworker/u:0][] (mmc_power_up+0x0/0xa8) from [] (mmc_rescan+0x234/0x2f4)
<4>[    0.689020] (2)[5:kworker/u:0][] (mmc_rescan+0x0/0x2f4) from [] (process_one_work+0x11c/0x3a4)


/mmc/core/core.c  仔细查看power up过程中总共delay 30ms ,delay的时间是怎么确定的呢? static void mmc_power_up(struct mmc_host *host)
{
int bit;

mmc_host_clk_hold(host);
/* If ocr is set, we use it */
if (host->ocr)
bit = ffs(host->ocr) - 1;
else
bit = fls(host->ocr_avail) - 1;
host->ios.vdd = bit;
if (mmc_host_is_spi(host))
host->ios.chip_select = MMC_CS_HIGH;
else
host->ios.chip_select = MMC_CS_DONTCARE;
host->ios.bus_mode = MMC_BUSMODE_PUSHPULL;
host->ios.power_mode = MMC_POWER_UP;
host->ios.bus_width = MMC_BUS_WIDTH_1;
host->ios.timing = MMC_TIMING_LEGACY;
mmc_set_ios(host);    // emmc driver 上电,mtk添加delay 10ms
/*
* This delay should be sufficient to allow the power supply
* to reach the minimum voltage.
*/
mmc_delay(10);    //delay 10ms
host->ios.clock = host->f_init;
host->ios.power_mode = MMC_POWER_ON;
mmc_set_ios(host);
/*
* This delay must be at least 74 clock sizes, or 1 ms, or the
* time required to reach a stable voltage.
*/
mmc_delay(10);   //delay 10ms


mmc_host_clk_release(host);
}


mtk emmc resume流程: <4>[   38.631520] 1)[] (msdc_emmc_power+0x0/0x160) from [] (msdc_pm+0x3f0/0x6b4)
<4>[   38.631549] 1)[] (msdc_pm+0x0/0x6b4) from [] (msdc_drv_resume+0x50/0x74)
<4>[   38.631582] 1)[] (msdc_drv_resume+0x0/0x74) from [] (platform_pm_resume+0x34/0x58)
<4>[   38.631602] 1)[] (platform_pm_resume+0x0/0x58) from [] (dpm_run_callback.isra.13+0x34/0x6c)
<4>[   38.631656] 1)[] (device_resume+0x0/0x404) from [] (dpm_resume+0x104/0x21c)
标准emmc resume流程应该是emmc driver resume 调用emmc core driver 的resume函数:mmc_resume_bus 。
不知道mtk为什么要这么搞
mmc_delay(10);