aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSimon Glass2020-12-23 08:11:16 -0700
committerSimon Glass2021-01-05 12:24:40 -0700
commit6d1a8ebefb8461f93e12b6e62efe36ca0a69e6d4 (patch)
treec92797be4377b6fbb0459bdb6e22cfccba0ea89f /lib
parent477a6bcb3b8b3d9e6818e19bf9baaee750665bad (diff)
timer: Use a shorter error in TPL
This error should not happen in normal use. Reduce the length of it to save space in the image. Add an empty spl.h file to sh since it appears to lack this. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/time.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/time.c b/lib/time.c
index 88bc50405ff..cc6944ec345 100644
--- a/lib/time.c
+++ b/lib/time.c
@@ -9,6 +9,7 @@
#include <dm.h>
#include <errno.h>
#include <init.h>
+#include <spl.h>
#include <time.h>
#include <timer.h>
#include <watchdog.h>
@@ -96,8 +97,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;
}