[coreboot-gerrit] New patch to review for coreboot: 071ac1b tegra124: switch to stopwatch API

Patrick Georgi (pgeorgi@google.com) gerrit at coreboot.org
Fri Mar 20 13:05:59 CET 2015


Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8814

-gerrit

commit 071ac1b81720e49ab4bd9aca428e238fbd8759e3
Author: Aaron Durbin <adurbin at chromium.org>
Date:   Wed Sep 24 09:51:19 2014 -0500

    tegra124: switch to stopwatch API
    
    Instead of using rela_time use the stopwatch API as the
    semantics fit perfectly with the expiration usage.
    
    BUG=None
    BRANCH=None
    TEST=Built, but similar usage tested on tegra132.
    
    Change-Id: I6d3f3da4e035e872890d8b67947b17a981673dba
    Signed-off-by: Aaron Durbin <adurbin at chromium.org>
    Reviewed-on: https://chromium-review.googlesource.com/219712
    Reviewed-by: Julius Werner <jwerner at chromium.org>
    Reviewed-by: Furquan Shaikh <furquan at chromium.org>
---
 src/soc/nvidia/tegra124/spi.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/soc/nvidia/tegra124/spi.c b/src/soc/nvidia/tegra124/spi.c
index 8e090aa..78a17d9 100644
--- a/src/soc/nvidia/tegra124/spi.c
+++ b/src/soc/nvidia/tegra124/spi.c
@@ -416,8 +416,7 @@ static inline u32 rx_fifo_count(struct tegra_spi_channel *spi)
 static int tegra_spi_pio_finish(struct tegra_spi_channel *spi)
 {
 	u8 *p = spi->in_buf;
-	struct mono_time start;
-	struct rela_time rt;
+	struct stopwatch sw;
 
 	clrbits_le32(&spi->regs->command1, SPI_CMD1_RX_EN | SPI_CMD1_TX_EN);
 
@@ -425,12 +424,11 @@ static int tegra_spi_pio_finish(struct tegra_spi_channel *spi)
 	 * Allow some time in case the Rx FIFO does not yet have
 	 * all packets pushed into it. See chrome-os-partner:24215.
 	 */
-	timer_monotonic_get(&start);
+	stopwatch_init_usecs_expire(&sw, SPI_FIFO_XFER_TIMEOUT_US);
 	do {
 		if (rx_fifo_count(spi) == spi_byte_count(spi))
 			break;
-		rt = current_time_from(&start);
-	} while (rela_time_in_microseconds(&rt) < SPI_FIFO_XFER_TIMEOUT_US);
+	} while (!stopwatch_expired(&sw));
 
 	while (!(read32(&spi->regs->fifo_status) &
 				SPI_FIFO_STATUS_RX_FIFO_EMPTY)) {



More information about the coreboot-gerrit mailing list