This is an automated email from the ASF dual-hosted git repository. acassis pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
The following commit(s) were added to refs/heads/master by this push: new c96c96a drivers: Merge the common driver initialization into one place c96c96a is described below commit c96c96a3994af517152ca99119339a46f632a685 Author: Xiang Xiao <xiaoxi...@xiaomi.com> AuthorDate: Fri Mar 11 22:52:32 2022 +0800 drivers: Merge the common driver initialization into one place Signed-off-by: Xiang Xiao <xiaoxi...@xiaomi.com> --- arch/arm/src/common/arm_initialize.c | 101 +---------------- arch/arm/src/common/arm_internal.h | 12 -- arch/arm/src/eoss3/eoss3_serial.c | 1 - arch/arm/src/imx6/imx_enet.c | 2 +- arch/arm/src/imx6/imx_enet.h | 22 ---- arch/arm/src/imxrt/imxrt_lpspi.c | 1 - arch/arm/src/nrf52/nrf52_pminitialize.c | 6 +- arch/arm/src/s32k1xx/s32k1xx_pminitialize.c | 5 - arch/arm/src/stm32/stm32_pminitialize.c | 5 - arch/arm/src/stm32f7/stm32_pminitialize.c | 5 - arch/arm/src/stm32h7/stm32_pminitialize.c | 5 - arch/arm/src/stm32l4/stm32l4_pminitialize.c | 5 - arch/avr/src/common/up_initialize.c | 92 +--------------- arch/avr/src/common/up_internal.h | 4 - arch/ceva/src/common/up_idle.c | 3 - arch/ceva/src/common/up_initialize.c | 99 ----------------- arch/ceva/src/common/up_internal.h | 24 ---- arch/hc/src/common/up_initialize.c | 92 +--------------- arch/hc/src/common/up_internal.h | 6 - arch/mips/src/common/mips_initialize.c | 91 --------------- arch/mips/src/common/mips_internal.h | 4 - arch/misoc/src/lm32/lm32.h | 18 --- arch/misoc/src/lm32/lm32_allocateheap.c | 16 --- arch/misoc/src/lm32/lm32_initialize.c | 21 ---- arch/misoc/src/minerva/minerva.h | 18 --- arch/misoc/src/minerva/minerva_allocateheap.c | 16 --- arch/misoc/src/minerva/minerva_initialize.c | 21 ---- arch/or1k/src/common/up_initialize.c | 92 ---------------- arch/or1k/src/common/up_internal.h | 8 -- arch/renesas/src/common/up_initialize.c | 96 +--------------- arch/renesas/src/common/up_internal.h | 8 -- arch/risc-v/src/common/riscv_initialize.c | 63 ----------- arch/risc-v/src/common/riscv_internal.h | 4 - arch/risc-v/src/esp32c3/esp32c3_irq.h | 6 - arch/risc-v/src/esp32c3/esp32c3_pminitialize.c | 4 - arch/risc-v/src/rv32m1/rv32m1_serial.c | 1 - arch/sim/src/sim/up_initialize.c | 112 +------------------ arch/sim/src/sim/up_internal.h | 6 - arch/sparc/src/common/up_initialize.c | 122 +-------------------- arch/sparc/src/common/up_internal.h | 11 -- arch/x86/src/common/up_initialize.c | 91 --------------- arch/x86/src/common/up_internal.h | 8 -- arch/x86_64/src/common/up_initialize.c | 94 ---------------- arch/x86_64/src/common/up_internal.h | 5 - arch/xtensa/src/common/xtensa.h | 2 - arch/xtensa/src/common/xtensa_initialize.c | 96 ---------------- arch/xtensa/src/esp32/esp32_pminitialize.c | 6 +- arch/z16/src/common/z16_initialize.c | 91 --------------- arch/z16/src/common/z16_internal.h | 4 - arch/z80/src/common/z80_initialize.c | 88 --------------- arch/z80/src/common/z80_internal.h | 6 - .../lpc4088-devkit/src/lpc17_40_userleds.c | 2 +- .../lpc4088-quickstart/src/lpc17_40_userleds.c | 2 +- .../lpc17xx_40xx/lx_cpu/src/lpc17_40_userleds.c | 2 +- .../arm/lpc17xx_40xx/mbed/src/lpc17_40_userleds.c | 1 - .../lpc17xx_40xx/open1788/src/lpc17_40_userleds.c | 2 +- boards/arm/stm32/axoloti/src/stm32_userleds.c | 1 - boards/arm/stm32/mikroe-stm32f4/src/stm32_pm.c | 6 - .../stm32/olimex-stm32-e407/src/stm32_userleds.c | 3 +- .../stm32/olimex-stm32-h407/src/stm32_userleds.c | 3 +- boards/arm/stm32/omnibusf4/src/stm32_pm.c | 7 -- boards/arm/stm32/stm3210e-eval/src/stm32_pm.c | 6 - boards/arm/stm32/stm32f4discovery/src/stm32_pm.c | 7 -- boards/arm/stm32/stm32vldiscovery/src/stm32_leds.c | 1 - drivers/Makefile | 2 + .../drivers_initialize.c | 74 ++++--------- drivers/efuse/efuse.c | 1 - include/nuttx/drivers/drivers.h | 20 ++++ sched/init/nx_start.c | 15 +-- 69 files changed, 69 insertions(+), 1805 deletions(-) diff --git a/arch/arm/src/common/arm_initialize.c b/arch/arm/src/common/arm_initialize.c index 75be389..cf34c5c 100644 --- a/arch/arm/src/common/arm_initialize.c +++ b/arch/arm/src/common/arm_initialize.c @@ -22,23 +22,8 @@ * Included Files ****************************************************************************/ -#include <nuttx/config.h> - -#include <debug.h> - #include <nuttx/arch.h> #include <nuttx/board.h> -#include <nuttx/drivers/drivers.h> -#include <nuttx/fs/loop.h> -#include <nuttx/net/loopback.h> -#include <nuttx/net/tun.h> -#include <nuttx/net/telnet.h> -#include <nuttx/note/note_driver.h> -#include <nuttx/syslog/syslog_console.h> -#include <nuttx/serial/pty.h> -#include <nuttx/crypto/crypto.h> -#include <nuttx/power/pm.h> - #include <arch/board/board.h> #include "arm_arch.h" @@ -49,7 +34,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: up_color_intstack + * Name: arm_color_intstack * * Description: * Set the interrupt stack to a value so that later we can determine how @@ -58,7 +43,7 @@ ****************************************************************************/ #if defined(CONFIG_STACK_COLORATION) && CONFIG_ARCH_INTERRUPTSTACK > 3 -static inline void up_color_intstack(void) +static inline void arm_color_intstack(void) { #ifdef CONFIG_SMP uint32_t *ptr = (uint32_t *)arm_intstack_alloc(); @@ -75,7 +60,7 @@ static inline void up_color_intstack(void) } } #else -# define up_color_intstack() +# define arm_color_intstack() #endif /**************************************************************************** @@ -101,13 +86,9 @@ static inline void up_color_intstack(void) void up_initialize(void) { - /* Initialize global variables */ - - CURRENT_REGS = NULL; - /* Colorize the interrupt stack */ - up_color_intstack(); + arm_color_intstack(); /* Add any extra memory fragments to the memory manager */ @@ -136,92 +117,18 @@ void up_initialize(void) } #endif - /* Register devices */ - -#if defined(CONFIG_DEV_NULL) - devnull_register(); /* Standard /dev/null */ -#endif - -#if defined(CONFIG_DEV_RANDOM) - devrandom_register(); /* Standard /dev/random */ -#endif - -#if defined(CONFIG_DEV_URANDOM) - devurandom_register(); /* Standard /dev/urandom */ -#endif - -#if defined(CONFIG_DEV_ZERO) - devzero_register(); /* Standard /dev/zero */ -#endif - -#if defined(CONFIG_DEV_LOOP) - loop_register(); /* Standard /dev/loop */ -#endif - -#if defined(CONFIG_DRIVER_NOTE) - note_register(); /* Non-standard /dev/note */ -#endif - /* Initialize the serial device driver */ #ifdef USE_SERIALDRIVER arm_serialinit(); #endif -#ifdef CONFIG_RPMSG_UART - rpmsg_serialinit(); -#endif - - /* Initialize the console device driver (if it is other than the standard - * serial driver). - */ - -#if defined (CONFIG_LWL_CONSOLE) - lwlconsole_init(); -#elif defined(CONFIG_CONSOLE_SYSLOG) - syslog_console_init(); -#endif - -#ifdef CONFIG_PSEUDOTERM_SUSV1 - /* Register the master pseudo-terminal multiplexor device */ - - ptmx_register(); -#endif - -#if defined(CONFIG_CRYPTO) - /* Initialize the HW crypto and /dev/crypto */ - - up_cryptoinitialize(); -#endif - -#ifdef CONFIG_CRYPTO_CRYPTODEV - devcrypto_register(); -#endif - #ifndef CONFIG_NETDEV_LATEINIT /* Initialize the network */ arm_netinitialize(); #endif -#ifdef CONFIG_NET_LOOPBACK - /* Initialize the local loopback device */ - - localhost_initialize(); -#endif - -#ifdef CONFIG_NET_TUN - /* Initialize the TUN device */ - - tun_initialize(); -#endif - -#ifdef CONFIG_NETDEV_TELNET - /* Initialize the Telnet session factory */ - - telnet_initialize(); -#endif - #if defined(CONFIG_USBDEV) || defined(CONFIG_USBHOST) /* Initialize USB -- device and/or host */ diff --git a/arch/arm/src/common/arm_internal.h b/arch/arm/src/common/arm_internal.h index 52a576e..6066daa 100644 --- a/arch/arm/src/common/arm_internal.h +++ b/arch/arm/src/common/arm_internal.h @@ -445,14 +445,6 @@ void arm_serialinit(void); void arm_earlyserialinit(void); #endif -#ifdef CONFIG_RPMSG_UART -void rpmsg_serialinit(void); -#endif - -#ifdef CONFIG_LWL_CONSOLE -void lwlconsole_init(void); -#endif - /* DMA **********************************************************************/ #ifdef CONFIG_ARCH_DMA @@ -475,10 +467,6 @@ void arm_addregion(void); # define arm_addregion() #endif -/* Watchdog timer ***********************************************************/ - -void arm_wdtinit(void); - /* Networking ***************************************************************/ /* Defined in board/xyz_network.c for board-specific Ethernet diff --git a/arch/arm/src/eoss3/eoss3_serial.c b/arch/arm/src/eoss3/eoss3_serial.c index 737cd3e..2387a28 100644 --- a/arch/arm/src/eoss3/eoss3_serial.c +++ b/arch/arm/src/eoss3/eoss3_serial.c @@ -38,7 +38,6 @@ #include <nuttx/irq.h> #include <nuttx/arch.h> #include <nuttx/init.h> -#include <nuttx/power/pm.h> #include <nuttx/fs/ioctl.h> #include <nuttx/serial/serial.h> #include <nuttx/wqueue.h> diff --git a/arch/arm/src/imx6/imx_enet.c b/arch/arm/src/imx6/imx_enet.c index c75941f..204d649 100644 --- a/arch/arm/src/imx6/imx_enet.c +++ b/arch/arm/src/imx6/imx_enet.c @@ -2668,7 +2668,7 @@ int imx_netinitialize(int intf) } /**************************************************************************** - * Name: up_netinitialize + * Name: arm_netinitialize * * Description: * Initialize the first network interface. If there are more than one diff --git a/arch/arm/src/imx6/imx_enet.h b/arch/arm/src/imx6/imx_enet.h index 68d1f2f..90a9b9f 100644 --- a/arch/arm/src/imx6/imx_enet.h +++ b/arch/arm/src/imx6/imx_enet.h @@ -55,28 +55,6 @@ extern "C" #endif /**************************************************************************** - * Function: up_netinitialize - * - * Description: - * Initialize the first network interface. If there are more than one - * interface in the chip, then board-specific logic will have to provide - * this function to determine which, if any, Ethernet controllers should - * be initialized. Also prototyped in up_internal.h. - * - * Input Parameters: - * None - * - * Returned Value: - * OK on success; Negated errno on failure. - * - * Assumptions: - * Called very early in the initialization sequence. - * - ****************************************************************************/ - -void up_netinitialize(void); - -/**************************************************************************** * Function: imx_phy_boardinitialize * * Description: diff --git a/arch/arm/src/imxrt/imxrt_lpspi.c b/arch/arm/src/imxrt/imxrt_lpspi.c index 6275109..c8c3eff 100644 --- a/arch/arm/src/imxrt/imxrt_lpspi.c +++ b/arch/arm/src/imxrt/imxrt_lpspi.c @@ -61,7 +61,6 @@ #include <nuttx/arch.h> #include <nuttx/semaphore.h> #include <nuttx/spi/spi.h> -#include <nuttx/power/pm.h> #include <arch/board/board.h> diff --git a/arch/arm/src/nrf52/nrf52_pminitialize.c b/arch/arm/src/nrf52/nrf52_pminitialize.c index edd3c22..08246d0 100644 --- a/arch/arm/src/nrf52/nrf52_pminitialize.c +++ b/arch/arm/src/nrf52/nrf52_pminitialize.c @@ -23,7 +23,8 @@ ****************************************************************************/ #include <nuttx/config.h> -#include <nuttx/power/pm.h> + +#include "arm_internal.h" /**************************************************************************** * Public Functions @@ -49,7 +50,4 @@ void arm_pminitialize(void) { - /* Then initialize the NuttX power management subsystem proper */ - - pm_initialize(); } diff --git a/arch/arm/src/s32k1xx/s32k1xx_pminitialize.c b/arch/arm/src/s32k1xx/s32k1xx_pminitialize.c index 096d6bb..173bb52 100644 --- a/arch/arm/src/s32k1xx/s32k1xx_pminitialize.c +++ b/arch/arm/src/s32k1xx/s32k1xx_pminitialize.c @@ -24,8 +24,6 @@ #include <nuttx/config.h> -#include <nuttx/power/pm.h> - #include "arm_internal.h" #ifdef CONFIG_PM @@ -54,9 +52,6 @@ void arm_pminitialize(void) { - /* Then initialize the NuttX power management subsystem proper */ - - pm_initialize(); } #endif /* CONFIG_PM */ diff --git a/arch/arm/src/stm32/stm32_pminitialize.c b/arch/arm/src/stm32/stm32_pminitialize.c index 1dcd6f4..2e46ab7 100644 --- a/arch/arm/src/stm32/stm32_pminitialize.c +++ b/arch/arm/src/stm32/stm32_pminitialize.c @@ -24,8 +24,6 @@ #include <nuttx/config.h> -#include <nuttx/power/pm.h> - #include "arm_internal.h" #include "stm32_pm.h" @@ -55,9 +53,6 @@ void arm_pminitialize(void) { - /* Then initialize the NuttX power management subsystem proper */ - - pm_initialize(); } #endif /* CONFIG_PM */ diff --git a/arch/arm/src/stm32f7/stm32_pminitialize.c b/arch/arm/src/stm32f7/stm32_pminitialize.c index 05af5bd..90d44f1 100644 --- a/arch/arm/src/stm32f7/stm32_pminitialize.c +++ b/arch/arm/src/stm32f7/stm32_pminitialize.c @@ -24,8 +24,6 @@ #include <nuttx/config.h> -#include <nuttx/power/pm.h> - #include "arm_internal.h" #include "stm32_pm.h" @@ -55,9 +53,6 @@ void arm_pminitialize(void) { - /* Then initialize the NuttX power management subsystem proper */ - - pm_initialize(); } #endif /* CONFIG_PM */ diff --git a/arch/arm/src/stm32h7/stm32_pminitialize.c b/arch/arm/src/stm32h7/stm32_pminitialize.c index baae5fb..b0a8b11 100644 --- a/arch/arm/src/stm32h7/stm32_pminitialize.c +++ b/arch/arm/src/stm32h7/stm32_pminitialize.c @@ -24,8 +24,6 @@ #include <nuttx/config.h> -#include <nuttx/power/pm.h> - #include "arm_internal.h" #include "stm32_pm.h" @@ -55,9 +53,6 @@ void arm_pminitialize(void) { - /* Then initialize the NuttX power management subsystem proper */ - - pm_initialize(); } #endif /* CONFIG_PM */ diff --git a/arch/arm/src/stm32l4/stm32l4_pminitialize.c b/arch/arm/src/stm32l4/stm32l4_pminitialize.c index 034a0c8..77d78f7 100644 --- a/arch/arm/src/stm32l4/stm32l4_pminitialize.c +++ b/arch/arm/src/stm32l4/stm32l4_pminitialize.c @@ -24,8 +24,6 @@ #include <nuttx/config.h> -#include <nuttx/power/pm.h> - #include "arm_internal.h" #include "stm32l4_pm.h" @@ -55,9 +53,6 @@ void arm_pminitialize(void) { - /* Then initialize the NuttX power management subsystem proper */ - - pm_initialize(); } #endif /* CONFIG_PM */ diff --git a/arch/avr/src/common/up_initialize.c b/arch/avr/src/common/up_initialize.c index 05a913b..dbbf85c 100644 --- a/arch/avr/src/common/up_initialize.c +++ b/arch/avr/src/common/up_initialize.c @@ -22,22 +22,8 @@ * Included Files ****************************************************************************/ -#include <nuttx/config.h> - -#include <debug.h> - #include <nuttx/arch.h> -#include <nuttx/drivers/drivers.h> -#include <nuttx/fs/loop.h> -#include <nuttx/net/loopback.h> -#include <nuttx/net/tun.h> -#include <nuttx/net/telnet.h> -#include <nuttx/note/note_driver.h> -#include <nuttx/syslog/syslog_console.h> -#include <nuttx/serial/pty.h> -#include <nuttx/crypto/crypto.h> -#include <nuttx/power/pm.h> - +#include <nuttx/board.h> #include <arch/board/board.h> #include "up_arch.h" @@ -129,10 +115,6 @@ static inline void up_color_intstack(void) void up_initialize(void) { - /* Initialize global variables */ - - g_current_regs = NULL; - /* Colorize the interrupt stack */ up_color_intstack(); @@ -164,90 +146,18 @@ void up_initialize(void) } #endif - /* Register devices */ - -#if defined(CONFIG_DEV_NULL) - devnull_register(); /* Standard /dev/null */ -#endif - -#if defined(CONFIG_DEV_RANDOM) - devrandom_register(); /* Standard /dev/random */ -#endif - -#if defined(CONFIG_DEV_URANDOM) - devurandom_register(); /* Standard /dev/urandom */ -#endif - -#if defined(CONFIG_DEV_ZERO) - devzero_register(); /* Standard /dev/zero */ -#endif - -#if defined(CONFIG_DEV_LOOP) - loop_register(); /* Standard /dev/loop */ -#endif - -#if defined(CONFIG_DRIVER_NOTE) - note_register(); /* Non-standard /dev/note */ -#endif - /* Initialize the serial device driver */ #ifdef USE_SERIALDRIVER up_serialinit(); #endif -#ifdef CONFIG_RPMSG_UART - rpmsg_serialinit(); -#endif - - /* Initialize the console device driver (if it is other than the standard - * serial driver). - */ - -#if defined(CONFIG_CONSOLE_SYSLOG) - syslog_console_init(); -#endif - -#ifdef CONFIG_PSEUDOTERM_SUSV1 - /* Register the master pseudo-terminal multiplexor device */ - - ptmx_register(); -#endif - -#if defined(CONFIG_CRYPTO) - /* Initialize the HW crypto and /dev/crypto */ - - up_cryptoinitialize(); -#endif - -#ifdef CONFIG_CRYPTO_CRYPTODEV - devcrypto_register(); -#endif - #ifndef CONFIG_NETDEV_LATEINIT /* Initialize the network */ up_netinitialize(); #endif -#ifdef CONFIG_NET_LOOPBACK - /* Initialize the local loopback device */ - - localhost_initialize(); -#endif - -#ifdef CONFIG_NET_TUN - /* Initialize the TUN device */ - - tun_initialize(); -#endif - -#ifdef CONFIG_NETDEV_TELNET - /* Initialize the Telnet session factory */ - - telnet_initialize(); -#endif - /* Initialize USB */ up_usbinitialize(); diff --git a/arch/avr/src/common/up_internal.h b/arch/avr/src/common/up_internal.h index 593c1fc..6918f90 100644 --- a/arch/avr/src/common/up_internal.h +++ b/arch/avr/src/common/up_internal.h @@ -140,10 +140,6 @@ void up_earlyserialinit(void); void up_serialinit(void); #endif -#ifdef CONFIG_RPMSG_UART -void rpmsg_serialinit(void); -#endif - /* Defined in chip/xxx_ethernet.c */ #if defined(CONFIG_NET) && !defined(CONFIG_NETDEV_LATEINIT) diff --git a/arch/ceva/src/common/up_idle.c b/arch/ceva/src/common/up_idle.c index da86dfc..21f65e1 100644 --- a/arch/ceva/src/common/up_idle.c +++ b/arch/ceva/src/common/up_idle.c @@ -163,8 +163,5 @@ void weak_function up_cpu_normal(void) #ifdef CONFIG_PM void up_pminitialize(void) { - /* Then initialize the power management subsystem proper */ - - pm_initialize(); } #endif diff --git a/arch/ceva/src/common/up_initialize.c b/arch/ceva/src/common/up_initialize.c index c2476b0..2974a43 100644 --- a/arch/ceva/src/common/up_initialize.c +++ b/arch/ceva/src/common/up_initialize.c @@ -22,30 +22,10 @@ * Included Files ****************************************************************************/ -#include <nuttx/config.h> - -#include <debug.h> - #include <nuttx/arch.h> -#include <nuttx/sched_note.h> -#include <nuttx/mm/iob.h> -#include <nuttx/drivers/drivers.h> -#include <nuttx/fs/loop.h> -#include <nuttx/net/loopback.h> -#include <nuttx/net/tun.h> -#include <nuttx/net/telnet.h> -#include <nuttx/syslog/ramlog.h> -#include <nuttx/syslog/syslog.h> -#include <nuttx/syslog/syslog_console.h> -#include <nuttx/serial/pty.h> -#include <nuttx/crypto/crypto.h> -#include <nuttx/power/pm.h> - -#include <arch/board/board.h> #include "up_arch.h" #include "up_internal.h" -#include "chip.h" /**************************************************************************** * Private Functions @@ -96,10 +76,6 @@ static inline void up_color_intstack(void) void up_initialize(void) { - /* Initialize global variables */ - - CURRENT_REGS = NULL; - /* Colorize the interrupt stack */ up_color_intstack(); @@ -126,93 +102,18 @@ void up_initialize(void) up_dma_initialize(); #endif - /* Register devices */ - -#if defined(CONFIG_DEV_NULL) - devnull_register(); /* Standard /dev/null */ -#endif - -#if defined(CONFIG_DEV_RANDOM) - devrandom_register(); /* Standard /dev/random */ -#endif - -#if defined(CONFIG_DEV_URANDOM) - devurandom_register(); /* Standard /dev/urandom */ -#endif - -#if defined(CONFIG_DEV_ZERO) - devzero_register(); /* Standard /dev/zero */ -#endif - -#if defined(CONFIG_DEV_LOOP) - loop_register(); /* Standard /dev/loop */ -#endif - -#if defined(CONFIG_SCHED_INSTRUMENTATION_BUFFER) && \ - defined(CONFIG_DRIVER_NOTE) - note_register(); /* Non-standard /dev/note */ -#endif - /* Initialize the serial device driver */ #ifdef USE_SERIALDRIVER up_serialinit(); #endif -#ifdef CONFIG_RPMSG_UART - rpmsg_serialinit(); -#endif - - /* Initialize the console device driver (if it is other than the standard - * serial driver). - */ - -#if defined (CONFIG_ARM_LWL_CONSOLE) - lwlconsole_init(); -#elif defined(CONFIG_CONSOLE_SYSLOG) - syslog_console_init(); -#endif - -#ifdef CONFIG_PSEUDOTERM_SUSV1 - /* Register the master pseudo-terminal multiplexor device */ - - ptmx_register(); -#endif - -#if defined(CONFIG_CRYPTO) - /* Initialize the HW crypto and /dev/crypto */ - - up_cryptoinitialize(); -#endif - -#ifdef CONFIG_CRYPTO_CRYPTODEV - devcrypto_register(); -#endif - #ifndef CONFIG_NETDEV_LATEINIT /* Initialize the network */ up_netinitialize(); #endif -#ifdef CONFIG_NET_LOOPBACK - /* Initialize the local loopback device */ - - localhost_initialize(); -#endif - -#ifdef CONFIG_NET_TUN - /* Initialize the TUN device */ - - tun_initialize(); -#endif - -#ifdef CONFIG_NETDEV_TELNET - /* Initialize the Telnet session factory */ - - telnet_initialize(); -#endif - #if defined(CONFIG_USBDEV) || defined(CONFIG_USBHOST) /* Initialize USB -- device and/or host */ diff --git a/arch/ceva/src/common/up_internal.h b/arch/ceva/src/common/up_internal.h index 3f73246..2ded122 100644 --- a/arch/ceva/src/common/up_internal.h +++ b/arch/ceva/src/common/up_internal.h @@ -248,8 +248,6 @@ void up_cpu_normal(void); /* Interrupt handling *******************************************************/ -void up_irqinitialize(void); - /* Interrupt acknowledge and dispatch */ uint32_t *up_doirq(int irq, uint32_t *regs); @@ -261,10 +259,6 @@ int up_hardfault(int irq, FAR void *context, FAR void *arg); void up_svcall_handler(void); -/* System timer *************************************************************/ - -void up_timer_initialize(void); - /* Low level serial output **************************************************/ #ifdef USE_SERIALDRIVER @@ -279,20 +273,6 @@ void up_earlyserialinit(void); # define up_earlyserialinit() #endif -#ifdef CONFIG_RPMSG_UART -void rpmsg_serialinit(void); -#else -# define rpmsg_serialinit() -#endif - -/* Defined in drivers/lowconsole.c */ - -#ifdef CONFIG_DEV_LOWCONSOLE -void lowconsole_init(void); -#else -# define lowconsole_init() -#endif - /* DMA **********************************************************************/ #ifdef CONFIG_ARCH_DMA @@ -307,10 +287,6 @@ void up_addregion(void); # define up_addregion() #endif -/* Watchdog timer ***********************************************************/ - -void up_wdtinit(void); - /* Networking ***************************************************************/ #if defined(CONFIG_NET) && !defined(CONFIG_NETDEV_LATEINIT) diff --git a/arch/hc/src/common/up_initialize.c b/arch/hc/src/common/up_initialize.c index 133a0ea..28b9399 100644 --- a/arch/hc/src/common/up_initialize.c +++ b/arch/hc/src/common/up_initialize.c @@ -22,22 +22,9 @@ * Included Files ****************************************************************************/ -#include <nuttx/config.h> - -#include <debug.h> - #include <nuttx/arch.h> #include <nuttx/board.h> -#include <nuttx/drivers/drivers.h> -#include <nuttx/fs/loop.h> -#include <nuttx/net/loopback.h> -#include <nuttx/net/tun.h> -#include <nuttx/net/telnet.h> -#include <nuttx/note/note_driver.h> -#include <nuttx/syslog/syslog_console.h> -#include <nuttx/serial/pty.h> -#include <nuttx/crypto/crypto.h> -#include <nuttx/power/pm.h> +#include <arch/board/board.h> #include "up_arch.h" #include "up_internal.h" @@ -65,10 +52,6 @@ void up_initialize(void) { - /* Initialize global variables */ - - g_current_regs = NULL; - /* Add any extra memory fragments to the memory manager */ up_addregion(); @@ -96,93 +79,20 @@ void up_initialize(void) } #endif - /* Register devices */ - -#if defined(CONFIG_DEV_NULL) - devnull_register(); /* Standard /dev/null */ -#endif - -#if defined(CONFIG_DEV_RANDOM) - devrandom_register(); /* Standard /dev/random */ -#endif - -#if defined(CONFIG_DEV_URANDOM) - devurandom_register(); /* Standard /dev/urandom */ -#endif - -#if defined(CONFIG_DEV_ZERO) - devzero_register(); /* Standard /dev/zero */ -#endif - -#if defined(CONFIG_DEV_LOOP) - loop_register(); /* Standard /dev/loop */ -#endif - -#if defined(CONFIG_DRIVER_NOTE) - note_register(); /* Non-standard /dev/note */ -#endif - /* Initialize the serial device driver */ #ifdef USE_SERIALDRIVER up_serialinit(); #endif -#ifdef CONFIG_RPMSG_UART - rpmsg_serialinit(); -#endif - - /* Initialize the console device driver (if it is other than the standard - * serial driver). - */ - -#if defined(CONFIG_CONSOLE_SYSLOG) - syslog_console_init(); -#endif - -#ifdef CONFIG_PSEUDOTERM_SUSV1 - /* Register the master pseudo-terminal multiplexor device */ - - ptmx_register(); -#endif - -#if defined(CONFIG_CRYPTO) - /* Initialize the HW crypto and /dev/crypto */ - - up_cryptoinitialize(); -#endif - -#ifdef CONFIG_CRYPTO_CRYPTODEV - devcrypto_register(); -#endif - #ifndef CONFIG_NETDEV_LATEINIT /* Initialize the network */ up_netinitialize(); #endif -#ifdef CONFIG_NET_LOOPBACK - /* Initialize the local loopback device */ - - localhost_initialize(); -#endif - -#ifdef CONFIG_NET_TUN - /* Initialize the TUN device */ - - tun_initialize(); -#endif - -#ifdef CONFIG_NETDEV_TELNET - /* Initialize the Telnet session factory */ - - telnet_initialize(); -#endif - /* Initialize USB */ up_usbinitialize(); - board_autoled_on(LED_IRQSENABLED); } diff --git a/arch/hc/src/common/up_internal.h b/arch/hc/src/common/up_internal.h index 5f59ea1..72fa526 100644 --- a/arch/hc/src/common/up_internal.h +++ b/arch/hc/src/common/up_internal.h @@ -157,10 +157,6 @@ void up_earlyserialinit(void); void up_serialinit(void); #endif -#ifdef CONFIG_RPMSG_UART -void rpmsg_serialinit(void); -#endif - void up_lowputc(char ch); void up_lowputs(const char *str); @@ -178,8 +174,6 @@ void up_addregion(void); void weak_function up_dma_initialize(void); #endif -void up_wdtinit(void); - #if defined(CONFIG_NET) && !defined(CONFIG_NETDEV_LATEINIT) void up_netinitialize(void); #else diff --git a/arch/mips/src/common/mips_initialize.c b/arch/mips/src/common/mips_initialize.c index c433c5a..8c8ee2d 100644 --- a/arch/mips/src/common/mips_initialize.c +++ b/arch/mips/src/common/mips_initialize.c @@ -22,23 +22,8 @@ * Included Files ****************************************************************************/ -#include <nuttx/config.h> - -#include <debug.h> - #include <nuttx/arch.h> #include <nuttx/board.h> -#include <nuttx/drivers/drivers.h> -#include <nuttx/fs/loop.h> -#include <nuttx/net/loopback.h> -#include <nuttx/net/tun.h> -#include <nuttx/net/telnet.h> -#include <nuttx/note/note_driver.h> -#include <nuttx/syslog/syslog_console.h> -#include <nuttx/serial/pty.h> -#include <nuttx/crypto/crypto.h> -#include <nuttx/power/pm.h> - #include <arch/board/board.h> #include "mips_arch.h" @@ -67,10 +52,6 @@ void up_initialize(void) { - /* Initialize global variables */ - - CURRENT_REGS = NULL; - /* Add any extra memory fragments to the memory manager */ up_addregion(); @@ -98,90 +79,18 @@ void up_initialize(void) } #endif - /* Register devices */ - -#if defined(CONFIG_DEV_NULL) - devnull_register(); /* Standard /dev/null */ -#endif - -#if defined(CONFIG_DEV_RANDOM) - devrandom_register(); /* Standard /dev/random */ -#endif - -#if defined(CONFIG_DEV_URANDOM) - devurandom_register(); /* Standard /dev/urandom */ -#endif - -#if defined(CONFIG_DEV_ZERO) - devzero_register(); /* Standard /dev/zero */ -#endif - -#if defined(CONFIG_DEV_LOOP) - loop_register(); /* Standard /dev/loop */ -#endif - -#if defined(CONFIG_DRIVER_NOTE) - note_register(); /* Non-standard /dev/note */ -#endif - /* Initialize the serial device driver */ #ifdef USE_SERIALDRIVER up_serialinit(); #endif -#ifdef CONFIG_RPMSG_UART - rpmsg_serialinit(); -#endif - - /* Initialize the console device driver (if it is other than the standard - * serial driver). - */ - -#if defined(CONFIG_CONSOLE_SYSLOG) - syslog_console_init(); -#endif - -#ifdef CONFIG_PSEUDOTERM_SUSV1 - /* Register the master pseudo-terminal multiplexor device */ - - ptmx_register(); -#endif - -#if defined(CONFIG_CRYPTO) - /* Initialize the HW crypto and /dev/crypto */ - - up_cryptoinitialize(); -#endif - -#ifdef CONFIG_CRYPTO_CRYPTODEV - devcrypto_register(); -#endif - #ifndef CONFIG_NETDEV_LATEINIT /* Initialize the network */ up_netinitialize(); #endif -#ifdef CONFIG_NET_LOOPBACK - /* Initialize the local loopback device */ - - localhost_initialize(); -#endif - -#ifdef CONFIG_NET_TUN - /* Initialize the TUN device */ - - tun_initialize(); -#endif - -#ifdef CONFIG_NETDEV_TELNET - /* Initialize the Telnet session factory */ - - telnet_initialize(); -#endif - /* Initialize USB -- device and/or host */ up_usbinitialize(); diff --git a/arch/mips/src/common/mips_internal.h b/arch/mips/src/common/mips_internal.h index 1abdb59..297ad62 100644 --- a/arch/mips/src/common/mips_internal.h +++ b/arch/mips/src/common/mips_internal.h @@ -244,10 +244,6 @@ void up_earlyserialinit(void); void up_serialinit(void); #endif -#ifdef CONFIG_RPMSG_UART -void rpmsg_serialinit(void); -#endif - /* Network */ #if defined(CONFIG_NET) && !defined(CONFIG_NETDEV_LATEINIT) diff --git a/arch/misoc/src/lm32/lm32.h b/arch/misoc/src/lm32/lm32.h index 77a0e67..e21b651 100644 --- a/arch/misoc/src/lm32/lm32.h +++ b/arch/misoc/src/lm32/lm32.h @@ -104,12 +104,6 @@ extern uint32_t g_idle_topstack; void lm32_board_initialize(void); -/* Memory allocation ********************************************************/ - -#if CONFIG_MM_REGIONS > 1 -void lm32_add_region(void); -#endif - /* Context switching ********************************************************/ void lm32_copystate(uint32_t *dest, uint32_t *src); @@ -123,18 +117,6 @@ uint32_t *lm32_doirq(int irq, uint32_t *regs); int lm32_swint(int irq, FAR void *context, FAR void *arg); -/* Rpmsg serial *************************************************************/ - -#ifdef CONFIG_RPMSG_UART -void rpmsg_serialinit(void); -#else -# define rpmsg_serialinit() -#endif - -/* System timer *************************************************************/ - -void lm32_timer_initialize(void); - /* Signal handling **********************************************************/ void lm32_sigdeliver(void); diff --git a/arch/misoc/src/lm32/lm32_allocateheap.c b/arch/misoc/src/lm32/lm32_allocateheap.c index 429751d..84b4e04 100644 --- a/arch/misoc/src/lm32/lm32_allocateheap.c +++ b/arch/misoc/src/lm32/lm32_allocateheap.c @@ -70,19 +70,3 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size) *heap_start = (FAR void *)g_idle_topstack; *heap_size = CONFIG_RAM_END - g_idle_topstack; } - -/**************************************************************************** - * Name: lm32_add_region - * - * Description: - * Memory may be added in non-contiguous chunks. Additional chunks are - * added by calling this function. - * - ****************************************************************************/ - -#if CONFIG_MM_REGIONS > 1 -void lm32_add_region(void) -{ -#warning Missing logic -} -#endif diff --git a/arch/misoc/src/lm32/lm32_initialize.c b/arch/misoc/src/lm32/lm32_initialize.c index 98c73b3..58ed160 100644 --- a/arch/misoc/src/lm32/lm32_initialize.c +++ b/arch/misoc/src/lm32/lm32_initialize.c @@ -22,26 +22,9 @@ * Included Files ****************************************************************************/ -#include <nuttx/config.h> - -#include <debug.h> - #include <nuttx/arch.h> -#include <nuttx/sched_note.h> -#include <nuttx/drivers/drivers.h> -#include <nuttx/fs/loop.h> -#include <nuttx/net/loopback.h> -#include <nuttx/net/tun.h> -#include <nuttx/net/telnet.h> -#include <nuttx/syslog/syslog.h> -#include <nuttx/serial/pty.h> -#include <nuttx/crypto/crypto.h> -#include <nuttx/power/pm.h> - -#include <arch/board/board.h> #include "misoc.h" -#include "lm32.h" /**************************************************************************** * Public Functions @@ -53,10 +36,6 @@ void up_initialize(void) misoc_serial_initialize(); -#ifdef CONFIG_RPMSG_UART - rpmsg_serialinit(); -#endif - #if 0 /* REVISIT */ /* Initialize the network cores */ diff --git a/arch/misoc/src/minerva/minerva.h b/arch/misoc/src/minerva/minerva.h index b1abe95..ad17d2d 100644 --- a/arch/misoc/src/minerva/minerva.h +++ b/arch/misoc/src/minerva/minerva.h @@ -104,12 +104,6 @@ extern uint32_t g_idle_topstack; void minerva_board_initialize(void); -/* Memory allocation ********************************************************/ - -#if CONFIG_MM_REGIONS > 1 -void minerva_add_region(void); -#endif - /* Context switching ********************************************************/ void minerva_copystate(uint32_t * dest, uint32_t * src); @@ -123,18 +117,6 @@ uint32_t *minerva_doirq(int irq, uint32_t * regs); int minerva_swint(int irq, FAR void *context, FAR void *arg); -/* Rpmsg serial *************************************************************/ - -#ifdef CONFIG_RPMSG_UART -void rpmsg_serialinit(void); -#else -# define rpmsg_serialinit() -#endif - -/* System timer *************************************************************/ - -void minerva_timer_initialize(void); - /* Signal handling **********************************************************/ void minerva_sigdeliver(void); diff --git a/arch/misoc/src/minerva/minerva_allocateheap.c b/arch/misoc/src/minerva/minerva_allocateheap.c index 315c5d9..b330403 100644 --- a/arch/misoc/src/minerva/minerva_allocateheap.c +++ b/arch/misoc/src/minerva/minerva_allocateheap.c @@ -58,19 +58,3 @@ void up_allocate_heap(FAR void **heap_start, size_t * heap_size) *heap_start = (FAR void *)g_idle_topstack; *heap_size = CONFIG_RAM_END - g_idle_topstack; } - -/**************************************************************************** - * Name: minerva_add_region - * - * Description: - * Memory may be added in non-contiguous chunks. Additional chunks are - * added by calling this function. - * - ****************************************************************************/ - -#if CONFIG_MM_REGIONS > 1 -void minerva_add_region(void) -{ -# warning Missing logic -} -#endif diff --git a/arch/misoc/src/minerva/minerva_initialize.c b/arch/misoc/src/minerva/minerva_initialize.c index 11d3d8f..0dde267 100644 --- a/arch/misoc/src/minerva/minerva_initialize.c +++ b/arch/misoc/src/minerva/minerva_initialize.c @@ -22,26 +22,9 @@ * Included Files ****************************************************************************/ -#include <nuttx/config.h> - -#include <debug.h> - #include <nuttx/arch.h> -#include <nuttx/sched_note.h> -#include <nuttx/drivers/drivers.h> -#include <nuttx/fs/loop.h> -#include <nuttx/net/loopback.h> -#include <nuttx/net/tun.h> -#include <nuttx/net/telnet.h> -#include <nuttx/syslog/syslog.h> -#include <nuttx/serial/pty.h> -#include <nuttx/crypto/crypto.h> -#include <nuttx/power/pm.h> - -#include <arch/board/board.h> #include "misoc.h" -#include "minerva.h" /**************************************************************************** * Public Functions @@ -53,10 +36,6 @@ void up_initialize(void) misoc_serial_initialize(); -#ifdef CONFIG_RPMSG_UART - rpmsg_serialinit(); -#endif - /* Initialize the network cores */ #ifdef CONFIG_MISOC_ETHERNET diff --git a/arch/or1k/src/common/up_initialize.c b/arch/or1k/src/common/up_initialize.c index e290306..bef341c 100644 --- a/arch/or1k/src/common/up_initialize.c +++ b/arch/or1k/src/common/up_initialize.c @@ -22,28 +22,12 @@ * Included Files ****************************************************************************/ -#include <nuttx/config.h> - -#include <debug.h> - #include <nuttx/arch.h> #include <nuttx/board.h> -#include <nuttx/drivers/drivers.h> -#include <nuttx/fs/loop.h> -#include <nuttx/net/loopback.h> -#include <nuttx/net/tun.h> -#include <nuttx/net/telnet.h> -#include <nuttx/note/note_driver.h> -#include <nuttx/syslog/syslog_console.h> -#include <nuttx/serial/pty.h> -#include <nuttx/crypto/crypto.h> -#include <nuttx/power/pm.h> #include <arch/board/board.h> - #include <arch/spr.h> -#include "up_arch.h" #include "up_internal.h" /**************************************************************************** @@ -157,10 +141,6 @@ static inline void up_color_intstack(void) void up_initialize(void) { - /* Initialize global variables */ - - CURRENT_REGS = NULL; - /* Colorize the interrupt stack */ up_color_intstack(); @@ -192,92 +172,20 @@ void up_initialize(void) } #endif - /* Register devices */ - -#if defined(CONFIG_DEV_NULL) - devnull_register(); /* Standard /dev/null */ -#endif - -#if defined(CONFIG_DEV_RANDOM) - devrandom_register(); /* Standard /dev/random */ -#endif - -#if defined(CONFIG_DEV_URANDOM) - devurandom_register(); /* Standard /dev/urandom */ -#endif - -#if defined(CONFIG_DEV_ZERO) - devzero_register(); /* Standard /dev/zero */ -#endif - -#if defined(CONFIG_DEV_LOOP) - loop_register(); /* Standard /dev/loop */ -#endif - -#if defined(CONFIG_DRIVER_NOTE) - note_register(); /* Non-standard /dev/note */ -#endif - /* Initialize the serial device driver */ up_serialinit(); -#ifdef CONFIG_RPMSG_UART - rpmsg_serialinit(); -#endif - - /* Initialize the console device driver (if it is other than the standard - * serial driver). - */ - -#if defined(CONFIG_CONSOLE_SYSLOG) - syslog_console_init(); -#endif - -#ifdef CONFIG_PSEUDOTERM_SUSV1 - /* Register the master pseudo-terminal multiplexor device */ - - ptmx_register(); -#endif - /* Print OpenRISC CPU information */ or1k_print_cpuinfo(); -#if defined(CONFIG_CRYPTO) - /* Initialize the HW crypto and /dev/crypto */ - - up_cryptoinitialize(); -#endif - -#ifdef CONFIG_CRYPTO_CRYPTODEV - devcrypto_register(); -#endif - #ifndef CONFIG_NETDEV_LATEINIT /* Initialize the network */ up_netinitialize(); #endif -#ifdef CONFIG_NET_LOOPBACK - /* Initialize the local loopback device */ - - localhost_initialize(); -#endif - -#ifdef CONFIG_NET_TUN - /* Initialize the TUN device */ - - tun_initialize(); -#endif - -#ifdef CONFIG_NETDEV_TELNET - /* Initialize the Telnet session factory */ - - telnet_initialize(); -#endif - /* Initialize USB -- device and/or host */ up_usbinitialize(); diff --git a/arch/or1k/src/common/up_internal.h b/arch/or1k/src/common/up_internal.h index 6c18457..7467267 100644 --- a/arch/or1k/src/common/up_internal.h +++ b/arch/or1k/src/common/up_internal.h @@ -279,10 +279,6 @@ void up_serialinit(void); void up_earlyserialinit(void); #endif -#ifdef CONFIG_RPMSG_UART -void rpmsg_serialinit(void); -#endif - /* DMA **********************************************************************/ #ifdef CONFIG_ARCH_DMA @@ -305,10 +301,6 @@ void up_addregion(void); # define up_addregion() #endif -/* Watchdog timer ***********************************************************/ - -void up_wdtinit(void); - /* Networking ***************************************************************/ /* Defined in board/xyz_network.c for board-specific Ethernet diff --git a/arch/renesas/src/common/up_initialize.c b/arch/renesas/src/common/up_initialize.c index 21d788d..7050372 100644 --- a/arch/renesas/src/common/up_initialize.c +++ b/arch/renesas/src/common/up_initialize.c @@ -22,22 +22,9 @@ * Included Files ****************************************************************************/ -#include <nuttx/config.h> - -#include <debug.h> - #include <nuttx/arch.h> #include <nuttx/board.h> -#include <nuttx/drivers/drivers.h> -#include <nuttx/fs/loop.h> -#include <nuttx/net/loopback.h> -#include <nuttx/net/tun.h> -#include <nuttx/net/telnet.h> -#include <nuttx/note/note_driver.h> -#include <nuttx/syslog/syslog_console.h> -#include <nuttx/serial/pty.h> -#include <nuttx/crypto/crypto.h> -#include <nuttx/power/pm.h> +#include <arch/board/board.h> #include "up_arch.h" #include "up_internal.h" @@ -65,10 +52,6 @@ void up_initialize(void) { - /* Initialize global variables */ - - g_current_regs = NULL; - #ifdef CONFIG_PM /* Initialize the power management subsystem. This MCU-specific function * must be called *very* early in the initialization sequence *before* any @@ -79,97 +62,20 @@ void up_initialize(void) up_pminitialize(); #endif - /* Register devices */ - -#if defined(CONFIG_DEV_NULL) - devnull_register(); /* Standard /dev/null */ -#endif - -#if defined(CONFIG_DEV_RANDOM) - devrandom_register(); /* Standard /dev/random */ -#endif - -#if defined(CONFIG_DEV_URANDOM) - devurandom_register(); /* Standard /dev/urandom */ -#endif - -#if defined(CONFIG_DEV_ZERO) - devzero_register(); /* Standard /dev/zero */ -#endif - -#if defined(CONFIG_DEV_LOOP) - loop_register(); /* Standard /dev/loop */ -#endif - -#if defined(CONFIG_DRIVER_NOTE) - note_register(); /* Non-standard /dev/note */ -#endif - /* Initialize the serial device driver */ #ifdef USE_SERIALDRIVER up_serialinit(); #endif -#ifdef CONFIG_RPMSG_UART - rpmsg_serialinit(); -#endif - - /* Initialize the console device driver (if it is other than the standard - * serial driver). NOTE that the naming implies that the console is a - * serial driver. That is usually the case, however, if no UARTs are - * enabled, the console could also be provided through some other device, - * such as an LCD. - * Architecture-specific logic will have to detect that case. - */ - -#if defined(CONFIG_CONSOLE_SYSLOG) - syslog_console_init(); -#endif - -#ifdef CONFIG_PSEUDOTERM_SUSV1 - /* Register the master pseudo-terminal multiplexor device */ - - ptmx_register(); -#endif - -#if defined(CONFIG_CRYPTO) - /* Initialize the HW crypto and /dev/crypto */ - - up_cryptoinitialize(); -#endif - -#ifdef CONFIG_CRYPTO_CRYPTODEV - devcrypto_register(); -#endif - #ifndef CONFIG_NETDEV_LATEINIT /* Initialize the network */ up_netinitialize(); #endif -#ifdef CONFIG_NET_LOOPBACK - /* Initialize the local loopback device */ - - localhost_initialize(); -#endif - -#ifdef CONFIG_NET_TUN - /* Initialize the TUN device */ - - tun_initialize(); -#endif - -#ifdef CONFIG_NETDEV_TELNET - /* Initialize the Telnet session factory */ - - telnet_initialize(); -#endif - /* Initialize USB */ up_usbinitialize(); - board_autoled_on(LED_IRQSENABLED); } diff --git a/arch/renesas/src/common/up_internal.h b/arch/renesas/src/common/up_internal.h index 517108a..da00a77 100644 --- a/arch/renesas/src/common/up_internal.h +++ b/arch/renesas/src/common/up_internal.h @@ -164,14 +164,6 @@ void up_consoleinit(void); void up_serialinit(void); #endif -#ifdef CONFIG_RPMSG_UART -void rpmsg_serialinit(void); -#endif - -/* Defined in xyz_watchdog.c */ - -void up_wdtinit(void); - /* Defined in board/xyz_lcd.c */ #ifdef CONFIG_SLCD_CONSOLE diff --git a/arch/risc-v/src/common/riscv_initialize.c b/arch/risc-v/src/common/riscv_initialize.c index bcf07ba..f7ebfe1 100644 --- a/arch/risc-v/src/common/riscv_initialize.c +++ b/arch/risc-v/src/common/riscv_initialize.c @@ -22,21 +22,10 @@ * Included Files ****************************************************************************/ -#include <nuttx/config.h> - -#include <debug.h> - #include <nuttx/arch.h> #include <nuttx/board.h> -#include <nuttx/serial/pty.h> -#include <nuttx/note/note_driver.h> -#include <nuttx/syslog/syslog_console.h> -#include <nuttx/drivers/drivers.h> -#include <nuttx/net/telnet.h> - #include <arch/board/board.h> -#include "sched/sched.h" #include "riscv_arch.h" #include "riscv_internal.h" @@ -111,63 +100,11 @@ void up_initialize(void) riscv_pminitialize(); #endif - /* Register devices */ - -#if defined(CONFIG_DEV_NULL) - devnull_register(); /* Standard /dev/null */ -#endif - -#if defined(CONFIG_DEV_RANDOM) - devrandom_register(); /* Standard /dev/random */ -#endif - -#if defined(CONFIG_DEV_URANDOM) - devurandom_register(); /* Standard /dev/urandom */ -#endif - -#if defined(CONFIG_DEV_ZERO) - devzero_register(); /* Standard /dev/zero */ -#endif - -#if defined(CONFIG_DRIVER_NOTE) - note_register(); /* Non-standard /dev/note */ -#endif - /* Initialize the serial device driver */ #ifdef USE_SERIALDRIVER riscv_serialinit(); #endif -#ifdef CONFIG_RPMSG_UART - rpmsg_serialinit(); -#endif - - /* Initialize the console device driver (if it is other than the standard - * serial driver). - */ - -#if defined(CONFIG_CONSOLE_SYSLOG) - syslog_console_init(); -#endif - -#ifdef CONFIG_PSEUDOTERM_SUSV1 - /* Register the master pseudo-terminal multiplexor device */ - - ptmx_register(); -#endif - -#ifdef CONFIG_NET_LOOPBACK - /* Initialize the local loopback device */ - - localhost_initialize(); -#endif - -#ifdef CONFIG_NETDEV_TELNET - /* Initialize the Telnet session factory */ - - telnet_initialize(); -#endif - board_autoled_on(LED_IRQSENABLED); } diff --git a/arch/risc-v/src/common/riscv_internal.h b/arch/risc-v/src/common/riscv_internal.h index 000727a..f64216e 100644 --- a/arch/risc-v/src/common/riscv_internal.h +++ b/arch/risc-v/src/common/riscv_internal.h @@ -225,10 +225,6 @@ void riscv_serialinit(void); void riscv_earlyserialinit(void); #endif -#ifdef CONFIG_RPMSG_UART -void rpmsg_serialinit(void); -#endif - /* Exception Handler ********************************************************/ void riscv_fault(int irq, uintptr_t *regs); diff --git a/arch/risc-v/src/esp32c3/esp32c3_irq.h b/arch/risc-v/src/esp32c3/esp32c3_irq.h index 8f0d0da..54cd410 100644 --- a/arch/risc-v/src/esp32c3/esp32c3_irq.h +++ b/arch/risc-v/src/esp32c3/esp32c3_irq.h @@ -42,12 +42,6 @@ #define ESP32C3_INT_PRIO_DEF 1 /**************************************************************************** - * Name: up_irqinitialize - ****************************************************************************/ - -void up_irqinitialize(void); - -/**************************************************************************** * Name: esp32c3_bind_irq * * Description: diff --git a/arch/risc-v/src/esp32c3/esp32c3_pminitialize.c b/arch/risc-v/src/esp32c3/esp32c3_pminitialize.c index 4625d90..ee25f78 100644 --- a/arch/risc-v/src/esp32c3/esp32c3_pminitialize.c +++ b/arch/risc-v/src/esp32c3/esp32c3_pminitialize.c @@ -23,7 +23,6 @@ ****************************************************************************/ #include <nuttx/config.h> -#include <nuttx/power/pm.h> #include "esp32c3_pm.h" @@ -43,9 +42,6 @@ void riscv_pminitialize(void) { - /* Then initialize the NuttX power management subsystem proper */ - - pm_initialize(); } #endif /* CONFIG_PM */ diff --git a/arch/risc-v/src/rv32m1/rv32m1_serial.c b/arch/risc-v/src/rv32m1/rv32m1_serial.c index df50c51..c7cb8a1 100644 --- a/arch/risc-v/src/rv32m1/rv32m1_serial.c +++ b/arch/risc-v/src/rv32m1/rv32m1_serial.c @@ -36,7 +36,6 @@ #include <nuttx/irq.h> #include <nuttx/arch.h> #include <nuttx/serial/serial.h> -#include <nuttx/power/pm.h> #ifdef CONFIG_SERIAL_TERMIOS # include <termios.h> diff --git a/arch/sim/src/sim/up_initialize.c b/arch/sim/src/sim/up_initialize.c index 1d32e12..7b64098 100644 --- a/arch/sim/src/sim/up_initialize.c +++ b/arch/sim/src/sim/up_initialize.c @@ -22,30 +22,13 @@ * Included Files ****************************************************************************/ -#include <nuttx/config.h> - -#include <assert.h> -#include <debug.h> - #include <nuttx/arch.h> #include <nuttx/audio/audio.h> -#include <nuttx/clock.h> -#include <nuttx/drivers/drivers.h> -#include <nuttx/fs/loop.h> -#include <nuttx/fs/ioctl.h> #include <nuttx/kthread.h> #include <nuttx/motor/foc/foc_dummy.h> -#include <nuttx/net/loopback.h> -#include <nuttx/net/tun.h> -#include <nuttx/net/telnet.h> #include <nuttx/mtd/mtd.h> -#include <nuttx/note/note_driver.h> -#include <nuttx/syslog/syslog_console.h> -#include <nuttx/serial/pty.h> #include <nuttx/spi/spi_flash.h> #include <nuttx/spi/qspi_flash.h> -#include <nuttx/crypto/crypto.h> -#include <nuttx/power/pm.h> #include "up_internal.h" @@ -206,19 +189,6 @@ static int up_loop_task(int argc, FAR char **argv) return 0; } -static void up_loop_init(void) -{ - int ret; - - /* Use loop_task to simulate the IRQ */ - - ret = kthread_create("loop_task", 1, - CONFIG_DEFAULT_TASK_STACKSIZE, - up_loop_task, NULL); - - DEBUGASSERT(ret > 0); -} - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -245,70 +215,10 @@ static void up_loop_init(void) void up_initialize(void) { -#ifdef CONFIG_PM - /* Initialize the power management subsystem. This MCU-specific function - * must be called *very* early in the initialization sequence *before* any - * other device drivers are initialized (since they may attempt to register - * with the power management subsystem). - */ - - pm_initialize(); -#endif - - /* Register devices */ - -#if defined(CONFIG_DEV_NULL) - devnull_register(); /* Standard /dev/null */ -#endif - -#if defined(CONFIG_DEV_RANDOM) - devrandom_register(); /* Standard /dev/random */ -#endif - -#if defined(CONFIG_DEV_URANDOM) - devurandom_register(); /* Standard /dev/urandom */ -#endif - -#if defined(CONFIG_DEV_ZERO) - devzero_register(); /* Standard /dev/zero */ -#endif - -#if defined(CONFIG_DEV_LOOP) - loop_register(); /* Standard /dev/loop */ -#endif - -#if defined(CONFIG_DRIVER_NOTE) - note_register(); /* Non-standard /dev/note */ -#endif - -#ifdef CONFIG_RPMSG_UART - rpmsg_serialinit(); -#endif - /* Register some tty-port to access tty-port on sim platform */ up_uartinit(); -#if defined(CONFIG_CONSOLE_SYSLOG) - syslog_console_init(); -#endif - -#ifdef CONFIG_PSEUDOTERM_SUSV1 - /* Register the master pseudo-terminal multiplexor device */ - - ptmx_register(); -#endif - -#if defined(CONFIG_CRYPTO) - /* Initialize the HW crypto and /dev/crypto */ - - up_cryptoinitialize(); -#endif - -#ifdef CONFIG_CRYPTO_CRYPTODEV - devcrypto_register(); -#endif - #if defined(CONFIG_FS_FAT) && !defined(CONFIG_DISABLE_MOUNTPOINT) up_registerblockdevice(); /* Our FAT ramdisk at /dev/ram0 */ #endif @@ -323,24 +233,6 @@ void up_initialize(void) usrsock_init(); #endif -#ifdef CONFIG_NET_LOOPBACK - /* Initialize the local loopback device */ - - localhost_initialize(); -#endif - -#ifdef CONFIG_NET_TUN - /* Initialize the TUN device */ - - tun_initialize(); -#endif - -#ifdef CONFIG_NETDEV_TELNET - /* Initialize the Telnet session factory */ - - telnet_initialize(); -#endif - #if defined(CONFIG_FS_SMARTFS) && defined(CONFIG_MTD_SMART) && \ (defined(CONFIG_SPI_FLASH) || defined(CONFIG_QSPI_FLASH)) up_init_smartfs(); @@ -351,5 +243,7 @@ void up_initialize(void) audio_register("pcm0c", sim_audio_initialize(false)); #endif - up_loop_init(); + kthread_create("loop_task", SCHED_PRIORITY_MIN, + CONFIG_DEFAULT_TASK_STACKSIZE, + up_loop_task, NULL); } diff --git a/arch/sim/src/sim/up_internal.h b/arch/sim/src/sim/up_internal.h index 3784cc4..bdcf87b 100644 --- a/arch/sim/src/sim/up_internal.h +++ b/arch/sim/src/sim/up_internal.h @@ -189,12 +189,6 @@ int up_init_ipi(int irq); void up_timer_update(void); #endif -/* rpmsg_serialinit *********************************************************/ - -#ifdef CONFIG_RPMSG_UART -void rpmsg_serialinit(void); -#endif - /* up_uart.c ****************************************************************/ void up_uartinit(void); diff --git a/arch/sparc/src/common/up_initialize.c b/arch/sparc/src/common/up_initialize.c index 6b95e99..2c75598 100644 --- a/arch/sparc/src/common/up_initialize.c +++ b/arch/sparc/src/common/up_initialize.c @@ -22,23 +22,8 @@ * Included Files ****************************************************************************/ -#include <nuttx/config.h> - -#include <debug.h> - #include <nuttx/arch.h> -#include <nuttx/sched_note.h> -#include <nuttx/mm/iob.h> -#include <nuttx/drivers/drivers.h> -#include <nuttx/fs/loop.h> -#include <nuttx/net/loopback.h> -#include <nuttx/net/tun.h> -#include <nuttx/net/telnet.h> -#include <nuttx/syslog/syslog.h> -#include <nuttx/syslog/syslog_console.h> -#include <nuttx/serial/pty.h> -#include <nuttx/crypto/crypto.h> - +#include <nuttx/board.h> #include <arch/board/board.h> #include "up_arch.h" @@ -140,10 +125,6 @@ static inline void up_color_intstack(void) void up_initialize(void) { - /* Initialize global variables */ - - g_current_regs = NULL; - /* Colorize the interrupt stack */ up_color_intstack(); @@ -152,10 +133,6 @@ void up_initialize(void) up_addregion(); - /* Initialize the interrupt subsystem */ - - up_irqinitialize(); - #ifdef CONFIG_ARCH_DMA /* Initialize the DMA subsystem if the weak function up_dma_initialize has * been brought into the build @@ -169,109 +146,12 @@ void up_initialize(void) } #endif -#ifdef CONFIG_MM_IOB - /* Initialize IO buffering */ - - iob_initialize(); -#endif - - /* Register devices */ - -#if defined(CONFIG_DEV_NULL) - devnull_register(); /* Standard /dev/null */ -#endif - -#if defined(CONFIG_DEV_RANDOM) - devrandom_register(); /* Standard /dev/random */ -#endif - -#if defined(CONFIG_DEV_URANDOM) - devurandom_register(); /* Standard /dev/urandom */ -#endif - -#if defined(CONFIG_DEV_ZERO) - devzero_register(); /* Standard /dev/zero */ -#endif - -#if defined(CONFIG_DEV_LOOP) - loop_register(); /* Standard /dev/loop */ -#endif - -#if defined(CONFIG_SCHED_INSTRUMENTATION_BUFFER) && \ - defined(CONFIG_DRIVER_NOTE) - note_register(); /* Non-standard /dev/note */ -#endif - /* Initialize the serial device driver */ #ifdef USE_SERIALDRIVER up_serialinit(); #endif -#ifdef CONFIG_RPMSG_UART - rpmsg_serialinit(); -#endif - - /* Initialize the console device driver (if it is other than the standard - * serial driver). - */ - -#if defined(CONFIG_DEV_LOWCONSOLE) - lowconsole_init(); -#elif defined(CONFIG_CONSOLE_SYSLOG) - syslog_console_init(); -#elif defined(CONFIG_RAMLOG_CONSOLE) - ramlog_consoleinit(); -#endif - -#ifdef CONFIG_PSEUDOTERM_SUSV1 - /* Register the master pseudo-terminal multiplexor device */ - - (void)ptmx_register(); -#endif - - /* Initialize the console device driver (if it is other than the standard - * serial driver). - */ - -#if defined(CONFIG_CONSOLE_SYSLOG) - syslog_console_init(); -#endif - -#if defined(CONFIG_CRYPTO) - /* Initialize the HW crypto and /dev/crypto */ - - up_cryptoinitialize(); -#endif - -#ifdef CONFIG_CRYPTO_CRYPTODEV - devcrypto_register(); -#endif - -#ifndef CONFIG_NETDEV_LATEINIT - /* Initialize the network */ - - up_netinitialize(); -#endif - -#ifdef CONFIG_NETDEV_LOOPBACK - /* Initialize the local loopback device */ - - (void)localhost_initialize(); -#endif - -#ifdef CONFIG_NET_TUN - /* Initialize the TUN device */ - - (void)tun_initialize(); -#endif - -#ifdef CONFIG_NETDEV_TELNET - /* Initialize the Telnet session factory */ - - (void)telnet_initialize(); -#endif - /* Initialize USB */ up_usbinitialize(); diff --git a/arch/sparc/src/common/up_internal.h b/arch/sparc/src/common/up_internal.h index 9b5bf2e..9812cbc 100644 --- a/arch/sparc/src/common/up_internal.h +++ b/arch/sparc/src/common/up_internal.h @@ -183,14 +183,6 @@ void up_copystate(uint32_t *dest, uint32_t *src); void up_lowputs(const char *str); -/* Defined in drivers/lowconsole.c */ - -#ifdef CONFIG_DEV_LOWCONSOLE -void lowconsole_init(void); -#else -# define lowconsole_init() -#endif - /* Debug */ #ifdef CONFIG_ARCH_STACKDUMP @@ -217,7 +209,6 @@ void up_sigdeliver(void); /* IRQs */ -void up_irqinitialize(void); bool up_pending_irq(int irq); void up_clrpend_irq(int irq); @@ -241,8 +232,6 @@ void up_lowputc(char ch); void up_earlyserialinit(void); void up_serialinit(void); -void rpmsg_serialinit(void); - /* Network */ #if defined(CONFIG_NET) && !defined(CONFIG_NETDEV_LATEINIT) diff --git a/arch/x86/src/common/up_initialize.c b/arch/x86/src/common/up_initialize.c index d90c91b..4c19762 100644 --- a/arch/x86/src/common/up_initialize.c +++ b/arch/x86/src/common/up_initialize.c @@ -22,23 +22,8 @@ * Included Files ****************************************************************************/ -#include <nuttx/config.h> - -#include <debug.h> - #include <nuttx/arch.h> #include <nuttx/board.h> -#include <nuttx/drivers/drivers.h> -#include <nuttx/fs/loop.h> -#include <nuttx/net/loopback.h> -#include <nuttx/net/tun.h> -#include <nuttx/net/telnet.h> -#include <nuttx/note/note_driver.h> -#include <nuttx/syslog/syslog_console.h> -#include <nuttx/serial/pty.h> -#include <nuttx/crypto/crypto.h> -#include <nuttx/power/pm.h> - #include <arch/board/board.h> #include "up_arch.h" @@ -67,10 +52,6 @@ void up_initialize(void) { - /* Initialize global variables */ - - g_current_regs = NULL; - /* Add any extra memory fragments to the memory manager */ up_addregion(); @@ -98,90 +79,18 @@ void up_initialize(void) } #endif - /* Register devices */ - -#if defined(CONFIG_DEV_NULL) - devnull_register(); /* Standard /dev/null */ -#endif - -#if defined(CONFIG_DEV_RANDOM) - devrandom_register(); /* Standard /dev/random */ -#endif - -#if defined(CONFIG_DEV_URANDOM) - devurandom_register(); /* Standard /dev/urandom */ -#endif - -#if defined(CONFIG_DEV_ZERO) - devzero_register(); /* Standard /dev/zero */ -#endif - -#if defined(CONFIG_DEV_LOOP) - loop_register(); /* Standard /dev/loop */ -#endif - -#if defined(CONFIG_DRIVER_NOTE) - note_register(); /* Non-standard /dev/note */ -#endif - /* Initialize the serial device driver */ #ifdef USE_SERIALDRIVER up_serialinit(); #endif -#ifdef CONFIG_RPMSG_UART - rpmsg_serialinit(); -#endif - - /* Initialize the console device driver (if it is other than the standard - * serial driver). - */ - -#if defined(CONFIG_CONSOLE_SYSLOG) - syslog_console_init(); -#endif - -#ifdef CONFIG_PSEUDOTERM_SUSV1 - /* Register the master pseudo-terminal multiplexor device */ - - ptmx_register(); -#endif - -#if defined(CONFIG_CRYPTO) - /* Initialize the HW crypto and /dev/crypto */ - - up_cryptoinitialize(); -#endif - -#ifdef CONFIG_CRYPTO_CRYPTODEV - devcrypto_register(); -#endif - #ifndef CONFIG_NETDEV_LATEINIT /* Initialize the network */ up_netinitialize(); #endif -#ifdef CONFIG_NET_LOOPBACK - /* Initialize the local loopback device */ - - localhost_initialize(); -#endif - -#ifdef CONFIG_NET_TUN - /* Initialize the TUN device */ - - tun_initialize(); -#endif - -#ifdef CONFIG_NETDEV_TELNET - /* Initialize the Telnet session factory */ - - telnet_initialize(); -#endif - /* Initialize USB -- device and/or host */ up_usbinitialize(); diff --git a/arch/x86/src/common/up_internal.h b/arch/x86/src/common/up_internal.h index 83f5a75..f841387 100644 --- a/arch/x86/src/common/up_internal.h +++ b/arch/x86/src/common/up_internal.h @@ -201,14 +201,6 @@ void up_earlyserialinit(void); void up_serialinit(void); #endif -#ifdef CONFIG_RPMSG_UART -void rpmsg_serialinit(void); -#endif - -/* Defined in xyz_watchdog.c */ - -void up_wdtinit(void); - /* Defined in board/up_network.c */ #if defined(CONFIG_NET) && !defined(CONFIG_NETDEV_LATEINIT) diff --git a/arch/x86_64/src/common/up_initialize.c b/arch/x86_64/src/common/up_initialize.c index 8d29988..d814124 100644 --- a/arch/x86_64/src/common/up_initialize.c +++ b/arch/x86_64/src/common/up_initialize.c @@ -22,28 +22,10 @@ * Included Files ****************************************************************************/ -#include <nuttx/config.h> - -#include <debug.h> - #include <nuttx/arch.h> #include <nuttx/board.h> -#include <nuttx/mm/iob.h> -#include <nuttx/drivers/drivers.h> -#include <nuttx/fs/loop.h> -#include <nuttx/net/loopback.h> -#include <nuttx/net/tun.h> -#include <nuttx/net/telnet.h> -#include <nuttx/syslog/syslog.h> -#include <nuttx/note/note_driver.h> -#include <nuttx/syslog/syslog_console.h> -#include <nuttx/serial/pty.h> -#include <nuttx/crypto/crypto.h> -#include <nuttx/power/pm.h> - #include <arch/board/board.h> -#include "sched/sched.h" #include "up_arch.h" #include "up_internal.h" @@ -101,10 +83,6 @@ static void up_calibratedelay(void) void up_initialize(void) { - /* Initialize global variables */ - - g_current_regs = NULL; - /* Add any extra memory fragments to the memory manager */ up_addregion(); @@ -132,90 +110,18 @@ void up_initialize(void) } #endif - /* Register devices */ - -#if defined(CONFIG_DEV_NULL) - devnull_register(); /* Standard /dev/null */ -#endif - -#if defined(CONFIG_DEV_RANDOM) - devrandom_register(); /* Standard /dev/random */ -#endif - -#if defined(CONFIG_DEV_URANDOM) - devurandom_register(); /* Standard /dev/urandom */ -#endif - -#if defined(CONFIG_DEV_ZERO) - devzero_register(); /* Standard /dev/zero */ -#endif - -#if defined(CONFIG_DEV_LOOP) - loop_register(); /* Standard /dev/loop */ -#endif - -#if defined(CONFIG_DRIVER_NOTE) - note_register(); /* Non-standard /dev/note */ -#endif - /* Initialize the serial device driver */ #ifdef USE_SERIALDRIVER up_serialinit(); #endif -#ifdef CONFIG_RPMSG_UART - rpmsg_serialinit(); -#endif - - /* Initialize the console device driver (if it is other than the standard - * serial driver). - */ - -#if defined(CONFIG_CONSOLE_SYSLOG) - syslog_console_init(); -#endif - -#ifdef CONFIG_PSEUDOTERM_SUSV1 - /* Register the master pseudo-terminal multiplexor device */ - - ptmx_register(); -#endif - -#if defined(CONFIG_CRYPTO) - /* Initialize the HW crypto and /dev/crypto */ - - up_cryptoinitialize(); -#endif - -#ifdef CONFIG_CRYPTO_CRYPTODEV - devcrypto_register(); -#endif - #ifndef CONFIG_NETDEV_LATEINIT /* Initialize the network */ up_netinitialize(); #endif -#ifdef CONFIG_NET_LOOPBACK - /* Initialize the local loopback device */ - - localhost_initialize(); -#endif - -#ifdef CONFIG_NET_TUN - /* Initialize the TUN device */ - - tun_initialize(); -#endif - -#ifdef CONFIG_NETDEV_TELNET - /* Initialize the Telnet session factory */ - - telnet_initialize(); -#endif - /* Initialize USB -- device and/or host */ up_usbinitialize(); diff --git a/arch/x86_64/src/common/up_internal.h b/arch/x86_64/src/common/up_internal.h index 222d642..f50a058 100644 --- a/arch/x86_64/src/common/up_internal.h +++ b/arch/x86_64/src/common/up_internal.h @@ -189,7 +189,6 @@ void x86_64_boardinitialize(void); void up_copystate(uint64_t *dest, uint64_t *src); void up_savestate(uint64_t *regs); void up_decodeirq(uint64_t *regs); -void up_irqinitialize(void); #ifdef CONFIG_ARCH_DMA void weak_function up_dmainitialize(void); #endif @@ -218,10 +217,6 @@ void up_addregion(void); void up_earlyserialinit(void); void up_serialinit(void); -/* Defined in xyz_watchdog.c */ - -void up_wdtinit(void); - /* Defined in xyz_timerisr.c */ void x86_64_timer_calibrate_freq(void); diff --git a/arch/xtensa/src/common/xtensa.h b/arch/xtensa/src/common/xtensa.h index b3baf52..43d59af 100644 --- a/arch/xtensa/src/common/xtensa.h +++ b/arch/xtensa/src/common/xtensa.h @@ -320,8 +320,6 @@ void up_lowputc(char ch); void xtensa_earlyserialinit(void); void xtensa_serialinit(void); -void rpmsg_serialinit(void); - /* Network */ #if defined(CONFIG_NET) && !defined(CONFIG_NETDEV_LATEINIT) diff --git a/arch/xtensa/src/common/xtensa_initialize.c b/arch/xtensa/src/common/xtensa_initialize.c index 5db6872..a8f98f1 100644 --- a/arch/xtensa/src/common/xtensa_initialize.c +++ b/arch/xtensa/src/common/xtensa_initialize.c @@ -22,23 +22,8 @@ * Included Files ****************************************************************************/ -#include <nuttx/config.h> - -#include <debug.h> - #include <nuttx/arch.h> #include <nuttx/board.h> -#include <nuttx/drivers/drivers.h> -#include <nuttx/fs/loop.h> -#include <nuttx/net/loopback.h> -#include <nuttx/net/tun.h> -#include <nuttx/net/telnet.h> -#include <nuttx/note/note_driver.h> -#include <nuttx/syslog/syslog_console.h> -#include <nuttx/serial/pty.h> -#include <nuttx/crypto/crypto.h> -#include <nuttx/power/pm.h> - #include <arch/board/board.h> #include "xtensa.h" @@ -99,17 +84,8 @@ static inline void xtensa_color_intstack(void) void up_initialize(void) { - int i; - xtensa_color_intstack(); - /* Initialize global variables */ - - for (i = 0; i < CONFIG_SMP_NCPUS; i++) - { - g_current_regs[i] = NULL; - } - /* Add any extra memory fragments to the memory manager */ xtensa_add_region(); @@ -143,90 +119,18 @@ void up_initialize(void) } #endif - /* Register devices */ - -#if defined(CONFIG_DEV_NULL) - devnull_register(); /* Standard /dev/null */ -#endif - -#if defined(CONFIG_DEV_RANDOM) - devrandom_register(); /* Standard /dev/random */ -#endif - -#if defined(CONFIG_DEV_URANDOM) - devurandom_register(); /* Standard /dev/urandom */ -#endif - -#if defined(CONFIG_DEV_ZERO) - devzero_register(); /* Standard /dev/zero */ -#endif - -#if defined(CONFIG_DEV_LOOP) - loop_register(); /* Standard /dev/loop */ -#endif - -#if defined(CONFIG_DRIVER_NOTE) - note_register(); /* Non-standard /dev/note */ -#endif - /* Initialize the serial device driver */ #ifdef USE_SERIALDRIVER xtensa_serialinit(); #endif -#ifdef CONFIG_RPMSG_UART - rpmsg_serialinit(); -#endif - - /* Initialize the console device driver (if it is other than the standard - * serial driver). - */ - -#if defined(CONFIG_CONSOLE_SYSLOG) - syslog_console_init(); -#endif - -#ifdef CONFIG_PSEUDOTERM_SUSV1 - /* Register the master pseudo-terminal multiplexor device */ - - ptmx_register(); -#endif - -#if defined(CONFIG_CRYPTO) - /* Initialize the HW crypto and /dev/crypto */ - - up_cryptoinitialize(); -#endif - -#ifdef CONFIG_CRYPTO_CRYPTODEV - devcrypto_register(); -#endif - #ifndef CONFIG_NETDEV_LATEINIT /* Initialize the network */ up_netinitialize(); #endif -#ifdef CONFIG_NET_LOOPBACK - /* Initialize the local loopback device */ - - localhost_initialize(); -#endif - -#ifdef CONFIG_NET_TUN - /* Initialize the TUN device */ - - tun_initialize(); -#endif - -#ifdef CONFIG_NETDEV_TELNET - /* Initialize the Telnet session factory */ - - telnet_initialize(); -#endif - /* Initialize USB -- device and/or host */ up_usbinitialize(); diff --git a/arch/xtensa/src/esp32/esp32_pminitialize.c b/arch/xtensa/src/esp32/esp32_pminitialize.c index f040202..7b04937 100644 --- a/arch/xtensa/src/esp32/esp32_pminitialize.c +++ b/arch/xtensa/src/esp32/esp32_pminitialize.c @@ -23,8 +23,8 @@ ****************************************************************************/ #include <nuttx/config.h> -#include <nuttx/power/pm.h> +#include "xtensa.h" #include "esp32_pm.h" #ifdef CONFIG_PM @@ -46,10 +46,6 @@ void xtensa_pminitialize(void) /* Initialize RTC parameters */ esp32_pminit(); - - /* Then initialize the NuttX power management subsystem proper */ - - pm_initialize(); } #endif /* CONFIG_PM */ diff --git a/arch/z16/src/common/z16_initialize.c b/arch/z16/src/common/z16_initialize.c index 08406f4..41ea700 100644 --- a/arch/z16/src/common/z16_initialize.c +++ b/arch/z16/src/common/z16_initialize.c @@ -22,23 +22,8 @@ * Included Files ****************************************************************************/ -#include <nuttx/config.h> - -#include <debug.h> - #include <nuttx/arch.h> #include <nuttx/board.h> -#include <nuttx/drivers/drivers.h> -#include <nuttx/fs/loop.h> -#include <nuttx/net/loopback.h> -#include <nuttx/net/tun.h> -#include <nuttx/net/telnet.h> -#include <nuttx/note/note_driver.h> -#include <nuttx/syslog/syslog_console.h> -#include <nuttx/serial/pty.h> -#include <nuttx/crypto/crypto.h> -#include <nuttx/power/pm.h> - #include <arch/board/board.h> #include "z16_arch.h" @@ -78,10 +63,6 @@ volatile FAR chipreg_t *g_current_regs; void up_initialize(void) { - /* Initialize global variables */ - - g_current_regs = NULL; - #if CONFIG_MM_REGIONS > 1 /* Add any extra memory fragments to the memory manager */ @@ -98,89 +79,17 @@ void up_initialize(void) up_pminitialize(); #endif - /* Register devices */ - -#if defined(CONFIG_DEV_NULL) - devnull_register(); /* Standard /dev/null */ -#endif - -#if defined(CONFIG_DEV_RANDOM) - devrandom_register(); /* Standard /dev/random */ -#endif - -#if defined(CONFIG_DEV_URANDOM) - devurandom_register(); /* Standard /dev/urandom */ -#endif - -#if defined(CONFIG_DEV_ZERO) - devzero_register(); /* Standard /dev/zero */ -#endif - -#if defined(CONFIG_DEV_LOOP) - loop_register(); /* Standard /dev/loop */ -#endif - -#if defined(CONFIG_DRIVER_NOTE) - note_register(); /* Non-standard /dev/note */ -#endif - /* Initialize the serial device driver */ #ifdef USE_SERIALDRIVER z16_serialinit(); #endif -#ifdef CONFIG_RPMSG_UART - rpmsg_serialinit(); -#endif - - /* Initialize the console device driver (if it is other than the standard - * serial driver). - */ - -#if defined(CONFIG_CONSOLE_SYSLOG) - syslog_console_init(); -#endif - -#ifdef CONFIG_PSEUDOTERM_SUSV1 - /* Register the master pseudo-terminal multiplexor device */ - - ptmx_register(); -#endif - -#if defined(CONFIG_CRYPTO) - /* Initialize the HW crypto and /dev/crypto */ - - up_cryptoinitialize(); -#endif - -#ifdef CONFIG_CRYPTO_CRYPTODEV - devcrypto_register(); -#endif - #ifndef CONFIG_NETDEV_LATEINIT /* Initialize the network */ z16_netinitialize(); #endif -#ifdef CONFIG_NET_LOOPBACK - /* Initialize the local loopback device */ - - localhost_initialize(); -#endif - -#ifdef CONFIG_NET_TUN - /* Initialize the TUN device */ - - tun_initialize(); -#endif - -#ifdef CONFIG_NETDEV_TELNET - /* Initialize the Telnet session factory */ - - telnet_initialize(); -#endif - board_autoled_on(LED_IRQSENABLED); } diff --git a/arch/z16/src/common/z16_internal.h b/arch/z16/src/common/z16_internal.h index ca72a21..bd3c349 100644 --- a/arch/z16/src/common/z16_internal.h +++ b/arch/z16/src/common/z16_internal.h @@ -148,10 +148,6 @@ void z16_serialinit(void); void z16_earlyserialinit(void); #endif -#ifdef CONFIG_RPMSG_UART -void rpmsg_serialinit(void); -#endif - /* Defined in xyz_irq.c */ void z16_ack_irq(int irq); diff --git a/arch/z80/src/common/z80_initialize.c b/arch/z80/src/common/z80_initialize.c index ba560d9..a66cb9d 100644 --- a/arch/z80/src/common/z80_initialize.c +++ b/arch/z80/src/common/z80_initialize.c @@ -22,24 +22,8 @@ * Included Files ****************************************************************************/ -#include <nuttx/config.h> - -#include <debug.h> - #include <nuttx/arch.h> #include <nuttx/board.h> -#include <nuttx/mm/mm.h> -#include <nuttx/drivers/drivers.h> -#include <nuttx/fs/loop.h> -#include <nuttx/net/loopback.h> -#include <nuttx/net/telnet.h> -#include <nuttx/net/tun.h> -#include <nuttx/note/note_driver.h> -#include <nuttx/syslog/syslog_console.h> -#include <nuttx/serial/pty.h> -#include <nuttx/crypto/crypto.h> -#include <nuttx/power/pm.h> - #include <arch/board/board.h> #include "chip/switch.h" @@ -97,89 +81,17 @@ void up_initialize(void) z80_mmu_initialize(); #endif - /* Register devices */ - -#if defined(CONFIG_DEV_NULL) - devnull_register(); /* Standard /dev/null */ -#endif - -#if defined(CONFIG_DEV_RANDOM) - devrandom_register(); /* Standard /dev/random */ -#endif - -#if defined(CONFIG_DEV_URANDOM) - devurandom_register(); /* Standard /dev/urandom */ -#endif - -#if defined(CONFIG_DEV_ZERO) - devzero_register(); /* Standard /dev/zero */ -#endif - -#if defined(CONFIG_DEV_LOOP) - loop_register(); /* Standard /dev/loop */ -#endif - -#if defined(CONFIG_DRIVER_NOTE) - note_register(); /* Non-standard /dev/note */ -#endif - /* Initialize the serial device driver */ #ifdef USE_SERIALDRIVER z80_serial_initialize(); #endif -#ifdef CONFIG_RPMSG_UART - rpmsg_serialinit(); -#endif - - /* Initialize the console device driver (if it is other than the standard - * serial driver). - */ - -#if defined(CONFIG_CONSOLE_SYSLOG) - syslog_console_init(); -#endif - -#ifdef CONFIG_PSEUDOTERM_SUSV1 - /* Register the master pseudo-terminal multiplexor device */ - - ptmx_register(); -#endif - -#if defined(CONFIG_CRYPTO) - /* Initialize the HW crypto and /dev/crypto */ - - up_cryptoinitialize(); -#endif - -#ifdef CONFIG_CRYPTO_CRYPTODEV - devcrypto_register(); -#endif - #ifndef CONFIG_NETDEV_LATEINIT /* Initialize the network */ up_netinitialize(); #endif -#ifdef CONFIG_NET_LOOPBACK - /* Initialize the local loopback device */ - - localhost_initialize(); -#endif - -#ifdef CONFIG_NET_TUN - /* Initialize the TUN device */ - - tun_initialize(); -#endif - -#ifdef CONFIG_NETDEV_TELNET - /* Initialize the Telnet session factory */ - - telnet_initialize(); -#endif - board_autoled_on(LED_IRQSENABLED); } diff --git a/arch/z80/src/common/z80_internal.h b/arch/z80/src/common/z80_internal.h index d9fa7d1..226b17d 100644 --- a/arch/z80/src/common/z80_internal.h +++ b/arch/z80/src/common/z80_internal.h @@ -105,12 +105,6 @@ void z80_serial_initialize(void); # define z80_serial_initialize() #endif -#ifdef CONFIG_RPMSG_UART -void rpmsg_serialinit(void); -#else -# define rpmsg_serialinit() -#endif - /* Architecture specific hook into the timer interrupt handler */ #ifdef CONFIG_ARCH_TIMERHOOK diff --git a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_userleds.c b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_userleds.c index 7448822..b8ca942 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_userleds.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_userleds.c @@ -28,8 +28,8 @@ #include <stdbool.h> #include <debug.h> +#include <nuttx/board.h> #include <arch/board/board.h> -#include <nuttx/power/pm.h> #include "chip.h" #include "arm_arch.h" diff --git a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_userleds.c b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_userleds.c index 3218312..2c79fe1 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_userleds.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_userleds.c @@ -28,8 +28,8 @@ #include <stdbool.h> #include <debug.h> +#include <nuttx/board.h> #include <arch/board/board.h> -#include <nuttx/power/pm.h> #include "chip.h" #include "arm_arch.h" diff --git a/boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_userleds.c b/boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_userleds.c index 765c12b..de567f2 100644 --- a/boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_userleds.c +++ b/boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_userleds.c @@ -28,8 +28,8 @@ #include <stdbool.h> #include <debug.h> +#include <nuttx/board.h> #include <arch/board/board.h> -#include <nuttx/power/pm.h> #include "chip.h" #include "arm_arch.h" diff --git a/boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_userleds.c b/boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_userleds.c index 735af9d..de5a5e8 100644 --- a/boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_userleds.c +++ b/boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_userleds.c @@ -29,7 +29,6 @@ #include <debug.h> #include <nuttx/board.h> -#include <nuttx/power/pm.h> #include <arch/board/board.h> #include "chip.h" diff --git a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_userleds.c b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_userleds.c index 4e7b6de..d940232 100644 --- a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_userleds.c +++ b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_userleds.c @@ -28,8 +28,8 @@ #include <stdbool.h> #include <debug.h> +#include <nuttx/board.h> #include <arch/board/board.h> -#include <nuttx/power/pm.h> #include "chip.h" #include "arm_arch.h" diff --git a/boards/arm/stm32/axoloti/src/stm32_userleds.c b/boards/arm/stm32/axoloti/src/stm32_userleds.c index d7ae3ed..10839c5 100644 --- a/boards/arm/stm32/axoloti/src/stm32_userleds.c +++ b/boards/arm/stm32/axoloti/src/stm32_userleds.c @@ -29,7 +29,6 @@ #include <debug.h> #include <nuttx/board.h> -#include <nuttx/power/pm.h> #include <arch/board/board.h> #include "chip.h" diff --git a/boards/arm/stm32/mikroe-stm32f4/src/stm32_pm.c b/boards/arm/stm32/mikroe-stm32f4/src/stm32_pm.c index 5a8858b..3606f2b 100644 --- a/boards/arm/stm32/mikroe-stm32f4/src/stm32_pm.c +++ b/boards/arm/stm32/mikroe-stm32f4/src/stm32_pm.c @@ -24,8 +24,6 @@ #include <nuttx/config.h> -#include <nuttx/power/pm.h> - #include "arm_internal.h" #include "stm32_pm.h" #include "mikroe-stm32f4.h" @@ -56,10 +54,6 @@ void arm_pminitialize(void) { - /* Then initialize the NuttX power management subsystem proper */ - - pm_initialize(); - #if defined(CONFIG_ARCH_IDLE_CUSTOM) && defined(CONFIG_PM_BUTTONS) /* Initialize the buttons to wake up the system from low power modes */ diff --git a/boards/arm/stm32/olimex-stm32-e407/src/stm32_userleds.c b/boards/arm/stm32/olimex-stm32-e407/src/stm32_userleds.c index 5972fef..79ec22b 100644 --- a/boards/arm/stm32/olimex-stm32-e407/src/stm32_userleds.c +++ b/boards/arm/stm32/olimex-stm32-e407/src/stm32_userleds.c @@ -27,8 +27,9 @@ #include <stdint.h> #include <stdbool.h> #include <debug.h> + +#include <nuttx/board.h> #include <arch/board/board.h> -#include <nuttx/power/pm.h> #include "chip.h" #include "arm_arch.h" diff --git a/boards/arm/stm32/olimex-stm32-h407/src/stm32_userleds.c b/boards/arm/stm32/olimex-stm32-h407/src/stm32_userleds.c index 3c09ccb..0c4798e 100644 --- a/boards/arm/stm32/olimex-stm32-h407/src/stm32_userleds.c +++ b/boards/arm/stm32/olimex-stm32-h407/src/stm32_userleds.c @@ -27,8 +27,9 @@ #include <stdint.h> #include <stdbool.h> #include <debug.h> + +#include <nuttx/board.h> #include <arch/board/board.h> -#include <nuttx/power/pm.h> #include "chip.h" #include "arm_arch.h" diff --git a/boards/arm/stm32/omnibusf4/src/stm32_pm.c b/boards/arm/stm32/omnibusf4/src/stm32_pm.c index 18bab41..2d6e8ef 100644 --- a/boards/arm/stm32/omnibusf4/src/stm32_pm.c +++ b/boards/arm/stm32/omnibusf4/src/stm32_pm.c @@ -24,9 +24,6 @@ #include <nuttx/config.h> -#include <nuttx/board.h> -#include <nuttx/power/pm.h> - #include "arm_internal.h" #include "stm32_pm.h" #include "omnibusf4.h" @@ -57,10 +54,6 @@ void arm_pminitialize(void) { - /* Then initialize the NuttX power management subsystem proper */ - - pm_initialize(); - #if defined(CONFIG_ARCH_IDLE_CUSTOM) && defined(CONFIG_PM_BUTTONS) /* Initialize the buttons to wake up the system from low power modes */ diff --git a/boards/arm/stm32/stm3210e-eval/src/stm32_pm.c b/boards/arm/stm32/stm3210e-eval/src/stm32_pm.c index d3f26a0..e01ff24 100644 --- a/boards/arm/stm32/stm3210e-eval/src/stm32_pm.c +++ b/boards/arm/stm32/stm3210e-eval/src/stm32_pm.c @@ -24,8 +24,6 @@ #include <nuttx/config.h> -#include <nuttx/power/pm.h> - #include "arm_internal.h" #include "stm32_pm.h" #include "stm3210e-eval.h" @@ -56,10 +54,6 @@ void arm_pminitialize(void) { - /* Then initialize the NuttX power management subsystem proper */ - - pm_initialize(); - #if defined(CONFIG_ARCH_IDLE_CUSTOM) && defined(CONFIG_PM_BUTTONS) /* Initialize the buttons to wake up the system from low power modes */ diff --git a/boards/arm/stm32/stm32f4discovery/src/stm32_pm.c b/boards/arm/stm32/stm32f4discovery/src/stm32_pm.c index b10656e..5e41b42 100644 --- a/boards/arm/stm32/stm32f4discovery/src/stm32_pm.c +++ b/boards/arm/stm32/stm32f4discovery/src/stm32_pm.c @@ -24,9 +24,6 @@ #include <nuttx/config.h> -#include <nuttx/board.h> -#include <nuttx/power/pm.h> - #include "arm_internal.h" #include "stm32_pm.h" #include "stm32f4discovery.h" @@ -57,10 +54,6 @@ void arm_pminitialize(void) { - /* Then initialize the NuttX power management subsystem proper */ - - pm_initialize(); - #if defined(CONFIG_ARCH_IDLE_CUSTOM) && defined(CONFIG_PM_BUTTONS) /* Initialize the buttons to wake up the system from low power modes */ diff --git a/boards/arm/stm32/stm32vldiscovery/src/stm32_leds.c b/boards/arm/stm32/stm32vldiscovery/src/stm32_leds.c index 4b3aaee..7c373da 100644 --- a/boards/arm/stm32/stm32vldiscovery/src/stm32_leds.c +++ b/boards/arm/stm32/stm32vldiscovery/src/stm32_leds.c @@ -29,7 +29,6 @@ #include <debug.h> #include <nuttx/board.h> -#include <nuttx/power/pm.h> #include <arch/board/board.h> #include "chip.h" diff --git a/drivers/Makefile b/drivers/Makefile index d6b5324..bfe6cf1 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -20,6 +20,8 @@ include $(TOPDIR)/Make.defs +CSRCS = drivers_initialize.c + # Include support for various drivers. Each Make.defs file will add its # files to the source file list, add its DEPPATH info, and will add # the appropriate paths to the VPATH variable diff --git a/arch/renesas/src/common/up_initialize.c b/drivers/drivers_initialize.c similarity index 64% copy from arch/renesas/src/common/up_initialize.c copy to drivers/drivers_initialize.c index 21d788d..755af2f 100644 --- a/arch/renesas/src/common/up_initialize.c +++ b/drivers/drivers_initialize.c @@ -1,5 +1,5 @@ /**************************************************************************** - * arch/renesas/src/common/up_initialize.c + * drivers/drivers_initialize.c * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -22,65 +22,47 @@ * Included Files ****************************************************************************/ -#include <nuttx/config.h> - -#include <debug.h> - -#include <nuttx/arch.h> -#include <nuttx/board.h> +#include <nuttx/crypto/crypto.h> #include <nuttx/drivers/drivers.h> #include <nuttx/fs/loop.h> #include <nuttx/net/loopback.h> #include <nuttx/net/tun.h> #include <nuttx/net/telnet.h> #include <nuttx/note/note_driver.h> +#include <nuttx/power/pm.h> +#include <nuttx/syslog/syslog.h> #include <nuttx/syslog/syslog_console.h> #include <nuttx/serial/pty.h> -#include <nuttx/crypto/crypto.h> -#include <nuttx/power/pm.h> - -#include "up_arch.h" -#include "up_internal.h" /**************************************************************************** * Public Functions ****************************************************************************/ /**************************************************************************** - * Name: up_initialize + * Name: drivers_initialize * * Description: - * up_initialize will be called once during OS initialization after the - * basic OS services have been initialized. The architecture specific - * details of initializing the OS will be handled here. Such things as - * setting up interrupt service routines, starting the clock, and - * registering device drivers are some of the things that are different - * for each processor and hardware platform. + * drivers_initialize will be called once during OS initialization after + * the basic OS services have been initialized. * - * up_initialize is called after the OS initialized but before the user - * initialization logic has been started and before the libraries have - * been initialized. OS services and driver services are available. + * drivers_initialize is called after the OS initialized but before the + * user initialization logic has been started and before the libraries + * have been initialized. OS services and driver services are available. * ****************************************************************************/ -void up_initialize(void) +void drivers_initialize(void) { - /* Initialize global variables */ - - g_current_regs = NULL; - #ifdef CONFIG_PM - /* Initialize the power management subsystem. This MCU-specific function - * must be called *very* early in the initialization sequence *before* any - * other device drivers are initialized (since they may attempt to register - * with the power management subsystem). - */ + /* Initialize power management subsystem proper */ - up_pminitialize(); + pm_initialize(); #endif /* Register devices */ + syslog_initialize(); + #if defined(CONFIG_DEV_NULL) devnull_register(); /* Standard /dev/null */ #endif @@ -107,23 +89,17 @@ void up_initialize(void) /* Initialize the serial device driver */ -#ifdef USE_SERIALDRIVER - up_serialinit(); -#endif - #ifdef CONFIG_RPMSG_UART rpmsg_serialinit(); #endif /* Initialize the console device driver (if it is other than the standard - * serial driver). NOTE that the naming implies that the console is a - * serial driver. That is usually the case, however, if no UARTs are - * enabled, the console could also be provided through some other device, - * such as an LCD. - * Architecture-specific logic will have to detect that case. + * serial driver). */ -#if defined(CONFIG_CONSOLE_SYSLOG) +#if defined(CONFIG_LWL_CONSOLE) + lwlconsole_init(); +#elif defined(CONFIG_CONSOLE_SYSLOG) syslog_console_init(); #endif @@ -143,12 +119,6 @@ void up_initialize(void) devcrypto_register(); #endif -#ifndef CONFIG_NETDEV_LATEINIT - /* Initialize the network */ - - up_netinitialize(); -#endif - #ifdef CONFIG_NET_LOOPBACK /* Initialize the local loopback device */ @@ -166,10 +136,4 @@ void up_initialize(void) telnet_initialize(); #endif - - /* Initialize USB */ - - up_usbinitialize(); - - board_autoled_on(LED_IRQSENABLED); } diff --git a/drivers/efuse/efuse.c b/drivers/efuse/efuse.c index 65d6342..ffb57b7 100644 --- a/drivers/efuse/efuse.c +++ b/drivers/efuse/efuse.c @@ -36,7 +36,6 @@ #include <nuttx/fs/fs.h> #include <nuttx/irq.h> #include <nuttx/kmalloc.h> -#include <nuttx/power/pm.h> #include <nuttx/semaphore.h> #include <nuttx/efuse/efuse.h> diff --git a/include/nuttx/drivers/drivers.h b/include/nuttx/drivers/drivers.h index cfbf640..c1bc04b 100644 --- a/include/nuttx/drivers/drivers.h +++ b/include/nuttx/drivers/drivers.h @@ -44,6 +44,16 @@ extern "C" #endif /**************************************************************************** + * Name: drivers_initialize + * + * Description: + * Initialize chip and board independent general driver + * + ****************************************************************************/ + +void drivers_initialize(void); + +/**************************************************************************** * Name: devnull_register * * Description: @@ -217,6 +227,16 @@ ssize_t bchlib_write(FAR void *handle, FAR const char *buffer, size_t offset, void lwlconsole_init(void); +/**************************************************************************** + * Name: rpmsg_serialinit + * + * Description: + * Register rpmsg serial driver + * + ****************************************************************************/ + +void rpmsg_serialinit(void); + #undef EXTERN #if defined(__cplusplus) } diff --git a/sched/init/nx_start.c b/sched/init/nx_start.c index 074cafd..7938ce3 100644 --- a/sched/init/nx_start.c +++ b/sched/init/nx_start.c @@ -39,8 +39,8 @@ #include <nuttx/mm/mm.h> #include <nuttx/kmalloc.h> #include <nuttx/sched_note.h> -#include <nuttx/syslog/syslog.h> #include <nuttx/binfmt/binfmt.h> +#include <nuttx/drivers/drivers.h> #include <nuttx/init.h> #include <nuttx/tls.h> @@ -648,6 +648,10 @@ void nx_start(void) binfmt_initialize(); #endif + /* Initialize common drivers */ + + drivers_initialize(); + /* Initialize Hardware Facilities *****************************************/ /* The processor specific details of running the operating system @@ -698,15 +702,6 @@ void nx_start(void) } } - /* Start SYSLOG ***********************************************************/ - - /* Late initialization of the system logging device. Some SYSLOG channel - * must be initialized late in the initialization sequence because it may - * depend on having IDLE task file structures setup. - */ - - syslog_initialize(); - #ifdef CONFIG_SMP /* Start all CPUs *********************************************************/