Lines Matching refs:cmd
123 static int stm32_sdmmc2_send_cmd_req(struct mmc_cmd *cmd);
124 static int stm32_sdmmc2_send_cmd(struct mmc_cmd *cmd);
181 static int stm32_sdmmc2_send_cmd_req(struct mmc_cmd *cmd) in stm32_sdmmc2_send_cmd_req() argument
190 if (cmd == NULL) { in stm32_sdmmc2_send_cmd_req()
195 arg_reg = cmd->cmd_arg; in stm32_sdmmc2_send_cmd_req()
201 cmd_reg = cmd->cmd_idx | SDMMC_CMDR_CPSMEN; in stm32_sdmmc2_send_cmd_req()
203 if (cmd->resp_type == 0U) { in stm32_sdmmc2_send_cmd_req()
207 if ((cmd->resp_type & MMC_RSP_48) != 0U) { in stm32_sdmmc2_send_cmd_req()
208 if ((cmd->resp_type & MMC_RSP_136) != 0U) { in stm32_sdmmc2_send_cmd_req()
211 } else if ((cmd->resp_type & MMC_RSP_CRC) != 0U) { in stm32_sdmmc2_send_cmd_req()
220 switch (cmd->cmd_idx) { in stm32_sdmmc2_send_cmd_req()
269 (cmd->cmd_idx != MMC_CMD(55))) { in stm32_sdmmc2_send_cmd_req()
273 if ((cmd->resp_type & MMC_RSP_BUSY) != 0U) { in stm32_sdmmc2_send_cmd_req()
289 __func__, cmd->cmd_idx, status); in stm32_sdmmc2_send_cmd_req()
304 if (!((cmd->cmd_idx == MMC_CMD(1)) || in stm32_sdmmc2_send_cmd_req()
305 (cmd->cmd_idx == MMC_CMD(13)) || in stm32_sdmmc2_send_cmd_req()
306 ((cmd->cmd_idx == MMC_CMD(8)) && in stm32_sdmmc2_send_cmd_req()
307 (cmd->resp_type == MMC_RESPONSE_R7)))) { in stm32_sdmmc2_send_cmd_req()
309 __func__, cmd->cmd_idx, status); in stm32_sdmmc2_send_cmd_req()
314 __func__, cmd->cmd_idx, status); in stm32_sdmmc2_send_cmd_req()
321 if ((cmd->cmd_idx == MMC_CMD(9)) && in stm32_sdmmc2_send_cmd_req()
324 cmd->resp_data[0] = mmio_read_32(base + SDMMC_RESP4R); in stm32_sdmmc2_send_cmd_req()
325 cmd->resp_data[1] = mmio_read_32(base + SDMMC_RESP3R); in stm32_sdmmc2_send_cmd_req()
326 cmd->resp_data[2] = mmio_read_32(base + SDMMC_RESP2R); in stm32_sdmmc2_send_cmd_req()
327 cmd->resp_data[3] = mmio_read_32(base + SDMMC_RESP1R); in stm32_sdmmc2_send_cmd_req()
329 cmd->resp_data[0] = mmio_read_32(base + SDMMC_RESP1R); in stm32_sdmmc2_send_cmd_req()
332 cmd->resp_data[1] = mmio_read_32(base + in stm32_sdmmc2_send_cmd_req()
334 cmd->resp_data[2] = mmio_read_32(base + in stm32_sdmmc2_send_cmd_req()
336 cmd->resp_data[3] = mmio_read_32(base + in stm32_sdmmc2_send_cmd_req()
355 __func__, cmd->cmd_idx, status); in stm32_sdmmc2_send_cmd_req()
367 cmd->cmd_idx, status); in stm32_sdmmc2_send_cmd_req()
386 static int stm32_sdmmc2_send_cmd(struct mmc_cmd *cmd) in stm32_sdmmc2_send_cmd() argument
391 assert(cmd != NULL); in stm32_sdmmc2_send_cmd()
394 err = stm32_sdmmc2_send_cmd_req(cmd); in stm32_sdmmc2_send_cmd()
399 if ((cmd->cmd_idx == MMC_CMD(1)) || in stm32_sdmmc2_send_cmd()
400 (cmd->cmd_idx == MMC_CMD(13))) { in stm32_sdmmc2_send_cmd()
405 if (cmd->cmd_idx != MMC_CMD(8)) { in stm32_sdmmc2_send_cmd()
407 cmd->cmd_idx, retry + 1U, err); in stm32_sdmmc2_send_cmd()
470 struct mmc_cmd cmd; in stm32_sdmmc2_prepare() local
497 zeromem(&cmd, sizeof(struct mmc_cmd)); in stm32_sdmmc2_prepare()
499 cmd.cmd_idx = MMC_CMD(16); in stm32_sdmmc2_prepare()
500 cmd.cmd_arg = arg_size; in stm32_sdmmc2_prepare()
501 cmd.resp_type = MMC_RESPONSE_R1; in stm32_sdmmc2_prepare()
503 ret = stm32_sdmmc2_send_cmd(&cmd); in stm32_sdmmc2_prepare()