O、 在sdio_add_func的时候,会触发设置function的block size;
这里只是初始化设置function的block size,在sdio设备驱动实际运行时,还会重新设置该值。
cmd,Arg:0x80022040, Cmd:52 /* 写寄存器110,function1 fbr的0x10 */
cmd resp, 0:0x1040, 1:0x34
cmd,Arg:0x80022200, Cmd:52 /* 写寄存器110,function1 fbr的0x11 */
cmd resp, 0:0x1000, 1:0x34
上面命令设置function1的block size大小为64byte;
cmd,Arg:0x80042000, Cmd:52 /* 写寄存器210,function2 fbr的0x10 */
cmd resp, 0:0x1000, 1:0x34
cmd,Arg:0x80042202, Cmd:52 /* 写寄存器210,function2 fbr的0x10 */
cmd resp, 0:0x1002, 1:0x34
上面命令设置function2的block size大小为512byte;
到此,linux内核中整个sdio设备的扫描就完成了,如果已经注册了对应sdio id的驱动,就会调用驱动的probe进行设备的初始化。
从整个扫描过程看,没有使用到data线,所以如果sdio设备初始化的时候,能检测到设备,但初始化失败,很大可能那就是data线出问题了。
附:
sdio扫描函数调用过程:
mmc_rescan->
mmc_rescan_try_freq->
sdio_reset->(cmd52,cmd52)
mmc_go_idle->(cmd0)
mmc_send_if_cond->(cmd8)
mmc_attach_sdio->
mmc_send_io_op_cond->(cmd5)
mmc_sdio_init_card->
mmc_send_io_op_cond->(cmd5)
mmc_send_relative_addr->(cmd3)
mmc_select_card->(cmd7)
sdio_read_cccr->(cmd52…)
sdio_read_common_cis->(cmd52…)
sdio_enable_hs->
mmc_sdio_switch_hs->(cmd52…)
sdio_enable_4bit_bus->
sdio_enable_wide->(cmd52…)
sdio_init_func->
sdio_read_fbr->(cmd52…)
sdio_read_func_cis->(cmd52…)
mmc_add_card->
sdio_add_func->
sd扫描函数调用过程:
mmc_rescan->
mmc_rescan_try_freq->
sdio_reset->(cmd52…)
mmc_go_idle->(cmd0)
mmc_send_if_cond->(cmd8)
mmc_attach_sdio->
mmc_send_io_op_cond->(cmd5)
mmc_attach_sd->
mmc_send_app_op_cond->(cmd55,acmd41)
mmc_sd_init_card->
mmc_sd_get_cid->
mmc_go_idle->(cmd0)
mmc_send_if_cond->(cmd8)
mmc_send_app_op_cond->(cmd55,acmd41 4次)
mmc_all_send_cid->(cmd2)
mmc_send_relative_addr->(cmd3)
mmc_sd_get_csd->
mmc_send_csd->
mmc_send_cxd_native->(cmd9)
mmc_select_card->(cmd7)
mmc_sd_setup_card->
mmc_app_send_scr->(cmd55,acmd51)
mmc_read_ssr->
mmc_app_sd_status->(cmd55,acmd13)
mmc_read_switch->
mmc_sd_switch->(cmd6)
mmc_sd_switch_hs->
mmc_sd_switch->(cmd6)
mmc_app_set_bus_width->(cmd55,acmd6)
mmc_add_card->
emmc扫描函数调用过程(没抓到数据包,根据代码流程整理,仅供参考):
mmc_rescan->
mmc_rescan_try_freq->
sdio_reset->(cmd52…)
mmc_go_idle->(cmd0)
mmc_send_if_cond->(cmd8)
mmc_attach_sdio->
mmc_send_io_op_cond->(cmd5)
mmc_attach_sd->
mmc_send_app_op_cond->(cmd55,acmd41)
mmc_attach_mmc->
mmc_send_op_cond->(cmd1)
mmc_init_card->
mmc_go_idle->(cmd0)
mmc_send_op_cond->(cmd1)
mmc_all_send_cid->(cmd2)
mmc_set_relative_addr->(cmd3)
mmc_send_csd->(cmd9)
mmc_select_card->(cmd7)
mmc_get_ext_csd->(cmd8)
……?
mmc_add_card->
Linux公社的RSS地址:https://www.linuxidc.com/rssFeed.aspx