!apps: Simplify NuttX initialization

BREAKING: In an effort to simplify board initialization logic for NuttX,
NSH will no longer support architecture initialization. This will happen
during boot via the BOARD_LATE_INITIALIZE option. The boardctl command
BOARDIOC_INIT is also no longer available from user-space.

Quick fix:
Any application relying on BOARDIOC_INIT should now enable
BOARD_LATE_INITIALIZE to have initialization performed by the kernel in
advance of the application running. If control over initialization is
still necessary, BOARDIOC_FINALINIT should be implemented and used.
Boards relying on NSH for initialization should also enable
BOARD_LATE_INITIALIZE instead.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
This commit is contained in:
Matteo Golin 2026-02-16 13:41:27 -05:00 committed by Lup Yuen Lee
parent a9881037ea
commit 5b0cae9ab0
22 changed files with 13 additions and 209 deletions

View file

@ -9,7 +9,7 @@ config NSH_LIBRARY
bool "NSH Library"
default n
select NETUTILS_NETLIB if NET
select BOARDCTL if (!NSH_DISABLE_MKRD && !DISABLE_MOUNTPOINT) || NSH_ARCHINIT
select BOARDCTL if (!NSH_DISABLE_MKRD && !DISABLE_MOUNTPOINT)
select BOARDCTL_MKRD if !NSH_DISABLE_MKRD && !DISABLE_MOUNTPOINT
---help---
Build the NSH support library. This is used, for example, by
@ -1116,16 +1116,6 @@ config NSH_USBDEV_TRACEINTERRUPTS
endif # NSH_USBDEV_TRACE
endmenu # USB Device Trace Support
config NSH_ARCHINIT
bool "Have architecture-specific initialization"
default n
select BOARDCTL
---help---
Set if your board provides architecture specific initialization
via the board-interface function boardctl(). The boardctl()
function will be called early in NSH initialization to allow
board logic to do such things as configure MMC/SD slots.
menu "Networking Configuration"
depends on NET

View file

@ -807,13 +807,6 @@ int nsh_loginscript(FAR struct nsh_vtbl_s *vtbl);
* available:
*/
/* Architecture-specific initialization depends on boardctl(BOARDIOC_INIT) */
#if defined(CONFIG_NSH_ARCHINIT) && !defined(CONFIG_BOARDCTL)
# warning CONFIG_NSH_ARCHINIT is set, but CONFIG_BOARDCTL is not
# undef CONFIG_NSH_ARCHINIT
#endif
/* The mkrd command depends on boardctl(BOARDIOC_MKRD) */
#if !defined(CONFIG_BOARDCTL) || !defined(CONFIG_BOARDCTL_MKRD)

View file

@ -143,12 +143,6 @@ void nsh_initialize(void)
boardctl(BOARDIOC_APP_SYMTAB, (uintptr_t)&symdesc);
#endif
#ifdef CONFIG_NSH_ARCHINIT
/* Perform architecture-specific initialization (if configured) */
boardctl(BOARDIOC_INIT, 0);
#endif
#if defined(CONFIG_ETC_ROMFS) && !defined(CONFIG_NSH_DISABLESCRIPT)
pstate = nsh_newconsole(false);
@ -163,12 +157,6 @@ void nsh_initialize(void)
netinit_bringup();
#endif
#if defined(CONFIG_NSH_ARCHINIT) && defined(CONFIG_BOARDCTL_FINALINIT)
/* Perform architecture-specific final-initialization (if configured) */
boardctl(BOARDIOC_FINALINIT, 0);
#endif
#if defined(CONFIG_ETC_ROMFS) && !defined(CONFIG_NSH_DISABLESCRIPT)
/* Execute the start-up script */