From f35dd7813ed1219aad37eac57fa66595deeb5a28 Mon Sep 17 00:00:00 2001 From: Justin Hammond Date: Mon, 17 Aug 2026 00:03:54 +0800 Subject: [PATCH] boards/risc-v/eic7700x: Report the pads at startup. Log one line from board start up with the pad count and how many differ from their reset defaults, through eic7700x_pinctrl_count(). A helper holds its locals so nothing stays on the stack for the bring up that follows. Turn the pinctrl driver's error output on for both boards, so a refused pad write says why rather than merely failing. Assisted-by: Claude:claude-opus-5 Signed-off-by: Justin Hammond --- .../eic7700x/common/src/eic7700x_boot.c | 23 +++++++++++++++++++ .../eic7700-evb/configs/nsh/defconfig | 2 ++ .../eic7700x/starpro64/configs/nsh/defconfig | 2 ++ 3 files changed, 27 insertions(+) diff --git a/boards/risc-v/eic7700x/common/src/eic7700x_boot.c b/boards/risc-v/eic7700x/common/src/eic7700x_boot.c index ac09f04ddb5..03f77a225c3 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_pinctrl.h" #include "eic7700x_reset.h" #include "board_config.h" @@ -59,6 +60,25 @@ * Private Functions ****************************************************************************/ +#ifdef CONFIG_EIC7700X_PINCTRL +/**************************************************************************** + * Name: report_pads + * + * Description: + * Report the pad census. Its own function so that nothing it needs + * stays on the stack for the bring up that follows. + * + ****************************************************************************/ + +static void report_pads(void) +{ + unsigned int nchanged; + unsigned int npads = eic7700x_pinctrl_count(&nchanged); + + syslog(LOG_INFO, "pinctrl: %u pads, %u configured\n", npads, nchanged); +} +#endif /* CONFIG_EIC7700X_PINCTRL */ + /**************************************************************************** * Name: mount_ramdisk * @@ -176,6 +196,9 @@ void board_late_initialize(void) report_clocks(); report_resets(); +#ifdef CONFIG_EIC7700X_PINCTRL + report_pads(); +#endif /* CONFIG_EIC7700X_PINCTRL */ /* 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 5055e1808ea..649b462b056 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_PINCTRL=y +CONFIG_DEBUG_PINCTRL_ERROR=y CONFIG_DEBUG_RESET=y CONFIG_DEBUG_RESET_ERROR=y CONFIG_DEBUG_SCHED=y diff --git a/boards/risc-v/eic7700x/starpro64/configs/nsh/defconfig b/boards/risc-v/eic7700x/starpro64/configs/nsh/defconfig index db0fceabd78..7e0b27ad46f 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_PINCTRL=y +CONFIG_DEBUG_PINCTRL_ERROR=y CONFIG_DEBUG_RESET=y CONFIG_DEBUG_RESET_ERROR=y CONFIG_DEBUG_SCHED=y