*/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...
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_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_attach_sd函数: /** Starting point for SD card init.*/intmmc_attach_sd(structmmc_host *host) {interr; u32 ocr, rocr; WARN_ON(!host->claimed); 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...
a. 发送CMD41指令,(sd卡支持该指令,但mmc卡不支持,所以可以以此区分)mmc_send_app_op_cond() b. 设置sdio卡的总线操作集mmc_attach_bus(),传入struct mmc_bus_ops类型的实现mmc_sd_ops。 c. 设置合适的电压mmc_select_voltage() d. 调用mmc_sd_init_card()(探测和初始化),获取mmc card的csd、cid,并...
示例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; ...
[1.536088] mmc1:MMC_attach_MMC:MMC_SEND_OP_COND 失败。 [1.541428] mmc1:MMC_rescan_try_freq:MMC_attach_bus 失败。 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
mmci为ARM的sd/mmc主控制器的驱动. 并且这个控制器是挂接在ARM的amba总线之下的, 所以驱动的注册会用到amba总线的一些函数. 1).驱动的注册. static struct amba_driver mmci_driver = { .drv = { .name = DRIVER_NAME, }, .probe = mmci_probe, ...
int mmc_send_if_cond(struct mmc_host*host, u32 ocr) { structmmc_command cmd; interr; staticconst u8 test_pattern = 0xAA; u8result_pattern; /* * To support SD 2.0 cards, we must alwaysinvoke SD_SEND_IF_COND * before SD_APP_OP_COND. This command willharmlessly fail for ...
*/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);...