mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-02-26 12:27:12 +00:00
lib: time: export usec_to_tick()
In the UEFI Stall() boottime service we need access to usec_to_tick(). Export the function. Remove redundant implementation in arch/arm/mach-rockchip/rk_timer.c. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
parent
66ca24a9a0
commit
6a853dbcc0
3 changed files with 10 additions and 8 deletions
|
@ -20,13 +20,6 @@ static uint64_t rockchip_get_ticks(void)
|
||||||
return timebase_h << 32 | timebase_l;
|
return timebase_h << 32 | timebase_l;
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint64_t usec_to_tick(unsigned int usec)
|
|
||||||
{
|
|
||||||
uint64_t tick = usec;
|
|
||||||
tick *= CONFIG_SYS_TIMER_RATE / (1000 * 1000);
|
|
||||||
return tick;
|
|
||||||
}
|
|
||||||
|
|
||||||
void rockchip_udelay(unsigned int usec)
|
void rockchip_udelay(unsigned int usec)
|
||||||
{
|
{
|
||||||
uint64_t tmp;
|
uint64_t tmp;
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#define _TIME_H
|
#define _TIME_H
|
||||||
|
|
||||||
#include <linux/typecheck.h>
|
#include <linux/typecheck.h>
|
||||||
|
#include <linux/types.h>
|
||||||
|
|
||||||
unsigned long get_timer(unsigned long base);
|
unsigned long get_timer(unsigned long base);
|
||||||
|
|
||||||
|
@ -21,6 +22,14 @@ unsigned long timer_get_us(void);
|
||||||
*/
|
*/
|
||||||
void timer_test_add_offset(unsigned long offset);
|
void timer_test_add_offset(unsigned long offset);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* usec_to_tick() - convert microseconds to clock ticks
|
||||||
|
*
|
||||||
|
* @usec: duration in microseconds
|
||||||
|
* Return: duration in clock ticks
|
||||||
|
*/
|
||||||
|
uint64_t usec_to_tick(unsigned long usec);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* These inlines deal with timer wrapping correctly. You are
|
* These inlines deal with timer wrapping correctly. You are
|
||||||
* strongly encouraged to use them
|
* strongly encouraged to use them
|
||||||
|
|
|
@ -139,7 +139,7 @@ unsigned long __weak notrace timer_get_us(void)
|
||||||
return tick_to_time(get_ticks() * 1000);
|
return tick_to_time(get_ticks() * 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint64_t usec_to_tick(unsigned long usec)
|
uint64_t usec_to_tick(unsigned long usec)
|
||||||
{
|
{
|
||||||
uint64_t tick = usec;
|
uint64_t tick = usec;
|
||||||
tick *= get_tbclk();
|
tick *= get_tbclk();
|
||||||
|
|
Loading…
Add table
Reference in a new issue