Lines Matching refs:op
137 static int stm32_qspi_wait_cmd(const struct spi_mem_op *op) in stm32_qspi_wait_cmd() argument
179 static int stm32_qspi_poll(const struct spi_mem_op *op) in stm32_qspi_poll() argument
185 if (op->data.dir == SPI_MEM_DATA_IN) { in stm32_qspi_poll()
191 buf = (uint8_t *)op->data.buf; in stm32_qspi_poll()
193 for (len = op->data.nbytes; len != 0U; len--) { in stm32_qspi_poll()
210 static int stm32_qspi_mm(const struct spi_mem_op *op) in stm32_qspi_mm() argument
212 memcpy(op->data.buf, in stm32_qspi_mm()
213 (void *)(stm32_qspi.mm_base + (size_t)op->addr.val), in stm32_qspi_mm()
214 op->data.nbytes); in stm32_qspi_mm()
219 static int stm32_qspi_tx(const struct spi_mem_op *op, uint8_t mode) in stm32_qspi_tx() argument
221 if (op->data.nbytes == 0U) { in stm32_qspi_tx()
226 return stm32_qspi_mm(op); in stm32_qspi_tx()
229 return stm32_qspi_poll(op); in stm32_qspi_tx()
241 static int stm32_qspi_exec_op(const struct spi_mem_op *op) in stm32_qspi_exec_op() argument
250 __func__, op->cmd.opcode, op->cmd.buswidth, op->addr.buswidth, in stm32_qspi_exec_op()
251 op->dummy.buswidth, op->data.buswidth, in stm32_qspi_exec_op()
252 op->addr.val, op->data.nbytes); in stm32_qspi_exec_op()
254 addr_max = op->addr.val + op->data.nbytes + 1U; in stm32_qspi_exec_op()
256 if ((op->data.dir == SPI_MEM_DATA_IN) && (op->data.nbytes != 0U)) { in stm32_qspi_exec_op()
258 (op->addr.buswidth != 0U)) { in stm32_qspi_exec_op()
265 if (op->data.nbytes != 0U) { in stm32_qspi_exec_op()
266 mmio_write_32(qspi_base() + QSPI_DLR, op->data.nbytes - 1U); in stm32_qspi_exec_op()
270 ccr |= op->cmd.opcode; in stm32_qspi_exec_op()
271 ccr |= stm32_qspi_get_mode(op->cmd.buswidth) << QSPI_CCR_IMODE_SHIFT; in stm32_qspi_exec_op()
273 if (op->addr.nbytes != 0U) { in stm32_qspi_exec_op()
274 ccr |= (op->addr.nbytes - 1U) << QSPI_CCR_ADSIZE_SHIFT; in stm32_qspi_exec_op()
275 ccr |= stm32_qspi_get_mode(op->addr.buswidth) << in stm32_qspi_exec_op()
279 if ((op->dummy.buswidth != 0U) && (op->dummy.nbytes != 0U)) { in stm32_qspi_exec_op()
280 ccr |= (op->dummy.nbytes * 8U / op->dummy.buswidth) << in stm32_qspi_exec_op()
284 if (op->data.nbytes != 0U) { in stm32_qspi_exec_op()
285 ccr |= stm32_qspi_get_mode(op->data.buswidth) << in stm32_qspi_exec_op()
291 if ((op->addr.nbytes != 0U) && (mode != QSPI_CCR_MEM_MAP)) { in stm32_qspi_exec_op()
292 mmio_write_32(qspi_base() + QSPI_AR, op->addr.val); in stm32_qspi_exec_op()
295 ret = stm32_qspi_tx(op, mode); in stm32_qspi_exec_op()
309 ret = stm32_qspi_wait_cmd(op); in stm32_qspi_exec_op()