spi: cadence_qspi: Address the comparison failure for 0-8
RFC PATCH 1/1 spi: cadence_qspi: Address the comparison failure for 0-8
In the current implementation, the test for data ranging from 0 to 8 bytes is encountering failures. This has been confirmed through testing with both ISSI (IS25WX256) and Micron (MT35XU02G) Flash in SDR mode exclusively.
Upon analysis, it was observed that utilizing the "SPI_NOR_OCTAL_READ" flag and attempting to read less than 8 bytes in STIG mode results in a failure to read, leading to a failure in the compare test.
Upon reviewing the Micron OSPI flash data sheet, it was noted that for protocol 1-1-8, 8 dummy clock cycles are required. While the current implementation achieves this, it still results in a compare test failure.
Therefore, the code has been revised to include DMA read for operations involving less than 8 bytes as well.
--- drivers/spi/cadence_qspi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/cadence_qspi.c +1 -1
@@ -313,7 +313,7 @@ static int cadence_spi_mem_exec_op(struct spi_slave *spi,* which is unsupported on some flash devices during register * reads, prefer STIG mode for such small reads. */ -if (op->data.nbytes <=CQSPI_STIG_DATA_LEN_MAX ) +if (!op->addr.nbytes) mode =CQSPI_STIG_READ ;else mode =CQSPI_READ ;
Signature · 1 line
2.27.0
[AMD Official Use Only - General]
Please ignore this patch, as I've submitted another one to address this problem.
Thank You,
Tejas
Quoted 51 lines
-----Original Message-----
From: U-Boot <[email protected]> On Behalf Of Tejas Bhumkar
Sent: Monday, January 22, 2024 4:44 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; a- [email protected]; Simek, Michal <[email protected]>; Abbarapu, Venkatesh <[email protected]>; [email protected]
Subject: [PATCH RFC] spi:cadence_qspi: Address the comparison failure for 0-8Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
In the current implementation, the test for data ranging from 0 to 8 bytes is encountering failures. This has been confirmed through testing with both ISSI (IS25WX256) and Micron (MT35XU02G) Flash in SDR mode exclusively.
Upon analysis, it was observed that utilizing the "
SPI_NOR_OCTAL_READ" flag and attempting to read less than 8 bytes in STIG mode results in a failure to read, leading to a failure in the compare test.Upon reviewing the Micron OSPI flash data sheet, it was noted that for protocol 1-1-8, 8 dummy clock cycles are required. While the current implementation achieves this, it still results in a compare test failure.
Therefore, the code has been revised to include DMA read for operations involving less than 8 bytes as well.
Fixes 53f4ef0 ("spi: cadence_qspi: use STIG mode for small reads")Signed-off-by Tejas Bhumkar <[email protected]>--- drivers/spi/cadence_qspi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/spi/cadence_qspi.c index renamed from drivers/spi/cadence_qspi.c +0
-0
dfc74c882d..a6477dbfcf100644drivers/spi/cadence_qspi.c +1
-1@@ -313,7 +313,7 @@ static int cadence_spi_mem_exec_op(struct spi_slave*spi, * which is unsupported on some flash devices during register * reads, prefer STIG mode for such small reads. */ -if (op->data.nbytes <=CQSPI_STIG_DATA_LEN_MAX ) +if (!op->addr.nbytes) mode =CQSPI_STIG_READ ;else mode = CQSPI_READ;--
2.27.0