summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-01-09 17:38:26 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2015-01-09 17:38:26 +0100
commitff6383c8e4bde31036fbd31f7961539be288d6af (patch)
tree26f187f697be5f434f533d6b304bddd311cc81fd /common
parent2af31fbc239ae40a59f926bc5e505956a1bf27ef (diff)
parent11f588be314af70e1b058aac06663f29606846cd (diff)
downloadbarebox-ff6383c8e4bde31036fbd31f7961539be288d6af.tar.gz
barebox-ff6383c8e4bde31036fbd31f7961539be288d6af.tar.xz
Merge branch 'for-next/misc'
Diffstat (limited to 'common')
-rw-r--r--common/clock.c20
-rw-r--r--common/memtest.c2
2 files changed, 19 insertions, 3 deletions
diff --git a/common/clock.c b/common/clock.c
index 2ee81da8e7..35c9e6cbb8 100644
--- a/common/clock.c
+++ b/common/clock.c
@@ -22,6 +22,7 @@
*/
#include <common.h>
+#include <init.h>
#include <asm-generic/div64.h>
#include <clock.h>
#include <poller.h>
@@ -35,6 +36,16 @@ static uint64_t time_ns;
*/
uint64_t time_beginning;
+static int dummy_csrc_warn(void)
+{
+ if (!current_clock) {
+ pr_warn("Warning: Using dummy clocksource\n");
+ }
+
+ return 0;
+}
+late_initcall(dummy_csrc_warn);
+
/**
* get_time_ns - get current timestamp in nanoseconds
*/
@@ -44,8 +55,13 @@ uint64_t get_time_ns(void)
uint64_t cycle_now, cycle_delta;
uint64_t ns_offset;
- if (!cs)
- return 0;
+ if (!cs) {
+ static uint64_t dummy_counter;
+
+ dummy_counter += CONFIG_CLOCKSOURCE_DUMMY_RATE;
+
+ return dummy_counter;
+ }
/* read clocksource: */
cycle_now = cs->read() & cs->mask;
diff --git a/common/memtest.c b/common/memtest.c
index 541d008221..25a97d845c 100644
--- a/common/memtest.c
+++ b/common/memtest.c
@@ -24,7 +24,7 @@
#include <common.h>
#include <memory.h>
#include <types.h>
-#include <sizes.h>
+#include <linux/sizes.h>
#include <errno.h>
#include <memtest.h>