Current code tries to print information about the reset method whenever sysreset support is enabled. This causes the core to try to bind the sysreset device in board_init_f, even if the driver doesn't support reset status reporting, causing pure waste on some platforms (e.g. on Rockchip RK3576 it increases the boot time by ~0.4s even though the driver doesn't support reset status reporting).
Make the printing of reset information optional, so that it can be enabled only on platforms where it is supported and useful. Only four sysreset drivers actually implement the get_status() op, so default the new symbol to y wherever one of them can be in use to avoid regressing those platforms: - sysreset_sandbox - sysreset_mpc83xx - sysreset_psci, whose weak stub get_status() is only overridden by i.MX9; - the pca9450 PMIC sysreset child driver. Signed-off-by: Alexey Charkov <[email protected]> --- common/board_f.c | 4 ++-- drivers/sysreset/Kconfig | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/common/board_f.c b/common/board_f.c index 85b888d4bb85..7d1f80cd7fbf 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -122,7 +122,7 @@ static int display_text_info(void) return 0; } -#ifdef CONFIG_SYSRESET +#ifdef CONFIG_SYSRESET_PRINT_RESETINFO static int print_resetinfo(void) { struct udevice *dev; @@ -963,7 +963,7 @@ static void initcall_run_f(void) INITCALL(display_options); /* say that we are here */ INITCALL(display_text_info); /* show debugging info if required */ INITCALL(checkcpu); -#if CONFIG_IS_ENABLED(SYSRESET) +#if CONFIG_IS_ENABLED(SYSRESET_PRINT_RESETINFO) INITCALL(print_resetinfo); #endif /* display cpu info (and speed) */ diff --git a/drivers/sysreset/Kconfig b/drivers/sysreset/Kconfig index 16ef434a8d9c..a046dd02e66f 100644 --- a/drivers/sysreset/Kconfig +++ b/drivers/sysreset/Kconfig @@ -43,6 +43,20 @@ config VPL_SYSRESET if SYSRESET +config SYSRESET_PRINT_RESETINFO + bool "Print reset information during boot" + default y if SANDBOX + default y if SYSRESET_MPC83XX + default y if SYSRESET_PSCI && ARCH_IMX9 + default y if DM_PMIC_PCA9450 + help + Print information about the cause of the last reset during early + boot, as reported by the get_status() method of the sysreset + drivers. This requires probing all sysreset devices in + board_init_f(), which costs boot time, so only enable it if at + least one of the sysreset drivers in use actually implements + get_status(). + config SYSRESET_CMD_RESET bool "sysreset implementation of the reset command" default y --- base-commit: 44f0dcf476140c1077ee3dbe16a80fdb6f8265c4 change-id: 20260730-resetinfo-optional-d2cb4cdf0892 Best regards, -- Alexey Charkov <[email protected]>
