projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
armv8: New MMU setup code allowing to use 48+ bits PA/VA
[oweals/u-boot.git]
/
arch
/
arm
/
cpu
/
armv8
/
generic_timer.c
diff --git
a/arch/arm/cpu/armv8/generic_timer.c
b/arch/arm/cpu/armv8/generic_timer.c
index 8e60baebc53487d17556facc322003e23dfbd15f..8f47a82043b00519100bb4e600edc23c47ac8d90 100644
(file)
--- a/
arch/arm/cpu/armv8/generic_timer.c
+++ b/
arch/arm/cpu/armv8/generic_timer.c
@@
-40,3
+40,14
@@
unsigned long timer_read_counter(void)
#endif
return cntpct;
}
#endif
return cntpct;
}
+
+unsigned long usec2ticks(unsigned long usec)
+{
+ ulong ticks;
+ if (usec < 1000)
+ ticks = ((usec * (get_tbclk()/1000)) + 500) / 1000;
+ else
+ ticks = ((usec / 10) * (get_tbclk() / 100000));
+
+ return ticks;
+}