summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2016-02-26 16:22:28 -0500
committerTom Rini <trini@konsulko.com>2016-02-26 16:22:28 -0500
commitd5c6144fe326e255e42ec273fc5d88f45cd61548 (patch)
tree470446ad6c9d5580b0ff778d5adc77ee05f6e1b8 /lib
parent38e65aeb70b72132c0d2ec0ed389f7fc8b7bdf4c (diff)
parent6796704b0dfb4f98cb4a026988e9739884812b5c (diff)
Merge git://git.denx.de/u-boot-dm
Diffstat (limited to 'lib')
-rw-r--r--lib/div64.c3
-rw-r--r--lib/time.c28
2 files changed, 23 insertions, 8 deletions
diff --git a/lib/div64.c b/lib/div64.c
index 795ef0e1e4..319fca50fa 100644
--- a/lib/div64.c
+++ b/lib/div64.c
@@ -18,8 +18,9 @@
#include <div64.h>
#include <linux/types.h>
+#include <linux/compiler.h>
-uint32_t __div64_32(uint64_t *n, uint32_t base)
+uint32_t notrace __div64_32(uint64_t *n, uint32_t base)
{
uint64_t rem = *n;
uint64_t b = base;
diff --git a/lib/time.c b/lib/time.c
index e9f6861b98..f37150fddc 100644
--- a/lib/time.c
+++ b/lib/time.c
@@ -43,11 +43,17 @@ extern unsigned long __weak timer_read_counter(void);
#ifdef CONFIG_TIMER
ulong notrace get_tbclk(void)
{
- int ret;
+ if (!gd->timer) {
+#ifdef CONFIG_TIMER_EARLY
+ return timer_early_get_rate();
+#else
+ int ret;
- ret = dm_timer_init();
- if (ret)
- return ret;
+ ret = dm_timer_init();
+ if (ret)
+ return ret;
+#endif
+ }
return timer_get_rate(gd->timer);
}
@@ -57,9 +63,17 @@ uint64_t notrace get_ticks(void)
u64 count;
int ret;
- ret = dm_timer_init();
- if (ret)
- return ret;
+ if (!gd->timer) {
+#ifdef CONFIG_TIMER_EARLY
+ return timer_early_get_count();
+#else
+ int ret;
+
+ ret = dm_timer_init();
+ if (ret)
+ return ret;
+#endif
+ }
ret = timer_get_count(gd->timer, &count);
if (ret)