Matt DeVillier has submitted this change. ( https://review.coreboot.org/c/coreboot/+/86325?usp=email )
Change subject: soc/mediatek/common: Measure mtk_fsp_load_and_run() execution time ......................................................................
soc/mediatek/common: Measure mtk_fsp_load_and_run() execution time
Measure mtk_fsp_load_and_run() execution time. This info helps AP boot time analysis. The logs show as below.
[INFO ] mtk_fsp_load_and_run: run fallback/mtk_fsp_romstage at phase 0x30 in 0 msecs [INFO ] mtk_fsp_load_and_run: run fallback/mtk_fsp_ramstage at phase 0x50 in 41 msecs
BUG=none BRANCH=rauru TEST=cbmem -1|grep "mtk_fsp_load_and_run"
Change-Id: I61706952bef4590c5bfd09707a08a4f1a25fbda2 Signed-off-by: Yidi Lin yidilin@chromium.org Reviewed-on: https://review.coreboot.org/c/coreboot/+/86325 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Yu-Ping Wu yupingso@google.com --- M src/soc/mediatek/common/mtk_fsp.c 1 file changed, 5 insertions(+), 2 deletions(-)
Approvals: build bot (Jenkins): Verified Yu-Ping Wu: Looks good to me, approved
diff --git a/src/soc/mediatek/common/mtk_fsp.c b/src/soc/mediatek/common/mtk_fsp.c index bc1b5d5..073a079 100644 --- a/src/soc/mediatek/common/mtk_fsp.c +++ b/src/soc/mediatek/common/mtk_fsp.c @@ -3,6 +3,7 @@ #include <cbfs.h> #include <console/console.h> #include <soc/mtk_fsp.h> +#include <timer.h>
#define MAX_PARAM_ENTRIES 32 #define FSP_INTF_SIZE (sizeof(struct mtk_fsp_intf) + \ @@ -82,7 +83,9 @@ enum cb_err mtk_fsp_load_and_run(void) { struct prog fsp = PROG_INIT(PROG_REFCODE, mtk_fsp_file()); + struct stopwatch sw;
+ stopwatch_init(&sw); if (cbfs_prog_stage_load(&fsp)) { printk(BIOS_ERR, "%s: CBFS load program failed\n", __func__); return CB_ERR; @@ -101,8 +104,8 @@ return CB_ERR; }
- printk(BIOS_INFO, "%s: run %s at phase %#x done\n", - __func__, mtk_fsp_file(), intf->phase); + printk(BIOS_INFO, "%s: run %s at phase %#x in %lld msecs\n", + __func__, mtk_fsp_file(), intf->phase, stopwatch_duration_msecs(&sw));
return CB_SUCCESS; }