[PATCH v3 2/3] riscv: timer: add timer_get_boot_us for BOOTSTAGE

Leo Liang ycliang at andestech.com
Wed Oct 4 11:24:59 CEST 2023


On Wed, Sep 06, 2023 at 02:18:13PM +0900, Chanho Park wrote:
> timer_get_boot_us function is required to record the boot stages as
> us-based timestamp.
> To get a micro-second time from a timer tick, this converts the
> formula like below to avoid zero result of (tick / rate) part.
> 
> From: time(us) = (tick / rate) * 10000000
> To  : time(us) = (tick * 1000) / (rate / 1000)
> 
> Signed-off-by: Chanho Park <chanho61.park at samsung.com>
> ---
>  drivers/timer/riscv_timer.c | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)

Reviewed-by: Leo Yu-Chi Liang <ycliang at andestech.com>


More information about the U-Boot mailing list