Re: [PATCH 3/3] spi: cadence-xspi: add ACMD mode support

From: Mark Brown

Date: Thu Oct 29 2026 - 12:55:58 EST


> So far every operation goes through STIG mode, where the CPU builds
> each command and drains the data. The controller also has an auto
> command (ACMD) mode where it runs a whole read sequence on its own and,
> with the internal DMA, writes the data straight to memory.

> +static int cdns_xspi_set_work_mode(struct cdns_xspi_dev *cdns_xspi, int mode)
> +{
> + int ret;
> +
> + if (cdns_xspi->cur_work_mode == mode)
> + return 0;

We need some suspend/resume handling to invalidate the configuration
when the IP power goes so we set everything up again. I'm not seeing
anything here.

> @@ -677,6 +893,9 @@ static int cdns_xspi_adjust_mem_op_size(struct spi_mem *mem, struct spi_mem_op *
> struct cdns_xspi_dev *cdns_xspi =
> spi_controller_get_devdata(mem->spi->controller);
>
> + if (cdns_xspi_acmd_can_read(cdns_xspi, op))
> + return 0;

That function has a minimum size but not a maximum size...

> +
> op->data.nbytes = clamp_val(op->data.nbytes, 0, cdns_xspi->sdmasize);

...which we have here?

--
Mark Brown <broonie@xxxxxxxxxx>