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

Leo Liang
2023-10-04T09:27:13Z

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@samsung.com>
> ---
> drivers/timer/riscv_timer.c | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)

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