免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1442 | 回复: 0
打印 上一主题 下一主题

QualComm 8x50 上MMC host controller 硬件检测分析 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-10-10 15:28 |只看该作者 |倒序浏览
in MMC host controller driver initialization process, msmsdcc_probe() function will be called. but in fact, kernel has not detected the real MMC host controller hardware till now, so it should has detect process.
there are two process for detect mechanism.
one is for "MMC / SD / SDIO card hardware is already ready while the kernel does initial process". some MMC / SD / SDIO card hardware is jointed to the host controller by hardware design, for example, WIFI chipset which uses SDIO interface.
another is for "MMC / SD / SDIO card hardware is not inserted while the kernel does initial process". one example for it is MMC / SD storage card, the card may be inserted at any time according to customer's request.
1. now let us analysis these two processes.
1.1  MMC / SD / SDIO card hardware is ready while the kernel does initial process.
as we know, msmsdcc_probe() function will be called in MMC host controller driver initialization.
this function do detect process in fact. the below the process.
msmsdcc_probe() -> mmc_add_host() -> mmc_start_host() -> mmc_detect_change() -> (&host->detect) -> mmc_rescan().
we will analysis mmc_rescan() function after a while.
1.2 MMC / SD / SDIO card hardware is not inserted while the kernel does initial process.
irq is used for this kind of detect process.
in msmsdcc_probe() function, it will register a irq for the card detect process.
        ret = request_irq(plat->status_irq,                  msmsdcc_platform_status_irq,                  IRQF_SHARED | plat->irq_flags,                  DRIVER_NAME " (slot)",                  host);
so, the detect process is as below:
msmsdcc_platform_status_irq() -> msmsdcc_check_status() -> mmc_detect_change() ->  -> (&host->detect) -> mmc_rescan()
now it is time to analysis mmc_rescan() function which does real detect process.
2. mmc rescan() function process analysis.
it is in driver/mmc/core/core.c
a. scan SDIO device firstly,
mmc_send_io_op_cond()  , it sends CMD5 command to detect SDIO device.
b. then scan SD device.
mmc_send_app_op_cond(), it sends CMD41 command to detect SD device.
c. scan MMC device at last.
mmc_send_op_cond(), it sends CMD1 command to detect MMC device.
for example, if mmc_send_io_op_cond() returns ok, mmc_attach_sdio() function will be called.
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/103613/showart_2067154.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP