.shutdown = mmc_shutdown, .hw_reset = _mmc_hw_reset, }; // MMC card初始化的入口函数 int mmc_attach_mmc(struct mmc_host *host) { int err; u32 ocr, rocr; // 首先检查host的使用权是否已经获得 WARN_ON(!host->claimed); /* Set correct
是的话不进行后续操作 */if(host->ios.power_mode==MMC_POWER_ON)return;/* 第一阶段,先设置对应的io setting使host处于MMC_POWER_UP的状态(总线工作频率没有设置) */mmc_host_clk_hold(host);// 先获取host时钟/* If ocr is set, we use it */if(host->ocr)bit=ffs(host->ocr)-1;// 选择一...
int bit;/* 判断是否已经处于MMC_POWER_ON,是的话不进行后续操作 */if(host->ios.power_mode == MMC_POWER_ON)return;/* 第一阶段,先设置对应的io setting使host处于MMC_POWER_UP的状态(总线工作频率没有设置) */mmc_host_clk_hold(host);// 先获取host时钟/* If ocr is set, we use it */if(...
简单介绍下第1082行的ffs函数,它的作用就是返回参数中第一个为1的bit的位置(ffs(0)=0,ffs(1)=1,ffs(8)=4),那么该函数用在这里的作用就是取出card需要的实际电压是多少; 第1090行的mmc_set_ios函数里面通过调用sdhci_set_power将host->iOS.vdd所代表的电压写入寄存器PWRCONn中 完成那个对电压的重新配置(...
mmc_set_ios(host); //core/core.c host->ops->set_ios(host, ios); //依次尝试切换为:3.3v,1.8v,1.2v __mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_330) //core/core.c //设置host的电压 host->ops->start_signal_voltage_switch(host, &host->ios) ...
.set_ios = rda_mmc_set_ios, .enable_sdio_irq =rda_mmc_enable_sdio_irq, }; 其中,request函数,主要实现命令发送,数据的读写;set_ios主要用来设置数据速度,mmc相位,power mode 和data bus width;get_cd用来检测设备是否存在;get_ro用来判断mmc是否为read-only card;enable_sdio_irq是用来使能或者关闭sdio...
s3cmci_set_ios : s3cmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) 依据核心层传递过来的 ios ,来设置硬件 IO, 包括引脚配置,使能时钟,和配置总线带宽。 s3cmci_request : 这个 函数是最主要,也最复杂的函数,实现了命令和数据的发送和接收, ...
drivers/MMC/core/core.c:999 [MMC_core]MMC_set_ios =p "%s":时钟%uHz 总线模式%u 电源模式%u cs %u Vdd %u 宽度%u 时序%u\012" drivers/MMC/core/core.c:1633 [MMC_core]MMC_POWER_UP =p "3.3V\012的初始信号电压" drivers/MMC/core/core.c:1635 [MMC_core]MMC_POWER_UP =p "初...
static int dm_mmc_spi_set_ios(struct udevice *dev) { return 0; }static int dm_mmc_spi_request(struct udevice *dev, struct mmc_cmd *cmd, struct mmc_data *data) { int i, multi, ret = 0; u8 *resp = NULL; u32 resp_size = 0;...
(*set_ios)(struct mmc_host*host,struct mmc_ios*ios);// 设置host的总线的io settingint(*get_ro)(struct mmc_host*host);// 获取host上的card的读写属性int(*get_cd)(struct mmc_host*host);// 检测host的卡槽中card的插入状态/* optional callback for HC quirks */void(*init_card)(struct ...