imx: syscounter: support timer_get_boot_us
Subsystems (3)
PATCH 1/1 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=yCONFIG_BOOTSTAGE_REPORT=yCONFIG_CMD_BOOTSTAGE=y
--- arch/arm/mach-imx/syscounter.c | 9 +++++++++ 1 file changed, 9 insertions(+)
arch/arm/mach-imx/syscounter.c +9 -0
@@ -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;
Signature · 1 line
2.25.1
Quoted 9 lines · Jun Nie
With supporting
timer_get_boot_us, we can profile boot up time with below configs and functionbootstage_mark_name().
CONFIG_BOOTSTAGE=yCONFIG_BOOTSTAGE_REPORT=yCONFIG_CMD_BOOTSTAGE=ySigned-off-by Jun Nie <[email protected]>
FWIW, it also fixes boot failure when bootstage is enabled.
Shawn
Quoted 34 lines
--- arch/arm/mach-imx/syscounter.c | 9 +++++++++ 1 file changed, 9 insertions(+)arch/arm/mach-imx/syscounter.c +9
-1@@ -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; --2.25.1
Hi Jun,
Quoted 9 lines · Jun Nie
With supporting
timer_get_boot_us, we can profile boot up time with below configs and functionbootstage_mark_name().
CONFIG_BOOTSTAGE=yCONFIG_BOOTSTAGE_REPORT=yCONFIG_CMD_BOOTSTAGE=ySigned-off-by Jun Nie <[email protected]>
PATCH 1/1 imx: syscounter: support timer_get_boot_us
In reply to Jun NieQuoted 8 lines
With supporting
timer_get_boot_us, we can profile boot up time with below configs and functionbootstage_mark_name().CONFIG_BOOTSTAGE=yCONFIG_BOOTSTAGE_REPORT=yCONFIG_CMD_BOOTSTAGE=ySigned-off-by Jun Nie <[email protected]>Acked-by Shawn Guo <[email protected]>Reviewed-by Fabio Estevam <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected] =====================================================================