[coreboot-gerrit] New patch to review for coreboot: 5ca8738 tegra124: Implement the monotonic timer by reading the 1us timer register.

Isaac Christensen (isaac.christensen@se-eng.com) gerrit at coreboot.org
Mon Aug 11 23:20:35 CEST 2014


Isaac Christensen (isaac.christensen at se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6620

-gerrit

commit 5ca8738ea6bdc9c71f24fe04288f4da9e33ad484
Author: Gabe Black <gabeblack at google.com>
Date:   Sun Oct 6 10:54:53 2013 -0700

    tegra124: Implement the monotonic timer by reading the 1us timer register.
    
    It turns out there's a register in tegra which automatically counts at 1us
    increments. It's primarily intended for hardware to use (I think to drive
    other timers) but we can read it ourselves since a 1us timer is exactly what
    we need to support the monotonic timer API.
    
    Change-Id: I68e947944acec7b460e61f42dbb325643a9739e8
    Signed-off-by: Gabe Black <gabeblack at google.com>
    Reviewed-on: https://chromium-review.googlesource.com/172044
    Reviewed-by: Ronald Minnich <rminnich at chromium.org>
    Reviewed-by: David Hendricks <dhendrix at chromium.org>
    Commit-Queue: Gabe Black <gabeblack at chromium.org>
    Tested-by: Gabe Black <gabeblack at chromium.org>
    (cherry picked from commit 161a39c53404ea0125221bbd54e54996967d6855)
    Signed-off-by: Isaac Christensen <isaac.christensen at se-eng.com>
---
 src/soc/nvidia/tegra124/monotonic_timer.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/soc/nvidia/tegra124/monotonic_timer.c b/src/soc/nvidia/tegra124/monotonic_timer.c
index 3423dde..7967b83 100644
--- a/src/soc/nvidia/tegra124/monotonic_timer.c
+++ b/src/soc/nvidia/tegra124/monotonic_timer.c
@@ -17,8 +17,11 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include <arch/io.h>
+#include <soc/addressmap.h>
 #include <timer.h>
 
 void timer_monotonic_get(struct mono_time *mt)
 {
+	mono_time_set_usecs(mt, read32((void *)TEGRA_TMRUS_BASE));
 }



More information about the coreboot-gerrit mailing list