All of lore.kernel.org
 help / color / mirror / Atom feed
From: Graeme Russ <graeme.russ@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 5/7]Timer: Remove reset_timer() for non-Nios2 arches
Date: Sat, 16 Jul 2011 19:36:40 +1000	[thread overview]
Message-ID: <1310809000-3402-1-git-send-email-graeme.russ@gmail.com> (raw)
In-Reply-To: <1310732384-5422-1-git-send-email-graeme.russ@gmail.com>

Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
---
Changes since v2:
 - Added Signed-off-by

Changes since v1 ((WIP) [Timer]API Rewrite):
 - Rebased to 68d4230c3ccce96a72c5b99e48399bf1796fe3c6

 arch/arm/cpu/arm1136/mx31/timer.c        |    5 -----
 arch/arm/cpu/arm1136/mx35/timer.c        |    5 -----
 arch/arm/cpu/arm1136/omap24xx/timer.c    |    5 -----
 arch/arm/cpu/arm1176/s3c64xx/timer.c     |    5 -----
 arch/arm/cpu/arm1176/tnetv107x/timer.c   |    9 ---------
 arch/arm/cpu/arm720t/interrupts.c        |    5 -----
 arch/arm/cpu/arm920t/a320/timer.c        |    6 ------
 arch/arm/cpu/arm920t/at91/timer.c        |    6 ------
 arch/arm/cpu/arm920t/at91rm9200/timer.c  |    6 ------
 arch/arm/cpu/arm920t/ep93xx/timer.c      |    5 -----
 arch/arm/cpu/arm920t/imx/timer.c         |    6 ------
 arch/arm/cpu/arm920t/ks8695/timer.c      |    7 +------
 arch/arm/cpu/arm920t/s3c24x0/timer.c     |    6 ------
 arch/arm/cpu/arm925t/timer.c             |    6 ------
 arch/arm/cpu/arm926ejs/armada100/timer.c |    5 -----
 arch/arm/cpu/arm926ejs/davinci/timer.c   |    5 -----
 arch/arm/cpu/arm926ejs/kirkwood/timer.c  |    5 -----
 arch/arm/cpu/arm926ejs/mb86r0x/timer.c   |    5 -----
 arch/arm/cpu/arm926ejs/mx25/timer.c      |    5 -----
 arch/arm/cpu/arm926ejs/mx27/timer.c      |    5 -----
 arch/arm/cpu/arm926ejs/nomadik/timer.c   |   12 +++++-------
 arch/arm/cpu/arm926ejs/omap/timer.c      |    6 ------
 arch/arm/cpu/arm926ejs/orion5x/timer.c   |    5 -----
 arch/arm/cpu/arm926ejs/pantheon/timer.c  |    5 -----
 arch/arm/cpu/arm926ejs/spear/timer.c     |    6 ------
 arch/arm/cpu/arm926ejs/versatile/timer.c |    6 ------
 arch/arm/cpu/armv7/mx5/timer.c           |    5 -----
 arch/arm/cpu/armv7/omap-common/timer.c   |    5 -----
 arch/arm/cpu/armv7/s5p-common/timer.c    |    5 -----
 arch/arm/cpu/armv7/tegra2/timer.c        |    5 -----
 arch/arm/cpu/ixp/timer.c                 |    5 -----
 arch/arm/cpu/lh7a40x/timer.c             |    6 ------
 arch/arm/cpu/pxa/timer.c                 |    7 +------
 arch/arm/cpu/s3c44b0/timer.c             |    6 ------
 arch/arm/cpu/sa1100/timer.c              |    5 -----
 arch/avr32/cpu/interrupts.c              |    7 -------
 arch/blackfin/cpu/interrupts.c           |    5 -----
 arch/m68k/cpu/mcf547x_8x/slicetimer.c    |    5 -----
 arch/m68k/lib/time.c                     |    5 -----
 arch/microblaze/cpu/timer.c              |    7 +------
 arch/mips/cpu/mips32/time.c              |    6 ------
 arch/powerpc/lib/interrupts.c            |    5 -----
 arch/sh/lib/time.c                       |    7 -------
 arch/sh/lib/time_sh2.c                   |    8 --------
 arch/sparc/lib/interrupts.c              |    7 +------
 arch/x86/lib/timer.c                     |    5 -----
 board/armltd/integrator/timer.c          |    5 -----
 board/armltd/vexpress/ca9x4_ct_vxp.c     |    5 -----
 board/nvidia/common/board.c              |    1 -
 49 files changed, 9 insertions(+), 270 deletions(-)

diff --git a/arch/arm/cpu/arm1136/mx31/timer.c b/arch/arm/cpu/arm1136/mx31/timer.c
index d51acbb..eac4ffb 100644
--- a/arch/arm/cpu/arm1136/mx31/timer.c
+++ b/arch/arm/cpu/arm1136/mx31/timer.c
@@ -113,11 +113,6 @@ void reset_timer_masked (void)
 	gd->tbl = 0; /* start "advancing" time stamp from 0 */
 }

-void reset_timer(void)
-{
-	reset_timer_masked();
-}
-
 unsigned long long get_ticks (void)
 {
 	ulong now = GPTCNT; /* current tick value */
diff --git a/arch/arm/cpu/arm1136/mx35/timer.c b/arch/arm/cpu/arm1136/mx35/timer.c
index 6dfb63a..80c0675 100644
--- a/arch/arm/cpu/arm1136/mx35/timer.c
+++ b/arch/arm/cpu/arm1136/mx35/timer.c
@@ -73,11 +73,6 @@ inline ulong get_timer_masked(void)
 	return val;
 }

-void reset_timer(void)
-{
-	reset_timer_masked();
-}
-
 ulong get_timer(ulong base)
 {
 	ulong tmp;
diff --git a/arch/arm/cpu/arm1136/omap24xx/timer.c b/arch/arm/cpu/arm1136/omap24xx/timer.c
index d6267ba..6f1ebbf 100644
--- a/arch/arm/cpu/arm1136/omap24xx/timer.c
+++ b/arch/arm/cpu/arm1136/omap24xx/timer.c
@@ -57,11 +57,6 @@ int timer_init (void)
 /*
  * timer without interrupts
  */
-void reset_timer (void)
-{
-	reset_timer_masked ();
-}
-
 ulong get_timer (ulong base)
 {
 	return get_timer_masked () - base;
diff --git a/arch/arm/cpu/arm1176/s3c64xx/timer.c b/arch/arm/cpu/arm1176/s3c64xx/timer.c
index 8e54060..bc21f86 100644
--- a/arch/arm/cpu/arm1176/s3c64xx/timer.c
+++ b/arch/arm/cpu/arm1176/s3c64xx/timer.c
@@ -142,11 +142,6 @@ void reset_timer_masked(void)
 	timestamp = 0;
 }

-void reset_timer(void)
-{
-	reset_timer_masked();
-}
-
 ulong get_timer_masked(void)
 {
 	unsigned long long res = get_ticks();
diff --git a/arch/arm/cpu/arm1176/tnetv107x/timer.c b/arch/arm/cpu/arm1176/tnetv107x/timer.c
index c27375c..b3123c5 100644
--- a/arch/arm/cpu/arm1176/tnetv107x/timer.c
+++ b/arch/arm/cpu/arm1176/tnetv107x/timer.c
@@ -60,15 +60,6 @@ int timer_init(void)
 	return 0;
 }

-void reset_timer(void)
-{
-	lastinc = timestamp = 0;
-
-	__raw_writel(0,		&regs->tcr);
-	__raw_writel(0,		&regs->tim34);
-	__raw_writel(2 << 22,	&regs->tcr);
-}
-
 static ulong get_timer_raw(void)
 {
 	ulong now = __raw_readl(&regs->tim34);
diff --git a/arch/arm/cpu/arm720t/interrupts.c b/arch/arm/cpu/arm720t/interrupts.c
index 164ca5d..9cd7fee 100644
--- a/arch/arm/cpu/arm720t/interrupts.c
+++ b/arch/arm/cpu/arm720t/interrupts.c
@@ -209,11 +209,6 @@ int timer_init (void)

 #if defined(CONFIG_IMPA7) || defined(CONFIG_EP7312) || defined(CONFIG_NETARM) || defined(CONFIG_ARMADILLO) || defined(CONFIG_LPC2292)

-void reset_timer (void)
-{
-	reset_timer_masked ();
-}
-
 ulong get_timer (ulong base)
 {
 	return get_timer_masked () - base;
diff --git a/arch/arm/cpu/arm920t/a320/timer.c b/arch/arm/cpu/arm920t/a320/timer.c
index b9c83c0..443d31d 100644
--- a/arch/arm/cpu/arm920t/a320/timer.c
+++ b/arch/arm/cpu/arm920t/a320/timer.c
@@ -81,12 +81,6 @@ void reset_timer_masked(void)
 	debug("%s(): lastdec = %lx\n", __func__, lastdec);
 }

-void reset_timer(void)
-{
-	debug("%s()\n", __func__);
-	reset_timer_masked();
-}
-
 /*
  * return timer ticks
  */
diff --git a/arch/arm/cpu/arm920t/at91/timer.c b/arch/arm/cpu/arm920t/at91/timer.c
index a69de57..374cc25 100644
--- a/arch/arm/cpu/arm920t/at91/timer.c
+++ b/arch/arm/cpu/arm920t/at91/timer.c
@@ -72,12 +72,6 @@ int timer_init(void)
 /*
  * timer without interrupts
  */
-
-void reset_timer(void)
-{
-	reset_timer_masked();
-}
-
 ulong get_timer(ulong base)
 {
 	return get_timer_masked() - base;
diff --git a/arch/arm/cpu/arm920t/at91rm9200/timer.c b/arch/arm/cpu/arm920t/at91rm9200/timer.c
index 0bcb775..9a1ae85 100644
--- a/arch/arm/cpu/arm920t/at91rm9200/timer.c
+++ b/arch/arm/cpu/arm920t/at91rm9200/timer.c
@@ -71,12 +71,6 @@ int timer_init (void)
 /*
  * timer without interrupts
  */
-
-void reset_timer (void)
-{
-	reset_timer_masked ();
-}
-
 ulong get_timer (ulong base)
 {
 	return get_timer_masked () - base;
diff --git a/arch/arm/cpu/arm920t/ep93xx/timer.c b/arch/arm/cpu/arm920t/ep93xx/timer.c
index 4a0ce4d..f19ec61 100644
--- a/arch/arm/cpu/arm920t/ep93xx/timer.c
+++ b/arch/arm/cpu/arm920t/ep93xx/timer.c
@@ -97,11 +97,6 @@ void reset_timer_masked(void)
 	timer.ticks = 0;
 }

-void reset_timer(void)
-{
-	reset_timer_masked();
-}
-
 void __udelay(unsigned long usec)
 {
 	unsigned long long target;
diff --git a/arch/arm/cpu/arm920t/imx/timer.c b/arch/arm/cpu/arm920t/imx/timer.c
index ff85a41..cdb2148 100644
--- a/arch/arm/cpu/arm920t/imx/timer.c
+++ b/arch/arm/cpu/arm920t/imx/timer.c
@@ -51,12 +51,6 @@ int timer_init (void)
 /*
  * timer without interrupts
  */
-
-void reset_timer (void)
-{
-	reset_timer_masked ();
-}
-
 ulong get_timer (ulong base)
 {
 	return get_timer_masked() - base;
diff --git a/arch/arm/cpu/arm920t/ks8695/timer.c b/arch/arm/cpu/arm920t/ks8695/timer.c
index 8e14109..c78fd90 100644
--- a/arch/arm/cpu/arm920t/ks8695/timer.c
+++ b/arch/arm/cpu/arm920t/ks8695/timer.c
@@ -33,7 +33,7 @@ ulong timer_ticks;

 int timer_init (void)
 {
-	reset_timer();
+	reset_timer_masked();

 	return 0;
 }
@@ -55,11 +55,6 @@ void reset_timer_masked(void)
 	timer_ticks = 0;
 }

-void reset_timer(void)
-{
-	reset_timer_masked();
-}
-
 ulong get_timer_masked(void)
 {
 	/* Check for timer wrap */
diff --git a/arch/arm/cpu/arm920t/s3c24x0/timer.c b/arch/arm/cpu/arm920t/s3c24x0/timer.c
index bba06d5..9c71b80 100644
--- a/arch/arm/cpu/arm920t/s3c24x0/timer.c
+++ b/arch/arm/cpu/arm920t/s3c24x0/timer.c
@@ -83,12 +83,6 @@ int timer_init(void)
 /*
  * timer without interrupts
  */
-
-void reset_timer(void)
-{
-	reset_timer_masked();
-}
-
 ulong get_timer(ulong base)
 {
 	return get_timer_masked() - base;
diff --git a/arch/arm/cpu/arm925t/timer.c b/arch/arm/cpu/arm925t/timer.c
index fdaeda5..9c965e0 100644
--- a/arch/arm/cpu/arm925t/timer.c
+++ b/arch/arm/cpu/arm925t/timer.c
@@ -64,12 +64,6 @@ int timer_init (void)
 /*
  * timer without interrupts
  */
-
-void reset_timer (void)
-{
-	reset_timer_masked ();
-}
-
 ulong get_timer (ulong base)
 {
 	return get_timer_masked () - base;
diff --git a/arch/arm/cpu/arm926ejs/armada100/timer.c b/arch/arm/cpu/arm926ejs/armada100/timer.c
index eb49234..86da0ce 100644
--- a/arch/arm/cpu/arm926ejs/armada100/timer.c
+++ b/arch/arm/cpu/arm926ejs/armada100/timer.c
@@ -100,11 +100,6 @@ ulong get_timer_masked(void)
 	return gd->tbu;
 }

-void reset_timer(void)
-{
-	reset_timer_masked();
-}
-
 ulong get_timer(ulong base)
 {
 	return ((get_timer_masked() / (CONFIG_SYS_HZ_CLOCK / 1000)) -
diff --git a/arch/arm/cpu/arm926ejs/davinci/timer.c b/arch/arm/cpu/arm926ejs/davinci/timer.c
index 1c6fa4a..8b1734c 100644
--- a/arch/arm/cpu/arm926ejs/davinci/timer.c
+++ b/arch/arm/cpu/arm926ejs/davinci/timer.c
@@ -78,11 +78,6 @@ int timer_init(void)
 	return(0);
 }

-void reset_timer(void)
-{
-	gd->timer_reset_value = get_ticks();
-}
-
 /*
  * Get the current 64 bit timer tick count
  */
diff --git a/arch/arm/cpu/arm926ejs/kirkwood/timer.c b/arch/arm/cpu/arm926ejs/kirkwood/timer.c
index e890edb..5beb3f5 100644
--- a/arch/arm/cpu/arm926ejs/kirkwood/timer.c
+++ b/arch/arm/cpu/arm926ejs/kirkwood/timer.c
@@ -112,11 +112,6 @@ ulong get_timer_masked(void)
 	return timestamp;
 }

-void reset_timer(void)
-{
-	reset_timer_masked();
-}
-
 ulong get_timer(ulong base)
 {
 	return get_timer_masked() - base;
diff --git a/arch/arm/cpu/arm926ejs/mb86r0x/timer.c b/arch/arm/cpu/arm926ejs/mb86r0x/timer.c
index 6966b0d..5f54085 100644
--- a/arch/arm/cpu/arm926ejs/mb86r0x/timer.c
+++ b/arch/arm/cpu/arm926ejs/mb86r0x/timer.c
@@ -121,11 +121,6 @@ void __udelay(unsigned long usec)
 		 /*NOP*/;
 }

-void reset_timer(void)
-{
-	reset_timer_masked();
-}
-
 ulong get_timer(ulong base)
 {
 	return get_timer_masked() - base;
diff --git a/arch/arm/cpu/arm926ejs/mx25/timer.c b/arch/arm/cpu/arm926ejs/mx25/timer.c
index af26b4c..9a84b50 100644
--- a/arch/arm/cpu/arm926ejs/mx25/timer.c
+++ b/arch/arm/cpu/arm926ejs/mx25/timer.c
@@ -130,11 +130,6 @@ void reset_timer_masked(void)
 	timestamp = 0; /* start "advancing" time stamp from 0 */
 }

-void reset_timer(void)
-{
-	reset_timer_masked();
-}
-
 unsigned long long get_ticks (void)
 {
 	struct gpt_regs *gpt = (struct gpt_regs *)IMX_GPT1_BASE;
diff --git a/arch/arm/cpu/arm926ejs/mx27/timer.c b/arch/arm/cpu/arm926ejs/mx27/timer.c
index 127e670..058dbee 100644
--- a/arch/arm/cpu/arm926ejs/mx27/timer.c
+++ b/arch/arm/cpu/arm926ejs/mx27/timer.c
@@ -133,11 +133,6 @@ void reset_timer_masked(void)
 	timestamp = 0; /* start "advancing" time stamp from 0 */
 }

-void reset_timer(void)
-{
-	reset_timer_masked();
-}
-
 unsigned long long get_ticks (void)
 {
 	struct gpt_regs *regs = (struct gpt_regs *)IMX_TIM1_BASE;
diff --git a/arch/arm/cpu/arm926ejs/nomadik/timer.c b/arch/arm/cpu/arm926ejs/nomadik/timer.c
index 1d98ef3..1cd0e1f 100644
--- a/arch/arm/cpu/arm926ejs/nomadik/timer.c
+++ b/arch/arm/cpu/arm926ejs/nomadik/timer.c
@@ -40,16 +40,12 @@
 /* Configure a free-running, auto-wrap counter with no prescaler */
 int timer_init(void)
 {
+	ulong val;
+
 	writel(MTU_CRn_ENA | MTU_CRn_PRESCALE_1 | MTU_CRn_32BITS,
 	       CONFIG_SYS_TIMERBASE + MTU_CR(0));
-	reset_timer();
-	return 0;
-}

-/* Restart counting from 0 */
-void reset_timer(void)
-{
-	ulong val;
+	/* Reset the timer */
 	writel(0, CONFIG_SYS_TIMERBASE + MTU_LR(0));
 	/*
 	 * The load-register isn't really immediate: it changes on clock
@@ -59,6 +55,8 @@ void reset_timer(void)
 	val = READ_TIMER();
 	while (READ_TIMER() == val)
 		;
+
+	return 0;
 }

 /* Return how many HZ passed since "base" */
diff --git a/arch/arm/cpu/arm926ejs/omap/timer.c b/arch/arm/cpu/arm926ejs/omap/timer.c
index f2e4deb..390c9c8 100644
--- a/arch/arm/cpu/arm926ejs/omap/timer.c
+++ b/arch/arm/cpu/arm926ejs/omap/timer.c
@@ -65,12 +65,6 @@ int timer_init (void)
 /*
  * timer without interrupts
  */
-
-void reset_timer (void)
-{
-	reset_timer_masked ();
-}
-
 ulong get_timer (ulong base)
 {
 	return get_timer_masked () - base;
diff --git a/arch/arm/cpu/arm926ejs/orion5x/timer.c b/arch/arm/cpu/arm926ejs/orion5x/timer.c
index f691c99..5bc43c8 100644
--- a/arch/arm/cpu/arm926ejs/orion5x/timer.c
+++ b/arch/arm/cpu/arm926ejs/orion5x/timer.c
@@ -119,11 +119,6 @@ ulong get_timer_masked(void)
 	return timestamp;
 }

-void reset_timer(void)
-{
-	reset_timer_masked();
-}
-
 ulong get_timer(ulong base)
 {
 	return get_timer_masked() - base;
diff --git a/arch/arm/cpu/arm926ejs/pantheon/timer.c b/arch/arm/cpu/arm926ejs/pantheon/timer.c
index b487416..2727adc 100644
--- a/arch/arm/cpu/arm926ejs/pantheon/timer.c
+++ b/arch/arm/cpu/arm926ejs/pantheon/timer.c
@@ -108,11 +108,6 @@ ulong get_timer_masked(void)
 	return gd->tbu;
 }

-void reset_timer(void)
-{
-	reset_timer_masked();
-}
-
 ulong get_timer(ulong base)
 {
 	return ((get_timer_masked() / (CONFIG_SYS_HZ_CLOCK / 1000)) -
diff --git a/arch/arm/cpu/arm926ejs/spear/timer.c b/arch/arm/cpu/arm926ejs/spear/timer.c
index 7305abd..cbef34f 100644
--- a/arch/arm/cpu/arm926ejs/spear/timer.c
+++ b/arch/arm/cpu/arm926ejs/spear/timer.c
@@ -76,12 +76,6 @@ int timer_init(void)
 /*
  * timer without interrupts
  */
-
-void reset_timer(void)
-{
-	reset_timer_masked();
-}
-
 ulong get_timer(ulong base)
 {
 	return (get_timer_masked() / GPT_RESOLUTION) - base;
diff --git a/arch/arm/cpu/arm926ejs/versatile/timer.c b/arch/arm/cpu/arm926ejs/versatile/timer.c
index 0e51a63..f58e151 100644
--- a/arch/arm/cpu/arm926ejs/versatile/timer.c
+++ b/arch/arm/cpu/arm926ejs/versatile/timer.c
@@ -94,12 +94,6 @@ int timer_init (void)
 /*
  * timer without interrupts
  */
-
-void reset_timer (void)
-{
-	reset_timer_masked ();
-}
-
 ulong get_timer (ulong base)
 {
 	return get_timer_masked () - base;
diff --git a/arch/arm/cpu/armv7/mx5/timer.c b/arch/arm/cpu/armv7/mx5/timer.c
index 40ee0be..4525beb 100644
--- a/arch/arm/cpu/armv7/mx5/timer.c
+++ b/arch/arm/cpu/armv7/mx5/timer.c
@@ -69,11 +69,6 @@ int timer_init(void)
 	return 0;
 }

-void reset_timer(void)
-{
-	reset_timer_masked();
-}
-
 void reset_timer_masked(void)
 {
 	ulong val = __raw_readl(&cur_gpt->counter);
diff --git a/arch/arm/cpu/armv7/omap-common/timer.c b/arch/arm/cpu/armv7/omap-common/timer.c
index a0f6b7c..4756e26 100644
--- a/arch/arm/cpu/armv7/omap-common/timer.c
+++ b/arch/arm/cpu/armv7/omap-common/timer.c
@@ -63,11 +63,6 @@ int timer_init(void)
 /*
  * timer without interrupts
  */
-void reset_timer(void)
-{
-	reset_timer_masked();
-}
-
 ulong get_timer(ulong base)
 {
 	return get_timer_masked() - base;
diff --git a/arch/arm/cpu/armv7/s5p-common/timer.c b/arch/arm/cpu/armv7/s5p-common/timer.c
index 0b69f06..359c21f 100644
--- a/arch/arm/cpu/armv7/s5p-common/timer.c
+++ b/arch/arm/cpu/armv7/s5p-common/timer.c
@@ -50,11 +50,6 @@ int timer_init(void)
 /*
  * timer without interrupts
  */
-void reset_timer(void)
-{
-	reset_timer_masked();
-}
-
 unsigned long get_timer(unsigned long base)
 {
 	return get_timer_masked() - base;
diff --git a/arch/arm/cpu/armv7/tegra2/timer.c b/arch/arm/cpu/armv7/tegra2/timer.c
index 4458de9..2761c12 100644
--- a/arch/arm/cpu/armv7/tegra2/timer.c
+++ b/arch/arm/cpu/armv7/tegra2/timer.c
@@ -48,11 +48,6 @@ struct timerus *timer_base = (struct timerus *)NV_PA_TMRUS_BASE;
 #define TIMER_LOAD_VAL	0xffffffff

 /* timer without interrupts */
-void reset_timer(void)
-{
-	reset_timer_masked();
-}
-
 ulong get_timer(ulong base)
 {
 	return get_timer_masked() - base;
diff --git a/arch/arm/cpu/ixp/timer.c b/arch/arm/cpu/ixp/timer.c
index c25e72f..087ddf8 100644
--- a/arch/arm/cpu/ixp/timer.c
+++ b/arch/arm/cpu/ixp/timer.c
@@ -89,11 +89,6 @@ void reset_timer_masked(void)
 	gd->timestamp = 0;
 }

-void reset_timer(void)
-{
-	reset_timer_masked();
-}
-
 ulong get_timer_masked(void)
 {
 	return tick_to_time(get_ticks());
diff --git a/arch/arm/cpu/lh7a40x/timer.c b/arch/arm/cpu/lh7a40x/timer.c
index 6c6277d..58b35b1 100644
--- a/arch/arm/cpu/lh7a40x/timer.c
+++ b/arch/arm/cpu/lh7a40x/timer.c
@@ -74,12 +74,6 @@ int timer_init (void)
 /*
  * timer without interrupts
  */
-
-void reset_timer (void)
-{
-	reset_timer_masked ();
-}
-
 ulong get_timer (ulong base)
 {
 	return (get_timer_masked() - base);
diff --git a/arch/arm/cpu/pxa/timer.c b/arch/arm/cpu/pxa/timer.c
index 8900a70..44dae9a 100644
--- a/arch/arm/cpu/pxa/timer.c
+++ b/arch/arm/cpu/pxa/timer.c
@@ -59,16 +59,11 @@ static inline unsigned long long us_to_tick(unsigned long long us)

 int timer_init (void)
 {
-	reset_timer();
+	reset_timer_masked();

 	return 0;
 }

-void reset_timer (void)
-{
-	reset_timer_masked ();
-}
-
 ulong get_timer (ulong base)
 {
 	return get_timer_masked () - base;
diff --git a/arch/arm/cpu/s3c44b0/timer.c b/arch/arm/cpu/s3c44b0/timer.c
index d30e1aa..ce48952 100644
--- a/arch/arm/cpu/s3c44b0/timer.c
+++ b/arch/arm/cpu/s3c44b0/timer.c
@@ -59,12 +59,6 @@ int timer_init (void)
 /*
  * timer without interrupts
  */
-
-void reset_timer (void)
-{
-	reset_timer_masked ();
-}
-
 ulong get_timer (ulong base)
 {
 	return get_timer_masked () - base;
diff --git a/arch/arm/cpu/sa1100/timer.c b/arch/arm/cpu/sa1100/timer.c
index 10ad964..694c03a 100644
--- a/arch/arm/cpu/sa1100/timer.c
+++ b/arch/arm/cpu/sa1100/timer.c
@@ -34,11 +34,6 @@ int timer_init (void)
 	return 0;
 }

-void reset_timer (void)
-{
-	reset_timer_masked ();
-}
-
 ulong get_timer (ulong base)
 {
 	return get_timer_masked ();
diff --git a/arch/avr32/cpu/interrupts.c b/arch/avr32/cpu/interrupts.c
index 8406f91..6681e13 100644
--- a/arch/avr32/cpu/interrupts.c
+++ b/arch/avr32/cpu/interrupts.c
@@ -62,13 +62,6 @@ unsigned long long get_ticks(void)
 	return ((unsigned long long)hi_now << 32) | lo;
 }

-void reset_timer(void)
-{
-	sysreg_write(COUNT, 0);
-	cpu_sync_pipeline();	/* process any pending interrupts */
-	timer_overflow = 0;
-}
-
 unsigned long get_timer(unsigned long base)
 {
 	u64 now = get_ticks();
diff --git a/arch/blackfin/cpu/interrupts.c b/arch/blackfin/cpu/interrupts.c
index 54a67b4..9189816 100644
--- a/arch/blackfin/cpu/interrupts.c
+++ b/arch/blackfin/cpu/interrupts.c
@@ -152,8 +152,3 @@ ulong get_timer(ulong base)

 	return (milisec - base);
 }
-
-void reset_timer(void)
-{
-	timer_init();
-}
diff --git a/arch/m68k/cpu/mcf547x_8x/slicetimer.c b/arch/m68k/cpu/mcf547x_8x/slicetimer.c
index 49dba6a..467a807 100644
--- a/arch/m68k/cpu/mcf547x_8x/slicetimer.c
+++ b/arch/m68k/cpu/mcf547x_8x/slicetimer.c
@@ -95,11 +95,6 @@ void timer_init(void)
 	timerp->cr = SLT_CR_RUN | SLT_CR_IEN | SLT_CR_TEN;
 }

-void reset_timer(void)
-{
-	timestamp = 0;
-}
-
 ulong get_timer(ulong base)
 {
 	return (timestamp - base);
diff --git a/arch/m68k/lib/time.c b/arch/m68k/lib/time.c
index d10bcc7..a316cdf 100644
--- a/arch/m68k/lib/time.c
+++ b/arch/m68k/lib/time.c
@@ -116,11 +116,6 @@ void timer_init(void)
 	    DTIM_DTMR_FRR | DTIM_DTMR_ORRI | DTIM_DTMR_RST_EN;
 }

-void reset_timer(void)
-{
-	timestamp = 0;
-}
-
 ulong get_timer(ulong base)
 {
 	return (timestamp - base);
diff --git a/arch/microblaze/cpu/timer.c b/arch/microblaze/cpu/timer.c
index 59ed126..a167755 100644
--- a/arch/microblaze/cpu/timer.c
+++ b/arch/microblaze/cpu/timer.c
@@ -28,11 +28,6 @@

 volatile int timestamp = 0;

-void reset_timer (void)
-{
-	timestamp = 0;
-}
-
 #ifdef CONFIG_SYS_TIMER_0
 ulong get_timer (ulong base)
 {
@@ -61,7 +56,7 @@ int timer_init (void)
 	tmr->control = TIMER_INTERRUPT | TIMER_RESET;
 	tmr->control =
 	    TIMER_ENABLE | TIMER_ENABLE_INTR | TIMER_RELOAD | TIMER_DOWN_COUNT;
-	reset_timer ();
+	timestamp = 0;
 	install_interrupt_handler (CONFIG_SYS_TIMER_0_IRQ, timer_isr, (void *)tmr);
 	return 0;
 }
diff --git a/arch/mips/cpu/mips32/time.c b/arch/mips/cpu/mips32/time.c
index b0a9c1f..350896a 100644
--- a/arch/mips/cpu/mips32/time.c
+++ b/arch/mips/cpu/mips32/time.c
@@ -42,12 +42,6 @@ int timer_init(void)
 	return 0;
 }

-void reset_timer(void)
-{
-	timestamp = 0;
-	write_c0_compare(read_c0_count() + CYCLES_PER_JIFFY);
-}
-
 ulong get_timer(ulong base)
 {
 	unsigned int count;
diff --git a/arch/powerpc/lib/interrupts.c b/arch/powerpc/lib/interrupts.c
index 847ad37..aeae413 100644
--- a/arch/powerpc/lib/interrupts.c
+++ b/arch/powerpc/lib/interrupts.c
@@ -137,11 +137,6 @@ void timer_interrupt (struct pt_regs *regs)
 #endif /* CONFIG_SHOW_ACTIVITY */
 }

-void reset_timer (void)
-{
-	timestamp = 0;
-}
-
 ulong get_timer (ulong base)
 {
 	return (timestamp - base);
diff --git a/arch/sh/lib/time.c b/arch/sh/lib/time.c
index c4bfc86..c70baed 100644
--- a/arch/sh/lib/time.c
+++ b/arch/sh/lib/time.c
@@ -139,13 +139,6 @@ unsigned long get_timer (unsigned long base)
 	return tick_to_time(get_ticks()) - base;
 }

-void reset_timer (void)
-{
-	tmu_timer_stop(0);
-	writel(0, TCNT0);
-	tmu_timer_start(0);
-}
-
 unsigned long get_tbclk (void)
 {
 	return timer_freq;
diff --git a/arch/sh/lib/time_sh2.c b/arch/sh/lib/time_sh2.c
index a5c838b..5827118 100644
--- a/arch/sh/lib/time_sh2.c
+++ b/arch/sh/lib/time_sh2.c
@@ -90,14 +90,6 @@ ulong get_timer(ulong base)
 	return (get_usec() / 1000) - base;
 }

-void reset_timer(void)
-{
-	cmt_timer_stop(0);
-	writew(CMT_TIMER_RESET, CMCOR_0);
-	cmt0_timer = 0;
-	cmt_timer_start(0);
-}
-
 void __udelay(unsigned long usec)
 {
 	unsigned long end = get_usec() + usec;
diff --git a/arch/sparc/lib/interrupts.c b/arch/sparc/lib/interrupts.c
index 5274311..61ee90b 100644
--- a/arch/sparc/lib/interrupts.c
+++ b/arch/sparc/lib/interrupts.c
@@ -90,11 +90,6 @@ void timer_interrupt(struct pt_regs *regs)
 	timestamp++;
 }

-void reset_timer(void)
-{
-	timestamp = 0;
-}
-
 ulong get_timer(ulong base)
 {
 	return (timestamp - base);
@@ -104,7 +99,7 @@ void timer_interrupt_init(void)
 {
 	int irq;

-	reset_timer();
+	timestamp = 0;

 	irq = timer_interrupt_init_cpu();

diff --git a/arch/x86/lib/timer.c b/arch/x86/lib/timer.c
index 199ca8e..a822d66 100644
--- a/arch/x86/lib/timer.c
+++ b/arch/x86/lib/timer.c
@@ -94,11 +94,6 @@ void timer_isr(void *unused)
 	}
 }

-void reset_timer (void)
-{
-	system_ticks = 0;
-}
-
 ulong get_timer (ulong base)
 {
 	return (system_ticks - base);
diff --git a/board/armltd/integrator/timer.c b/board/armltd/integrator/timer.c
index 5406066..6734e8d 100644
--- a/board/armltd/integrator/timer.c
+++ b/board/armltd/integrator/timer.c
@@ -107,11 +107,6 @@ int timer_init (void)
 /*
  * timer without interrupts
  */
-void reset_timer (void)
-{
-	reset_timer_masked ();
-}
-
 ulong get_timer (ulong base_ticks)
 {
 	return get_timer_masked () - base_ticks;
diff --git a/board/armltd/vexpress/ca9x4_ct_vxp.c b/board/armltd/vexpress/ca9x4_ct_vxp.c
index 6e5884b..da6f14d 100644
--- a/board/armltd/vexpress/ca9x4_ct_vxp.c
+++ b/board/armltd/vexpress/ca9x4_ct_vxp.c
@@ -199,11 +199,6 @@ void reset_timer_masked(void)
 	timestamp = 0;
 }

-void reset_timer(void)
-{
-	reset_timer_masked();
-}
-
 ulong get_timer_masked(void)
 {
 	ulong now = readl(&systimer_base->timer0value) / 1000;
diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index 3d6c248..c48c7ef 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -62,7 +62,6 @@ int board_early_init_f(void)
  */
 int timer_init(void)
 {
-	reset_timer();
 	return 0;
 }

--
1.7.5.2.317.g391b14

  reply	other threads:[~2011-07-16  9:36 UTC|newest]

Thread overview: 110+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-28 11:40 [U-Boot] [PATCH v1 (WIP) 00/16] [Timer]API Rewrite Graeme Russ
2011-06-28 11:40 ` [U-Boot] [PATCH v1 (WIP) 01/16] [Timer]Fix misuse of ARM *timer_masked() functions outside arch/arm Graeme Russ
2011-06-28 12:35   ` Andreas Bießmann
2011-07-11 21:57   ` Wolfgang Denk
2011-07-14 17:01     ` Albert ARIBAUD
2011-07-14 19:50       ` Wolfgang Denk
2011-07-14 23:24         ` Graeme Russ
2011-07-15  6:31           ` Wolfgang Denk
2011-07-15  7:00             ` Graeme Russ
2011-07-15 12:16   ` [U-Boot] [PATCH v2 1/7]Timer: Fix " Graeme Russ
2011-07-16  8:40     ` Albert ARIBAUD
2011-07-16  8:59       ` Graeme Russ
2011-07-16  9:12         ` Albert ARIBAUD
2011-07-16  9:31     ` [U-Boot] [PATCH v3 " Graeme Russ
2011-07-16  9:58       ` Albert ARIBAUD
2011-06-28 11:40 ` [U-Boot] [PATCH v1 (WIP) 02/16] [Timer]Remove calls to set_timer outside arch/ Graeme Russ
2011-07-11 21:58   ` Wolfgang Denk
2011-07-15 12:17   ` [U-Boot] [PATCH v2 2/7]Timer: Remove " Graeme Russ
2011-07-16  9:33     ` [U-Boot] [PATCH v3 " Graeme Russ
2011-07-26 12:52       ` Wolfgang Denk
2011-06-28 11:40 ` [U-Boot] [PATCH v1 (WIP) 03/16] [Timer]Remove calls to set_timer in arch/ Graeme Russ
2011-07-11 21:59   ` Wolfgang Denk
2011-07-15 12:18   ` [U-Boot] [PATCH v2 3/7]Timer: Remove set_timer completely Graeme Russ
2011-07-16  9:34     ` [U-Boot] [PATCH v3 " Graeme Russ
2011-07-26 12:52       ` Wolfgang Denk
2011-06-28 11:40 ` [U-Boot] [PATCH v1 (WIP) 04/16] [Timer]Allow reset_timer() only for Nios2 Graeme Russ
2011-07-11 22:01   ` Wolfgang Denk
2011-07-15 12:18   ` [U-Boot] [PATCH v2 4/7]Timer: Allow reset_timer() only for systems with low resolution timers Graeme Russ
2011-07-16  9:35     ` [U-Boot] [PATCH v3 " Graeme Russ
2011-07-26 12:53       ` Wolfgang Denk
2011-06-28 11:40 ` [U-Boot] [PATCH v1 (WIP) 05/16] [Timer]Remove reset_timer() for non-Nios2 arches Graeme Russ
2011-07-11 22:02   ` Wolfgang Denk
2011-07-15  0:01     ` Graeme Russ
2011-07-15 12:19   ` [U-Boot] [PATCH v2 5/7]Timer: Remove " Graeme Russ
2011-07-16  9:36     ` Graeme Russ [this message]
2011-07-26 12:53       ` [U-Boot] [PATCH v3 " Wolfgang Denk
2011-08-19 21:24         ` Mike Frysinger
2011-08-19 22:55           ` Graeme Russ
2011-08-19 23:12             ` Mike Frysinger
2011-09-28 19:24           ` Wolfgang Denk
2011-06-28 11:40 ` [U-Boot] [PATCH v1 (WIP) 06/16] [Timer]Fix at91rm9200/spi.c timer usage Graeme Russ
2011-06-28 12:30   ` Andreas Bießmann
2011-07-15 12:20   ` [U-Boot] [PATCH v2 6/7]Timer: Fix " Graeme Russ
2011-07-16  9:37     ` [U-Boot] [PATCH v3 " Graeme Russ
2011-07-26 12:54       ` Wolfgang Denk
2011-06-28 11:41 ` [U-Boot] [PATCH v1 (WIP) 07/16] [Timer]Remove reset_timer_masked() Graeme Russ
2011-07-11 22:04   ` Wolfgang Denk
2011-07-15 12:21   ` [U-Boot] [PATCH v2 7/7]Timer: Remove reset_timer_masked() Graeme Russ
2011-07-16  9:38     ` [U-Boot] [PATCH v3 " Graeme Russ
2011-07-26 12:54       ` Wolfgang Denk
2011-06-28 11:41 ` [U-Boot] [PATCH v1 (WIP) 08/16] [Timer]Create new userland timer API Graeme Russ
2011-06-29  4:31   ` Simon Glass
2011-06-29  4:36     ` Graeme Russ
2011-06-29  4:48       ` Simon Glass
2011-07-11 22:05   ` Wolfgang Denk
2011-07-11 22:32     ` Graeme Russ
2011-06-28 11:41 ` [U-Boot] [PATCH v1 (WIP) 09/16] [Timer]Replace get_timer() usage in drivers/block/ Graeme Russ
2011-06-29  4:40   ` Simon Glass
2011-06-29  5:06     ` Reinhard Meyer
2011-06-29  5:19       ` Graeme Russ
2011-06-29  5:30         ` Simon Glass
2011-06-29  5:38           ` Graeme Russ
2011-06-28 11:41 ` [U-Boot] [PATCH v1 (WIP) 10/16] [Timer]Replace get_timer() usage in driver/mtd and driver/block Graeme Russ
2011-06-28 11:41 ` [U-Boot] [PATCH v1 (WIP) 11/16] [Timer]Remove reset_timer() completely Graeme Russ
2011-06-28 11:41 ` [U-Boot] [PATCH v1 (WIP) 12/16] [Timer]Replace get_timer() usage in drivers/ Graeme Russ
2011-06-28 12:36   ` Vitaly Kuzmichev
2011-06-28 23:03     ` Graeme Russ
2011-06-28 11:41 ` [U-Boot] [PATCH v1 (WIP) 13/16] [Timer]Replace get_timer() usage in net/ Graeme Russ
2011-06-28 11:41 ` [U-Boot] [PATCH v1 (WIP) 14/16] [Timer]Replace get_timer() usage in common/ Graeme Russ
2011-06-28 11:41 ` [U-Boot] [PATCH v1 (WIP) 15/16] [Timer]Replace get_timer() usage in board/ Graeme Russ
2011-06-28 11:41 ` [U-Boot] [PATCH v1 (WIP) 16/16] [Timer]Replace get_timer() usage in arch/ Graeme Russ
2011-06-29  4:45   ` Simon Glass
2011-06-29  4:51     ` Graeme Russ
2011-06-29  5:15       ` Mike Frysinger
2011-06-29  5:26         ` Mike Frysinger
2011-06-29  5:29           ` Graeme Russ
2011-06-29  4:54 ` [U-Boot] [PATCH v1 (WIP) 00/16] [Timer]API Rewrite Graeme Russ
2011-06-29  5:08 ` Mike Frysinger
2011-06-29  5:20   ` Graeme Russ
2011-07-08  0:25 ` Graeme Russ
2011-07-09  6:01   ` Albert ARIBAUD
2011-07-11 21:56 ` Wolfgang Denk
2011-07-11 22:49   ` Graeme Russ
2011-07-11 23:36   ` Graeme Russ
2011-07-12  2:17     ` Graeme Russ
2011-07-12  8:49       ` Wolfgang Denk
2011-07-12 10:36         ` Graeme Russ
2011-07-12 13:10           ` Wolfgang Denk
2011-07-12 15:23             ` Scott McNutt
2011-07-12 17:27               ` J. William Campbell
2011-07-13  0:29             ` Graeme Russ
2011-07-14 19:30               ` Wolfgang Denk
2011-07-17  1:51           ` Graeme Russ
2011-07-12 14:30       ` J. William Campbell
2011-07-12 16:08         ` Reinhard Meyer
2011-07-13  0:33           ` Graeme Russ
2011-07-13  1:20             ` J. William Campbell
2011-07-14 19:41               ` Wolfgang Denk
2011-07-14 23:52                 ` J. William Campbell
2011-07-15  7:17                   ` Wolfgang Denk
2011-07-15 18:08                     ` J. William Campbell
2011-07-15 18:34                       ` Wolfgang Denk
2011-07-15 21:03                         ` J. William Campbell
2011-07-16 14:11                           ` Graeme Russ
2011-07-15 12:15 ` [U-Boot] [PATCH v2 0/7]Timer: Simplify API Graeme Russ
2011-07-15 13:08   ` Graeme Russ
2011-07-16  8:36     ` Albert ARIBAUD
2011-07-16  9:01       ` Graeme Russ
2011-07-16  9:13         ` Albert ARIBAUD
2011-07-16  9:32         ` Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1310809000-3402-1-git-send-email-graeme.russ@gmail.com \
    --to=graeme.russ@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.