mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-23 22:14:54 +00:00
DW SPI: fix transmit only mode
In current implementation we get -ETIMEDOUT error when we try to use transmit only mode (SPI_TMOD_TO) This happens because in transmit only mode input FIFO never gets any data which breaks our logic in dw_reader(): we are waiting until RX data will be ready in dw_reader, but this newer happens, so we return with error. Fix that by using SPI_TMOD_TR instead of SPI_TMOD_TO which allows to use RX FIFO. Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
This commit is contained in:
parent
c6b4f031d9
commit
fc282c7bcb
1 changed files with 5 additions and 1 deletions
|
@ -361,7 +361,11 @@ static int dw_spi_xfer(struct udevice *dev, unsigned int bitlen,
|
||||||
else if (rx)
|
else if (rx)
|
||||||
priv->tmode = SPI_TMOD_RO;
|
priv->tmode = SPI_TMOD_RO;
|
||||||
else
|
else
|
||||||
priv->tmode = SPI_TMOD_TO;
|
/*
|
||||||
|
* In transmit only mode (SPI_TMOD_TO) input FIFO never gets
|
||||||
|
* any data which breaks our logic in poll_transfer() above.
|
||||||
|
*/
|
||||||
|
priv->tmode = SPI_TMOD_TR;
|
||||||
|
|
||||||
cr0 &= ~SPI_TMOD_MASK;
|
cr0 &= ~SPI_TMOD_MASK;
|
||||||
cr0 |= (priv->tmode << SPI_TMOD_OFFSET);
|
cr0 |= (priv->tmode << SPI_TMOD_OFFSET);
|
||||||
|
|
Loading…
Add table
Reference in a new issue