return (mmc_get_op_cond(mmc) < 0) ? 0 : 1; } int checkboard(void) { switch (board_type()) { @@ -579,6 +588,10 @@ int board_late_init(void) if (is_rev_15_som()) env_set("som_rev", "V15"); if (has_emmc()) env_set("has_emmc", "yes"); #endif return 0; 0...
err=mmc_send_app_op_cond(host,0, &ocr);if(err)returnerr; mmc_attach_bus(host,&mmc_sd_ops);if(host->ocr_avail_sd) host->ocr_avail = host->ocr_avail_sd;/** We need to get OCR a different way for SPI.*/if(mmc_host_is_spi(host)) { mmc_go_idle(host); err= mmc_spi_re...
b). mmc_go_idle(host):发送CMD0,由于改变了OCR的值,需要让卡重新回到idle状态 c).mmc_send_op_cond(host, ocr| (1<<30), &rocr):发送CMD1,设置访问mode,前一个CMD1是获取ocr值,此处设置为sector模式???,进入ready状态 d).mmc_all_send_cid:发送CMD2,获取CID寄存器的值,进入identification状态 e)....
虽然进入到了Idle State,但是上电复位过程并不一定完成了,这主要靠读取OCR的busy位来判断,而流程归结为下一步。 mmc_send_op_cond 发送CMD1指令,SEND_OP_COND 这里会设置card的工作电压寄存器OCR,并且通过busy位(bit31)来判断card的上电复位过程是否完成,如果没有完成的话需要重复发送。 完成之后,mmc card进入re...
mmc_send_op_cond 发送CMD1指令,SEND_OP_COND 这里会设置card的工作电压寄存器OCR,并且通过busy位(bit31)来判断card的上电复位过程是否完成,如果没有完成的话需要重复发送。 完成之后,mmc card进入ready state。 mmc_all_send_cid 这里会发送CMD2指令,ALL_SEND_CID 广播指令,使card回复对应的CID寄存器的值。
a. 发送CMD1指令mmc_send_op_cond() b. 设置mmc卡的总线操作集mmc_attach_bus(),传入struct mmc_bus_ops类型的实现mmc_ops。 c. 选择一个card和host都支持的最低工作电压mmc_select_voltage() d. 初始化card使其进入工作状态mmc_init_card()
mmc_sd_get_cid(host, ocr, cid, &rocr); //mmc/core/sd.c mmc_go_idle(host); //命令号:8 (为兼容SD2.0,发命令41之前必须发命令8) mmc_send_if_cond(host, ocr); //命令号:41 mmc_send_app_op_cond(host, ocr, rocr); mmc_all_send_cid(host, cid); ...
mmc_send_if_cond(host, host->ocr_avail); err = mmc_send_app_op_cond(host, 0, &ocr); if (err == MMC_ERR_NONE) { if (mmc_attach_sd(host, ocr)) mmc_power_off(host); } else { //检测MMC卡 /* * If we fail to detect any SD cards then try ...
mmc_claim_host(host);/* try SDMEM (but not MMC) even if SDIO is broken */if(mmc_send_app_op_cond(host,0, &ocr))gotoout_fail;if(mmc_attach_sd(host, ocr)) mmc_power_off(host); }gotoout; }/* * ...then normal SD... ...
err = mmc_send_io_op_cond(host, 0, &ocr); if (!err) { if (mmc_attach_sdio(host, ocr)) { ... 在SD: /* * ...then normal SD... */ err = mmc_send_app_op_cond(host, 0, &ocr); if (!err) { if (mmc_attach_sd(host, ocr)) ...