From 124b849503759e636f64d3f81ae9bfff3535811e Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Mon, 2 Jan 2023 18:08:35 +0100 Subject: [PATCH] cpu: call early_init() --- cpu/avr8_common/avr_libc_extra/avr8_stdio.c | 3 ++- cpu/cc2538/cpu.c | 3 ++- cpu/cc26x0_cc13x0/cpu.c | 3 ++- cpu/cc26x2_cc13x2/cpu.c | 3 ++- cpu/efm32/cpu.c | 3 ++- cpu/esp32/startup.c | 2 +- cpu/esp8266/startup.c | 2 +- cpu/fe310/cpu.c | 3 ++- cpu/gd32v/cpu.c | 3 ++- cpu/kinetis/cpu.c | 3 ++- cpu/lm4f120/cpu.c | 3 ++- cpu/lpc1768/cpu.c | 3 ++- cpu/lpc23xx/cpu.c | 3 ++- cpu/msp430_common/cpu.c | 1 + cpu/msp430_common/startup.c | 2 +- cpu/native/startup.c | 2 +- cpu/nrf51/cpu.c | 3 ++- cpu/nrf52/cpu.c | 3 ++- cpu/nrf9160/cpu.c | 3 ++- cpu/qn908x/cpu.c | 3 ++- cpu/rpx0xx/cpu.c | 3 ++- cpu/sam3/cpu.c | 3 ++- cpu/samd21/cpu.c | 3 ++- cpu/samd5x/cpu.c | 3 ++- cpu/saml1x/cpu.c | 3 ++- cpu/saml21/cpu.c | 3 ++- cpu/stm32/cpu_init.c | 3 ++- 27 files changed, 49 insertions(+), 26 deletions(-) diff --git a/cpu/avr8_common/avr_libc_extra/avr8_stdio.c b/cpu/avr8_common/avr_libc_extra/avr8_stdio.c index 274688d3e9..cdb64252b0 100644 --- a/cpu/avr8_common/avr_libc_extra/avr8_stdio.c +++ b/cpu/avr8_common/avr_libc_extra/avr8_stdio.c @@ -21,6 +21,7 @@ #include #include +#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; diff --git a/cpu/cc2538/cpu.c b/cpu/cc2538/cpu.c index 7c17fc226a..83abd1e465 100644 --- a/cpu/cc2538/cpu.c +++ b/cpu/cc2538/cpu.c @@ -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(); } diff --git a/cpu/cc26x0_cc13x0/cpu.c b/cpu/cc26x0_cc13x0/cpu.c index a1aa81bbeb..d330696c79 100644 --- a/cpu/cc26x0_cc13x0/cpu.c +++ b/cpu/cc26x0_cc13x0/cpu.c @@ -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(); diff --git a/cpu/cc26x2_cc13x2/cpu.c b/cpu/cc26x2_cc13x2/cpu.c index f68513981c..4bcd3e9f82 100644 --- a/cpu/cc26x2_cc13x2/cpu.c +++ b/cpu/cc26x2_cc13x2/cpu.c @@ -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(); diff --git a/cpu/efm32/cpu.c b/cpu/efm32/cpu.c index cafe62701a..d92f93f3c7 100644 --- a/cpu/efm32/cpu.c +++ b/cpu/efm32/cpu.c @@ -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(); diff --git a/cpu/esp32/startup.c b/cpu/esp32/startup.c index 9455f4033a..341d24b402 100644 --- a/cpu/esp32/startup.c +++ b/cpu/esp32/startup.c @@ -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); diff --git a/cpu/esp8266/startup.c b/cpu/esp8266/startup.c index e74a00195b..113bb04214 100644 --- a/cpu/esp8266/startup.c +++ b/cpu/esp8266/startup.c @@ -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 */ diff --git a/cpu/fe310/cpu.c b/cpu/fe310/cpu.c index ffa271705d..9130f43824 100644 --- a/cpu/fe310/cpu.c +++ b/cpu/fe310/cpu.c @@ -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(); diff --git a/cpu/gd32v/cpu.c b/cpu/gd32v/cpu.c index 0f31dfba11..fd34780abd 100644 --- a/cpu/gd32v/cpu.c +++ b/cpu/gd32v/cpu.c @@ -14,6 +14,7 @@ * * @author Koen Zandberg */ +#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(); } diff --git a/cpu/kinetis/cpu.c b/cpu/kinetis/cpu.c index 2e2a2a3cfa..d0cd806181 100644 --- a/cpu/kinetis/cpu.c +++ b/cpu/kinetis/cpu.c @@ -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(); diff --git a/cpu/lm4f120/cpu.c b/cpu/lm4f120/cpu.c index 189f3e1490..6c15d8f1a0 100644 --- a/cpu/lm4f120/cpu.c +++ b/cpu/lm4f120/cpu.c @@ -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(); diff --git a/cpu/lpc1768/cpu.c b/cpu/lpc1768/cpu.c index f41547e19b..15d6eb46e9 100644 --- a/cpu/lpc1768/cpu.c +++ b/cpu/lpc1768/cpu.c @@ -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(); } diff --git a/cpu/lpc23xx/cpu.c b/cpu/lpc23xx/cpu.c index c2e2ea9199..844c8383ac 100644 --- a/cpu/lpc23xx/cpu.c +++ b/cpu/lpc23xx/cpu.c @@ -13,6 +13,7 @@ #include #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(); diff --git a/cpu/msp430_common/cpu.c b/cpu/msp430_common/cpu.c index fe9dfbd83a..cdd4acbb43 100644 --- a/cpu/msp430_common/cpu.c +++ b/cpu/msp430_common/cpu.c @@ -9,6 +9,7 @@ */ #include "cpu.h" +#include "kernel_init.h" #include "irq.h" #include "sched.h" #include "thread.h" diff --git a/cpu/msp430_common/startup.c b/cpu/msp430_common/startup.c index e4c9d85820..b46c0fcec8 100644 --- a/cpu/msp430_common/startup.c +++ b/cpu/msp430_common/startup.c @@ -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 */ diff --git a/cpu/native/startup.c b/cpu/native/startup.c index 61f0f2297b..7f49330933 100644 --- a/cpu/native/startup.c +++ b/cpu/native/startup.c @@ -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]; diff --git a/cpu/nrf51/cpu.c b/cpu/nrf51/cpu.c index a4e595632c..aa6f4cadd3 100644 --- a/cpu/nrf51/cpu.c +++ b/cpu/nrf51/cpu.c @@ -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(); } diff --git a/cpu/nrf52/cpu.c b/cpu/nrf52/cpu.c index c0273fadf9..f6f8493a76 100644 --- a/cpu/nrf52/cpu.c +++ b/cpu/nrf52/cpu.c @@ -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(); diff --git a/cpu/nrf9160/cpu.c b/cpu/nrf9160/cpu.c index 0a23839b22..a04be65fbe 100644 --- a/cpu/nrf9160/cpu.c +++ b/cpu/nrf9160/cpu.c @@ -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(); diff --git a/cpu/qn908x/cpu.c b/cpu/qn908x/cpu.c index c938cc159b..c486f3984d 100644 --- a/cpu/qn908x/cpu.c +++ b/cpu/qn908x/cpu.c @@ -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(); } diff --git a/cpu/rpx0xx/cpu.c b/cpu/rpx0xx/cpu.c index 54bdc786dd..61fd73f773 100644 --- a/cpu/rpx0xx/cpu.c +++ b/cpu/rpx0xx/cpu.c @@ -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)"); diff --git a/cpu/sam3/cpu.c b/cpu/sam3/cpu.c index 15a139ede9..300ba86e1a 100644 --- a/cpu/sam3/cpu.c +++ b/cpu/sam3/cpu.c @@ -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(); diff --git a/cpu/samd21/cpu.c b/cpu/samd21/cpu.c index 010fb8a674..d673c44c95 100644 --- a/cpu/samd21/cpu.c +++ b/cpu/samd21/cpu.c @@ -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(); } diff --git a/cpu/samd5x/cpu.c b/cpu/samd5x/cpu.c index c14d6d90bb..e4769c9400 100644 --- a/cpu/samd5x/cpu.c +++ b/cpu/samd5x/cpu.c @@ -20,6 +20,7 @@ #include #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(); diff --git a/cpu/saml1x/cpu.c b/cpu/saml1x/cpu.c index b8403f80a1..19cfec720d 100644 --- a/cpu/saml1x/cpu.c +++ b/cpu/saml1x/cpu.c @@ -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(); diff --git a/cpu/saml21/cpu.c b/cpu/saml21/cpu.c index f4b53bf6b7..9c1132adb1 100644 --- a/cpu/saml21/cpu.c +++ b/cpu/saml21/cpu.c @@ -21,6 +21,7 @@ #include #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(); diff --git a/cpu/stm32/cpu_init.c b/cpu/stm32/cpu_init.c index c85d3a0f61..9b2a1623bc 100644 --- a/cpu/stm32/cpu_init.c +++ b/cpu/stm32/cpu_init.c @@ -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;