!boards: Remove NSH_ARCHINIT and board_app_initialize

BREAKING: In an effort to simplify NuttX initialization, NSH_ARCHINIT is
removed. board_app_initialize is also removed. BOARD_LATE_INITIALIZE now
performs all board initialization logic, and is by default enabled. All
references to these symbols are removed. BOARDIOC_INIT remains, but will
result in -ENOTTY when called. It is to be removed in a later commit.

Quick fix: Boards relying on NSH_ARCHINIT should now enable
CONFIG_BOARD_LATE_INITIALIZE instead. If the application needs
fine-grained control over board initialization from userspace, the logic
performed by BOARDIOC_INIT may be copied to the board_finalinitialize
function and used instead via BOARDIOC_FINALINIT. All
board_app_initialize logic provided by NuttX is now moved to
board_late_initialize, and the same should be done for out-of-tree
boards.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
This commit is contained in:
Matteo Golin
2026-02-16 14:24:28 -05:00
committed by Xiang Xiao
parent 8e91dd60a0
commit 48db502daf
1631 changed files with 579 additions and 2753 deletions
+59 -77
View File
@@ -42,73 +42,55 @@ implementing the :c:func:`board_ioctl` interface.
System state control
--------------------
.. c:macro:: BOARDIOC_INIT
Perform one-time application initialization.
:Argument: The argument is passed to the
:c:func:`board_app_initialize` implementation without modification.
The argument has no meaning to NuttX; the meaning of the
argument is a contract between the board-specific
initialization logic and the matching application logic.
The value could be such things as a mode enumeration value,
a set of DIP switch switch settings, a pointer to
configuration data read from a file or serial FLASH, or
whatever you would like to do with it. Every
implementation should accept zero/NULL as a default
configuration.
:Dependencies: Board logic must provide :c:func:`board_app_initialize`.
.. c:macro:: BOARDIOC_POWEROFF
Power off the board
:Argument: Integer value providing power off status information
:configuration: CONFIG_BOARDCTL_POWEROFF
:dependencies: Board logic must provide the :c:func:`board_power_off` interface.
.. c:macro:: BOARDIOC_RESET
Reset the board
:Argument: Integer value providing power off status information
:configuration: CONFIG_BOARDCTL_RESET
:dependencies: Board logic must provide the :c:func:`board_reset` interface.
Power Management
----------------
.. c:macro:: BOARDIOC_PM_CONTROL
Manage power state transition and query. The supplied argument
indicates the specific PM operation to perform, which map to
corresponding internal ``pm_<operation>`` functions
(see :doc:`/components/drivers/special/power/pm/index`).
With this interface you can interact with PM handling arch/board logic
(typically done in IDLE loop) or you can directly manage state transitions
from userspace.
:Argument: A pointer to an instance of :c:struct:`boardioc_pm_ctrl_s`.
:configuration: CONFIG_PM
Board information
-----------------
.. c:macro:: BOARDIOC_UNIQUEID
Return a unique ID associated with the board (such as a
serial number or a MAC address).
:Argument: A writable array of size :c:macro:`CONFIG_BOARDCTL_UNIQUEID_SIZE` in
which to receive the board unique ID.
:dependencies: Board logic must provide the :c:func:`board_uniqueid` interface.
.. c:macro:: BOARDIOC_MACADDR
@@ -120,49 +102,49 @@ Board information
:configuration: CONFIG_BOARDCTL_MACADDR
:dependencies: Board logic must provide the :c:func:`board_macaddr` interface.
Filesystems
-----------
.. c:macro:: BOARDIOC_MKRD
Create a RAM disk
:Argument: Pointer to read-only instance of :c:struct:`boardioc_mkrd_s`.
:configuration: CONFIG_BOARDCTL_MKRD
.. c:macro:: BOARDIOC_ROMDISK
Register a ROM disk
:Argument: Pointer to read-only instance of :c:struct:`boardioc_romdisk_s`.
:configuration: CONFIG_BOARDCTL_ROMDISK
Symbol Handling
---------------
.. c:macro:: BOARDIOC_APP_SYMTAB
Select the application symbol table. This symbol table
provides the symbol definitions exported to application
code from application space.
:Argument: A pointer to an instance of :c:struct:`boardioc_symtab_s`.
:configuration: CONFIG_BOARDCTL_APP_SYMTAB
.. c:macro:: BOARDIOC_OS_SYMTAB
Select the OS symbol table. This symbol table provides
the symbol definitions exported by the OS to kernel
modules.
:Argument: A pointer to an instance of :c:struct:`boardioc_symtab_s`.
:configuration: CONFIG_BOARDCTL_OS_SYMTAB
.. c:macro:: BOARDIOC_BUILTINS
Provide the user-space list of built-in applications for
@@ -176,86 +158,86 @@ Symbol Handling
available. (BINFS is not supportable in KERNEL mode since
user-space address have no general meaning that
configuration).
:Argument: A pointer to an instance of :c:struct:`boardioc_builtin_s`.
:configuration: This command is always available when
CONFIG_BUILTIN is enabled, but does nothing unless
CONFIG_BUILD_PROTECTED is also selected.
USB
---
.. c:macro:: BOARDIOC_USBDEV_CONTROL
Manage USB device classes
:Argument: A pointer to an instance of :c:struct:`boardioc_usbdev_ctrl_s`.
:configuration: CONFIG_BOARDCTL && CONFIG_BOARDCTL_USBDEVCTRL
:dependencies: Board logic must provide `board_<usbdev>_initialize()`.
Graphics
--------
.. c:macro:: BOARDIOC_NX_START
Start the NX server
:Argument: Integer display number to be served by this NXMU instance.
:configuration: CONFIG_NX
:dependencies: Base graphics logic provides :c:func:`nxmu_start`.
.. c:macro:: BOARDIOC_VNC_START
Start the NX server and framebuffer driver.
:Argument: A reference readable instance of :c:struct:`boardioc_vncstart_s`.
:configuration: CONFIG_VNCSERVER
:dependencies: VNC server provides :c:func:`nx_vnc_fbinitialize`.
.. c:macro:: BOARDIOC_NXTERM
Create an NX terminal device
:Argument: A reference readable/writable instance of
:c:struct:`boardioc_nxterm_create_s`.
:configuration: CONFIG_NXTERM
:dependencies: Base NX terminal logic provides :c:func:`nx_register` and
:c:func:`nxtk_register`.
.. c:macro:: BOARDIOC_NXTERM_IOCTL
Create an NX terminal IOCTL command. Normal IOCTLs
cannot be be performed in most graphics contexts since
the depend on the task holding an open file descriptor
:Argument: A reference readable/writable instance of
:c:struct:`boardioc_nxterm_ioctl_s`.
:configuration: CONFIG_NXTERM
:dependencies: Base NX terminal logic provides :c:func:`nxterm_ioctl_tap`.
Testing
-------
.. c:macro:: BOARDIOC_TESTSET
Access architecture-specific up_testset() operation
:Argument: A pointer to a write-able spinlock object. On success
the preceding spinlock state is returned: 0=unlocked,
1=locked.
:configuration: CONFIG_BOARDCTL_TESTSET
:dependencies: Architecture-specific logic provides :c:func:`up_testset`.