spi: fsl_qspi: Copy 16 byte aligned data in TX FIFO
PATCH 1/1 spi: fsl_qspi: Copy 16 byte aligned data in TX FIFO
In some of the QSPI controller version, there must be atleast 128bit data available in TX FIFO for any pop operation otherwise error bit will be set. The code will not make any behavior change for previous controller as the transfer data size in ipcr register is still the same.
Patch is tested on LS1046A which do not require 16 bytes aligned and LS1088A which require 16 bytes aligned data in TX FIFO
--- drivers/spi/fsl_qspi.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-)
drivers/spi/fsl_qspi.c +8 -10
@@ -659,22 +659,20 @@ static void qspi_op_write(struct fsl_qspi_priv *priv, u8 *txbuf, u32 len) tx_size = (len >TX_BUFFER_SIZE ) ?TX_BUFFER_SIZE : len; - size = tx_size /4 ; -for (i =0 ; i < size; i++) { + size = tx_size /16 ; +/* +* There must be atleast 128bit data +* available in TX FIFO for any pop operation +*/ +if (tx_size %16 ) + size++; +for (i =0 ; i < size *4 ; i++) {memcpy (&data, txbuf,4 ); data =qspi_endian_xchg (data);qspi_write32 (priv->flags, ®s->tbdr, data); txbuf +=4 ; } - size = tx_size %4 ; -if (size) { - data =0 ; -memcpy (&data, txbuf, size); - data =qspi_endian_xchg (data); -qspi_write32 (priv->flags, ®s->tbdr, data); - } -qspi_write32 (priv->flags, ®s->ipcr, (seqid <<QSPI_IPCR_SEQID_SHIFT ) | tx_size);while (qspi_read32 (priv->flags, ®s->sr) &QSPI_SR_BUSY_MASK )
Signature · 1 line
1.9.3
PATCH 1/1 spi: fsl_qspi: Copy 16 byte aligned data in TX FIFO
Quoted 11 lines · Suresh Gupta
In some of the QSPI controller version, there must be atleast 128bit data available in TX FIFO for any pop operation otherwise error bit will be set. The code will not make any behavior change for previous controller as the transfer data size in ipcr register is still the same.
Patch is tested on LS1046A which do not require 16 bytes aligned and LS1088A which require 16 bytes aligned data in TX FIFO
Signed-off-by Suresh Gupta <[email protected]>Signed-off-by Anupam Kumar <[email protected]>
Can some one Tested and verified the result?
thanks!
Signature · 4 lines
Jagan Teki Free Software Engineer | www.openedev.com U-Boot, Linux | Upstream Maintainer Hyderabad, India.
PATCH 1/1 spi: fsl_qspi: Copy 16 byte aligned data in TX FIFO
In reply to a message not in the archiveHi Jagan,
Quoted 18 lines
Quoted 11 lines
-----Original Message-----
From: Jagan Teki [mailto:jagannadh.teki at gmail.com]
Sent: Friday, August 11, 2017 4:44 PM
To: Suresh Gupta <[email protected]>
Cc: u-boot at lists.denx.de; Jagan Teki <[email protected]>; yorksun at freescale.com; Anupam Kumar <[email protected]>
Subject: Re: [PATCH] spi:fsl_qspi: Copy 16 byte aligned data in TX FIFOOn Mon, Jun 5, 2017 at 2:37 PM, Suresh Gupta <[email protected]>
Quoted 6 lines · wrote:
Quoted 6 lines
In some of the QSPI controller version, there must be atleast 128bit data available in TX FIFO for any pop operation otherwise error bit will be set. The code will not make any behavior change for previous controller as the transfer data size in ipcr register is still the same.
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
Patch is tested on LS1046A which do not require 16 bytes aligned and LS1088A which require 16 bytes aligned data in TX FIFO
Signed-off-by Suresh Gupta <[email protected]>Signed-off-by Anupam Kumar <[email protected]>Can some one Tested and verified the result?
Please pick this patch, we have the same patch in our SDK from last 2 months and do not face any issue.
Quoted 6 lines
Quoted 6 lines
thanks!
--
Jagan Teki
Free Software Engineer | www.openedev.com U-Boot, Linux | Upstream Maintainer Hyderabad, India.
PATCH 1/1 spi: fsl_qspi: Copy 16 byte aligned data in TX FIFO
In reply to Suresh GuptaQuoted 11 lines · Suresh Gupta
In some of the QSPI controller version, there must be atleast 128bit data available in TX FIFO for any pop operation otherwise error bit will be set. The code will not make any behavior change for previous controller as the transfer data size in ipcr register is still the same.
Patch is tested on LS1046A which do not require 16 bytes aligned and LS1088A which require 16 bytes aligned data in TX FIFO
Signed-off-by Suresh Gupta <[email protected]>Signed-off-by Anupam Kumar <[email protected]>
Applied to u-boot-spi//master
thanks!
Signature · 4 lines
Jagan Teki Free Software Engineer | www.openedev.com U-Boot, Linux | Upstream Maintainer Hyderabad, India.