t210: SPI driver cleanup

Hardware / Coreboot - Furquan Shaikh [google.com] - 16 July 2015 15:37 UTC

1. Get rid of spi_delay - Instead have a tight loop to check for the spi status 2. The first check for SPI operation complete i.e. FIFOs have been processed is the SPI_STATUS_RDY bit. Thus, tegra_spi_wait should check for this bit before reading BLOCK_COUNT or any other fifo count field. 3. Flush both TX and RX FIFOs for SEND and RECV operations for PIO and DMA. 4. No need to check for rx_fifo_count == spi_byte_count to determine pio_finish operation. RDY bit should be sufficient to ensure that the SPI operation is complete. Added assert to ensure we never hit the case of RDY bit being set, yet rx_fifo_count != spi_byte_count for PIO.

BUG=chrome-os-partner:41877 BRANCH=None TEST=Compiles successfully and reboot test runs successfully for 10K+ iterations.

Change-Id: I1adb9672c1503b562309a8bc6c22fe7d2271768e

7731cdd t210: SPI driver cleanup
src/soc/nvidia/tegra210/spi.c | 99 +++++++++++++++++------------------------
1 file changed, 41 insertions(+), 58 deletions(-)

Upstream: review.coreboot.org


  • Share