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

cpu: Moved stdio_init() into cpu_init()

- Removed stdio_init() from newlib's _init(), as this is too late in the boot
  process to allow DEBUG()ing during periph_init()
- Added stdio_init() to the various cpu_init() routines of the ARM CPUs just
  before periph_init()
This commit is contained in:
Marian Buschsieweke 2019-04-10 11:07:05 +02:00
parent 999fffdc59
commit df27dbef7a
No known key found for this signature in database
GPG Key ID: 61F64C6599B1539F
16 changed files with 56 additions and 1 deletions

View File

@ -21,6 +21,7 @@
#include "cpu.h"
#include "periph/init.h"
#include "stdio_base.h"
#define BIT(n) ( 1UL << (n) )
@ -48,6 +49,8 @@ void cpu_init(void)
SYS_CTRL->I_MAP = 1;
/* initialize the clock system */
cpu_clock_init();
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
stdio_init();
/* trigger static peripheral initialization */
periph_init();
}

View File

@ -20,6 +20,7 @@
#include "cpu.h"
#include "periph_conf.h"
#include "periph/init.h"
#include "stdio_base.h"
#ifndef HF_CLOCK_SOURCE
#define HF_CLOCK_SOURCE DDI_0_OSC_CTL0_SCLK_HF_SRC_SEL_RCOSC /* set 48MHz RCOSC */
@ -44,6 +45,9 @@ void cpu_init(void)
/* initialize the system clock */
cpu_clock_init();
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
stdio_init();
/* trigger static peripheral initialization */
periph_init();
}

View File

@ -22,6 +22,7 @@
#include "cpu.h"
#include "periph_conf.h"
#include "periph/init.h"
#include "stdio_base.h"
#include "em_chip.h"
#include "em_cmu.h"
@ -172,6 +173,9 @@ void cpu_init(void)
/* initialize power management interface */
pm_init();
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
stdio_init();
/* trigger static peripheral initialization */
periph_init();
}

View File

@ -20,6 +20,7 @@
#include "cpu.h"
#include "periph_conf.h"
#include "periph/init.h"
#include "stdio_base.h"
/**
* @brief Configure clock sources and the CPU frequency
@ -60,6 +61,8 @@ void cpu_init(void)
cortexm_init();
/* Initialise clock sources and generic clocks */
clk_init();
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
stdio_init();
/* trigger static peripheral initialization */
periph_init();
}

View File

@ -19,6 +19,7 @@
#include "cpu.h"
#include "periph/init.h"
#include "stdio_base.h"
#ifdef MODULE_PERIPH_MCG
#include "mcg.h"
#endif
@ -41,6 +42,10 @@ void cpu_init(void)
/* initialize the CPU clocking provided by the MCG module */
kinetis_mcg_init();
#endif
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
stdio_init();
/* trigger static peripheral initialization */
periph_init();
}

View File

@ -24,6 +24,7 @@
#include "irq.h"
#include "periph/init.h"
#include "periph_conf.h"
#include "stdio_base.h"
/**
* @brief Initialize the CPU, set IRQ priorities
@ -36,6 +37,9 @@ void cpu_init(void)
/* initialize the clock system */
cpu_clock_init(CLOCK_SOURCE);
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
stdio_init();
/* trigger static peripheral initialization */
periph_init();
}

View File

@ -19,6 +19,7 @@
#include "cpu.h"
#include "periph/init.h"
#include "stdio_base.h"
/**
* @brief Initialize the CPU, set IRQ priorities
@ -27,6 +28,8 @@ 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();
/* trigger static peripheral initialization */
periph_init();
}

View File

@ -21,6 +21,7 @@
#include "nrf_clock.h"
#include "periph_conf.h"
#include "periph/init.h"
#include "stdio_base.h"
/**
* @brief Initialize the CPU, set IRQ priorities
@ -31,6 +32,8 @@ void cpu_init(void)
cortexm_init();
/* setup the HF clock */
clock_init_hf();
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
stdio_init();
/* trigger static peripheral initialization */
periph_init();
}

View File

@ -26,6 +26,7 @@
#include "nrf_clock.h"
#include "periph_conf.h"
#include "periph/init.h"
#include "stdio_base.h"
/* FTPAN helper functions */
static bool ftpan_32(void);
@ -83,6 +84,9 @@ void cpu_init(void)
/* enable wake up on events for __WFE CPU sleep */
SCB->SCR |= SCB_SCR_SEVONPEND_Msk;
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
stdio_init();
/* trigger static peripheral initialization */
periph_init();
}

View File

@ -20,6 +20,7 @@
#include "cpu.h"
#include "periph_conf.h"
#include "periph/init.h"
#include "stdio_base.h"
/**
* @brief Keys needed for editing certain PMC registers
@ -90,6 +91,9 @@ void cpu_init(void)
/* wait for master clock to be ready */
while (!(PMC->PMC_SR & PMC_SR_MCKRDY));
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
stdio_init();
/* trigger static peripheral initialization */
periph_init();
}

View File

@ -21,6 +21,7 @@
#include "cpu.h"
#include "periph_conf.h"
#include "periph/init.h"
#include "stdio_base.h"
#ifndef CLOCK_8MHZ
#define CLOCK_8MHZ 1
@ -218,6 +219,8 @@ void cpu_init(void)
cortexm_init();
/* Initialise clock sources and generic clocks */
clk_init();
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
stdio_init();
/* trigger static peripheral initialization */
periph_init();
}

View File

@ -20,6 +20,7 @@
#include "cpu.h"
#include "periph_conf.h"
#include "periph/init.h"
#include "stdio_base.h"
static void xosc32k_init(void)
{
@ -137,6 +138,9 @@ void cpu_init(void)
gclk_connect(6, GCLK_SOURCE_DFLL, 0);
#endif
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
stdio_init();
/* trigger static peripheral initialization */
periph_init();
}

View File

@ -22,6 +22,7 @@
#include "periph/init.h"
#include "periph_conf.h"
#include "board.h"
#include "stdio_base.h"
#ifdef CPU_FAM_SAML11
#define _NVMCTRL NVMCTRL_SEC
@ -115,6 +116,9 @@ void cpu_init(void)
/* Setup GCLK generators */
_gclk_setup(0, GCLK_GENCTRL_GENEN | GCLK_GENCTRL_SRC_OSC16M);
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
stdio_init();
/* trigger static peripheral initialization */
periph_init();
}

View File

@ -21,6 +21,7 @@
#include "cpu.h"
#include "periph/init.h"
#include "periph_conf.h"
#include "stdio_base.h"
static void _gclk_setup(int gclk, uint32_t reg)
{
@ -118,6 +119,9 @@ void cpu_init(void)
SUPC->BOD33.bit.ENABLE=0;
#endif
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
stdio_init();
/* trigger static peripheral initialization */
periph_init();
}

View File

@ -33,6 +33,7 @@
*/
#include "cpu.h"
#include "stdio_base.h"
#include "stmclk.h"
#include "periph_cpu.h"
#include "periph/init.h"
@ -160,6 +161,8 @@ void cpu_init(void)
/* initialize DMA streams */
dma_init();
#endif
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
stdio_init();
/* trigger static peripheral initialization */
periph_init();
}

View File

@ -69,7 +69,7 @@ char *heap_top = &_sheap + 4;
*/
void _init(void)
{
stdio_init();
/* nothing to do here */
}
/**