drivers: Merge the common driver initialization into one place

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2022-03-11 22:52:32 +08:00
committed by Alan Carvalho de Assis
parent ea614090cd
commit c96c96a399
69 changed files with 189 additions and 1750 deletions
+4 -97
View File
@@ -22,23 +22,8 @@
* Included Files * Included Files
****************************************************************************/ ****************************************************************************/
#include <nuttx/config.h>
#include <debug.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include <nuttx/board.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/board/board.h>
#include "arm_arch.h" #include "arm_arch.h"
@@ -49,7 +34,7 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_color_intstack * Name: arm_color_intstack
* *
* Description: * Description:
* Set the interrupt stack to a value so that later we can determine how * 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 #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 #ifdef CONFIG_SMP
uint32_t *ptr = (uint32_t *)arm_intstack_alloc(); uint32_t *ptr = (uint32_t *)arm_intstack_alloc();
@@ -75,7 +60,7 @@ static inline void up_color_intstack(void)
} }
} }
#else #else
# define up_color_intstack() # define arm_color_intstack()
#endif #endif
/**************************************************************************** /****************************************************************************
@@ -101,13 +86,9 @@ static inline void up_color_intstack(void)
void up_initialize(void) void up_initialize(void)
{ {
/* Initialize global variables */
CURRENT_REGS = NULL;
/* Colorize the interrupt stack */ /* Colorize the interrupt stack */
up_color_intstack(); arm_color_intstack();
/* Add any extra memory fragments to the memory manager */ /* Add any extra memory fragments to the memory manager */
@@ -136,92 +117,18 @@ void up_initialize(void)
} }
#endif #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 */ /* Initialize the serial device driver */
#ifdef USE_SERIALDRIVER #ifdef USE_SERIALDRIVER
arm_serialinit(); arm_serialinit();
#endif #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 #ifndef CONFIG_NETDEV_LATEINIT
/* Initialize the network */ /* Initialize the network */
arm_netinitialize(); arm_netinitialize();
#endif #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) #if defined(CONFIG_USBDEV) || defined(CONFIG_USBHOST)
/* Initialize USB -- device and/or host */ /* Initialize USB -- device and/or host */
-12
View File
@@ -445,14 +445,6 @@ void arm_serialinit(void);
void arm_earlyserialinit(void); void arm_earlyserialinit(void);
#endif #endif
#ifdef CONFIG_RPMSG_UART
void rpmsg_serialinit(void);
#endif
#ifdef CONFIG_LWL_CONSOLE
void lwlconsole_init(void);
#endif
/* DMA **********************************************************************/ /* DMA **********************************************************************/
#ifdef CONFIG_ARCH_DMA #ifdef CONFIG_ARCH_DMA
@@ -475,10 +467,6 @@ void arm_addregion(void);
# define arm_addregion() # define arm_addregion()
#endif #endif
/* Watchdog timer ***********************************************************/
void arm_wdtinit(void);
/* Networking ***************************************************************/ /* Networking ***************************************************************/
/* Defined in board/xyz_network.c for board-specific Ethernet /* Defined in board/xyz_network.c for board-specific Ethernet
-1
View File
@@ -38,7 +38,6 @@
#include <nuttx/irq.h> #include <nuttx/irq.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include <nuttx/init.h> #include <nuttx/init.h>
#include <nuttx/power/pm.h>
#include <nuttx/fs/ioctl.h> #include <nuttx/fs/ioctl.h>
#include <nuttx/serial/serial.h> #include <nuttx/serial/serial.h>
#include <nuttx/wqueue.h> #include <nuttx/wqueue.h>
+1 -1
View File
@@ -2668,7 +2668,7 @@ int imx_netinitialize(int intf)
} }
/**************************************************************************** /****************************************************************************
* Name: up_netinitialize * Name: arm_netinitialize
* *
* Description: * Description:
* Initialize the first network interface. If there are more than one * Initialize the first network interface. If there are more than one
-22
View File
@@ -54,28 +54,6 @@ extern "C"
#define EXTERN extern #define EXTERN extern
#endif #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 * Function: imx_phy_boardinitialize
* *
-1
View File
@@ -61,7 +61,6 @@
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include <nuttx/semaphore.h> #include <nuttx/semaphore.h>
#include <nuttx/spi/spi.h> #include <nuttx/spi/spi.h>
#include <nuttx/power/pm.h>
#include <arch/board/board.h> #include <arch/board/board.h>
+2 -4
View File
@@ -23,7 +23,8 @@
****************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
#include <nuttx/power/pm.h>
#include "arm_internal.h"
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
@@ -49,7 +50,4 @@
void arm_pminitialize(void) void arm_pminitialize(void)
{ {
/* Then initialize the NuttX power management subsystem proper */
pm_initialize();
} }
@@ -24,8 +24,6 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <nuttx/power/pm.h>
#include "arm_internal.h" #include "arm_internal.h"
#ifdef CONFIG_PM #ifdef CONFIG_PM
@@ -54,9 +52,6 @@
void arm_pminitialize(void) void arm_pminitialize(void)
{ {
/* Then initialize the NuttX power management subsystem proper */
pm_initialize();
} }
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
-5
View File
@@ -24,8 +24,6 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <nuttx/power/pm.h>
#include "arm_internal.h" #include "arm_internal.h"
#include "stm32_pm.h" #include "stm32_pm.h"
@@ -55,9 +53,6 @@
void arm_pminitialize(void) void arm_pminitialize(void)
{ {
/* Then initialize the NuttX power management subsystem proper */
pm_initialize();
} }
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
@@ -24,8 +24,6 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <nuttx/power/pm.h>
#include "arm_internal.h" #include "arm_internal.h"
#include "stm32_pm.h" #include "stm32_pm.h"
@@ -55,9 +53,6 @@
void arm_pminitialize(void) void arm_pminitialize(void)
{ {
/* Then initialize the NuttX power management subsystem proper */
pm_initialize();
} }
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
@@ -24,8 +24,6 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <nuttx/power/pm.h>
#include "arm_internal.h" #include "arm_internal.h"
#include "stm32_pm.h" #include "stm32_pm.h"
@@ -55,9 +53,6 @@
void arm_pminitialize(void) void arm_pminitialize(void)
{ {
/* Then initialize the NuttX power management subsystem proper */
pm_initialize();
} }
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
@@ -24,8 +24,6 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <nuttx/power/pm.h>
#include "arm_internal.h" #include "arm_internal.h"
#include "stm32l4_pm.h" #include "stm32l4_pm.h"
@@ -55,9 +53,6 @@
void arm_pminitialize(void) void arm_pminitialize(void)
{ {
/* Then initialize the NuttX power management subsystem proper */
pm_initialize();
} }
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
+1 -91
View File
@@ -22,22 +22,8 @@
* Included Files * Included Files
****************************************************************************/ ****************************************************************************/
#include <nuttx/config.h>
#include <debug.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include <nuttx/drivers/drivers.h> #include <nuttx/board.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/board/board.h>
#include "up_arch.h" #include "up_arch.h"
@@ -129,10 +115,6 @@ static inline void up_color_intstack(void)
void up_initialize(void) void up_initialize(void)
{ {
/* Initialize global variables */
g_current_regs = NULL;
/* Colorize the interrupt stack */ /* Colorize the interrupt stack */
up_color_intstack(); up_color_intstack();
@@ -164,90 +146,18 @@ void up_initialize(void)
} }
#endif #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 */ /* Initialize the serial device driver */
#ifdef USE_SERIALDRIVER #ifdef USE_SERIALDRIVER
up_serialinit(); up_serialinit();
#endif #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 #ifndef CONFIG_NETDEV_LATEINIT
/* Initialize the network */ /* Initialize the network */
up_netinitialize(); up_netinitialize();
#endif #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 */ /* Initialize USB */
up_usbinitialize(); up_usbinitialize();
-4
View File
@@ -140,10 +140,6 @@ void up_earlyserialinit(void);
void up_serialinit(void); void up_serialinit(void);
#endif #endif
#ifdef CONFIG_RPMSG_UART
void rpmsg_serialinit(void);
#endif
/* Defined in chip/xxx_ethernet.c */ /* Defined in chip/xxx_ethernet.c */
#if defined(CONFIG_NET) && !defined(CONFIG_NETDEV_LATEINIT) #if defined(CONFIG_NET) && !defined(CONFIG_NETDEV_LATEINIT)
-3
View File
@@ -163,8 +163,5 @@ void weak_function up_cpu_normal(void)
#ifdef CONFIG_PM #ifdef CONFIG_PM
void up_pminitialize(void) void up_pminitialize(void)
{ {
/* Then initialize the power management subsystem proper */
pm_initialize();
} }
#endif #endif
-99
View File
@@ -22,30 +22,10 @@
* Included Files * Included Files
****************************************************************************/ ****************************************************************************/
#include <nuttx/config.h>
#include <debug.h>
#include <nuttx/arch.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_arch.h"
#include "up_internal.h" #include "up_internal.h"
#include "chip.h"
/**************************************************************************** /****************************************************************************
* Private Functions * Private Functions
@@ -96,10 +76,6 @@ static inline void up_color_intstack(void)
void up_initialize(void) void up_initialize(void)
{ {
/* Initialize global variables */
CURRENT_REGS = NULL;
/* Colorize the interrupt stack */ /* Colorize the interrupt stack */
up_color_intstack(); up_color_intstack();
@@ -126,93 +102,18 @@ void up_initialize(void)
up_dma_initialize(); up_dma_initialize();
#endif #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 */ /* Initialize the serial device driver */
#ifdef USE_SERIALDRIVER #ifdef USE_SERIALDRIVER
up_serialinit(); up_serialinit();
#endif #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 #ifndef CONFIG_NETDEV_LATEINIT
/* Initialize the network */ /* Initialize the network */
up_netinitialize(); up_netinitialize();
#endif #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) #if defined(CONFIG_USBDEV) || defined(CONFIG_USBHOST)
/* Initialize USB -- device and/or host */ /* Initialize USB -- device and/or host */
-24
View File
@@ -248,8 +248,6 @@ void up_cpu_normal(void);
/* Interrupt handling *******************************************************/ /* Interrupt handling *******************************************************/
void up_irqinitialize(void);
/* Interrupt acknowledge and dispatch */ /* Interrupt acknowledge and dispatch */
uint32_t *up_doirq(int irq, uint32_t *regs); 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); void up_svcall_handler(void);
/* System timer *************************************************************/
void up_timer_initialize(void);
/* Low level serial output **************************************************/ /* Low level serial output **************************************************/
#ifdef USE_SERIALDRIVER #ifdef USE_SERIALDRIVER
@@ -279,20 +273,6 @@ void up_earlyserialinit(void);
# define up_earlyserialinit() # define up_earlyserialinit()
#endif #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 **********************************************************************/ /* DMA **********************************************************************/
#ifdef CONFIG_ARCH_DMA #ifdef CONFIG_ARCH_DMA
@@ -307,10 +287,6 @@ void up_addregion(void);
# define up_addregion() # define up_addregion()
#endif #endif
/* Watchdog timer ***********************************************************/
void up_wdtinit(void);
/* Networking ***************************************************************/ /* Networking ***************************************************************/
#if defined(CONFIG_NET) && !defined(CONFIG_NETDEV_LATEINIT) #if defined(CONFIG_NET) && !defined(CONFIG_NETDEV_LATEINIT)
+1 -91
View File
@@ -22,22 +22,9 @@
* Included Files * Included Files
****************************************************************************/ ****************************************************************************/
#include <nuttx/config.h>
#include <debug.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include <nuttx/board.h> #include <nuttx/board.h>
#include <nuttx/drivers/drivers.h> #include <arch/board/board.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 "up_arch.h" #include "up_arch.h"
#include "up_internal.h" #include "up_internal.h"
@@ -65,10 +52,6 @@
void up_initialize(void) void up_initialize(void)
{ {
/* Initialize global variables */
g_current_regs = NULL;
/* Add any extra memory fragments to the memory manager */ /* Add any extra memory fragments to the memory manager */
up_addregion(); up_addregion();
@@ -96,93 +79,20 @@ void up_initialize(void)
} }
#endif #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 */ /* Initialize the serial device driver */
#ifdef USE_SERIALDRIVER #ifdef USE_SERIALDRIVER
up_serialinit(); up_serialinit();
#endif #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 #ifndef CONFIG_NETDEV_LATEINIT
/* Initialize the network */ /* Initialize the network */
up_netinitialize(); up_netinitialize();
#endif #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 */ /* Initialize USB */
up_usbinitialize(); up_usbinitialize();
board_autoled_on(LED_IRQSENABLED); board_autoled_on(LED_IRQSENABLED);
} }
-6
View File
@@ -157,10 +157,6 @@ void up_earlyserialinit(void);
void up_serialinit(void); void up_serialinit(void);
#endif #endif
#ifdef CONFIG_RPMSG_UART
void rpmsg_serialinit(void);
#endif
void up_lowputc(char ch); void up_lowputc(char ch);
void up_lowputs(const char *str); void up_lowputs(const char *str);
@@ -178,8 +174,6 @@ void up_addregion(void);
void weak_function up_dma_initialize(void); void weak_function up_dma_initialize(void);
#endif #endif
void up_wdtinit(void);
#if defined(CONFIG_NET) && !defined(CONFIG_NETDEV_LATEINIT) #if defined(CONFIG_NET) && !defined(CONFIG_NETDEV_LATEINIT)
void up_netinitialize(void); void up_netinitialize(void);
#else #else
-91
View File
@@ -22,23 +22,8 @@
* Included Files * Included Files
****************************************************************************/ ****************************************************************************/
#include <nuttx/config.h>
#include <debug.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include <nuttx/board.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/board/board.h>
#include "mips_arch.h" #include "mips_arch.h"
@@ -67,10 +52,6 @@
void up_initialize(void) void up_initialize(void)
{ {
/* Initialize global variables */
CURRENT_REGS = NULL;
/* Add any extra memory fragments to the memory manager */ /* Add any extra memory fragments to the memory manager */
up_addregion(); up_addregion();
@@ -98,90 +79,18 @@ void up_initialize(void)
} }
#endif #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 */ /* Initialize the serial device driver */
#ifdef USE_SERIALDRIVER #ifdef USE_SERIALDRIVER
up_serialinit(); up_serialinit();
#endif #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 #ifndef CONFIG_NETDEV_LATEINIT
/* Initialize the network */ /* Initialize the network */
up_netinitialize(); up_netinitialize();
#endif #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 */ /* Initialize USB -- device and/or host */
up_usbinitialize(); up_usbinitialize();
-4
View File
@@ -244,10 +244,6 @@ void up_earlyserialinit(void);
void up_serialinit(void); void up_serialinit(void);
#endif #endif
#ifdef CONFIG_RPMSG_UART
void rpmsg_serialinit(void);
#endif
/* Network */ /* Network */
#if defined(CONFIG_NET) && !defined(CONFIG_NETDEV_LATEINIT) #if defined(CONFIG_NET) && !defined(CONFIG_NETDEV_LATEINIT)
-18
View File
@@ -104,12 +104,6 @@ extern uint32_t g_idle_topstack;
void lm32_board_initialize(void); void lm32_board_initialize(void);
/* Memory allocation ********************************************************/
#if CONFIG_MM_REGIONS > 1
void lm32_add_region(void);
#endif
/* Context switching ********************************************************/ /* Context switching ********************************************************/
void lm32_copystate(uint32_t *dest, uint32_t *src); 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); 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 **********************************************************/ /* Signal handling **********************************************************/
void lm32_sigdeliver(void); void lm32_sigdeliver(void);
-16
View File
@@ -70,19 +70,3 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
*heap_start = (FAR void *)g_idle_topstack; *heap_start = (FAR void *)g_idle_topstack;
*heap_size = CONFIG_RAM_END - 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
-21
View File
@@ -22,26 +22,9 @@
* Included Files * Included Files
****************************************************************************/ ****************************************************************************/
#include <nuttx/config.h>
#include <debug.h>
#include <nuttx/arch.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 "misoc.h"
#include "lm32.h"
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
@@ -53,10 +36,6 @@ void up_initialize(void)
misoc_serial_initialize(); misoc_serial_initialize();
#ifdef CONFIG_RPMSG_UART
rpmsg_serialinit();
#endif
#if 0 /* REVISIT */ #if 0 /* REVISIT */
/* Initialize the network cores */ /* Initialize the network cores */
-18
View File
@@ -104,12 +104,6 @@ extern uint32_t g_idle_topstack;
void minerva_board_initialize(void); void minerva_board_initialize(void);
/* Memory allocation ********************************************************/
#if CONFIG_MM_REGIONS > 1
void minerva_add_region(void);
#endif
/* Context switching ********************************************************/ /* Context switching ********************************************************/
void minerva_copystate(uint32_t * dest, uint32_t * src); 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); 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 **********************************************************/ /* Signal handling **********************************************************/
void minerva_sigdeliver(void); void minerva_sigdeliver(void);
@@ -58,19 +58,3 @@ void up_allocate_heap(FAR void **heap_start, size_t * heap_size)
*heap_start = (FAR void *)g_idle_topstack; *heap_start = (FAR void *)g_idle_topstack;
*heap_size = CONFIG_RAM_END - 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
@@ -22,26 +22,9 @@
* Included Files * Included Files
****************************************************************************/ ****************************************************************************/
#include <nuttx/config.h>
#include <debug.h>
#include <nuttx/arch.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 "misoc.h"
#include "minerva.h"
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
@@ -53,10 +36,6 @@ void up_initialize(void)
misoc_serial_initialize(); misoc_serial_initialize();
#ifdef CONFIG_RPMSG_UART
rpmsg_serialinit();
#endif
/* Initialize the network cores */ /* Initialize the network cores */
#ifdef CONFIG_MISOC_ETHERNET #ifdef CONFIG_MISOC_ETHERNET
-92
View File
@@ -22,28 +22,12 @@
* Included Files * Included Files
****************************************************************************/ ****************************************************************************/
#include <nuttx/config.h>
#include <debug.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include <nuttx/board.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/board/board.h>
#include <arch/spr.h> #include <arch/spr.h>
#include "up_arch.h"
#include "up_internal.h" #include "up_internal.h"
/**************************************************************************** /****************************************************************************
@@ -157,10 +141,6 @@ static inline void up_color_intstack(void)
void up_initialize(void) void up_initialize(void)
{ {
/* Initialize global variables */
CURRENT_REGS = NULL;
/* Colorize the interrupt stack */ /* Colorize the interrupt stack */
up_color_intstack(); up_color_intstack();
@@ -192,92 +172,20 @@ void up_initialize(void)
} }
#endif #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 */ /* Initialize the serial device driver */
up_serialinit(); 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 */ /* Print OpenRISC CPU information */
or1k_print_cpuinfo(); 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 #ifndef CONFIG_NETDEV_LATEINIT
/* Initialize the network */ /* Initialize the network */
up_netinitialize(); up_netinitialize();
#endif #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 */ /* Initialize USB -- device and/or host */
up_usbinitialize(); up_usbinitialize();
-8
View File
@@ -279,10 +279,6 @@ void up_serialinit(void);
void up_earlyserialinit(void); void up_earlyserialinit(void);
#endif #endif
#ifdef CONFIG_RPMSG_UART
void rpmsg_serialinit(void);
#endif
/* DMA **********************************************************************/ /* DMA **********************************************************************/
#ifdef CONFIG_ARCH_DMA #ifdef CONFIG_ARCH_DMA
@@ -305,10 +301,6 @@ void up_addregion(void);
# define up_addregion() # define up_addregion()
#endif #endif
/* Watchdog timer ***********************************************************/
void up_wdtinit(void);
/* Networking ***************************************************************/ /* Networking ***************************************************************/
/* Defined in board/xyz_network.c for board-specific Ethernet /* Defined in board/xyz_network.c for board-specific Ethernet
+1 -95
View File
@@ -22,22 +22,9 @@
* Included Files * Included Files
****************************************************************************/ ****************************************************************************/
#include <nuttx/config.h>
#include <debug.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include <nuttx/board.h> #include <nuttx/board.h>
#include <nuttx/drivers/drivers.h> #include <arch/board/board.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 "up_arch.h" #include "up_arch.h"
#include "up_internal.h" #include "up_internal.h"
@@ -65,10 +52,6 @@
void up_initialize(void) void up_initialize(void)
{ {
/* Initialize global variables */
g_current_regs = NULL;
#ifdef CONFIG_PM #ifdef CONFIG_PM
/* Initialize the power management subsystem. This MCU-specific function /* Initialize the power management subsystem. This MCU-specific function
* must be called *very* early in the initialization sequence *before* any * must be called *very* early in the initialization sequence *before* any
@@ -79,97 +62,20 @@ void up_initialize(void)
up_pminitialize(); up_pminitialize();
#endif #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 */ /* Initialize the serial device driver */
#ifdef USE_SERIALDRIVER #ifdef USE_SERIALDRIVER
up_serialinit(); up_serialinit();
#endif #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 #ifndef CONFIG_NETDEV_LATEINIT
/* Initialize the network */ /* Initialize the network */
up_netinitialize(); up_netinitialize();
#endif #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 */ /* Initialize USB */
up_usbinitialize(); up_usbinitialize();
board_autoled_on(LED_IRQSENABLED); board_autoled_on(LED_IRQSENABLED);
} }
-8
View File
@@ -164,14 +164,6 @@ void up_consoleinit(void);
void up_serialinit(void); void up_serialinit(void);
#endif #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 */ /* Defined in board/xyz_lcd.c */
#ifdef CONFIG_SLCD_CONSOLE #ifdef CONFIG_SLCD_CONSOLE
-63
View File
@@ -22,21 +22,10 @@
* Included Files * Included Files
****************************************************************************/ ****************************************************************************/
#include <nuttx/config.h>
#include <debug.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include <nuttx/board.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 <arch/board/board.h>
#include "sched/sched.h"
#include "riscv_arch.h" #include "riscv_arch.h"
#include "riscv_internal.h" #include "riscv_internal.h"
@@ -111,63 +100,11 @@ void up_initialize(void)
riscv_pminitialize(); riscv_pminitialize();
#endif #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 */ /* Initialize the serial device driver */
#ifdef USE_SERIALDRIVER #ifdef USE_SERIALDRIVER
riscv_serialinit(); riscv_serialinit();
#endif #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); board_autoled_on(LED_IRQSENABLED);
} }
-4
View File
@@ -225,10 +225,6 @@ void riscv_serialinit(void);
void riscv_earlyserialinit(void); void riscv_earlyserialinit(void);
#endif #endif
#ifdef CONFIG_RPMSG_UART
void rpmsg_serialinit(void);
#endif
/* Exception Handler ********************************************************/ /* Exception Handler ********************************************************/
void riscv_fault(int irq, uintptr_t *regs); void riscv_fault(int irq, uintptr_t *regs);
-6
View File
@@ -41,12 +41,6 @@
#define ESP32C3_INT_PRIO_DEF 1 #define ESP32C3_INT_PRIO_DEF 1
/****************************************************************************
* Name: up_irqinitialize
****************************************************************************/
void up_irqinitialize(void);
/**************************************************************************** /****************************************************************************
* Name: esp32c3_bind_irq * Name: esp32c3_bind_irq
* *
@@ -23,7 +23,6 @@
****************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
#include <nuttx/power/pm.h>
#include "esp32c3_pm.h" #include "esp32c3_pm.h"
@@ -43,9 +42,6 @@
void riscv_pminitialize(void) void riscv_pminitialize(void)
{ {
/* Then initialize the NuttX power management subsystem proper */
pm_initialize();
} }
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
-1
View File
@@ -36,7 +36,6 @@
#include <nuttx/irq.h> #include <nuttx/irq.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include <nuttx/serial/serial.h> #include <nuttx/serial/serial.h>
#include <nuttx/power/pm.h>
#ifdef CONFIG_SERIAL_TERMIOS #ifdef CONFIG_SERIAL_TERMIOS
# include <termios.h> # include <termios.h>
+3 -109
View File
@@ -22,30 +22,13 @@
* Included Files * Included Files
****************************************************************************/ ****************************************************************************/
#include <nuttx/config.h>
#include <assert.h>
#include <debug.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include <nuttx/audio/audio.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/kthread.h>
#include <nuttx/motor/foc/foc_dummy.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/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/spi_flash.h>
#include <nuttx/spi/qspi_flash.h> #include <nuttx/spi/qspi_flash.h>
#include <nuttx/crypto/crypto.h>
#include <nuttx/power/pm.h>
#include "up_internal.h" #include "up_internal.h"
@@ -206,19 +189,6 @@ static int up_loop_task(int argc, FAR char **argv)
return 0; 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 * Public Functions
****************************************************************************/ ****************************************************************************/
@@ -245,70 +215,10 @@ static void up_loop_init(void)
void up_initialize(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 */ /* Register some tty-port to access tty-port on sim platform */
up_uartinit(); 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) #if defined(CONFIG_FS_FAT) && !defined(CONFIG_DISABLE_MOUNTPOINT)
up_registerblockdevice(); /* Our FAT ramdisk at /dev/ram0 */ up_registerblockdevice(); /* Our FAT ramdisk at /dev/ram0 */
#endif #endif
@@ -323,24 +233,6 @@ void up_initialize(void)
usrsock_init(); usrsock_init();
#endif #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) && \ #if defined(CONFIG_FS_SMARTFS) && defined(CONFIG_MTD_SMART) && \
(defined(CONFIG_SPI_FLASH) || defined(CONFIG_QSPI_FLASH)) (defined(CONFIG_SPI_FLASH) || defined(CONFIG_QSPI_FLASH))
up_init_smartfs(); up_init_smartfs();
@@ -351,5 +243,7 @@ void up_initialize(void)
audio_register("pcm0c", sim_audio_initialize(false)); audio_register("pcm0c", sim_audio_initialize(false));
#endif #endif
up_loop_init(); kthread_create("loop_task", SCHED_PRIORITY_MIN,
CONFIG_DEFAULT_TASK_STACKSIZE,
up_loop_task, NULL);
} }
-6
View File
@@ -189,12 +189,6 @@ int up_init_ipi(int irq);
void up_timer_update(void); void up_timer_update(void);
#endif #endif
/* rpmsg_serialinit *********************************************************/
#ifdef CONFIG_RPMSG_UART
void rpmsg_serialinit(void);
#endif
/* up_uart.c ****************************************************************/ /* up_uart.c ****************************************************************/
void up_uartinit(void); void up_uartinit(void);
+1 -121
View File
@@ -22,23 +22,8 @@
* Included Files * Included Files
****************************************************************************/ ****************************************************************************/
#include <nuttx/config.h>
#include <debug.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include <nuttx/sched_note.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/syslog/syslog_console.h>
#include <nuttx/serial/pty.h>
#include <nuttx/crypto/crypto.h>
#include <arch/board/board.h> #include <arch/board/board.h>
#include "up_arch.h" #include "up_arch.h"
@@ -140,10 +125,6 @@ static inline void up_color_intstack(void)
void up_initialize(void) void up_initialize(void)
{ {
/* Initialize global variables */
g_current_regs = NULL;
/* Colorize the interrupt stack */ /* Colorize the interrupt stack */
up_color_intstack(); up_color_intstack();
@@ -152,10 +133,6 @@ void up_initialize(void)
up_addregion(); up_addregion();
/* Initialize the interrupt subsystem */
up_irqinitialize();
#ifdef CONFIG_ARCH_DMA #ifdef CONFIG_ARCH_DMA
/* Initialize the DMA subsystem if the weak function up_dma_initialize has /* Initialize the DMA subsystem if the weak function up_dma_initialize has
* been brought into the build * been brought into the build
@@ -169,109 +146,12 @@ void up_initialize(void)
} }
#endif #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 */ /* Initialize the serial device driver */
#ifdef USE_SERIALDRIVER #ifdef USE_SERIALDRIVER
up_serialinit(); up_serialinit();
#endif #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 */ /* Initialize USB */
up_usbinitialize(); up_usbinitialize();
-11
View File
@@ -183,14 +183,6 @@ void up_copystate(uint32_t *dest, uint32_t *src);
void up_lowputs(const char *str); 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 */ /* Debug */
#ifdef CONFIG_ARCH_STACKDUMP #ifdef CONFIG_ARCH_STACKDUMP
@@ -217,7 +209,6 @@ void up_sigdeliver(void);
/* IRQs */ /* IRQs */
void up_irqinitialize(void);
bool up_pending_irq(int irq); bool up_pending_irq(int irq);
void up_clrpend_irq(int irq); void up_clrpend_irq(int irq);
@@ -241,8 +232,6 @@ void up_lowputc(char ch);
void up_earlyserialinit(void); void up_earlyserialinit(void);
void up_serialinit(void); void up_serialinit(void);
void rpmsg_serialinit(void);
/* Network */ /* Network */
#if defined(CONFIG_NET) && !defined(CONFIG_NETDEV_LATEINIT) #if defined(CONFIG_NET) && !defined(CONFIG_NETDEV_LATEINIT)
-91
View File
@@ -22,23 +22,8 @@
* Included Files * Included Files
****************************************************************************/ ****************************************************************************/
#include <nuttx/config.h>
#include <debug.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include <nuttx/board.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/board/board.h>
#include "up_arch.h" #include "up_arch.h"
@@ -67,10 +52,6 @@
void up_initialize(void) void up_initialize(void)
{ {
/* Initialize global variables */
g_current_regs = NULL;
/* Add any extra memory fragments to the memory manager */ /* Add any extra memory fragments to the memory manager */
up_addregion(); up_addregion();
@@ -98,90 +79,18 @@ void up_initialize(void)
} }
#endif #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 */ /* Initialize the serial device driver */
#ifdef USE_SERIALDRIVER #ifdef USE_SERIALDRIVER
up_serialinit(); up_serialinit();
#endif #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 #ifndef CONFIG_NETDEV_LATEINIT
/* Initialize the network */ /* Initialize the network */
up_netinitialize(); up_netinitialize();
#endif #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 */ /* Initialize USB -- device and/or host */
up_usbinitialize(); up_usbinitialize();
-8
View File
@@ -201,14 +201,6 @@ void up_earlyserialinit(void);
void up_serialinit(void); void up_serialinit(void);
#endif #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 */ /* Defined in board/up_network.c */
#if defined(CONFIG_NET) && !defined(CONFIG_NETDEV_LATEINIT) #if defined(CONFIG_NET) && !defined(CONFIG_NETDEV_LATEINIT)
-94
View File
@@ -22,28 +22,10 @@
* Included Files * Included Files
****************************************************************************/ ****************************************************************************/
#include <nuttx/config.h>
#include <debug.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include <nuttx/board.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 <arch/board/board.h>
#include "sched/sched.h"
#include "up_arch.h" #include "up_arch.h"
#include "up_internal.h" #include "up_internal.h"
@@ -101,10 +83,6 @@ static void up_calibratedelay(void)
void up_initialize(void) void up_initialize(void)
{ {
/* Initialize global variables */
g_current_regs = NULL;
/* Add any extra memory fragments to the memory manager */ /* Add any extra memory fragments to the memory manager */
up_addregion(); up_addregion();
@@ -132,90 +110,18 @@ void up_initialize(void)
} }
#endif #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 */ /* Initialize the serial device driver */
#ifdef USE_SERIALDRIVER #ifdef USE_SERIALDRIVER
up_serialinit(); up_serialinit();
#endif #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 #ifndef CONFIG_NETDEV_LATEINIT
/* Initialize the network */ /* Initialize the network */
up_netinitialize(); up_netinitialize();
#endif #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 */ /* Initialize USB -- device and/or host */
up_usbinitialize(); up_usbinitialize();
-5
View File
@@ -189,7 +189,6 @@ void x86_64_boardinitialize(void);
void up_copystate(uint64_t *dest, uint64_t *src); void up_copystate(uint64_t *dest, uint64_t *src);
void up_savestate(uint64_t *regs); void up_savestate(uint64_t *regs);
void up_decodeirq(uint64_t *regs); void up_decodeirq(uint64_t *regs);
void up_irqinitialize(void);
#ifdef CONFIG_ARCH_DMA #ifdef CONFIG_ARCH_DMA
void weak_function up_dmainitialize(void); void weak_function up_dmainitialize(void);
#endif #endif
@@ -218,10 +217,6 @@ void up_addregion(void);
void up_earlyserialinit(void); void up_earlyserialinit(void);
void up_serialinit(void); void up_serialinit(void);
/* Defined in xyz_watchdog.c */
void up_wdtinit(void);
/* Defined in xyz_timerisr.c */ /* Defined in xyz_timerisr.c */
void x86_64_timer_calibrate_freq(void); void x86_64_timer_calibrate_freq(void);
-2
View File
@@ -320,8 +320,6 @@ void up_lowputc(char ch);
void xtensa_earlyserialinit(void); void xtensa_earlyserialinit(void);
void xtensa_serialinit(void); void xtensa_serialinit(void);
void rpmsg_serialinit(void);
/* Network */ /* Network */
#if defined(CONFIG_NET) && !defined(CONFIG_NETDEV_LATEINIT) #if defined(CONFIG_NET) && !defined(CONFIG_NETDEV_LATEINIT)
@@ -22,23 +22,8 @@
* Included Files * Included Files
****************************************************************************/ ****************************************************************************/
#include <nuttx/config.h>
#include <debug.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include <nuttx/board.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/board/board.h>
#include "xtensa.h" #include "xtensa.h"
@@ -99,17 +84,8 @@ static inline void xtensa_color_intstack(void)
void up_initialize(void) void up_initialize(void)
{ {
int i;
xtensa_color_intstack(); 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 */ /* Add any extra memory fragments to the memory manager */
xtensa_add_region(); xtensa_add_region();
@@ -143,90 +119,18 @@ void up_initialize(void)
} }
#endif #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 */ /* Initialize the serial device driver */
#ifdef USE_SERIALDRIVER #ifdef USE_SERIALDRIVER
xtensa_serialinit(); xtensa_serialinit();
#endif #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 #ifndef CONFIG_NETDEV_LATEINIT
/* Initialize the network */ /* Initialize the network */
up_netinitialize(); up_netinitialize();
#endif #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 */ /* Initialize USB -- device and/or host */
up_usbinitialize(); up_usbinitialize();
+1 -5
View File
@@ -23,8 +23,8 @@
****************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
#include <nuttx/power/pm.h>
#include "xtensa.h"
#include "esp32_pm.h" #include "esp32_pm.h"
#ifdef CONFIG_PM #ifdef CONFIG_PM
@@ -46,10 +46,6 @@ void xtensa_pminitialize(void)
/* Initialize RTC parameters */ /* Initialize RTC parameters */
esp32_pminit(); esp32_pminit();
/* Then initialize the NuttX power management subsystem proper */
pm_initialize();
} }
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
-91
View File
@@ -22,23 +22,8 @@
* Included Files * Included Files
****************************************************************************/ ****************************************************************************/
#include <nuttx/config.h>
#include <debug.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include <nuttx/board.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/board/board.h>
#include "z16_arch.h" #include "z16_arch.h"
@@ -78,10 +63,6 @@ volatile FAR chipreg_t *g_current_regs;
void up_initialize(void) void up_initialize(void)
{ {
/* Initialize global variables */
g_current_regs = NULL;
#if CONFIG_MM_REGIONS > 1 #if CONFIG_MM_REGIONS > 1
/* Add any extra memory fragments to the memory manager */ /* Add any extra memory fragments to the memory manager */
@@ -98,89 +79,17 @@ void up_initialize(void)
up_pminitialize(); up_pminitialize();
#endif #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 */ /* Initialize the serial device driver */
#ifdef USE_SERIALDRIVER #ifdef USE_SERIALDRIVER
z16_serialinit(); z16_serialinit();
#endif #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 #ifndef CONFIG_NETDEV_LATEINIT
/* Initialize the network */ /* Initialize the network */
z16_netinitialize(); z16_netinitialize();
#endif #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); board_autoled_on(LED_IRQSENABLED);
} }
-4
View File
@@ -148,10 +148,6 @@ void z16_serialinit(void);
void z16_earlyserialinit(void); void z16_earlyserialinit(void);
#endif #endif
#ifdef CONFIG_RPMSG_UART
void rpmsg_serialinit(void);
#endif
/* Defined in xyz_irq.c */ /* Defined in xyz_irq.c */
void z16_ack_irq(int irq); void z16_ack_irq(int irq);
-88
View File
@@ -22,24 +22,8 @@
* Included Files * Included Files
****************************************************************************/ ****************************************************************************/
#include <nuttx/config.h>
#include <debug.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include <nuttx/board.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 <arch/board/board.h>
#include "chip/switch.h" #include "chip/switch.h"
@@ -97,89 +81,17 @@ void up_initialize(void)
z80_mmu_initialize(); z80_mmu_initialize();
#endif #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 */ /* Initialize the serial device driver */
#ifdef USE_SERIALDRIVER #ifdef USE_SERIALDRIVER
z80_serial_initialize(); z80_serial_initialize();
#endif #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 #ifndef CONFIG_NETDEV_LATEINIT
/* Initialize the network */ /* Initialize the network */
up_netinitialize(); up_netinitialize();
#endif #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); board_autoled_on(LED_IRQSENABLED);
} }

Some files were not shown because too many files have changed in this diff Show More