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 3/7]Timer: Remove set_timer completely
Date: Fri, 15 Jul 2011 22:18:12 +1000	[thread overview]
Message-ID: <1310732292-5345-1-git-send-email-graeme.russ@gmail.com> (raw)
In-Reply-To: <1309261269-4363-4-git-send-email-graeme.russ@gmail.com>

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

 arch/arm/cpu/arm1136/mx31/timer.c        |    5 -----
 arch/arm/cpu/arm1136/mx35/timer.c        |    4 ----
 arch/arm/cpu/arm1136/omap24xx/timer.c    |    5 -----
 arch/arm/cpu/arm1176/s3c64xx/timer.c     |    5 -----
 arch/arm/cpu/arm1176/tnetv107x/timer.c   |    5 -----
 arch/arm/cpu/arm720t/interrupts.c        |    5 -----
 arch/arm/cpu/arm920t/a320/timer.c        |    6 ------
 arch/arm/cpu/arm920t/at91/timer.c        |    5 -----
 arch/arm/cpu/arm920t/at91rm9200/timer.c  |    5 -----
 arch/arm/cpu/arm920t/imx/timer.c         |    5 -----
 arch/arm/cpu/arm920t/ks8695/timer.c      |    5 -----
 arch/arm/cpu/arm920t/s3c24x0/timer.c     |    5 -----
 arch/arm/cpu/arm925t/timer.c             |    5 -----
 arch/arm/cpu/arm926ejs/armada100/timer.c |    5 -----
 arch/arm/cpu/arm926ejs/kirkwood/timer.c  |    5 -----
 arch/arm/cpu/arm926ejs/mx25/timer.c      |    5 -----
 arch/arm/cpu/arm926ejs/mx27/timer.c      |    5 -----
 arch/arm/cpu/arm926ejs/omap/timer.c      |    5 -----
 arch/arm/cpu/arm926ejs/orion5x/timer.c   |    5 -----
 arch/arm/cpu/arm926ejs/pantheon/timer.c  |    5 -----
 arch/arm/cpu/arm926ejs/spear/timer.c     |    5 -----
 arch/arm/cpu/arm926ejs/versatile/timer.c |    5 -----
 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/armv7/u8500/timer.c         |    5 -----
 arch/arm/cpu/ixp/timer.c                 |    5 -----
 arch/arm/cpu/lh7a40x/timer.c             |    5 -----
 arch/arm/cpu/pxa/timer.c                 |    5 -----
 arch/arm/cpu/s3c44b0/timer.c             |    5 -----
 arch/arm/cpu/sa1100/timer.c              |    5 -----
 arch/avr32/cpu/interrupts.c              |   16 ----------------
 arch/m68k/cpu/mcf547x_8x/slicetimer.c    |    4 ----
 arch/m68k/lib/board.c                    |    2 --
 arch/m68k/lib/time.c                     |   16 ++--------------
 arch/microblaze/cpu/timer.c              |    5 -----
 arch/mips/cpu/mips32/time.c              |    6 ------
 arch/nios2/cpu/interrupts.c              |    6 ------
 arch/powerpc/lib/board.c                 |    2 --
 arch/powerpc/lib/interrupts.c            |    5 -----
 arch/sh/lib/time.c                       |    7 +------
 arch/sh/lib/time_sh2.c                   |    9 ++-------
 arch/sparc/lib/board.c                   |    2 --
 arch/sparc/lib/interrupts.c              |    5 -----
 arch/x86/lib/board.c                     |    2 --
 arch/x86/lib/timer.c                     |    5 -----
 board/armltd/integrator/timer.c          |    6 ------
 include/common.h                         |    1 -
 49 files changed, 5 insertions(+), 254 deletions(-)

diff --git a/arch/arm/cpu/arm1136/mx31/timer.c b/arch/arm/cpu/arm1136/mx31/timer.c
index c4bc3b3..d51acbb 100644
--- a/arch/arm/cpu/arm1136/mx31/timer.c
+++ b/arch/arm/cpu/arm1136/mx31/timer.c
@@ -147,11 +147,6 @@ ulong get_timer (ulong base)
 	return get_timer_masked () - base;
 }

-void set_timer (ulong t)
-{
-	gd->tbl = time_to_tick(t);
-}
-
 /* delay x useconds AND preserve advance timestamp value */
 void __udelay (unsigned long usec)
 {
diff --git a/arch/arm/cpu/arm1136/mx35/timer.c b/arch/arm/cpu/arm1136/mx35/timer.c
index db1e2c9..6dfb63a 100644
--- a/arch/arm/cpu/arm1136/mx35/timer.c
+++ b/arch/arm/cpu/arm1136/mx35/timer.c
@@ -92,10 +92,6 @@ ulong get_timer(ulong base)
 	return (tmp / 1000) - base;
 }

-void set_timer(ulong t)
-{
-}
-
 /*
  * delay x useconds AND preserve advance timstamp value
  * GPTCNT is now supposed to tick 1 by 1 us.
diff --git a/arch/arm/cpu/arm1136/omap24xx/timer.c b/arch/arm/cpu/arm1136/omap24xx/timer.c
index 228ceba..d6267ba 100644
--- a/arch/arm/cpu/arm1136/omap24xx/timer.c
+++ b/arch/arm/cpu/arm1136/omap24xx/timer.c
@@ -67,11 +67,6 @@ ulong get_timer (ulong base)
 	return get_timer_masked () - base;
 }

-void set_timer (ulong t)
-{
-	gd->tbl	= t;
-}
-
 /* delay x useconds AND preserve advance timestamp value */
 void __udelay (unsigned long usec)
 {
diff --git a/arch/arm/cpu/arm1176/s3c64xx/timer.c b/arch/arm/cpu/arm1176/s3c64xx/timer.c
index 9768319..8e54060 100644
--- a/arch/arm/cpu/arm1176/s3c64xx/timer.c
+++ b/arch/arm/cpu/arm1176/s3c64xx/timer.c
@@ -159,11 +159,6 @@ ulong get_timer(ulong base)
 	return get_timer_masked() - base;
 }

-void set_timer(ulong t)
-{
-	timestamp = t * (timer_load_val / (100 * CONFIG_SYS_HZ));
-}
-
 void __udelay(unsigned long usec)
 {
 	unsigned long long tmp;
diff --git a/arch/arm/cpu/arm1176/tnetv107x/timer.c b/arch/arm/cpu/arm1176/tnetv107x/timer.c
index a7a400d..c27375c 100644
--- a/arch/arm/cpu/arm1176/tnetv107x/timer.c
+++ b/arch/arm/cpu/arm1176/tnetv107x/timer.c
@@ -88,11 +88,6 @@ ulong get_timer(ulong base)
 	return (get_timer_raw() / (TIMER_LOAD_VAL / TIM_CLK_DIV)) - base;
 }

-void set_timer(ulong t)
-{
-	timestamp = t;
-}
-
 unsigned long long get_ticks(void)
 {
 	return get_timer(0);
diff --git a/arch/arm/cpu/arm720t/interrupts.c b/arch/arm/cpu/arm720t/interrupts.c
index eb8d425..164ca5d 100644
--- a/arch/arm/cpu/arm720t/interrupts.c
+++ b/arch/arm/cpu/arm720t/interrupts.c
@@ -219,11 +219,6 @@ ulong get_timer (ulong base)
 	return get_timer_masked () - base;
 }

-void set_timer (ulong t)
-{
-	timestamp = t;
-}
-
 void __udelay (unsigned long usec)
 {
 	ulong tmo;
diff --git a/arch/arm/cpu/arm920t/a320/timer.c b/arch/arm/cpu/arm920t/a320/timer.c
index 95cb8fd..b9c83c0 100644
--- a/arch/arm/cpu/arm920t/a320/timer.c
+++ b/arch/arm/cpu/arm920t/a320/timer.c
@@ -132,12 +132,6 @@ ulong get_timer(ulong base)
 	return get_timer_masked() - base;
 }

-void set_timer(ulong t)
-{
-	debug("%s(%lx)\n", __func__, t);
-	timestamp = t;
-}
-
 /* delay x useconds AND preserve advance timestamp value */
 void __udelay(unsigned long usec)
 {
diff --git a/arch/arm/cpu/arm920t/at91/timer.c b/arch/arm/cpu/arm920t/at91/timer.c
index f0ad7d6..a69de57 100644
--- a/arch/arm/cpu/arm920t/at91/timer.c
+++ b/arch/arm/cpu/arm920t/at91/timer.c
@@ -83,11 +83,6 @@ ulong get_timer(ulong base)
 	return get_timer_masked() - base;
 }

-void set_timer(ulong t)
-{
-	gd->tbl = t;
-}
-
 void __udelay(unsigned long usec)
 {
 	udelay_masked(usec);
diff --git a/arch/arm/cpu/arm920t/at91rm9200/timer.c b/arch/arm/cpu/arm920t/at91rm9200/timer.c
index 9c54bbe..0bcb775 100644
--- a/arch/arm/cpu/arm920t/at91rm9200/timer.c
+++ b/arch/arm/cpu/arm920t/at91rm9200/timer.c
@@ -82,11 +82,6 @@ ulong get_timer (ulong base)
 	return get_timer_masked () - base;
 }

-void set_timer (ulong t)
-{
-	timestamp = t;
-}
-
 void __udelay (unsigned long usec)
 {
 	udelay_masked(usec);
diff --git a/arch/arm/cpu/arm920t/imx/timer.c b/arch/arm/cpu/arm920t/imx/timer.c
index b06b518..ff85a41 100644
--- a/arch/arm/cpu/arm920t/imx/timer.c
+++ b/arch/arm/cpu/arm920t/imx/timer.c
@@ -62,11 +62,6 @@ ulong get_timer (ulong base)
 	return get_timer_masked() - base;
 }

-void set_timer (ulong t)
-{
-	/* nop */
-}
-
 void reset_timer_masked (void)
 {
 	TCTL1 &= ~TCTL_TEN;
diff --git a/arch/arm/cpu/arm920t/ks8695/timer.c b/arch/arm/cpu/arm920t/ks8695/timer.c
index 886e370..8e14109 100644
--- a/arch/arm/cpu/arm920t/ks8695/timer.c
+++ b/arch/arm/cpu/arm920t/ks8695/timer.c
@@ -76,11 +76,6 @@ ulong get_timer(ulong base)
        return (get_timer_masked() - base);
 }

-void set_timer(ulong t)
-{
-	timer_ticks = t;
-}
-
 void __udelay(ulong usec)
 {
 	ulong start = get_timer_masked();
diff --git a/arch/arm/cpu/arm920t/s3c24x0/timer.c b/arch/arm/cpu/arm920t/s3c24x0/timer.c
index f17b7ea..bba06d5 100644
--- a/arch/arm/cpu/arm920t/s3c24x0/timer.c
+++ b/arch/arm/cpu/arm920t/s3c24x0/timer.c
@@ -94,11 +94,6 @@ ulong get_timer(ulong base)
 	return get_timer_masked() - base;
 }

-void set_timer(ulong t)
-{
-	timestamp = t;
-}
-
 void __udelay (unsigned long usec)
 {
 	ulong tmo;
diff --git a/arch/arm/cpu/arm925t/timer.c b/arch/arm/cpu/arm925t/timer.c
index 7dfe2b5..fdaeda5 100644
--- a/arch/arm/cpu/arm925t/timer.c
+++ b/arch/arm/cpu/arm925t/timer.c
@@ -75,11 +75,6 @@ ulong get_timer (ulong base)
 	return get_timer_masked () - base;
 }

-void set_timer (ulong t)
-{
-	timestamp = t;
-}
-
 /* delay x useconds AND preserve advance timestamp value */
 void __udelay (unsigned long usec)
 {
diff --git a/arch/arm/cpu/arm926ejs/armada100/timer.c b/arch/arm/cpu/arm926ejs/armada100/timer.c
index 5d911c5..eb49234 100644
--- a/arch/arm/cpu/arm926ejs/armada100/timer.c
+++ b/arch/arm/cpu/arm926ejs/armada100/timer.c
@@ -111,11 +111,6 @@ ulong get_timer(ulong base)
 		base);
 }

-void set_timer(ulong t)
-{
-	gd->tbu = t;
-}
-
 void __udelay(unsigned long usec)
 {
 	ulong delayticks;
diff --git a/arch/arm/cpu/arm926ejs/kirkwood/timer.c b/arch/arm/cpu/arm926ejs/kirkwood/timer.c
index 3e80329..e890edb 100644
--- a/arch/arm/cpu/arm926ejs/kirkwood/timer.c
+++ b/arch/arm/cpu/arm926ejs/kirkwood/timer.c
@@ -122,11 +122,6 @@ ulong get_timer(ulong base)
 	return get_timer_masked() - base;
 }

-void set_timer(ulong t)
-{
-	timestamp = t;
-}
-
 void __udelay(unsigned long usec)
 {
 	uint current;
diff --git a/arch/arm/cpu/arm926ejs/mx25/timer.c b/arch/arm/cpu/arm926ejs/mx25/timer.c
index 14f0c2d..af26b4c 100644
--- a/arch/arm/cpu/arm926ejs/mx25/timer.c
+++ b/arch/arm/cpu/arm926ejs/mx25/timer.c
@@ -170,11 +170,6 @@ ulong get_timer (ulong base)
 	return get_timer_masked () - base;
 }

-void set_timer (ulong t)
-{
-	timestamp = time_to_tick(t);
-}
-
 /* delay x useconds AND preserve advance timstamp value */
 void __udelay (unsigned long usec)
 {
diff --git a/arch/arm/cpu/arm926ejs/mx27/timer.c b/arch/arm/cpu/arm926ejs/mx27/timer.c
index 5c1cf01..127e670 100644
--- a/arch/arm/cpu/arm926ejs/mx27/timer.c
+++ b/arch/arm/cpu/arm926ejs/mx27/timer.c
@@ -173,11 +173,6 @@ ulong get_timer (ulong base)
 	return get_timer_masked () - base;
 }

-void set_timer (ulong t)
-{
-	timestamp = time_to_tick(t);
-}
-
 /* delay x useconds AND preserve advance timstamp value */
 void __udelay (unsigned long usec)
 {
diff --git a/arch/arm/cpu/arm926ejs/omap/timer.c b/arch/arm/cpu/arm926ejs/omap/timer.c
index 88a0ee6..f2e4deb 100644
--- a/arch/arm/cpu/arm926ejs/omap/timer.c
+++ b/arch/arm/cpu/arm926ejs/omap/timer.c
@@ -76,11 +76,6 @@ ulong get_timer (ulong base)
 	return get_timer_masked () - base;
 }

-void set_timer (ulong t)
-{
-	timestamp = t;
-}
-
 /* delay x useconds AND preserve advance timestamp value */
 void __udelay (unsigned long usec)
 {
diff --git a/arch/arm/cpu/arm926ejs/orion5x/timer.c b/arch/arm/cpu/arm926ejs/orion5x/timer.c
index 9d45260..f691c99 100644
--- a/arch/arm/cpu/arm926ejs/orion5x/timer.c
+++ b/arch/arm/cpu/arm926ejs/orion5x/timer.c
@@ -129,11 +129,6 @@ ulong get_timer(ulong base)
 	return get_timer_masked() - base;
 }

-void set_timer(ulong t)
-{
-	timestamp = t;
-}
-
 static inline ulong uboot_cntr_val(void)
 {
 	return readl(CNTMR_VAL_REG(UBOOT_CNTR));
diff --git a/arch/arm/cpu/arm926ejs/pantheon/timer.c b/arch/arm/cpu/arm926ejs/pantheon/timer.c
index ca7f7f0..b487416 100644
--- a/arch/arm/cpu/arm926ejs/pantheon/timer.c
+++ b/arch/arm/cpu/arm926ejs/pantheon/timer.c
@@ -119,11 +119,6 @@ ulong get_timer(ulong base)
 		base);
 }

-void set_timer(ulong t)
-{
-	gd->tbu = t;
-}
-
 void __udelay(unsigned long usec)
 {
 	ulong delayticks;
diff --git a/arch/arm/cpu/arm926ejs/spear/timer.c b/arch/arm/cpu/arm926ejs/spear/timer.c
index 66cf4de..7305abd 100644
--- a/arch/arm/cpu/arm926ejs/spear/timer.c
+++ b/arch/arm/cpu/arm926ejs/spear/timer.c
@@ -87,11 +87,6 @@ ulong get_timer(ulong base)
 	return (get_timer_masked() / GPT_RESOLUTION) - base;
 }

-void set_timer(ulong t)
-{
-	timestamp = t;
-}
-
 void __udelay(unsigned long usec)
 {
 	ulong tmo;
diff --git a/arch/arm/cpu/arm926ejs/versatile/timer.c b/arch/arm/cpu/arm926ejs/versatile/timer.c
index 2e243b1..0e51a63 100644
--- a/arch/arm/cpu/arm926ejs/versatile/timer.c
+++ b/arch/arm/cpu/arm926ejs/versatile/timer.c
@@ -105,11 +105,6 @@ ulong get_timer (ulong base)
 	return get_timer_masked () - base;
 }

-void set_timer (ulong t)
-{
-	timestamp = t;
-}
-
 /* delay x useconds AND preserve advance timestamp value */
 void __udelay (unsigned long usec)
 {
diff --git a/arch/arm/cpu/armv7/mx5/timer.c b/arch/arm/cpu/armv7/mx5/timer.c
index 1972f64..40ee0be 100644
--- a/arch/arm/cpu/armv7/mx5/timer.c
+++ b/arch/arm/cpu/armv7/mx5/timer.c
@@ -99,11 +99,6 @@ ulong get_timer(ulong base)
 	return get_timer_masked() - base;
 }

-void set_timer(ulong t)
-{
-	timestamp = t;
-}
-
 /* delay x useconds AND preserve advance timestamp value */
 void __udelay(unsigned long usec)
 {
diff --git a/arch/arm/cpu/armv7/omap-common/timer.c b/arch/arm/cpu/armv7/omap-common/timer.c
index 59bbca8..a0f6b7c 100644
--- a/arch/arm/cpu/armv7/omap-common/timer.c
+++ b/arch/arm/cpu/armv7/omap-common/timer.c
@@ -73,11 +73,6 @@ ulong get_timer(ulong base)
 	return get_timer_masked() - base;
 }

-void set_timer(ulong t)
-{
-	gd->tbl = t;
-}
-
 /* delay x useconds */
 void __udelay(unsigned long usec)
 {
diff --git a/arch/arm/cpu/armv7/s5p-common/timer.c b/arch/arm/cpu/armv7/s5p-common/timer.c
index b750d16..0b69f06 100644
--- a/arch/arm/cpu/armv7/s5p-common/timer.c
+++ b/arch/arm/cpu/armv7/s5p-common/timer.c
@@ -60,11 +60,6 @@ unsigned long get_timer(unsigned long base)
 	return get_timer_masked() - base;
 }

-void set_timer(unsigned long t)
-{
-	gd->tbl = t;
-}
-
 /* delay x useconds */
 void __udelay(unsigned long usec)
 {
diff --git a/arch/arm/cpu/armv7/tegra2/timer.c b/arch/arm/cpu/armv7/tegra2/timer.c
index fb061d0..4458de9 100644
--- a/arch/arm/cpu/armv7/tegra2/timer.c
+++ b/arch/arm/cpu/armv7/tegra2/timer.c
@@ -58,11 +58,6 @@ ulong get_timer(ulong base)
 	return get_timer_masked() - base;
 }

-void set_timer(ulong t)
-{
-	gd->tbl = t;
-}
-
 /* delay x useconds */
 void __udelay(unsigned long usec)
 {
diff --git a/arch/arm/cpu/armv7/u8500/timer.c b/arch/arm/cpu/armv7/u8500/timer.c
index 8e96eaa..79aad99 100644
--- a/arch/arm/cpu/armv7/u8500/timer.c
+++ b/arch/arm/cpu/armv7/u8500/timer.c
@@ -129,11 +129,6 @@ ulong get_timer(ulong base)
 	return get_timer_masked() - base;
 }

-void set_timer(ulong t)
-{
-	gd->tbl = t;
-}
-
 /*
  * Emulation of Power architecture long long timebase.
  *
diff --git a/arch/arm/cpu/ixp/timer.c b/arch/arm/cpu/ixp/timer.c
index 9f3ea42..c25e72f 100644
--- a/arch/arm/cpu/ixp/timer.c
+++ b/arch/arm/cpu/ixp/timer.c
@@ -104,11 +104,6 @@ ulong get_timer(ulong base)
 	return get_timer_masked() - base;
 }

-void set_timer(ulong t)
-{
-	gd->timestamp = time_to_tick(t);
-}
-
 /* delay x useconds AND preserve advance timestamp value */
 void __udelay(unsigned long usec)
 {
diff --git a/arch/arm/cpu/lh7a40x/timer.c b/arch/arm/cpu/lh7a40x/timer.c
index 2691315..6c6277d 100644
--- a/arch/arm/cpu/lh7a40x/timer.c
+++ b/arch/arm/cpu/lh7a40x/timer.c
@@ -85,11 +85,6 @@ ulong get_timer (ulong base)
 	return (get_timer_masked() - base);
 }

-void set_timer (ulong t)
-{
-	timestamp = t;
-}
-
 void __udelay (unsigned long usec)
 {
 	ulong tmo,tmp;
diff --git a/arch/arm/cpu/pxa/timer.c b/arch/arm/cpu/pxa/timer.c
index ec950c7..8900a70 100644
--- a/arch/arm/cpu/pxa/timer.c
+++ b/arch/arm/cpu/pxa/timer.c
@@ -74,11 +74,6 @@ ulong get_timer (ulong base)
 	return get_timer_masked () - base;
 }

-void set_timer (ulong t)
-{
-	/* nop */
-}
-
 void __udelay (unsigned long usec)
 {
 	udelay_masked (usec);
diff --git a/arch/arm/cpu/s3c44b0/timer.c b/arch/arm/cpu/s3c44b0/timer.c
index 6f1d8f6..d30e1aa 100644
--- a/arch/arm/cpu/s3c44b0/timer.c
+++ b/arch/arm/cpu/s3c44b0/timer.c
@@ -70,11 +70,6 @@ ulong get_timer (ulong base)
 	return get_timer_masked () - base;
 }

-void set_timer (ulong t)
-{
-	timestamp = t;
-}
-
 void __udelay (unsigned long usec)
 {
 	ulong tmo;
diff --git a/arch/arm/cpu/sa1100/timer.c b/arch/arm/cpu/sa1100/timer.c
index 0207501..10ad964 100644
--- a/arch/arm/cpu/sa1100/timer.c
+++ b/arch/arm/cpu/sa1100/timer.c
@@ -44,11 +44,6 @@ ulong get_timer (ulong base)
 	return get_timer_masked ();
 }

-void set_timer (ulong t)
-{
-	/* nop */
-}
-
 void __udelay (unsigned long usec)
 {
 	udelay_masked (usec);
diff --git a/arch/avr32/cpu/interrupts.c b/arch/avr32/cpu/interrupts.c
index c6ea435..8406f91 100644
--- a/arch/avr32/cpu/interrupts.c
+++ b/arch/avr32/cpu/interrupts.c
@@ -77,22 +77,6 @@ unsigned long get_timer(unsigned long base)
 	return (unsigned long)(now >> 32) - base;
 }

-void set_timer(unsigned long t)
-{
-	unsigned long long ticks = t;
-	unsigned long lo, hi, hi_new;
-
-	ticks = (ticks * get_tbclk()) / CONFIG_SYS_HZ;
-	hi = ticks >> 32;
-	lo = ticks & 0xffffffffUL;
-
-	do {
-		timer_overflow = hi;
-		sysreg_write(COUNT, lo);
-		hi_new = timer_overflow;
-	} while (hi_new != hi);
-}
-
 /*
  * For short delays only. It will overflow after a few seconds.
  */
diff --git a/arch/m68k/cpu/mcf547x_8x/slicetimer.c b/arch/m68k/cpu/mcf547x_8x/slicetimer.c
index 8dc010a..49dba6a 100644
--- a/arch/m68k/cpu/mcf547x_8x/slicetimer.c
+++ b/arch/m68k/cpu/mcf547x_8x/slicetimer.c
@@ -105,8 +105,4 @@ ulong get_timer(ulong base)
 	return (timestamp - base);
 }

-void set_timer(ulong t)
-{
-	timestamp = t;
-}
 #endif				/* CONFIG_SLTTMR */
diff --git a/arch/m68k/lib/board.c b/arch/m68k/lib/board.c
index 6a892db..945ab66 100644
--- a/arch/m68k/lib/board.c
+++ b/arch/m68k/lib/board.c
@@ -574,8 +574,6 @@ void board_init_r (gd_t *id, ulong dest_addr)

 	udelay (20);

-	set_timer (0);
-
 	/* Insert function pointers now that we have relocated the code */

 	/* Initialize from environment */
diff --git a/arch/m68k/lib/time.c b/arch/m68k/lib/time.c
index 7eaea5e..d10bcc7 100644
--- a/arch/m68k/lib/time.c
+++ b/arch/m68k/lib/time.c
@@ -126,10 +126,6 @@ ulong get_timer(ulong base)
 	return (timestamp - base);
 }

-void set_timer(ulong t)
-{
-	timestamp = t;
-}
 #endif				/* CONFIG_MCFTMR */

 #if defined(CONFIG_MCFPIT)
@@ -173,14 +169,6 @@ void timer_init(void)
 	timerp->pcsr |= PIT_PCSR_PRE(CONFIG_SYS_PIT_PRESCALE) | PIT_PCSR_EN;
 }

-void set_timer(ulong t)
-{
-	volatile pit_t *timerp = (pit_t *) (CONFIG_SYS_PIT_BASE);
-
-	timestamp = 0;
-	timerp->pmr = lastinc = 0;
-}
-
 ulong get_timer(ulong base)
 {
 	unsigned short now, diff;
@@ -196,8 +184,8 @@ ulong get_timer(ulong base)

 void wait_ticks(unsigned long ticks)
 {
-	set_timer(0);
-	while (get_timer(0) < ticks) ;
+	u32 start = get_timer(0);
+	while (get_timer(start) < ticks) ;
 }
 #endif				/* CONFIG_MCFPIT */

diff --git a/arch/microblaze/cpu/timer.c b/arch/microblaze/cpu/timer.c
index 4936c62..59ed126 100644
--- a/arch/microblaze/cpu/timer.c
+++ b/arch/microblaze/cpu/timer.c
@@ -45,11 +45,6 @@ ulong get_timer (ulong base)
 }
 #endif

-void set_timer (ulong t)
-{
-	timestamp = t;
-}
-
 #ifdef CONFIG_SYS_INTC_0
 #ifdef CONFIG_SYS_TIMER_0
 microblaze_timer_t *tmr = (microblaze_timer_t *) (CONFIG_SYS_TIMER_0_ADDR);
diff --git a/arch/mips/cpu/mips32/time.c b/arch/mips/cpu/mips32/time.c
index 0e66441..b0a9c1f 100644
--- a/arch/mips/cpu/mips32/time.c
+++ b/arch/mips/cpu/mips32/time.c
@@ -64,12 +64,6 @@ ulong get_timer(ulong base)
 	return (timestamp - base);
 }

-void set_timer(ulong t)
-{
-	timestamp = t;
-	write_c0_compare(read_c0_count() + CYCLES_PER_JIFFY);
-}
-
 void __udelay(unsigned long usec)
 {
 	unsigned int tmo;
diff --git a/arch/nios2/cpu/interrupts.c b/arch/nios2/cpu/interrupts.c
index 63acfa9..0a97fa6 100644
--- a/arch/nios2/cpu/interrupts.c
+++ b/arch/nios2/cpu/interrupts.c
@@ -98,12 +98,6 @@ ulong get_timer (ulong base)
 	return (timestamp - base);
 }

-void set_timer (ulong t)
-{
-	timestamp = t;
-}
-
-
 /* The board must handle this interrupt if a timer is not
  * provided.
  */
diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
index aaa5add..22bbc52 100644
--- a/arch/powerpc/lib/board.c
+++ b/arch/powerpc/lib/board.c
@@ -932,8 +932,6 @@ void board_init_r (gd_t *id, ulong dest_addr)

 	udelay (20);

-	set_timer (0);
-
 	/* Initialize from environment */
 	if ((s = getenv ("loadaddr")) != NULL) {
 		load_addr = simple_strtoul (s, NULL, 16);
diff --git a/arch/powerpc/lib/interrupts.c b/arch/powerpc/lib/interrupts.c
index f603170..847ad37 100644
--- a/arch/powerpc/lib/interrupts.c
+++ b/arch/powerpc/lib/interrupts.c
@@ -146,8 +146,3 @@ ulong get_timer (ulong base)
 {
 	return (timestamp - base);
 }
-
-void set_timer (ulong t)
-{
-	timestamp = t;
-}
diff --git a/arch/sh/lib/time.c b/arch/sh/lib/time.c
index bc1656f..c4bfc86 100644
--- a/arch/sh/lib/time.c
+++ b/arch/sh/lib/time.c
@@ -139,15 +139,10 @@ unsigned long get_timer (unsigned long base)
 	return tick_to_time(get_ticks()) - base;
 }

-void set_timer (unsigned long t)
-{
-	writel((0 - t), TCNT0);
-}
-
 void reset_timer (void)
 {
 	tmu_timer_stop(0);
-	set_timer (0);
+	writel(0, TCNT0);
 	tmu_timer_start(0);
 }

diff --git a/arch/sh/lib/time_sh2.c b/arch/sh/lib/time_sh2.c
index 789b46f..a5c838b 100644
--- a/arch/sh/lib/time_sh2.c
+++ b/arch/sh/lib/time_sh2.c
@@ -54,7 +54,7 @@ int timer_init(void)

 	/* User Device 0 only */
 	cmt_timer_stop(0);
-	set_timer(CMT_TIMER_RESET);
+	writew(CMT_TIMER_RESET, CMCOR_0);
 	cmt_timer_start(0);

 	return 0;
@@ -90,15 +90,10 @@ ulong get_timer(ulong base)
 	return (get_usec() / 1000) - base;
 }

-void set_timer(ulong t)
-{
-	writew((u16) t, CMCOR_0);
-}
-
 void reset_timer(void)
 {
 	cmt_timer_stop(0);
-	set_timer(CMT_TIMER_RESET);
+	writew(CMT_TIMER_RESET, CMCOR_0);
 	cmt0_timer = 0;
 	cmt_timer_start(0);
 }
diff --git a/arch/sparc/lib/board.c b/arch/sparc/lib/board.c
index 386cd04..6b705e5 100644
--- a/arch/sparc/lib/board.c
+++ b/arch/sparc/lib/board.c
@@ -365,8 +365,6 @@ void board_init_f(ulong bootflag)

 	udelay(20);

-	set_timer(0);
-
 	/* Initialize from environment */
 	if ((s = getenv("loadaddr")) != NULL) {
 		load_addr = simple_strtoul(s, NULL, 16);
diff --git a/arch/sparc/lib/interrupts.c b/arch/sparc/lib/interrupts.c
index 4c73b82..5274311 100644
--- a/arch/sparc/lib/interrupts.c
+++ b/arch/sparc/lib/interrupts.c
@@ -100,11 +100,6 @@ ulong get_timer(ulong base)
 	return (timestamp - base);
 }

-void set_timer(ulong t)
-{
-	timestamp = t;
-}
-
 void timer_interrupt_init(void)
 {
 	int irq;
diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c
index df54222..c92291b 100644
--- a/arch/x86/lib/board.c
+++ b/arch/x86/lib/board.c
@@ -363,8 +363,6 @@ void board_init_r(gd_t *id, ulong dest_addr)

 	udelay(20);

-	set_timer (0);
-
 	/* Initialize from environment */
 	if ((s = getenv ("loadaddr")) != NULL) {
 		load_addr = simple_strtoul (s, NULL, 16);
diff --git a/arch/x86/lib/timer.c b/arch/x86/lib/timer.c
index 8fc68cd..199ca8e 100644
--- a/arch/x86/lib/timer.c
+++ b/arch/x86/lib/timer.c
@@ -103,8 +103,3 @@ ulong get_timer (ulong base)
 {
 	return (system_ticks - base);
 }
-
-void set_timer (ulong t)
-{
-	system_ticks = t;
-}
diff --git a/board/armltd/integrator/timer.c b/board/armltd/integrator/timer.c
index 7562ffa..5406066 100644
--- a/board/armltd/integrator/timer.c
+++ b/board/armltd/integrator/timer.c
@@ -117,12 +117,6 @@ ulong get_timer (ulong base_ticks)
 	return get_timer_masked () - base_ticks;
 }

-void set_timer (ulong ticks)
-{
-	timestamp   = ticks;
-	total_count = ticks * div_timer;
-}
-
 /* delay usec useconds */
 void __udelay (unsigned long usec)
 {
diff --git a/include/common.h b/include/common.h
index 2c8513a..1f5c8fa 100644
--- a/include/common.h
+++ b/include/common.h
@@ -587,7 +587,6 @@ void	irq_install_handler(int, interrupt_handler_t *, void *);
 void	irq_free_handler   (int);
 void	reset_timer	   (void);
 ulong	get_timer	   (ulong base);
-void	set_timer	   (ulong t);
 void	enable_interrupts  (void);
 int	disable_interrupts (void);

--
1.7.5.2.317.g391b14

  parent reply	other threads:[~2011-07-15 12:18 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   ` Graeme Russ [this message]
2011-07-16  9:34     ` [U-Boot] [PATCH v3 3/7]Timer: Remove set_timer completely 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   ` [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=1310732292-5345-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.