Let's rename board_driver_initialize() to board_early_initialize() to emphasize its relationship to board_late_initialize().

This commit is contained in:
Gregory Nutt 2019-02-18 16:25:08 -06:00
parent a76e137ce2
commit 32a300806e
4 changed files with 25 additions and 24 deletions

View File

@ -939,7 +939,7 @@ struct nx_callback_s
<p> <p>
The NX server may be started in your board startup logic by simply calling the function <code> nxmu_start()</code>. The NX server may be started in your board startup logic by simply calling the function <code> nxmu_start()</code>.
The board startup logic usually resides the the <code>configs/<i>board</i>/src</code> directory. The board startup logic usually resides the the <code>configs/<i>board</i>/src</code> directory.
The boar board startup logic can run automatically during the early system if <code>CONFIG_BOARD_LATE_INITIALIZE</code> is defined in the configuration. The board startup logic can run automatically during the early system if <code>CONFIG_BOARD_LATE_INITIALIZE</code> is defined in the configuration.
Or, the board startup logic can execute under control of the application by calling the <code>boardctl(BOARDIOC_INIT, arg)</code> OS interface. Or, the board startup logic can execute under control of the application by calling the <code>boardctl(BOARDIOC_INIT, arg)</code> OS interface.
</p> </p>
<p> <p>

View File

@ -120,19 +120,19 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: board_late_initialize * Name: board_early_initialize
* *
* Description: * Description:
* If CONFIG_BOARD_DRIVER_INITIALIZE is selected, then an additional * If CONFIG_BOARD_EARLY_INITIALIZE is selected, then an additional
* initialization call will be performed in the boot-up sequence to a * initialization call will be performed in the boot-up sequence to a
* function called board_driver_initialize(). board_driver_initialize() * function called board_early_initialize(). board_early_initialize()
* will be called immediately after up_initialize() and well before * will be called immediately after up_initialize() and well before
* board_driver_initialize() is called and the initial application is * board_early_initialize() is called and the initial application is
* started. The context in which board_driver_initialize() executes is * started. The context in which board_early_initialize() executes is
* suitable for early initialization of most, simple device drivers and * suitable for early initialization of most, simple device drivers and
* is a logical, board-specific extension of up_initialize(). * is a logical, board-specific extension of up_initialize().
* *
* board_driver_initialize() runs on the startup, initialization thread. * board_early_initialize() runs on the startup, initialization thread.
* Some initialization operations cannot be performed on the start-up, * Some initialization operations cannot be performed on the start-up,
* initialization thread. That is because the initialization thread * initialization thread. That is because the initialization thread
* cannot wait for event. Waiting may be required, for example, to * cannot wait for event. Waiting may be required, for example, to
@ -142,8 +142,8 @@
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_BOARD_DRIVER_INITIALIZE #ifdef CONFIG_BOARD_EARLY_INITIALIZE
void board_driver_initialize(void); void board_early_initialize(void);
#endif #endif
/**************************************************************************** /****************************************************************************
@ -153,10 +153,10 @@ void board_driver_initialize(void);
* If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional * If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional
* initialization call will be performed in the boot-up sequence to a * initialization call will be performed in the boot-up sequence to a
* function called board_late_initialize(). board_late_initialize() will * function called board_late_initialize(). board_late_initialize() will
* be called after up_initialize() and board_driver_initialize() and just * be called after up_initialize() and board_early_initialize() and just
* before the initial application is started. This additional * before the initial application is started. This additional
* initialization phase may be used, for example, to initialize board- * initialization phase may be used, for example, to initialize board-
* specific device drivers for which board_driver_initialize() is not * specific device drivers for which board_early_initialize() is not
* suitable. * suitable.
* *
* Waiting for events, use of I2C, SPI, etc are permissable in the context * Waiting for events, use of I2C, SPI, etc are permissable in the context

View File

@ -1147,8 +1147,8 @@ endif # PRIORITY_INHERITANCE
menu "RTOS hooks" menu "RTOS hooks"
config BOARD_DRIVER_INITIALIZE config BOARD_EARLY_INITIALIZE
bool "Custom board driver initialization" bool "Custom board early initialization"
default n default n
---help--- ---help---
By default, there are three points in time where you can insert By default, there are three points in time where you can insert
@ -1166,13 +1166,13 @@ config BOARD_DRIVER_INITIALIZE
initialize drivers in this phase. initialize drivers in this phase.
At this same point in time, the OS will also call a board- At this same point in time, the OS will also call a board-
specific initialization function named board_driver_initialize() specific initialization function named board_early_initialize()
if CONFIG_BOARD_DRIVER_INITIALIZE is selectd. The context in if CONFIG_BOARD_EARLY_INITIALIZE is selectd. The context in
which board_driver_initialize() executes is suitable for early which board_early_initialize() executes is suitable for early
initialization of most, simple device drivers and is a logical, initialization of most, simple device drivers and is a logical,
board-specific extension of up_initialize(). board-specific extension of up_initialize().
board_driver_initialize() runs on the startup, initialization thread. board_early_initialize() runs on the startup, initialization thread.
Some initialization operations cannot be performed on the start-up, Some initialization operations cannot be performed on the start-up,
initialization thread. That is because the initialization thread initialization thread. That is because the initialization thread
cannot wait for event. Waiting may be required, for example, to cannot wait for event. Waiting may be required, for example, to
@ -1214,13 +1214,13 @@ config BOARD_LATE_INITIALIZE
initialize drivers in this phase. initialize drivers in this phase.
At this same point in time, the OS will also call a board- At this same point in time, the OS will also call a board-
specific initialization function named board_driver_initialize() specific initialization function named board_early_initialize()
if CONFIG_BOARD_DRIVER_INITIALIZE is selectd. The context in if CONFIG_BOARD_EARLY_INITIALIZE is selectd. The context in
which board_driver_initialize() executes is suitable for early which board_early_initialize() executes is suitable for early
initialization of most, simple device drivers and is a logical, initialization of most, simple device drivers and is a logical,
board-specific extension of up_initialize(). board-specific extension of up_initialize().
board_driver_initialize() runs on the startup, initialization thread. board_early_initialize() runs on the startup, initialization thread.
Some initialization operations cannot be performed on the start-up, Some initialization operations cannot be performed on the start-up,
initialization thread. That is because the initialization thread initialization thread. That is because the initialization thread
cannot wait for event. Waiting may be required, for example, to cannot wait for event. Waiting may be required, for example, to

View File

@ -45,6 +45,7 @@
#include <debug.h> #include <debug.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include <nuttx/board.h>
#include <nuttx/compiler.h> #include <nuttx/compiler.h>
#include <nuttx/sched.h> #include <nuttx/sched.h>
#include <nuttx/fs/fs.h> #include <nuttx/fs/fs.h>
@ -718,16 +719,16 @@ void nx_start(void)
up_initialize(); up_initialize();
#ifdef CONFIG_BOARD_DRIVER_INITIALIZE #ifdef CONFIG_BOARD_EARLY_INITIALIZE
/* Call the board-specific up_initialize() extension to support /* Call the board-specific up_initialize() extension to support
* early initialization of board-specific drivers and resources * early initialization of board-specific drivers and resources
* that cannot wait until board_late_initialize. * that cannot wait until board_late_initialize.
*/ */
board_driver_initialize(); board_early_initialize();
#endif #endif
/* Hardware resources are available */ /* Hardware resources are now available */
g_nx_initstate = OSINIT_HARDWARE; g_nx_initstate = OSINIT_HARDWARE;