Skip to contentSkip to conversation

MX28: Fix get_timer() / get_tbclk() issue

PATCH New Marek Vasut 2 participants 2 messages Feb 7, 2012 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MX28: Fix get_timer() / get_tbclk() issue

Cc Wolfgang Denk <[email protected]>
Cc Detlev Zundel <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
---
 arch/arm/cpu/arm926ejs/mx28/timer.c |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)
arch/arm/cpu/arm926ejs/mx28/timer.c +17 -2
index dbc904d..5b73f4a 100644
@@ -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;
+}
Signature · 1 line
1.7.8.3
#1 lore raw

PATCH 1/1 MX28: Fix get_timer() / get_tbclk() issue

Quoted 6 lines · Marek Vasut
Cc Wolfgang Denk <[email protected]>
Cc Detlev Zundel <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>

---

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

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
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
=====================================================================