void up_initialize(void)
{
  /* The real purpose of the following is to make sure that syslog
   * is drawn into the link.  It is needed by up_tapdev which is linked
   * separately.
   */

#ifdef CONFIG_NET
  syslog(LOG_INFO, "SIM: Initializing");
#endif

#if CONFIG_NFILE_DESCRIPTORS > 0
  /* Register devices */

#if defined(CONFIG_DEV_NULL)
  devnull_register();   /* Standard /dev/null */
#endif

#if defined(CONFIG_DEV_ZERO)
  devzero_register();   /* Standard /dev/zero */
#endif

#endif /* CONFIG_NFILE_DESCRIPTORS */

#if defined(USE_DEVCONSOLE)
  /* Start the sumulated UART device */

  simuart_start();

  /* Register a console (or not) */

  up_devconsole();          /* Our private /dev/console */
#elif defined(CONFIG_SYSLOG_CONSOLE)
  syslog_console_init();
#elif defined(CONFIG_RAMLOG_CONSOLE)
  ramlog_consoleinit();
#endif

#ifdef CONFIG_SYSLOG_CHAR
  syslog_initialize();
#endif
#ifdef CONFIG_RAMLOG_SYSLOG
  ramlog_sysloginit();      /* System logging device */
#endif

#if defined(CONFIG_FS_FAT) && !defined(CONFIG_DISABLE_MOUNTPOINT)
  up_registerblockdevice(); /* Our FAT ramdisk at /dev/ram0 */
#endif

#ifdef CONFIG_NET_ETHERNET
  netdriver_init();         /* Our "real" network driver */
#endif

#if defined(CONFIG_FS_SMARTFS) && defined(CONFIG_SIM_SPIFLASH)
  up_init_smartfs();
#endif
}
Exemple #2
0
void up_initialize(void)
{
#ifdef CONFIG_NET
  /* The real purpose of the following is to make sure that syslog
   * is drawn into the link.  It is needed by up_tapdev which is linked
   * separately.
   */

  syslog(LOG_INFO, "SIM: Initializing\n");
#endif

#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).
   */

  up_pminitialize();
#endif

#ifdef CONFIG_MM_IOB
  /* Initialize IO buffering */

  iob_initialize();
#endif

#if CONFIG_NFILE_DESCRIPTORS > 0
  /* 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
#endif /* CONFIG_NFILE_DESCRIPTORS */

#if defined(CONFIG_SCHED_INSTRUMENTATION_BUFFER) && \
    defined(CONFIG_DRIVER_NOTE)
  note_register();          /* Non-standard /dev/note */
#endif

#if defined(USE_DEVCONSOLE)
  /* Start the sumulated UART device */

  simuart_start();

  /* Register a console (or not) */

  up_devconsole();          /* Our private /dev/console */
#elif defined(CONFIG_CONSOLE_SYSLOG)
  syslog_console_init();
#elif defined(CONFIG_RAMLOG_CONSOLE)
  ramlog_consoleinit();
#endif

#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_PSEUDOTERM_SUSV1)
  /* Register the master pseudo-terminal multiplexor device */

  (void)ptmx_register();
#endif

  /* Early initialization of the system logging device.  Some SYSLOG channel
   * can be initialized early in the initialization sequence because they
   * depend on only minimal OS initialization.
   */

  syslog_initialize(SYSLOG_INIT_EARLY);

#if defined(CONFIG_CRYPTO)
  /* Initialize the HW crypto and /dev/crypto */

  up_cryptoinitialize();
#endif

#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_CRYPTO_CRYPTODEV)
  devcrypto_register();
#endif

#if defined(CONFIG_FS_FAT) && !defined(CONFIG_DISABLE_MOUNTPOINT)
  up_registerblockdevice(); /* Our FAT ramdisk at /dev/ram0 */
#endif

#if defined(CONFIG_NET_ETHERNET) && defined(CONFIG_SIM_NETDEV)
  netdriver_init();         /* Our "real" network driver */
#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

#if defined(CONFIG_FS_SMARTFS) && (defined(CONFIG_SIM_SPIFLASH) || defined(CONFIG_SIM_QSPIFLASH))
  up_init_smartfs();
#endif
}