spi: cadence-qspi: Fix QSPI write issues
PATCH 1/1 spi: cadence-qspi: Fix QSPI write issues
QSPI driver perform chip select on every flash read/write access. The driver need to disable/enable the QSPI controller while performing chip select. This may cause some data lost especially the QSPI controller is configured to run at slower speed as it may take longer time to access the flash device. This patch prevent the driver from disable/enable the QSPI controller too soon and inadvertently halting any ongoing flash read/write access by ensuring the QSPI controller is always in idle mode after each read/write access.
--- drivers/spi/cadence_qspi_apb.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/spi/cadence_qspi_apb.c +9 -0
@@ -648,6 +648,10 @@ cadence_qspi_apb_indirect_read_execute(struct cadence_spi_platdata *plat,writel (CQSPI_REG_INDIRECTRD_DONE , plat->regbase +CQSPI_REG_INDIRECTRD ); +/* Wait til QSPI is idle */ +if (!cadence_qspi_wait_idle (plat->regbase)) +return -EIO ; +return 0 ; failrd:
@@ -763,6 +767,11 @@ cadence_qspi_apb_indirect_write_execute(struct cadence_spi_platdata *plat, plat->regbase + CQSPI_REG_INDIRECTWR);if (bounce_buf)free (bounce_buf); + +/* Wait til QSPI is idle */ +if (!cadence_qspi_wait_idle (plat->regbase)) +return -EIO ; +return 0 ; failwr:
Signature · 1 line
2.2.0
Tan
PATCH 1/1 spi: cadence-qspi: Fix QSPI write issues
Quoted 23 lines
-----Original Message-----
From: Ang, Chee Hong <[email protected]>
Sent: Wednesday, August 5, 2020 5:33 PM
To: u-boot at lists.denx.de
Cc: Phil Edworthy <[email protected]>; Vignesh R <[email protected]>; Tom Rini <[email protected]>; See, Chin Liang <[email protected]>; Tan, Ley Foon <[email protected]>; Ang, Chee Hong <[email protected]>; Chee, Tien Fong <[email protected]>; Lim, Elly Siew Chin <[email protected]>
Subject: [PATCH v1] spi: cadence-qspi: Fix QSPI write issuesQSPI driver perform chip select on every flash read/write access. The driver need to disable/enable the QSPI controller while performing chip select. This may cause some data lost especially the QSPI controller is configured to run at slower speed as it may take longer time to access the flash device. This patch prevent the driver from disable/enable the QSPI controller too soon and inadvertently halting any ongoing flash read/write access by ensuring the QSPI controller is always in idle mode after each read/write access.
Quoted 5 lines
Signed-off-by Chee Hong Ang <[email protected]>--- drivers/spi/cadence_qspi_apb.c | 9 +++++++++ 1 file changed, 9 insertions(+)
Regards
Ley Foon
Tan
PATCH 1/1 spi: cadence-qspi: Fix QSPI write issues
Quoted 42 lines
-----Original Message-----
From: U-Boot <[email protected]> On Behalf Of Tan, Ley Foon
Sent: Wednesday, August 5, 2020 6:00 PM
To: Ang, Chee Hong <[email protected]>; u-boot at lists.denx.de
Cc: Phil Edworthy <[email protected]>; Vignesh R <[email protected]>; Tom Rini <[email protected]>; See, Chin Liang <[email protected]>; Chee, Tien Fong <[email protected]>; Lim, Elly Siew Chin <[email protected]>
Subject: RE: [PATCH v1] spi: cadence-qspi: Fix QSPI write issuesQuoted 12 lines
-----Original Message-----
From: Ang, Chee Hong <[email protected]>
Sent: Wednesday, August 5, 2020 5:33 PM
To: u-boot at lists.denx.de
Cc: Phil Edworthy <[email protected]>; Vignesh R <[email protected]>; Tom Rini <[email protected]>; See, Chin Liang <[email protected]>; Tan, Ley Foon <[email protected]>; Ang, Chee Hong <[email protected]>; Chee, Tien Fong <[email protected]>; Lim, Elly Siew Chin <[email protected]>
Subject: [PATCH v1] spi: cadence-qspi: Fix QSPI write issuesQuoted 4 lines
QSPI driver perform chip select on every flash read/write access. The driver need to disable/enable the QSPI controller while performing chip select. This may cause some data lost especially the QSPI controller is configured to run at slower speed as it may take longer time to
access the flash device.
Quoted 10 lines
This patch prevent the driver from disable/enable the QSPI controller too soon and inadvertently halting any ongoing flash read/write access by ensuring the QSPI controller is always in idle mode after each read/write access.
Signed-off-by Chee Hong Ang <[email protected]>--- drivers/spi/cadence_qspi_apb.c | 9 +++++++++ 1 file changed, 9 insertions(+)
Quoted 4 lines
Reviewed-by Ley Foon Tan <[email protected]>Regards
Ley Foon
+ Jagan, SPI maintainer.
Jagan, can you help integrate this patch?
Regards
Ley Foon