From 7fe77bf1d70f2403538dee675b82798589d20fe9 Mon Sep 17 00:00:00 2001 From: Justin Hammond Date: Sun, 16 Aug 2026 02:23:39 +0800 Subject: [PATCH] boards/risc-v/eic7700x: Report the reset lines at startup. A peripheral held in reset reads like one that is absent, and the boot loader does not leave the same lines released on every board or every boot. One line at startup says how much is held: reset: 324 lines, 117 held Beside the clock tree's line and for the same reason: the summary is worth seeing on every boot, and the detail belongs in /proc where it can be read when it is wanted. The driver's error output is enabled, matching the clock driver. Info level is not, since nothing at that level prints on a healthy boot. Assisted-by: Claude:claude-opus-5 Signed-off-by: Justin Hammond --- .../eic7700x/common/src/eic7700x_boot.c | 20 +++++++++++++++++++ .../eic7700-evb/configs/nsh/defconfig | 2 ++ .../eic7700x/starpro64/configs/nsh/defconfig | 2 ++ 3 files changed, 24 insertions(+) diff --git a/boards/risc-v/eic7700x/common/src/eic7700x_boot.c b/boards/risc-v/eic7700x/common/src/eic7700x_boot.c index 3d86b3420cc..ac09f04ddb5 100644 --- a/boards/risc-v/eic7700x/common/src/eic7700x_boot.c +++ b/boards/risc-v/eic7700x/common/src/eic7700x_boot.c @@ -41,6 +41,7 @@ #ifdef CONFIG_EIC7700X_CPUCLK # include "eic7700x_cpuclk.h" #endif +#include "eic7700x_reset.h" #include "board_config.h" @@ -117,6 +118,24 @@ static void report_clocks(void) syslog(LOG_INFO, "clk: registered %u clocks, %u failed\n", nclk, nfail); } +/**************************************************************************** + * Name: report_resets + * + * Description: + * Report the reset lines the architecture registered before this board + * ran, and how many the boot loader left held. Its own function for the + * same reason as report_clocks(). + * + ****************************************************************************/ + +static void report_resets(void) +{ + unsigned int held; + unsigned int nline = eic7700x_reset_count(&held); + + syslog(LOG_INFO, "reset: %u lines, %u held\n", nline, held); +} + /**************************************************************************** * Name: board_late_initialize * @@ -156,6 +175,7 @@ void board_late_initialize(void) mount(NULL, "/proc", "procfs", 0, NULL); report_clocks(); + report_resets(); /* Devices whose presence or order is this board's business */ diff --git a/boards/risc-v/eic7700x/eic7700-evb/configs/nsh/defconfig b/boards/risc-v/eic7700x/eic7700-evb/configs/nsh/defconfig index ce4a8a086ac..252bf2a674a 100644 --- a/boards/risc-v/eic7700x/eic7700-evb/configs/nsh/defconfig +++ b/boards/risc-v/eic7700x/eic7700-evb/configs/nsh/defconfig @@ -63,6 +63,8 @@ CONFIG_DEBUG_FS_ERROR=y CONFIG_DEBUG_FULLOPT=y CONFIG_DEBUG_MM=y CONFIG_DEBUG_MM_ERROR=y +CONFIG_DEBUG_RESET=y +CONFIG_DEBUG_RESET_ERROR=y CONFIG_DEBUG_SCHED=y CONFIG_DEBUG_SYMBOLS=y CONFIG_DEFAULT_TASK_STACKSIZE=8192 diff --git a/boards/risc-v/eic7700x/starpro64/configs/nsh/defconfig b/boards/risc-v/eic7700x/starpro64/configs/nsh/defconfig index 88dbbc3a195..72e92019e2e 100644 --- a/boards/risc-v/eic7700x/starpro64/configs/nsh/defconfig +++ b/boards/risc-v/eic7700x/starpro64/configs/nsh/defconfig @@ -59,6 +59,8 @@ CONFIG_DEBUG_FS_ERROR=y CONFIG_DEBUG_FULLOPT=y CONFIG_DEBUG_MM=y CONFIG_DEBUG_MM_ERROR=y +CONFIG_DEBUG_RESET=y +CONFIG_DEBUG_RESET_ERROR=y CONFIG_DEBUG_SCHED=y CONFIG_DEBUG_SYMBOLS=y CONFIG_DEFAULT_TASK_STACKSIZE=8192