Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[PATCH 2/11] OMAP2: take the timecounter i/f into use



--Imre
From c0e694a28ce5521f700db47995b9984a28774795 Mon Sep 17 00:00:00 2001
From: Imre Deak <imre.deak%teleca.com@localhost>
Date: Fri, 25 Apr 2008 21:16:26 +0300
Subject: [PATCH] OMAP2: take the timecounter interface into use

Also remove the custom microtime implementation, it's located
now in kern_tc.
---
 sys/arch/arm/omap/omap2430_mputmr.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/sys/arch/arm/omap/omap2430_mputmr.c 
b/sys/arch/arm/omap/omap2430_mputmr.c
index 4d71b41..852fe3f 100644
--- a/sys/arch/arm/omap/omap2430_mputmr.c
+++ b/sys/arch/arm/omap/omap2430_mputmr.c
@@ -86,6 +86,7 @@ __KERNEL_RCSID(0, "omap2430_mputmr.c,v 1.1.2.4 2008/01/08 
07:16:27 matt Exp");
 #include <sys/systm.h>
 #include <sys/kernel.h>
 #include <sys/time.h>
+#include <sys/timetc.h>
 #include <sys/device.h>
 
 #include <dev/clock_subr.h>
@@ -102,6 +103,7 @@ struct timeval hardtime;
 struct omap2430mputmr_softc *clock_sc;
 struct omap2430mputmr_softc *stat_sc;
 struct omap2430mputmr_softc *ref_sc;
+static struct timecounter omap2_mpu_timecounter;
 
 static inline void
 _timer_intr_dis(struct omap2430mputmr_softc *sc)
@@ -237,6 +239,8 @@ cpu_initclocks(void)
 
        _timer_intr_enb(clock_sc);
        _timer_intr_enb(stat_sc);
+
+       tc_init(&omap2_mpu_timecounter);
 }
 
 uint32_t
@@ -257,6 +261,23 @@ omap_microtimer_interval(uint32_t start, uint32_t end)
                return 0;
 }
 
+static u_int
+omap2_mpu_timecounter_read(struct timecounter *tc)
+{
+       return omap_microtimer_read();
+}
+
+static struct timecounter omap2_mpu_timecounter = {
+       .tc_get_timecount = omap2_mpu_timecounter_read,
+       .tc_poll_pps = NULL,
+       .tc_counter_mask = 0xffffffff,
+       .tc_frequency = OMAP_MPU_TIMER_CLOCK_FREQ,
+       .tc_name = "mpu",
+       .tc_quality = 100,
+};
+
+
+#if 0
 void
 microtime(struct timeval *tvp)
 {
@@ -310,6 +331,7 @@ microtime(struct timeval *tvp)
                tvp->tv_sec++;
        }
 }
+#endif
 
 #ifndef ARM11_PMC
 void
-- 
1.5.4.2



Home | Main Index | Thread Index | Old Index