mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-16 09:54:35 +00:00
imx: syscounter: support timer_get_boot_us
With supporting timer_get_boot_us, we can profile boot up time with below configs and function bootstage_mark_name(). CONFIG_BOOTSTAGE=y CONFIG_BOOTSTAGE_REPORT=y CONFIG_CMD_BOOTSTAGE=y Signed-off-by: Jun Nie <jun.nie@linaro.org> Acked-by: Shawn Guo <shawn.guo@linaro.org> Reviewed-by: Fabio Estevam <festevam@denx.de>
This commit is contained in:
parent
085d041b57
commit
651478777b
1 changed files with 9 additions and 0 deletions
|
@ -79,6 +79,7 @@ int timer_init(void)
|
|||
gd->arch.tbl = 0;
|
||||
gd->arch.tbu = 0;
|
||||
|
||||
gd->arch.timer_rate_hz = freq;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
@ -100,6 +101,14 @@ ulong get_timer(ulong base)
|
|||
return tick_to_time(get_ticks()) - base;
|
||||
}
|
||||
|
||||
ulong timer_get_boot_us(void)
|
||||
{
|
||||
if (!gd->arch.timer_rate_hz)
|
||||
timer_init();
|
||||
|
||||
return tick_to_time(get_ticks());
|
||||
}
|
||||
|
||||
void __udelay(unsigned long usec)
|
||||
{
|
||||
unsigned long long tmp;
|
||||
|
|
Loading…
Add table
Reference in a new issue