[coreboot-gerrit] New patch to review for coreboot: 9bb491e rk3288: switch to stopwatch API
Patrick Georgi (pgeorgi@google.com)
gerrit at coreboot.org
Tue Mar 24 11:56:51 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/8895
-gerrit
commit 9bb491e8f05765ae23de16f168e56b0890d5b2b1
Author: Aaron Durbin <adurbin at chromium.org>
Date: Wed Sep 24 09:53:15 2014 -0500
rk3288: 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=None, but similar usage tested on tegra132.
Change-Id: I91ef59212a2dd1b48640b1aaaab6acacf4e9b3e6
Signed-off-by: Patrick Georgi <pgeorgi at chromium.org>
Original-Commit-Id: b1dd8380f04641f4f73caa3441f349d9eca6be05
Original-Change-Id: Iff3293debc2f85553c9e9b765084e5c00720012c
Original-Signed-off-by: Aaron Durbin <adurbin at chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/219713
Original-Reviewed-by: Julius Werner <jwerner at chromium.org>
Original-Reviewed-by: Furquan Shaikh <furquan at chromium.org>
---
src/soc/rockchip/rk3288/spi.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/src/soc/rockchip/rk3288/spi.c b/src/soc/rockchip/rk3288/spi.c
index 396f537..844d692 100644
--- a/src/soc/rockchip/rk3288/spi.c
+++ b/src/soc/rockchip/rk3288/spi.c
@@ -167,14 +167,13 @@ void spi_release_bus(struct spi_slave *slave)
static int rockchip_spi_wait_till_not_busy(struct rockchip_spi *regs)
{
- struct mono_time start;
- struct rela_time rt;
- timer_monotonic_get(&start);
+ struct stopwatch sw;
+
+ stopwatch_init_usecs_expire(&sw, SPI_TIMEOUT_US);
do {
if (!(readl(®s->sr) & SR_BUSY))
return 0;
- rt = current_time_from(&start);
- } while (rela_time_in_microseconds(&rt) < SPI_TIMEOUT_US);
+ } while (!stopwatch_expired(&sw));
printk(BIOS_DEBUG,
"RK SPI: Status keeps busy for 1000us after a read/write!\n");
return -1;
More information about the coreboot-gerrit
mailing list