configs: meson64_android: define raw parts for bootloader
[platform/kernel/u-boot.git] / lib / time.c
index 88bc504..96074b8 100644 (file)
@@ -5,14 +5,17 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <bootstage.h>
 #include <dm.h>
 #include <errno.h>
 #include <init.h>
+#include <spl.h>
 #include <time.h>
 #include <timer.h>
 #include <watchdog.h>
 #include <div64.h>
+#include <asm/global_data.h>
 #include <asm/io.h>
 #include <linux/delay.h>
 
@@ -96,8 +99,13 @@ uint64_t notrace get_ticks(void)
        }
 
        ret = timer_get_count(gd->timer, &count);
-       if (ret)
-               panic("Could not read count from timer (err %d)\n", ret);
+       if (ret) {
+               if (spl_phase() > PHASE_TPL)
+                       panic("Could not read count from timer (err %d)\n",
+                             ret);
+               else
+                       panic("no timer (err %d)\n", ret);
+       }
 
        return count;
 }