]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
spi: cadence-quadspi: Enable SPI_TX_QUAD
authorSanthosh Kumar K <s-k6@ti.com>
Thu, 2 Jan 2025 12:05:44 +0000 (17:35 +0530)
committerMark Brown <broonie@kernel.org>
Mon, 6 Jan 2025 13:08:55 +0000 (13:08 +0000)
Enable the SPI_TX_QUAD mode bit in the host->mode_bits to support
data transmission over four lines to improve the performance.

Tested the functionality on AM62Lx EVM (W25N01JW) in 1S-4S-4S mode.

Signed-off-by: Santhosh Kumar K <s-k6@ti.com>
Link: https://patch.msgid.link/20250102120544.1407152-1-s-k6@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-cadence-quadspi.c

index 47477f2d9a25bc1f6c678f2c31a75d00f2c2c83f..594408d5340034ace94392bb9820fe6629f87439 100644 (file)
@@ -49,6 +49,7 @@ static_assert(CQSPI_MAX_CHIPSELECT <= SPI_CS_CNT_MAX);
 
 /* Capabilities */
 #define CQSPI_SUPPORTS_OCTAL           BIT(0)
+#define CQSPI_SUPPORTS_QUAD            BIT(1)
 
 #define CQSPI_OP_WIDTH(part) ((part).nbytes ? ilog2((part).buswidth) : 0)
 
@@ -1888,6 +1889,8 @@ static int cqspi_probe(struct platform_device *pdev)
                                                cqspi->master_ref_clk_hz);
                if (ddata->hwcaps_mask & CQSPI_SUPPORTS_OCTAL)
                        host->mode_bits |= SPI_RX_OCTAL | SPI_TX_OCTAL;
+               if (ddata->hwcaps_mask & CQSPI_SUPPORTS_QUAD)
+                       host->mode_bits |= SPI_TX_QUAD;
                if (!(ddata->quirks & CQSPI_DISABLE_DAC_MODE)) {
                        cqspi->use_direct_mode = true;
                        cqspi->use_direct_mode_wr = true;
@@ -2062,7 +2065,7 @@ static const struct cqspi_driver_platdata k2g_qspi = {
 };
 
 static const struct cqspi_driver_platdata am654_ospi = {
-       .hwcaps_mask = CQSPI_SUPPORTS_OCTAL,
+       .hwcaps_mask = CQSPI_SUPPORTS_OCTAL | CQSPI_SUPPORTS_QUAD,
        .quirks = CQSPI_NEEDS_WR_DELAY,
 };