*/err =mmc_send_io_op_cond(host,0, &ocr);if(!err) {if(mmc_attach_sdio(host, ocr)) mmc_power_off(host); extend_wakelock =1;gotoout; }/* * ...then normal SD... */err = mmc_send_app_op_cond(host,0, &ocr);if(!err) {if(mmc_attach_sd(host, ocr)) mmc_power_off(hos...
发送CMD1指令,SEND_OP_COND 这里会设置card的工作电压寄存器OCR,并且通过busy位(bit31)来判断card的上电复位过程是否完成,如果没有完成的话需要重复发送。 完成之后,mmc card进入ready state。 mmc_all_send_cid 这里会发送CMD2指令,ALL_SEND_CID 广播指令,使card回复对应的CID寄存器的值。在这里就相应获得了CID...
mmc_power_off(host);gotoout; }/* * ...and finally MMC. *///判断是否为mmc卡err = mmc_send_op_cond(host,0, &ocr);if(!err) {if(mmc_attach_mmc(host, ocr)) mmc_power_off(host);gotoout; } 还是以sd卡为例: mmc_send_app_op_cond主要工作是: 发送命令41(该命令是sd支持的,但mmc...
mmc_send_if_cond(host, ocr); //命令号:41 mmc_send_app_op_cond(host, ocr, rocr); mmc_all_send_cid(host, cid); if (host->ops->init_card) host->ops->init_card(host, card); mmc_send_relative_addr(host, &card->rca); //mmc/core/sd_ops.c mmc_sd_get_csd(host, card); /...
mmc_send_app_op_cond 发送CMD55(MMC_APP_CMD)+ACMD41(SD_APP_OP_COND),用来识别满足host所提供电压的卡。 根据SD4.0协议,CMD55表示下个命令是特定应用命令,而不是标准命令,后面需要跟着发送特定应用命令(如ACMD41)。 后续过程待补充... === 参考文章: https://blog.csdn.net/weixin_38878510/article/det...
示例6: mmc_send_app_op_cond ▲点赞 1▼ intmmc_send_app_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr){structmmc_commandcmd;inti, err =0; BUG_ON(!host);memset(&cmd,0,sizeof(struct mmc_command)); cmd.opcode = SD_APP_OP_COND; ...
CMD1的参数可以根据OCR寄存器的位定义来填写,命令的类型为bcr,此时CMD1的命令缩写为SEND_OP_COND,命令响应为R3,命令功能为在idle状态下要求eMMC设备通过R3响应返回它的OCR寄存器的值。 如果eMMC设备不支持boot operation模式,或者eMMC设备仅仅支持eMMC 4.2或者更早的版本,或者BOOT_PARTITION_ENABLE位被清除,在power-on...
mmci为ARM的sd/mmc主控制器的驱动. 并且这个控制器是挂接在ARM的amba总线之下的, 所以驱动的注册会用到amba总线的一些函数. 1).驱动的注册. static struct amba_driver mmci_driver = { .drv = { .name = DRIVER_NAME, }, .probe = mmci_probe, ...
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)) ...
*/err = mmc_send_op_cond(host, 0, &ocr);if (!err) {if (mmc_attach_mmc(host, ocr))mmc_power_off(host);goto out;}mmc_release_host(host);mmc_power_off(host);out:if (host->caps & MMC_CAP_NEEDS_POLL)mmc_schedule_delayed_work(&host->detect, HZ);...