mirror of
https://github.com/u-boot/u-boot.git
synced 2024-11-26 21:54:37 +08:00
drivers/spi/omap3: Bug fix of premature write transfer completion
The logic determining SPI "write" transfer completion was faulty. At certain conditions (e.g. slow SPI clock freq) the transfers were interrupted before completion. Both EOT and TXS flags of channel status registeer shall be checked to ensure that all data was transferred. Tested on AM3359 chip. Signed-off-by: Vasili Galka <vasili@visionmap.com>
This commit is contained in:
parent
d73f38f7ba
commit
ce6889a997
@ -260,8 +260,9 @@ int omap3_spi_write(struct spi_slave *slave, unsigned int len, const void *txp,
|
||||
}
|
||||
|
||||
/* wait to finish of transfer */
|
||||
while (!(readl(&ds->regs->channel[ds->slave.cs].chstat) &
|
||||
OMAP3_MCSPI_CHSTAT_EOT));
|
||||
while ((readl(&ds->regs->channel[ds->slave.cs].chstat) &
|
||||
(OMAP3_MCSPI_CHSTAT_EOT | OMAP3_MCSPI_CHSTAT_TXS)) !=
|
||||
(OMAP3_MCSPI_CHSTAT_EOT | OMAP3_MCSPI_CHSTAT_TXS));
|
||||
|
||||
/* Disable the channel otherwise the next immediate RX will get affected */
|
||||
omap3_spi_set_enable(ds,OMAP3_MCSPI_CHCTRL_DIS);
|
||||
|
Loading…
Reference in New Issue
Block a user