soc: gd: move init code from SYS_INIT to hooks
Replace SYS_INIT with SoC hooks and adapt SoC init code Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
c9e0a4b843
commit
e6506619ca
16 changed files with 16 additions and 43 deletions
|
@ -10,3 +10,4 @@ config SOC_SERIES_GD32A50X
|
||||||
select GD32_HAS_AF_PINMUX
|
select GD32_HAS_AF_PINMUX
|
||||||
select GD32_HAS_IRC_40K
|
select GD32_HAS_IRC_40K
|
||||||
select SOC_RESET_HOOK
|
select SOC_RESET_HOOK
|
||||||
|
select SOC_EARLY_INIT_HOOK
|
||||||
|
|
|
@ -19,11 +19,7 @@ void soc_reset_hook(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int gd32a50x_soc_init(void)
|
void soc_early_init_hook(void)
|
||||||
{
|
{
|
||||||
SystemInit();
|
SystemInit();
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SYS_INIT(gd32a50x_soc_init, PRE_KERNEL_1, 0);
|
|
||||||
|
|
|
@ -9,3 +9,4 @@ config SOC_SERIES_GD32E10X
|
||||||
select CPU_CORTEX_M_HAS_VTOR
|
select CPU_CORTEX_M_HAS_VTOR
|
||||||
select GD32_HAS_AFIO_PINMUX
|
select GD32_HAS_AFIO_PINMUX
|
||||||
select GD32_HAS_IRC_40K
|
select GD32_HAS_IRC_40K
|
||||||
|
select SOC_EARLY_INIT_HOOK
|
||||||
|
|
|
@ -7,11 +7,7 @@
|
||||||
#include <zephyr/init.h>
|
#include <zephyr/init.h>
|
||||||
#include <soc.h>
|
#include <soc.h>
|
||||||
|
|
||||||
static int gd32e10x_soc_init(void)
|
void soc_early_init_hook(void)
|
||||||
{
|
{
|
||||||
SystemInit();
|
SystemInit();
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SYS_INIT(gd32e10x_soc_init, PRE_KERNEL_1, 0);
|
|
||||||
|
|
|
@ -9,3 +9,4 @@ config SOC_SERIES_GD32E50X
|
||||||
select ARMV8_M_DSP
|
select ARMV8_M_DSP
|
||||||
select GD32_HAS_AFIO_PINMUX
|
select GD32_HAS_AFIO_PINMUX
|
||||||
select GD32_HAS_IRC_40K
|
select GD32_HAS_IRC_40K
|
||||||
|
select SOC_EARLY_INIT_HOOK
|
||||||
|
|
|
@ -6,11 +6,7 @@
|
||||||
#include <zephyr/init.h>
|
#include <zephyr/init.h>
|
||||||
#include <soc.h>
|
#include <soc.h>
|
||||||
|
|
||||||
static int gd32e50x_soc_init(void)
|
void soc_early_init_hook(void)
|
||||||
{
|
{
|
||||||
SystemInit();
|
SystemInit();
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SYS_INIT(gd32e50x_soc_init, PRE_KERNEL_1, 0);
|
|
||||||
|
|
|
@ -7,3 +7,4 @@ config SOC_SERIES_GD32F3X0
|
||||||
select CPU_CORTEX_M4
|
select CPU_CORTEX_M4
|
||||||
select GD32_HAS_AF_PINMUX
|
select GD32_HAS_AF_PINMUX
|
||||||
select GD32_HAS_IRC_40K
|
select GD32_HAS_IRC_40K
|
||||||
|
select SOC_EARLY_INIT_HOOK
|
||||||
|
|
|
@ -7,11 +7,7 @@
|
||||||
#include <zephyr/init.h>
|
#include <zephyr/init.h>
|
||||||
#include <soc.h>
|
#include <soc.h>
|
||||||
|
|
||||||
static int gd32f3x0_init(void)
|
void soc_early_init_hook(void)
|
||||||
{
|
{
|
||||||
SystemInit();
|
SystemInit();
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SYS_INIT(gd32f3x0_init, PRE_KERNEL_1, 0);
|
|
||||||
|
|
|
@ -10,3 +10,4 @@ config SOC_SERIES_GD32F403
|
||||||
select CPU_CORTEX_M_HAS_VTOR
|
select CPU_CORTEX_M_HAS_VTOR
|
||||||
select GD32_HAS_AFIO_PINMUX
|
select GD32_HAS_AFIO_PINMUX
|
||||||
select GD32_HAS_IRC_40K
|
select GD32_HAS_IRC_40K
|
||||||
|
select SOC_EARLY_INIT_HOOK
|
||||||
|
|
|
@ -19,15 +19,8 @@
|
||||||
* @brief Perform basic hardware initialization at boot.
|
* @brief Perform basic hardware initialization at boot.
|
||||||
*
|
*
|
||||||
* This needs to be run from the very beginning.
|
* This needs to be run from the very beginning.
|
||||||
* So the init priority has to be 0 (zero).
|
|
||||||
*
|
|
||||||
* @return 0
|
|
||||||
*/
|
*/
|
||||||
static int gigadevice_gd32_soc_init(void)
|
void soc_early_init_hook(void)
|
||||||
{
|
{
|
||||||
SystemInit();
|
SystemInit();
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SYS_INIT(gigadevice_gd32_soc_init, PRE_KERNEL_1, 0);
|
|
||||||
|
|
|
@ -8,3 +8,4 @@ config SOC_SERIES_GD32F4XX
|
||||||
select CPU_CORTEX_M4
|
select CPU_CORTEX_M4
|
||||||
select GD32_HAS_AF_PINMUX
|
select GD32_HAS_AF_PINMUX
|
||||||
select GD32_HAS_IRC_32K
|
select GD32_HAS_IRC_32K
|
||||||
|
select SOC_EARLY_INIT_HOOK
|
||||||
|
|
|
@ -7,11 +7,7 @@
|
||||||
#include <zephyr/init.h>
|
#include <zephyr/init.h>
|
||||||
#include <soc.h>
|
#include <soc.h>
|
||||||
|
|
||||||
static int gd32f4xx_soc_init(void)
|
void soc_early_init_hook(void)
|
||||||
{
|
{
|
||||||
SystemInit();
|
SystemInit();
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SYS_INIT(gd32f4xx_soc_init, PRE_KERNEL_1, 0);
|
|
||||||
|
|
|
@ -8,3 +8,4 @@ config SOC_SERIES_GD32L23X
|
||||||
select CPU_CORTEX_M_HAS_VTOR
|
select CPU_CORTEX_M_HAS_VTOR
|
||||||
select GD32_HAS_AF_PINMUX
|
select GD32_HAS_AF_PINMUX
|
||||||
select GD32_HAS_IRC_32K
|
select GD32_HAS_IRC_32K
|
||||||
|
select SOC_EARLY_INIT_HOOK
|
||||||
|
|
|
@ -7,11 +7,7 @@
|
||||||
#include <zephyr/init.h>
|
#include <zephyr/init.h>
|
||||||
#include <soc.h>
|
#include <soc.h>
|
||||||
|
|
||||||
static int gd32l23x_init(void)
|
void soc_early_init_hook(void)
|
||||||
{
|
{
|
||||||
SystemInit();
|
SystemInit();
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SYS_INIT(gd32l23x_init, PRE_KERNEL_1, 0);
|
|
||||||
|
|
|
@ -18,3 +18,4 @@ config SOC_SERIES_GD32VF103
|
||||||
select GD32_HAS_AFIO_PINMUX
|
select GD32_HAS_AFIO_PINMUX
|
||||||
select GD32_HAS_IRC_40K
|
select GD32_HAS_IRC_40K
|
||||||
select XIP
|
select XIP
|
||||||
|
select SOC_EARLY_INIT_HOOK
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
#include <gd32vf103.h>
|
#include <gd32vf103.h>
|
||||||
|
|
||||||
static int gigadevice_gd32v_soc_init(void)
|
void soc_early_init_hook(void)
|
||||||
{
|
{
|
||||||
uint32_t key;
|
uint32_t key;
|
||||||
|
|
||||||
|
@ -19,8 +19,4 @@ static int gigadevice_gd32v_soc_init(void)
|
||||||
SystemInit();
|
SystemInit();
|
||||||
|
|
||||||
irq_unlock(key);
|
irq_unlock(key);
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SYS_INIT(gigadevice_gd32v_soc_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue