Skip to content

Commit 25fb0e7

Browse files
rabarabroonie
authored andcommitted
spi: spi-cadence-qspi: Disable STIG mode for Altera SoCFPGA.
STIG mode is enabled by default for less than 8 bytes data read/write. STIG mode doesn't work with Altera SocFPGA platform due hardware limitation. Add a quirks to disable STIG mode for Altera SoCFPGA platform. Signed-off-by: Niravkumar L Rabara <niravkumar.l.rabara@intel.com> Link: https://patch.msgid.link/20241204063338.296959-1-niravkumar.l.rabara@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 0bb3940 commit 25fb0e7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

drivers/spi/spi-cadence-quadspi.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ static_assert(CQSPI_MAX_CHIPSELECT <= SPI_CS_CNT_MAX);
4343
#define CQSPI_SLOW_SRAM BIT(4)
4444
#define CQSPI_NEEDS_APB_AHB_HAZARD_WAR BIT(5)
4545
#define CQSPI_RD_NO_IRQ BIT(6)
46+
#define CQSPI_DISABLE_STIG_MODE BIT(7)
4647

4748
/* Capabilities */
4849
#define CQSPI_SUPPORTS_OCTAL BIT(0)
@@ -103,6 +104,7 @@ struct cqspi_st {
103104
bool apb_ahb_hazard;
104105

105106
bool is_jh7110; /* Flag for StarFive JH7110 SoC */
107+
bool disable_stig_mode;
106108

107109
const struct cqspi_driver_platdata *ddata;
108110
};
@@ -1416,7 +1418,8 @@ static int cqspi_mem_process(struct spi_mem *mem, const struct spi_mem_op *op)
14161418
* reads, prefer STIG mode for such small reads.
14171419
*/
14181420
if (!op->addr.nbytes ||
1419-
op->data.nbytes <= CQSPI_STIG_DATA_LEN_MAX)
1421+
(op->data.nbytes <= CQSPI_STIG_DATA_LEN_MAX &&
1422+
!cqspi->disable_stig_mode))
14201423
return cqspi_command_read(f_pdata, op);
14211424

14221425
return cqspi_read(f_pdata, op);
@@ -1880,6 +1883,8 @@ static int cqspi_probe(struct platform_device *pdev)
18801883
if (ret)
18811884
goto probe_reset_failed;
18821885
}
1886+
if (ddata->quirks & CQSPI_DISABLE_STIG_MODE)
1887+
cqspi->disable_stig_mode = true;
18831888

18841889
if (of_device_is_compatible(pdev->dev.of_node,
18851890
"xlnx,versal-ospi-1.0")) {
@@ -2043,7 +2048,8 @@ static const struct cqspi_driver_platdata intel_lgm_qspi = {
20432048
static const struct cqspi_driver_platdata socfpga_qspi = {
20442049
.quirks = CQSPI_DISABLE_DAC_MODE
20452050
| CQSPI_NO_SUPPORT_WR_COMPLETION
2046-
| CQSPI_SLOW_SRAM,
2051+
| CQSPI_SLOW_SRAM
2052+
| CQSPI_DISABLE_STIG_MODE,
20472053
};
20482054

20492055
static const struct cqspi_driver_platdata versal_ospi = {

0 commit comments

Comments
 (0)