1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

cpu: call early_init()

This commit is contained in:
Benjamin Valentin 2023-01-02 18:08:35 +01:00
parent 092b235845
commit 124b849503
27 changed files with 49 additions and 26 deletions

View File

@ -21,6 +21,7 @@
#include <stdio.h>
#include <avr/io.h>
#include "kernel_init.h"
#include "stdio_uart.h"
static int _uart_putchar(char c, FILE *stream);
@ -45,7 +46,7 @@ static int _uart_getchar(FILE *stream)
void avr8_stdio_init(void)
{
stdio_init();
early_init();
stdout = &_uart_stdout;
stdin = &_uart_stdin;

View File

@ -20,6 +20,7 @@
#include "stdio_base.h"
#include "cpu.h"
#include "kernel_init.h"
#include "periph/init.h"
#include "periph_conf.h"
@ -37,7 +38,7 @@ void cpu_init(void)
/* initialize the clock system */
cpu_clock_init();
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
stdio_init();
early_init();
/* trigger static peripheral initialization */
periph_init();
}

View File

@ -18,6 +18,7 @@
*/
#include "cpu.h"
#include "kernel_init.h"
#include "periph_conf.h"
#include "periph/init.h"
#include "stdio_base.h"
@ -46,7 +47,7 @@ void cpu_init(void)
#endif
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
stdio_init();
early_init();
/* trigger static peripheral initialization */
periph_init();

View File

@ -19,6 +19,7 @@
*/
#include "cpu.h"
#include "kernel_init.h"
#include "periph_conf.h"
#include "periph/init.h"
#include "stdio_base.h"
@ -37,7 +38,7 @@ void cpu_init(void)
setup_trim_device();
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
stdio_init();
early_init();
/* trigger static peripheral initialization */
periph_init();

View File

@ -22,6 +22,7 @@
*/
#include "cpu.h"
#include "kernel_init.h"
#include "periph_conf.h"
#include "periph/init.h"
#include "stdio_base.h"
@ -231,7 +232,7 @@ void cpu_init(void)
pm_init();
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
stdio_init();
early_init();
/* trigger static peripheral initialization */
periph_init();

View File

@ -149,7 +149,7 @@ static NORETURN void IRAM system_startup_cpu0(void)
/* initialize stdio */
esp_rom_uart_tx_wait_idle(CONFIG_ESP_CONSOLE_UART_NUM);
stdio_init();
early_init();
RESET_REASON reset_reason = rtc_get_reset_reason(PRO_CPU_NUM);

View File

@ -106,7 +106,7 @@ void esp_riot_init(void)
/* initialize stdio*/
extern int stdio_is_initialized;
stdio_init();
early_init();
stdio_is_initialized = 1;
/* trigger static peripheral initialization */

View File

@ -19,6 +19,7 @@
#include "clk.h"
#include "cpu.h"
#include "kernel_init.h"
#include "periph/init.h"
#include "periph_conf.h"
@ -108,7 +109,7 @@ void cpu_init(void)
riscv_init();
/* Initialize stdio */
stdio_init();
early_init();
/* Initialize static peripheral */
periph_init();

View File

@ -14,6 +14,7 @@
*
* @author Koen Zandberg <koen@bergzand.net>
*/
#include "kernel_init.h"
#include "stdio_uart.h"
#include "periph/init.h"
#include "irq_arch.h"
@ -30,6 +31,6 @@ void cpu_init(void)
gd32vf103_clock_init();
/* Common RISC-V initialization */
riscv_init();
stdio_init();
early_init();
periph_init();
}

View File

@ -18,6 +18,7 @@
*/
#include "cpu.h"
#include "kernel_init.h"
#include "periph/init.h"
#include "stdio_base.h"
#ifdef MODULE_PERIPH_MCG
@ -44,7 +45,7 @@ void cpu_init(void)
#endif
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
stdio_init();
early_init();
/* trigger static peripheral initialization */
periph_init();

View File

@ -18,6 +18,7 @@
*/
#include "cpu.h"
#include "kernel_init.h"
#include "irq.h"
#include "sched.h"
#include "thread.h"
@ -38,7 +39,7 @@ void cpu_init(void)
cpu_clock_init(CLOCK_SOURCE);
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
stdio_init();
early_init();
/* trigger static peripheral initialization */
periph_init();

View File

@ -18,6 +18,7 @@
*/
#include "cpu.h"
#include "kernel_init.h"
#include "periph/init.h"
#include "stdio_base.h"
@ -29,7 +30,7 @@ void cpu_init(void)
/* initialize the Cortex-M core */
cortexm_init();
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
stdio_init();
early_init();
/* trigger static peripheral initialization */
periph_init();
}

View File

@ -13,6 +13,7 @@
#include <stdint.h>
#include "cpu.h"
#include "kernel_init.h"
#include "irq.h"
#include "VIC.h"
@ -130,7 +131,7 @@ void cpu_init(void)
board_init();
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
stdio_init();
early_init();
/* trigger static peripheral initialization */
periph_init();

View File

@ -9,6 +9,7 @@
*/
#include "cpu.h"
#include "kernel_init.h"
#include "irq.h"
#include "sched.h"
#include "thread.h"

View File

@ -51,7 +51,7 @@ __attribute__((constructor)) static void startup(void)
#endif
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
stdio_init();
early_init();
/* trigger static peripheral initialization */
periph_init();
/* continue with kernel initialization */

View File

@ -466,7 +466,7 @@ __attribute__((constructor)) static void startup(int argc, char **argv, char **e
{
_native_init_syscalls();
/* initialize stdio as early as possible */
stdio_init();
early_init();
_native_argv = argv;
_progname = argv[0];

View File

@ -18,6 +18,7 @@
*/
#include "cpu.h"
#include "kernel_init.h"
#include "nrf_clock.h"
#include "nrfx_riot.h"
#include "periph_conf.h"
@ -36,7 +37,7 @@ void cpu_init(void)
/* setup the HF clock */
clock_init_hf();
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
stdio_init();
early_init();
/* trigger static peripheral initialization */
periph_init();
}

View File

@ -23,6 +23,7 @@
#define DONT_OVERRIDE_NVIC
#include "cpu.h"
#include "kernel_init.h"
#include "nrfx_riot.h"
#include "nrf_clock.h"
#include "periph_conf.h"
@ -75,7 +76,7 @@ void cpu_init(void)
SCB->SCR |= SCB_SCR_SEVONPEND_Msk;
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
stdio_init();
early_init();
/* trigger static peripheral initialization */
periph_init();

View File

@ -19,6 +19,7 @@
*/
#include "cpu.h"
#include "kernel_init.h"
#include "nrf_clock.h"
#include "periph_conf.h"
#include "periph/init.h"
@ -44,7 +45,7 @@ void cpu_init(void)
SCB->SCR |= SCB_SCR_SEVONPEND_Msk;
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
stdio_init();
early_init();
/* trigger static peripheral initialization */
periph_init();

View File

@ -18,6 +18,7 @@
*/
#include "cpu.h"
#include "kernel_init.h"
#include "periph/init.h"
#include "stdio_base.h"
@ -51,7 +52,7 @@ void cpu_init(void)
cpu_clock_init();
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
stdio_init();
early_init();
/* trigger static peripheral initialization */
periph_init();
}

View File

@ -19,6 +19,7 @@
*/
#include "cpu.h"
#include "kernel_init.h"
#include "macros/units.h"
#include "periph/init.h"
#include "periph_cpu.h"
@ -87,7 +88,7 @@ void cpu_init(void)
_cpu_reset();
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
stdio_init();
early_init();
DEBUG_PUTS("[rpx0xx] GPOUT0 (GPIO pin 21) is clocked from XOSC (typically 12 MHz)");

View File

@ -18,6 +18,7 @@
*/
#include "cpu.h"
#include "kernel_init.h"
#include "periph_conf.h"
#include "periph/init.h"
#include "stdio_base.h"
@ -104,7 +105,7 @@ void cpu_init(void)
#endif
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
stdio_init();
early_init();
/* trigger static peripheral initialization */
periph_init();

View File

@ -19,6 +19,7 @@
*/
#include "cpu.h"
#include "kernel_init.h"
#include "periph_conf.h"
#include "periph/init.h"
#include "stdio_base.h"
@ -281,7 +282,7 @@ void cpu_init(void)
dma_init();
#endif
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
stdio_init();
early_init();
/* trigger static peripheral initialization */
periph_init();
}

View File

@ -20,6 +20,7 @@
#include <assert.h>
#include "cpu.h"
#include "kernel_init.h"
#include "macros/units.h"
#include "periph_conf.h"
#include "periph/init.h"
@ -383,7 +384,7 @@ void cpu_init(void)
#endif
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
stdio_init();
early_init();
/* trigger static peripheral initialization */
periph_init();

View File

@ -19,6 +19,7 @@
*/
#include "cpu.h"
#include "kernel_init.h"
#include "periph/init.h"
#include "periph_conf.h"
#include "board.h"
@ -183,7 +184,7 @@ void cpu_init(void)
#endif
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
stdio_init();
early_init();
/* trigger static peripheral initialization */
periph_init();

View File

@ -21,6 +21,7 @@
#include <assert.h>
#include "cpu.h"
#include "kernel_init.h"
#include "periph/init.h"
#include "periph_conf.h"
#include "stdio_base.h"
@ -312,7 +313,7 @@ void cpu_init(void)
dma_init();
#endif
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
stdio_init();
early_init();
/* trigger static peripheral initialization */
periph_init();

View File

@ -33,6 +33,7 @@
*/
#include "cpu.h"
#include "kernel_init.h"
#include "stdio_base.h"
#include "stmclk.h"
#include "periph_cpu.h"
@ -359,7 +360,7 @@ void cpu_init(void)
dma_init();
#endif
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
stdio_init();
early_init();
#ifdef STM32F1_DISABLE_JTAG
RCC->APB2ENR |= RCC_APB2ENR_AFIOEN;