summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Charkov <alchark@flipper.net>2026-07-30 12:39:27 +0400
committerTom Rini <trini@konsulko.com>2026-08-13 15:02:01 -0600
commita1f39f70134734c7e3f061900fa988d46771da44 (patch)
tree903622492f4a1fe3220d89e7e69b5f2d04f84bef
parent824317a8bc5689d93016e4c2211d194f98d9da33 (diff)
downloadu-boot-a1f39f70134734c7e3f061900fa988d46771da44.tar.gz
u-boot-a1f39f70134734c7e3f061900fa988d46771da44.zip
board_f: Make printing reset information optional
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 <alchark@flipper.net>
-rw-r--r--common/board_f.c4
-rw-r--r--drivers/sysreset/Kconfig14
2 files changed, 16 insertions, 2 deletions
diff --git a/common/board_f.c b/common/board_f.c
index 9efcd9499a9..59f1f173a27 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 16ef434a8d9..a046dd02e66 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