Lines Matching refs:cmd
155 struct mmc_command *cmd; member
217 static struct mmc_command *meson_mmc_get_next_command(struct mmc_command *cmd) in meson_mmc_get_next_command() argument
219 if (cmd->opcode == MMC_SET_BLOCK_COUNT && !cmd->error) in meson_mmc_get_next_command()
220 return cmd->mrq->cmd; in meson_mmc_get_next_command()
221 else if (mmc_op_multi(cmd->opcode) && in meson_mmc_get_next_command()
222 (!cmd->mrq->sbc || cmd->error || cmd->data->error)) in meson_mmc_get_next_command()
223 return cmd->mrq->stop; in meson_mmc_get_next_command()
245 if (data->blocks > 1 || mrq->cmd->opcode == SD_IO_RW_EXTENDED) { in meson_mmc_get_transfer_mode()
657 host->cmd = NULL; in meson_mmc_request_done()
688 static void meson_mmc_set_response_bits(struct mmc_command *cmd, u32 *cmd_cfg) in meson_mmc_set_response_bits() argument
690 if (cmd->flags & MMC_RSP_PRESENT) { in meson_mmc_set_response_bits()
691 if (cmd->flags & MMC_RSP_136) in meson_mmc_set_response_bits()
695 if (!(cmd->flags & MMC_RSP_CRC)) in meson_mmc_set_response_bits()
698 if (cmd->flags & MMC_RSP_BUSY) in meson_mmc_set_response_bits()
709 struct mmc_data *data = host->cmd->data; in meson_mmc_desc_chain_transfer()
732 desc[i].cmd_arg = host->cmd->arg; in meson_mmc_desc_chain_transfer()
790 static void meson_mmc_start_cmd(struct mmc_host *mmc, struct mmc_command *cmd) in meson_mmc_start_cmd() argument
793 struct mmc_data *data = cmd->data; in meson_mmc_start_cmd()
800 host->cmd = cmd; in meson_mmc_start_cmd()
802 cmd_cfg |= FIELD_PREP(CMD_CFG_CMD_INDEX_MASK, cmd->opcode); in meson_mmc_start_cmd()
805 meson_mmc_set_response_bits(cmd, &cmd_cfg); in meson_mmc_start_cmd()
852 writel(cmd->arg, host->regs + SD_EMMC_CMD_ARG); in meson_mmc_start_cmd()
885 mrq->cmd->error = meson_mmc_validate_dram_access(mmc, mrq->data); in meson_mmc_request()
886 if (mrq->cmd->error) { in meson_mmc_request()
904 meson_mmc_start_cmd(mmc, mrq->sbc ?: mrq->cmd); in meson_mmc_request()
907 static void meson_mmc_read_resp(struct mmc_host *mmc, struct mmc_command *cmd) in meson_mmc_read_resp() argument
911 if (cmd->flags & MMC_RSP_136) { in meson_mmc_read_resp()
912 cmd->resp[0] = readl(host->regs + SD_EMMC_CMD_RSP3); in meson_mmc_read_resp()
913 cmd->resp[1] = readl(host->regs + SD_EMMC_CMD_RSP2); in meson_mmc_read_resp()
914 cmd->resp[2] = readl(host->regs + SD_EMMC_CMD_RSP1); in meson_mmc_read_resp()
915 cmd->resp[3] = readl(host->regs + SD_EMMC_CMD_RSP); in meson_mmc_read_resp()
916 } else if (cmd->flags & MMC_RSP_PRESENT) { in meson_mmc_read_resp()
917 cmd->resp[0] = readl(host->regs + SD_EMMC_CMD_RSP); in meson_mmc_read_resp()
934 struct mmc_command *cmd; in meson_mmc_irq() local
953 cmd = host->cmd; in meson_mmc_irq()
965 if (WARN_ON(!cmd)) in meson_mmc_irq()
968 cmd->error = 0; in meson_mmc_irq()
971 cmd->error = -EILSEQ; in meson_mmc_irq()
978 cmd->error = -ETIMEDOUT; in meson_mmc_irq()
983 meson_mmc_read_resp(host->mmc, cmd); in meson_mmc_irq()
986 struct mmc_data *data = cmd->data; in meson_mmc_irq()
988 if (data && !cmd->error) in meson_mmc_irq()
995 if (cmd->error) { in meson_mmc_irq()
1026 struct mmc_command *next_cmd, *cmd = host->cmd; in meson_mmc_irq_thread() local
1030 if (WARN_ON(!cmd)) in meson_mmc_irq_thread()
1033 if (cmd->error) { in meson_mmc_irq_thread()
1035 meson_mmc_request_done(host->mmc, cmd->mrq); in meson_mmc_irq_thread()
1040 data = cmd->data; in meson_mmc_irq_thread()
1051 next_cmd = meson_mmc_get_next_command(cmd); in meson_mmc_irq_thread()
1055 meson_mmc_request_done(host->mmc, cmd->mrq); in meson_mmc_irq_thread()