Lines Matching defs:cmd
141 static int stm32_sdmmc2_send_cmd_req(struct mmc_cmd *cmd);
142 static int stm32_sdmmc2_send_cmd(struct mmc_cmd *cmd);
227 static int stm32_sdmmc2_send_cmd_req(struct mmc_cmd *cmd)
236 if (cmd == NULL) {
241 arg_reg = cmd->cmd_arg;
247 cmd_reg = cmd->cmd_idx | SDMMC_CMDR_CPSMEN;
249 if (cmd->resp_type == 0U) {
253 if ((cmd->resp_type & MMC_RSP_48) != 0U) {
254 if ((cmd->resp_type & MMC_RSP_136) != 0U) {
257 } else if ((cmd->resp_type & MMC_RSP_CRC) != 0U) {
266 switch (cmd->cmd_idx) {
321 next_cmd_is_acmd = (cmd->cmd_idx == MMC_CMD(55));
334 if ((cmd->resp_type & MMC_RSP_BUSY) != 0U) {
349 ERROR("%s: timeout 10ms (cmd = %u,status = %x)\n",
350 __func__, cmd->cmd_idx, status);
365 if (!((cmd->cmd_idx == MMC_CMD(1)) ||
366 (cmd->cmd_idx == MMC_CMD(13)) ||
367 ((cmd->cmd_idx == MMC_CMD(8)) &&
368 (cmd->resp_type == MMC_RESPONSE_R7)))) {
369 ERROR("%s: CTIMEOUT (cmd = %u,status = %x)\n",
370 __func__, cmd->cmd_idx, status);
374 ERROR("%s: CRCFAIL (cmd = %u,status = %x)\n",
375 __func__, cmd->cmd_idx, status);
382 if ((cmd->cmd_idx == MMC_CMD(9)) &&
385 cmd->resp_data[0] = mmio_read_32(base + SDMMC_RESP4R);
386 cmd->resp_data[1] = mmio_read_32(base + SDMMC_RESP3R);
387 cmd->resp_data[2] = mmio_read_32(base + SDMMC_RESP2R);
388 cmd->resp_data[3] = mmio_read_32(base + SDMMC_RESP1R);
390 cmd->resp_data[0] = mmio_read_32(base + SDMMC_RESP1R);
393 cmd->resp_data[1] = mmio_read_32(base +
395 cmd->resp_data[2] = mmio_read_32(base +
397 cmd->resp_data[3] = mmio_read_32(base +
415 ERROR("%s: timeout 10ms (cmd = %u,status = %x)\n",
416 __func__, cmd->cmd_idx, status);
427 ERROR("%s: Error flag (cmd = %u,status = %x)\n", __func__,
428 cmd->cmd_idx, status);
447 static int stm32_sdmmc2_send_cmd(struct mmc_cmd *cmd)
452 assert(cmd != NULL);
455 err = stm32_sdmmc2_send_cmd_req(cmd);
460 if ((cmd->cmd_idx == MMC_CMD(1)) ||
461 (cmd->cmd_idx == MMC_CMD(13))) {
466 if (cmd->cmd_idx != MMC_CMD(8)) {
468 cmd->cmd_idx, retry + 1U, err);
531 struct mmc_cmd cmd;
558 zeromem(&cmd, sizeof(struct mmc_cmd));
560 cmd.cmd_idx = MMC_CMD(16);
561 cmd.cmd_arg = arg_size;
562 cmd.resp_type = MMC_RESPONSE_R1;
564 ret = stm32_sdmmc2_send_cmd(&cmd);