void up_initialize(void) { /* Initialize global variables */ INIT_IRQCONTEXT(); /* Calibrate the timing loop */ up_calibratedelay(); /* Add extra memory fragments to the memory manager */ #if CONFIG_MM_REGIONS > 1 up_addregion(); #endif /* Initialize the interrupt subsystem */ up_irqinitialize(); /* Initialize the system timer interrupt */ #if !defined(CONFIG_SUPPRESS_INTERRUPTS) && !defined(CONFIG_SUPPRESS_TIMER_INTS) up_timerinit(); #endif /* Register devices */ #if CONFIG_NFILE_DESCRIPTORS > 0 devnull_register(); /* Standard /dev/null */ #endif /* Initialize the serial device driver */ #ifdef USE_LOWUARTINIT up_lowuartinit(); #endif /* Initialize the console device driver */ #if defined(USE_SERIALDRIVER) up_serialinit(); #elif defined(CONFIG_DEV_LOWCONSOLE) lowconsole_init(); #elif defined(CONFIG_RAMLOG_CONSOLE) ramlog_consoleinit(); #endif /* Initialize the netwok */ up_netinitialize(); up_ledon(LED_IRQSENABLED); }
void up_initialize(void) { /* Initialize global variables */ INIT_IRQCONTEXT(); /* Calibrate the timing loop */ up_calibratedelay(); #if CONFIG_MM_REGIONS > 1 /* Add any extra memory fragments to the memory manager */ up_addregion(); #endif /* Initialize the interrupt subsystem */ up_irqinitialize(); #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 #if !defined(CONFIG_SUPPRESS_INTERRUPTS) && !defined(CONFIG_SUPPRESS_TIMER_INTS) /* Initialize the system timer interrupt */ z80_timer_initialize(); #endif /* Initialize the CPU for those that use it (only for the Z180). This * needs to be done before any tasks are created). */ #ifdef CONFIG_ARCH_ADDRENV (void)up_mmuinit(); #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 /* Initialize the serial device driver */ #ifdef USE_SERIALDRIVER up_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 #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 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 #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 board_autoled_on(LED_IRQSENABLED); }