]> git.dujemihanovic.xyz Git - u-boot.git/commit
timer: riscv_aclint_timer: add timer_get_boot_us for BOOTSTAGE
authorChanho Park <chanho61.park@samsung.com>
Wed, 6 Sep 2023 05:18:14 +0000 (14:18 +0900)
committerLeo Yu-Chi Liang <ycliang@andestech.com>
Wed, 4 Oct 2023 09:55:37 +0000 (17:55 +0800)
commit6d78473b3d390c650aa7f418bdd5044ea42ee951
tree72acc3a568e5ca0c3a3bc812352fe6975a3b9cf5
parent74fbd74ed2069985c9d7dd15ffe94f8a95f1022a
timer: riscv_aclint_timer: add timer_get_boot_us for BOOTSTAGE

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) * 1000000
To  : time(us) = (tick * 1000) / (rate / 1000)

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
drivers/timer/riscv_aclint_timer.c