public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] MX28: Fix get_timer() / get_tbclk() issue
@ 2012-02-07 16:47 Marek Vasut
  2012-02-07 17:08 ` Stefano Babic
  0 siblings, 1 reply; 2+ messages in thread
From: Marek Vasut @ 2012-02-07 16:47 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Detlev Zundel <dzu@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
---
 arch/arm/cpu/arm926ejs/mx28/timer.c |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/mx28/timer.c b/arch/arm/cpu/arm926ejs/mx28/timer.c
index dbc904d..5b73f4a 100644
--- a/arch/arm/cpu/arm926ejs/mx28/timer.c
+++ b/arch/arm/cpu/arm926ejs/mx28/timer.c
@@ -82,7 +82,7 @@ int timer_init(void)
 	return 0;
 }
 
-ulong get_timer(ulong base)
+unsigned long long get_ticks(void)
 {
 	struct mx28_timrot_regs *timrot_regs =
 		(struct mx28_timrot_regs *)MXS_TIMROT_BASE;
@@ -103,7 +103,17 @@ ulong get_timer(ulong base)
 	}
 	lastdec = now;
 
-	return tick_to_time(timestamp) - base;
+	return timestamp;
+}
+
+ulong get_timer_masked(void)
+{
+	return tick_to_time(get_ticks());
+}
+
+ulong get_timer(ulong base)
+{
+	return get_timer_masked() - base;
 }
 
 /* We use the HW_DIGCTL_MICROSECONDS register for sub-millisecond timer. */
@@ -139,3 +149,8 @@ void __udelay(unsigned long usec)
 		old = new;
 	}
 }
+
+ulong get_tbclk(void)
+{
+	return MX28_INCREMENTER_HZ;
+}
-- 
1.7.8.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] [PATCH] MX28: Fix get_timer() / get_tbclk() issue
  2012-02-07 16:47 [U-Boot] [PATCH] MX28: Fix get_timer() / get_tbclk() issue Marek Vasut
@ 2012-02-07 17:08 ` Stefano Babic
  0 siblings, 0 replies; 2+ messages in thread
From: Stefano Babic @ 2012-02-07 17:08 UTC (permalink / raw)
  To: u-boot

On 07/02/2012 17:47, Marek Vasut wrote:
> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
> Cc: Wolfgang Denk <wd@denx.de>
> Cc: Detlev Zundel <dzu@denx.de>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Fabio Estevam <festevam@gmail.com>
> ---

This fixes building of MX28 based boards - applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-02-07 17:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-07 16:47 [U-Boot] [PATCH] MX28: Fix get_timer() / get_tbclk() issue Marek Vasut
2012-02-07 17:08 ` Stefano Babic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox