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 v2 7/7]Timer: Remove reset_timer_masked()
Date: Fri, 15 Jul 2011 22:21:14 +1000	[thread overview]
Message-ID: <1310732474-5541-1-git-send-email-graeme.russ@gmail.com> (raw)
In-Reply-To: <1309261269-4363-8-git-send-email-graeme.russ@gmail.com>

In some circumstances, reset_timer_masked() was called be timer_init() in
order to perform architecture specific timer initialisation. In such
cases, the required code in reset_timer_masked() has been moved into
timer_init()
---
Changes since v1 ((WIP) [Timer]API Rewrite):
 - Rebased to 68d4230c3ccce96a72c5b99e48399bf1796fe3c6
 - Updated description

 arch/arm/cpu/arm1136/mx31/timer.c        |    7 -------
 arch/arm/cpu/arm1136/omap24xx/timer.c    |   14 +++++++-------
 arch/arm/cpu/arm1176/s3c64xx/timer.c     |    7 -------
 arch/arm/cpu/arm720t/interrupts.c        |    7 -------
 arch/arm/cpu/arm920t/at91/timer.c        |    8 --------
 arch/arm/cpu/arm920t/at91rm9200/timer.c  |    7 -------
 arch/arm/cpu/arm920t/ep93xx/timer.c      |   10 +++-------
 arch/arm/cpu/arm920t/imx/timer.c         |   10 +++-------
 arch/arm/cpu/arm920t/ks8695/timer.c      |   15 +++++----------
 arch/arm/cpu/arm920t/s3c24x0/timer.c     |    7 -------
 arch/arm/cpu/arm925t/timer.c             |   12 +++---------
 arch/arm/cpu/arm926ejs/armada100/timer.c |   10 ++--------
 arch/arm/cpu/arm926ejs/kirkwood/timer.c  |   10 ++--------
 arch/arm/cpu/arm926ejs/mb86r0x/timer.c   |   14 +++-----------
 arch/arm/cpu/arm926ejs/mx25/timer.c      |    9 ---------
 arch/arm/cpu/arm926ejs/mx27/timer.c      |    9 ---------
 arch/arm/cpu/arm926ejs/orion5x/timer.c   |   10 ++--------
 arch/arm/cpu/arm926ejs/pantheon/timer.c  |   10 ++--------
 arch/arm/cpu/arm926ejs/spear/timer.c     |   11 +++--------
 arch/arm/cpu/armv7/mx5/timer.c           |   10 ++++------
 arch/arm/cpu/armv7/omap-common/timer.c   |   11 +++--------
 arch/arm/cpu/armv7/tegra2/timer.c        |    7 -------
 arch/arm/cpu/pxa/timer.c                 |    8 +-------
 arch/arm/cpu/s3c44b0/timer.c             |    7 -------
 arch/arm/cpu/sa1100/timer.c              |    6 ------
 board/armltd/integrator/timer.c          |   13 ++++---------
 26 files changed, 47 insertions(+), 202 deletions(-)

diff --git a/arch/arm/cpu/arm1136/mx31/timer.c b/arch/arm/cpu/arm1136/mx31/timer.c
index eac4ffb..c05a39d 100644
--- a/arch/arm/cpu/arm1136/mx31/timer.c
+++ b/arch/arm/cpu/arm1136/mx31/timer.c
@@ -106,13 +106,6 @@ int timer_init (void)
 	return 0;
 }

-void reset_timer_masked (void)
-{
-	/* reset time */
-	gd->lastinc = GPTCNT; /* capture current incrementer value time */
-	gd->tbl = 0; /* start "advancing" time stamp from 0 */
-}
-
 unsigned long long get_ticks (void)
 {
 	ulong now = GPTCNT; /* current tick value */
diff --git a/arch/arm/cpu/arm1136/omap24xx/timer.c b/arch/arm/cpu/arm1136/omap24xx/timer.c
index 6f1ebbf..73bf4a7 100644
--- a/arch/arm/cpu/arm1136/omap24xx/timer.c
+++ b/arch/arm/cpu/arm1136/omap24xx/timer.c
@@ -41,6 +41,13 @@

 DECLARE_GLOBAL_DATA_PTR;

+static void reset_timer_masked (void)
+{
+	/* reset time */
+	gd->lastinc = READ_TIMER;	/* capture current incrementer value time */
+	gd->tbl = 0;			/* start "advancing" time stamp from 0 */
+}
+
 int timer_init (void)
 {
 	int32_t val;
@@ -85,13 +92,6 @@ void __udelay (unsigned long usec)
 		/*NOP*/;
 }

-void reset_timer_masked (void)
-{
-	/* reset time */
-	gd->lastinc = READ_TIMER;	/* capture current incrementer value time */
-	gd->tbl = 0;			/* start "advancing" time stamp from 0 */
-}
-
 ulong get_timer_masked (void)
 {
 	ulong now = READ_TIMER;		/* current tick value */
diff --git a/arch/arm/cpu/arm1176/s3c64xx/timer.c b/arch/arm/cpu/arm1176/s3c64xx/timer.c
index bc21f86..f16a37b 100644
--- a/arch/arm/cpu/arm1176/s3c64xx/timer.c
+++ b/arch/arm/cpu/arm1176/s3c64xx/timer.c
@@ -135,13 +135,6 @@ ulong get_tbclk(void)
 	return (ulong)(timer_load_val / 100);
 }

-void reset_timer_masked(void)
-{
-	/* reset time */
-	lastdec = read_timer();
-	timestamp = 0;
-}
-
 ulong get_timer_masked(void)
 {
 	unsigned long long res = get_ticks();
diff --git a/arch/arm/cpu/arm720t/interrupts.c b/arch/arm/cpu/arm720t/interrupts.c
index 9cd7fee..fa9c5a2 100644
--- a/arch/arm/cpu/arm720t/interrupts.c
+++ b/arch/arm/cpu/arm720t/interrupts.c
@@ -233,13 +233,6 @@ void __udelay (unsigned long usec)
 #endif
 }

-void reset_timer_masked (void)
-{
-	/* reset time */
-	lastdec = READ_TIMER;
-	timestamp = 0;
-}
-
 ulong get_timer_masked (void)
 {
 	ulong now = READ_TIMER;
diff --git a/arch/arm/cpu/arm920t/at91/timer.c b/arch/arm/cpu/arm920t/at91/timer.c
index 374cc25..c321e28 100644
--- a/arch/arm/cpu/arm920t/at91/timer.c
+++ b/arch/arm/cpu/arm920t/at91/timer.c
@@ -82,14 +82,6 @@ void __udelay(unsigned long usec)
 	udelay_masked(usec);
 }

-void reset_timer_masked(void)
-{
-	/* reset time */
-	at91_tc_t *tc = (at91_tc_t *) ATMEL_BASE_TC;
-	gd->lastinc = readl(&tc->tc[0].cv) & 0x0000ffff;
-	gd->tbl = 0;
-}
-
 ulong get_timer_raw(void)
 {
 	at91_tc_t *tc = (at91_tc_t *) ATMEL_BASE_TC;
diff --git a/arch/arm/cpu/arm920t/at91rm9200/timer.c b/arch/arm/cpu/arm920t/at91rm9200/timer.c
index 9a1ae85..fbe74b6 100644
--- a/arch/arm/cpu/arm920t/at91rm9200/timer.c
+++ b/arch/arm/cpu/arm920t/at91rm9200/timer.c
@@ -81,13 +81,6 @@ void __udelay (unsigned long usec)
 	udelay_masked(usec);
 }

-void reset_timer_masked (void)
-{
-	/* reset time */
-	lastinc = READ_TIMER;
-	timestamp = 0;
-}
-
 ulong get_timer_raw (void)
 {
 	ulong now = READ_TIMER;
diff --git a/arch/arm/cpu/arm920t/ep93xx/timer.c b/arch/arm/cpu/arm920t/ep93xx/timer.c
index f19ec61..a3990a7 100644
--- a/arch/arm/cpu/arm920t/ep93xx/timer.c
+++ b/arch/arm/cpu/arm920t/ep93xx/timer.c
@@ -91,12 +91,6 @@ unsigned long get_timer(unsigned long base)
 	return get_timer_masked() - base;
 }

-void reset_timer_masked(void)
-{
-	read_timer();
-	timer.ticks = 0;
-}
-
 void __udelay(unsigned long usec)
 {
 	unsigned long long target;
@@ -123,7 +117,9 @@ int timer_init(void)
 	writel(TIMER_ENABLE | TIMER_CLKSEL,
 		&timer_regs->timer3.control);

-	reset_timer_masked();
+	/* Reset the timer */
+	read_timer();
+	timer.ticks = 0;

 	return 0;
 }
diff --git a/arch/arm/cpu/arm920t/imx/timer.c b/arch/arm/cpu/arm920t/imx/timer.c
index cdb2148..6141bd4 100644
--- a/arch/arm/cpu/arm920t/imx/timer.c
+++ b/arch/arm/cpu/arm920t/imx/timer.c
@@ -43,7 +43,9 @@ int timer_init (void)
 	TPRER1 = get_PERCLK1() / 1000000; /* 1 MHz */
 	TCTL1 |= TCTL_FRR | (1<<1); /* Freerun Mode, PERCLK1 input */

-	reset_timer_masked();
+	/* Reset the timer */
+	TCTL1 &= ~TCTL_TEN;
+	TCTL1 |= TCTL_TEN; /* Enable timer */

 	return (0);
 }
@@ -56,12 +58,6 @@ ulong get_timer (ulong base)
 	return get_timer_masked() - base;
 }

-void reset_timer_masked (void)
-{
-	TCTL1 &= ~TCTL_TEN;
-	TCTL1 |= TCTL_TEN; /* Enable timer */
-}
-
 ulong get_timer_masked (void)
 {
 	return TCN1;
diff --git a/arch/arm/cpu/arm920t/ks8695/timer.c b/arch/arm/cpu/arm920t/ks8695/timer.c
index c78fd90..234fe91 100644
--- a/arch/arm/cpu/arm920t/ks8695/timer.c
+++ b/arch/arm/cpu/arm920t/ks8695/timer.c
@@ -33,7 +33,11 @@ ulong timer_ticks;

 int timer_init (void)
 {
-	reset_timer_masked();
+	/* Set the hadware timer for 1ms */
+	ks8695_write(KS8695_TIMER1, TIMER_COUNT);
+	ks8695_write(KS8695_TIMER1_PCOUNT, TIMER_PULSE);
+	ks8695_write(KS8695_TIMER_CTRL, 0x2);
+	timer_ticks = 0;

 	return 0;
 }
@@ -46,15 +50,6 @@ int timer_init (void)
 #define	TIMER_COUNT	(TIMER_INTERVAL / 2)
 #define	TIMER_PULSE	TIMER_COUNT

-void reset_timer_masked(void)
-{
-	/* Set the hadware timer for 1ms */
-	ks8695_write(KS8695_TIMER1, TIMER_COUNT);
-	ks8695_write(KS8695_TIMER1_PCOUNT, TIMER_PULSE);
-	ks8695_write(KS8695_TIMER_CTRL, 0x2);
-	timer_ticks = 0;
-}
-
 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 9c71b80..9571870 100644
--- a/arch/arm/cpu/arm920t/s3c24x0/timer.c
+++ b/arch/arm/cpu/arm920t/s3c24x0/timer.c
@@ -101,13 +101,6 @@ void __udelay (unsigned long usec)
 		/*NOP*/;
 }

-void reset_timer_masked(void)
-{
-	/* reset time */
-	lastdec = READ_TIMER();
-	timestamp = 0;
-}
-
 ulong get_timer_masked(void)
 {
 	ulong tmr = get_ticks();
diff --git a/arch/arm/cpu/arm925t/timer.c b/arch/arm/cpu/arm925t/timer.c
index 9c965e0..1b9386b 100644
--- a/arch/arm/cpu/arm925t/timer.c
+++ b/arch/arm/cpu/arm925t/timer.c
@@ -56,7 +56,9 @@ int timer_init (void)
 		CONFIG_SYS_TIMERBASE + CNTL_TIMER);

 	/* init the timestamp and lastdec value */
-	reset_timer_masked();
+	lastdec = __raw_readl(CONFIG_SYS_TIMERBASE + READ_TIM) /
+			(TIMER_CLOCK / CONFIG_SYS_HZ);
+	timestamp = 0;	       /* start "advancing" time stamp from 0 */

 	return 0;
 }
@@ -85,14 +87,6 @@ void __udelay (unsigned long usec)
 	}
 }

-void reset_timer_masked (void)
-{
-	/* reset time */
-	lastdec = __raw_readl(CONFIG_SYS_TIMERBASE + READ_TIM) /
-			(TIMER_CLOCK / CONFIG_SYS_HZ);
-	timestamp = 0;	       /* start "advancing" time stamp from 0 */
-}
-
 ulong get_timer_masked (void)
 {
 	uint32_t now = __raw_readl(CONFIG_SYS_TIMERBASE + READ_TIM) /
diff --git a/arch/arm/cpu/arm926ejs/armada100/timer.c b/arch/arm/cpu/arm926ejs/armada100/timer.c
index 86da0ce..82a6d7b 100644
--- a/arch/arm/cpu/arm926ejs/armada100/timer.c
+++ b/arch/arm/cpu/arm926ejs/armada100/timer.c
@@ -77,13 +77,6 @@ ulong read_timer(void)
 	return(readl(&armd1timers->cvwr));
 }

-void reset_timer_masked(void)
-{
-	/* reset time */
-	gd->tbl = read_timer();
-	gd->tbu = 0;
-}
-
 ulong get_timer_masked(void)
 {
 	ulong now = read_timer();
@@ -142,7 +135,8 @@ int timer_init(void)
 	/* Enable timer 0 */
 	writel(0x1, &armd1timers->cer);
 	/* init the gd->tbu and gd->tbl value */
-	reset_timer_masked();
+	gd->tbl = read_timer();
+	gd->tbu = 0;

 	return 0;
 }
diff --git a/arch/arm/cpu/arm926ejs/kirkwood/timer.c b/arch/arm/cpu/arm926ejs/kirkwood/timer.c
index 5beb3f5..b4f6cf8 100644
--- a/arch/arm/cpu/arm926ejs/kirkwood/timer.c
+++ b/arch/arm/cpu/arm926ejs/kirkwood/timer.c
@@ -88,13 +88,6 @@ DECLARE_GLOBAL_DATA_PTR;
 #define timestamp gd->tbl
 #define lastdec gd->lastinc

-void reset_timer_masked(void)
-{
-	/* reset time */
-	lastdec = READ_TIMER;
-	timestamp = 0;
-}
-
 ulong get_timer_masked(void)
 {
 	ulong now = READ_TIMER;
@@ -154,7 +147,8 @@ int timer_init(void)
 	writel(cntmrctrl, CNTMR_CTRL_REG);

 	/* init the timestamp and lastdec value */
-	reset_timer_masked();
+	lastdec = READ_TIMER;
+	timestamp = 0;

 	return 0;
 }
diff --git a/arch/arm/cpu/arm926ejs/mb86r0x/timer.c b/arch/arm/cpu/arm926ejs/mb86r0x/timer.c
index 5f54085..8f38056 100644
--- a/arch/arm/cpu/arm926ejs/mb86r0x/timer.c
+++ b/arch/arm/cpu/arm926ejs/mb86r0x/timer.c
@@ -68,7 +68,9 @@ int timer_init(void)

 	writel(ctrl, &timer->control);

-	reset_timer_masked();
+	/* capture current value time */
+	lastdec = readl(&timer->value);
+	timestamp = 0; /* start "advancing" time stamp from 0 */

 	return 0;
 }
@@ -94,16 +96,6 @@ unsigned long long get_ticks(void)
 	return timestamp;
 }

-void reset_timer_masked(void)
-{
-	struct mb86r0x_timer * timer = (struct mb86r0x_timer *)
-					MB86R0x_TIMER_BASE;
-
-	/* capture current value time */
-	lastdec = readl(&timer->value);
-	timestamp = 0; /* start "advancing" time stamp from 0 */
-}
-
 ulong get_timer_masked(void)
 {
 	return tick_to_time(get_ticks());
diff --git a/arch/arm/cpu/arm926ejs/mx25/timer.c b/arch/arm/cpu/arm926ejs/mx25/timer.c
index 9a84b50..131d600 100644
--- a/arch/arm/cpu/arm926ejs/mx25/timer.c
+++ b/arch/arm/cpu/arm926ejs/mx25/timer.c
@@ -121,15 +121,6 @@ int timer_init(void)
 	return 0;
 }

-void reset_timer_masked(void)
-{
-	struct gpt_regs *gpt = (struct gpt_regs *)IMX_GPT1_BASE;
-	/* reset time */
-	/* capture current incrementer value time */
-	lastinc = readl(&gpt->counter);
-	timestamp = 0; /* start "advancing" time stamp from 0 */
-}
-
 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 058dbee..df76d16 100644
--- a/arch/arm/cpu/arm926ejs/mx27/timer.c
+++ b/arch/arm/cpu/arm926ejs/mx27/timer.c
@@ -124,15 +124,6 @@ int timer_init(void)
 	return 0;
 }

-void reset_timer_masked(void)
-{
-	struct gpt_regs *regs = (struct gpt_regs *)IMX_TIM1_BASE;
-	/* reset time */
-	/* capture current incrementer value time */
-	lastinc = readl(&regs->gpt_tcn);
-	timestamp = 0; /* start "advancing" time stamp from 0 */
-}
-
 unsigned long long get_ticks (void)
 {
 	struct gpt_regs *regs = (struct gpt_regs *)IMX_TIM1_BASE;
diff --git a/arch/arm/cpu/arm926ejs/orion5x/timer.c b/arch/arm/cpu/arm926ejs/orion5x/timer.c
index 5bc43c8..17df68f 100644
--- a/arch/arm/cpu/arm926ejs/orion5x/timer.c
+++ b/arch/arm/cpu/arm926ejs/orion5x/timer.c
@@ -95,13 +95,6 @@ DECLARE_GLOBAL_DATA_PTR;
 #define timestamp gd->tbl
 #define lastdec gd->lastinc

-void reset_timer_masked(void)
-{
-	/* reset time */
-	lastdec = read_timer();
-	timestamp = 0;
-}
-
 ulong get_timer_masked(void)
 {
 	ulong now = read_timer();
@@ -171,5 +164,6 @@ int timer_init(void)
 void timer_init_r(void)
 {
 	/* init the timestamp and lastdec value */
-	reset_timer_masked();
+	lastdec = read_timer();
+	timestamp = 0;
 }
diff --git a/arch/arm/cpu/arm926ejs/pantheon/timer.c b/arch/arm/cpu/arm926ejs/pantheon/timer.c
index 2727adc..c71162a 100644
--- a/arch/arm/cpu/arm926ejs/pantheon/timer.c
+++ b/arch/arm/cpu/arm926ejs/pantheon/timer.c
@@ -85,13 +85,6 @@ ulong read_timer(void)
 	return val;
 }

-void reset_timer_masked(void)
-{
-	/* reset time */
-	gd->tbl = read_timer();
-	gd->tbu = 0;
-}
-
 ulong get_timer_masked(void)
 {
 	ulong now = read_timer();
@@ -151,7 +144,8 @@ int timer_init(void)
 	/* Enable timer 0 */
 	writel(0x1, &panthtimers->cer);
 	/* init the gd->tbu and gd->tbl value */
-	reset_timer_masked();
+	gd->tbl = read_timer();
+	gd->tbu = 0;

 	return 0;
 }
diff --git a/arch/arm/cpu/arm926ejs/spear/timer.c b/arch/arm/cpu/arm926ejs/spear/timer.c
index cbef34f..1dc7860 100644
--- a/arch/arm/cpu/arm926ejs/spear/timer.c
+++ b/arch/arm/cpu/arm926ejs/spear/timer.c
@@ -68,7 +68,9 @@ int timer_init(void)
 	/* auto reload, start timer */
 	writel(readl(&gpt_regs_p->control) | GPT_ENABLE, &gpt_regs_p->control);

-	reset_timer_masked();
+	/* Reset the timer */
+	lastdec = READ_TIMER();
+	timestamp = 0;

 	return 0;
 }
@@ -97,13 +99,6 @@ void __udelay(unsigned long usec)
 		;
 }

-void reset_timer_masked(void)
-{
-	/* reset time */
-	lastdec = READ_TIMER();
-	timestamp = 0;
-}
-
 ulong get_timer_masked(void)
 {
 	ulong now = READ_TIMER();
diff --git a/arch/arm/cpu/armv7/mx5/timer.c b/arch/arm/cpu/armv7/mx5/timer.c
index 4525beb..2544b08 100644
--- a/arch/arm/cpu/armv7/mx5/timer.c
+++ b/arch/arm/cpu/armv7/mx5/timer.c
@@ -52,6 +52,7 @@ DECLARE_GLOBAL_DATA_PTR;
 int timer_init(void)
 {
 	int i;
+	ulong val;

 	/* setup GP Timer 1 */
 	__raw_writel(GPTCR_SWR, &cur_gpt->control);
@@ -65,15 +66,12 @@ int timer_init(void)
 	/* Freerun Mode, PERCLK1 input */
 	i = __raw_readl(&cur_gpt->control);
 	__raw_writel(i | GPTCR_CLKSOURCE_32 | GPTCR_TEN, &cur_gpt->control);
-	reset_timer_masked();
-	return 0;
-}

-void reset_timer_masked(void)
-{
-	ulong val = __raw_readl(&cur_gpt->counter);
+	val = __raw_readl(&cur_gpt->counter);
 	lastinc = val / (CONFIG_SYS_MX5_CLK32 / CONFIG_SYS_HZ);
 	timestamp = 0;
+
+	return 0;
 }

 ulong get_timer_masked(void)
diff --git a/arch/arm/cpu/armv7/omap-common/timer.c b/arch/arm/cpu/armv7/omap-common/timer.c
index 4756e26..9f8bc93 100644
--- a/arch/arm/cpu/armv7/omap-common/timer.c
+++ b/arch/arm/cpu/armv7/omap-common/timer.c
@@ -55,7 +55,9 @@ int timer_init(void)
 	writel((CONFIG_SYS_PTV << 2) | TCLR_PRE | TCLR_AR | TCLR_ST,
 		&timer_base->tclr);

-	reset_timer_masked();	/* init the timestamp and lastinc value */
+	/* reset time, capture current incrementer value time */
+	gd->lastinc = readl(&timer_base->tcrr) / (TIMER_CLOCK / CONFIG_SYS_HZ);
+	gd->tbl = 0;		/* start "advancing" time stamp from 0 */

 	return 0;
 }
@@ -84,13 +86,6 @@ void __udelay(unsigned long usec)
 	}
 }

-void reset_timer_masked(void)
-{
-	/* reset time, capture current incrementer value time */
-	gd->lastinc = readl(&timer_base->tcrr) / (TIMER_CLOCK / CONFIG_SYS_HZ);
-	gd->tbl = 0;		/* start "advancing" time stamp from 0 */
-}
-
 ulong get_timer_masked(void)
 {
 	/* current tick value */
diff --git a/arch/arm/cpu/armv7/tegra2/timer.c b/arch/arm/cpu/armv7/tegra2/timer.c
index 2761c12..0b9fa64 100644
--- a/arch/arm/cpu/armv7/tegra2/timer.c
+++ b/arch/arm/cpu/armv7/tegra2/timer.c
@@ -69,13 +69,6 @@ void __udelay(unsigned long usec)
 	}
 }

-void reset_timer_masked(void)
-{
-	/* reset time, capture current incrementer value time */
-	gd->lastinc = readl(&timer_base->cntr_1us) / (TIMER_CLK/CONFIG_SYS_HZ);
-	gd->tbl = 0;		/* start "advancing" time stamp from 0 */
-}
-
 ulong get_timer_masked(void)
 {
 	ulong now;
diff --git a/arch/arm/cpu/pxa/timer.c b/arch/arm/cpu/pxa/timer.c
index 44dae9a..2866745 100644
--- a/arch/arm/cpu/pxa/timer.c
+++ b/arch/arm/cpu/pxa/timer.c
@@ -59,7 +59,7 @@ static inline unsigned long long us_to_tick(unsigned long long us)

 int timer_init (void)
 {
-	reset_timer_masked();
+	writel(0, OSCR);

 	return 0;
 }
@@ -74,12 +74,6 @@ void __udelay (unsigned long usec)
 	udelay_masked (usec);
 }

-
-void reset_timer_masked (void)
-{
-	writel(0, OSCR);
-}
-
 ulong get_timer_masked (void)
 {
 	return tick_to_time(get_ticks());
diff --git a/arch/arm/cpu/s3c44b0/timer.c b/arch/arm/cpu/s3c44b0/timer.c
index ce48952..6c2f066 100644
--- a/arch/arm/cpu/s3c44b0/timer.c
+++ b/arch/arm/cpu/s3c44b0/timer.c
@@ -78,13 +78,6 @@ void __udelay (unsigned long usec)
 		/*NOP*/;
 }

-void reset_timer_masked (void)
-{
-	/* reset time */
-	lastdec = READ_TIMER;
-	timestamp = 0;
-}
-
 ulong get_timer_masked (void)
 {
 	ulong now = READ_TIMER;
diff --git a/arch/arm/cpu/sa1100/timer.c b/arch/arm/cpu/sa1100/timer.c
index 694c03a..53bec0b 100644
--- a/arch/arm/cpu/sa1100/timer.c
+++ b/arch/arm/cpu/sa1100/timer.c
@@ -44,12 +44,6 @@ void __udelay (unsigned long usec)
 	udelay_masked (usec);
 }

-
-void reset_timer_masked (void)
-{
-	OSCR = 0;
-}
-
 ulong get_timer_masked (void)
 {
 	return OSCR;
diff --git a/board/armltd/integrator/timer.c b/board/armltd/integrator/timer.c
index 6734e8d..f10a026 100644
--- a/board/armltd/integrator/timer.c
+++ b/board/armltd/integrator/timer.c
@@ -95,7 +95,10 @@ int timer_init (void)

 	/* init the timestamp */
 	total_count = 0ULL;
-	reset_timer_masked();
+	/* capure current decrementer value    */
+	lastdec	  = READ_TIMER;
+	/* start "advancing" time stamp from 0 */
+	timestamp = 0L;

 	div_timer = CONFIG_SYS_HZ_CLOCK;
 	do_div(div_timer, CONFIG_SYS_HZ);
@@ -129,14 +132,6 @@ void __udelay (unsigned long usec)
 	}
 }

-void reset_timer_masked (void)
-{
-	/* capure current decrementer value    */
-	lastdec	  = READ_TIMER;
-	/* start "advancing" time stamp from 0 */
-	timestamp = 0L;
-}
-
 /* converts the timer reading to U-Boot ticks	       */
 /* the timestamp is the number of ticks since reset    */
 ulong get_timer_masked (void)
--
1.7.5.2.317.g391b14

  parent reply	other threads:[~2011-07-15 12:21 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     ` [U-Boot] [PATCH v3 " Graeme Russ
2011-07-26 12:53       ` 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   ` Graeme Russ [this message]
2011-07-16  9:38     ` [U-Boot] [PATCH v3 7/7]Timer: Remove reset_timer_masked() 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=1310732474-5541-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.