From 32a300806eba2984a8911b721e0a2dd2a8d4d7c2 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 18 Feb 2019 16:25:08 -0600 Subject: [PATCH] Let's rename board_driver_initialize() to board_early_initialize() to emphasize its relationship to board_late_initialize(). --- Documentation/NXGraphicsSubsystem.html | 2 +- include/nuttx/board.h | 20 ++++++++++---------- sched/Kconfig | 20 ++++++++++---------- sched/init/nx_start.c | 7 ++++--- 4 files changed, 25 insertions(+), 24 deletions(-) diff --git a/Documentation/NXGraphicsSubsystem.html b/Documentation/NXGraphicsSubsystem.html index a88312a3ae..324664ce7d 100644 --- a/Documentation/NXGraphicsSubsystem.html +++ b/Documentation/NXGraphicsSubsystem.html @@ -939,7 +939,7 @@ struct nx_callback_s

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

diff --git a/include/nuttx/board.h b/include/nuttx/board.h index ebcc6af644..7b6566a249 100644 --- a/include/nuttx/board.h +++ b/include/nuttx/board.h @@ -120,19 +120,19 @@ ****************************************************************************/ /**************************************************************************** - * Name: board_late_initialize + * Name: board_early_initialize * * 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 - * 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 - * board_driver_initialize() is called and the initial application is - * started. The context in which board_driver_initialize() executes is + * board_early_initialize() is called and the initial application is + * started. The context in which board_early_initialize() executes is * suitable for early initialization of most, simple device drivers and * 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, * initialization thread. That is because the initialization thread * cannot wait for event. Waiting may be required, for example, to @@ -142,8 +142,8 @@ ****************************************************************************/ -#ifdef CONFIG_BOARD_DRIVER_INITIALIZE -void board_driver_initialize(void); +#ifdef CONFIG_BOARD_EARLY_INITIALIZE +void board_early_initialize(void); #endif /**************************************************************************** @@ -153,10 +153,10 @@ void board_driver_initialize(void); * If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional * initialization call will be performed in the boot-up sequence to a * 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 * 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. * * Waiting for events, use of I2C, SPI, etc are permissable in the context diff --git a/sched/Kconfig b/sched/Kconfig index 0aa7466449..f2696b5896 100644 --- a/sched/Kconfig +++ b/sched/Kconfig @@ -1147,8 +1147,8 @@ endif # PRIORITY_INHERITANCE menu "RTOS hooks" -config BOARD_DRIVER_INITIALIZE - bool "Custom board driver initialization" +config BOARD_EARLY_INITIALIZE + bool "Custom board early initialization" default n ---help--- 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. At this same point in time, the OS will also call a board- - specific initialization function named board_driver_initialize() - if CONFIG_BOARD_DRIVER_INITIALIZE is selectd. The context in - which board_driver_initialize() executes is suitable for early + specific initialization function named board_early_initialize() + if CONFIG_BOARD_EARLY_INITIALIZE is selectd. The context in + which board_early_initialize() executes is suitable for early initialization of most, simple device drivers and 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, initialization thread. That is because the initialization thread cannot wait for event. Waiting may be required, for example, to @@ -1214,13 +1214,13 @@ config BOARD_LATE_INITIALIZE initialize drivers in this phase. At this same point in time, the OS will also call a board- - specific initialization function named board_driver_initialize() - if CONFIG_BOARD_DRIVER_INITIALIZE is selectd. The context in - which board_driver_initialize() executes is suitable for early + specific initialization function named board_early_initialize() + if CONFIG_BOARD_EARLY_INITIALIZE is selectd. The context in + which board_early_initialize() executes is suitable for early initialization of most, simple device drivers and 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, initialization thread. That is because the initialization thread cannot wait for event. Waiting may be required, for example, to diff --git a/sched/init/nx_start.c b/sched/init/nx_start.c index c48135678c..9a5eef4d3f 100644 --- a/sched/init/nx_start.c +++ b/sched/init/nx_start.c @@ -45,6 +45,7 @@ #include #include +#include #include #include #include @@ -718,16 +719,16 @@ void nx_start(void) up_initialize(); -#ifdef CONFIG_BOARD_DRIVER_INITIALIZE +#ifdef CONFIG_BOARD_EARLY_INITIALIZE /* Call the board-specific up_initialize() extension to support * early initialization of board-specific drivers and resources * that cannot wait until board_late_initialize. */ - board_driver_initialize(); + board_early_initialize(); #endif - /* Hardware resources are available */ + /* Hardware resources are now available */ g_nx_initstate = OSINIT_HARDWARE;