]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - lib/time.c
fw_env: calculate default number of env sectors
[karo-tx-uboot.git] / lib / time.c
index 111b493a420d65c462e70747b5830aa51c45da0e..73c3b6ad7ff4503c3b485dbdab091601575e3a12 100644 (file)
@@ -51,7 +51,7 @@ unsigned long long __weak notrace get_ticks(void)
        return ((unsigned long long)gd->timebase_h << 32) | gd->timebase_l;
 }
 
-static unsigned long long notrace tick_to_time(unsigned long long tick)
+static unsigned long long notrace tick_to_time(uint64_t tick)
 {
        unsigned int div = get_tbclk();
 
@@ -60,6 +60,11 @@ static unsigned long long notrace tick_to_time(unsigned long long tick)
        return tick;
 }
 
+int __weak timer_init(void)
+{
+       return 0;
+}
+
 ulong __weak get_timer(ulong base)
 {
        return tick_to_time(get_ticks()) - base;
@@ -71,8 +76,8 @@ unsigned long __weak notrace timer_get_us(void)
 }
 static unsigned long long usec_to_tick(unsigned long usec)
 {
-       unsigned long long tick = usec * get_tbclk();
-       usec *= get_tbclk();
+       uint64_t tick = usec;
+       tick *= get_tbclk();
        do_div(tick, 1000000);
        return tick;
 }