diff --git a/soc/microchip/mec/mec15xx/Kconfig b/soc/microchip/mec/mec15xx/Kconfig index d00e938a6d1..510fbd898ea 100644 --- a/soc/microchip/mec/mec15xx/Kconfig +++ b/soc/microchip/mec/mec15xx/Kconfig @@ -9,6 +9,7 @@ config SOC_SERIES_MEC15XX select CPU_CORTEX_M_HAS_DWT select CPU_HAS_ARM_MPU select HAS_PM + select SOC_EARLY_INIT_HOOK config SOC_MEC1501_HSZ select HAS_MEC_HAL diff --git a/soc/microchip/mec/mec15xx/soc.c b/soc/microchip/mec/mec15xx/soc.c index 27fd059c339..df21dde363e 100644 --- a/soc/microchip/mec/mec15xx/soc.c +++ b/soc/microchip/mec/mec15xx/soc.c @@ -71,7 +71,7 @@ static void configure_debug_interface(void) #endif /* CONFIG_SOC_MEC1501_DEBUG_WITHOUT_TRACING */ } -static int soc_init(void) +void soc_early_init_hook(void) { uint32_t isave; @@ -94,8 +94,4 @@ static int soc_init(void) if (!isave) { __enable_irq(); } - - return 0; } - -SYS_INIT(soc_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); diff --git a/soc/microchip/mec/mec172x/Kconfig b/soc/microchip/mec/mec172x/Kconfig index c529d83fc31..85f579ec776 100644 --- a/soc/microchip/mec/mec172x/Kconfig +++ b/soc/microchip/mec/mec172x/Kconfig @@ -11,6 +11,7 @@ config SOC_SERIES_MEC172X select CPU_HAS_ARM_MPU select HAS_SWO select HAS_PM + select SOC_EARLY_INIT_HOOK if SOC_SERIES_MEC172X diff --git a/soc/microchip/mec/mec172x/soc.c b/soc/microchip/mec/mec172x/soc.c index 9de2f7ce552..6b000f957b0 100644 --- a/soc/microchip/mec/mec172x/soc.c +++ b/soc/microchip/mec/mec172x/soc.c @@ -38,12 +38,8 @@ static void configure_debug_interface(void) #endif /* CONFIG_SOC_MEC172X_DEBUG_DISABLED */ } -static int soc_init(void) +void soc_early_init_hook(void) { configure_debug_interface(); - - return 0; } - -SYS_INIT(soc_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); diff --git a/soc/microchip/mec/mec174x/Kconfig b/soc/microchip/mec/mec174x/Kconfig index 52eb412941a..eeb77525d72 100644 --- a/soc/microchip/mec/mec174x/Kconfig +++ b/soc/microchip/mec/mec174x/Kconfig @@ -12,6 +12,7 @@ config SOC_SERIES_MEC174X select HAS_SWO select HAS_MEC5_HAL select HAS_PM + select SOC_PREP_HOOK if SOC_SERIES_MEC174X diff --git a/soc/microchip/mec/mec174x/soc.c b/soc/microchip/mec/mec174x/soc.c index 6d7a502b082..f4d0db790d6 100644 --- a/soc/microchip/mec/mec174x/soc.c +++ b/soc/microchip/mec/mec174x/soc.c @@ -10,15 +10,7 @@ #include #include -static int soc_init(void) +void soc_prep_hook(void) { mec5_soc_common_init(); - return 0; } - -/* Enabling HW debug and initializing the MEC interrupt aggregator should be done - * before driver are loaded to not overwrite driver interrupt configuration. - * Use early initialization category called soon after Zephyr z_cstart and before - * Zephyr starts making driver initialization calls. - */ -SYS_INIT(soc_init, EARLY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); diff --git a/soc/microchip/mec/mec175x/Kconfig b/soc/microchip/mec/mec175x/Kconfig index 1cce7ce0e2b..5670fe72540 100644 --- a/soc/microchip/mec/mec175x/Kconfig +++ b/soc/microchip/mec/mec175x/Kconfig @@ -12,6 +12,7 @@ config SOC_SERIES_MEC175X select HAS_SWO select HAS_MEC5_HAL select HAS_PM + select SOC_PREP_HOOK if SOC_SERIES_MEC175X diff --git a/soc/microchip/mec/mec175x/soc.c b/soc/microchip/mec/mec175x/soc.c index 6d7a502b082..f4d0db790d6 100644 --- a/soc/microchip/mec/mec175x/soc.c +++ b/soc/microchip/mec/mec175x/soc.c @@ -10,15 +10,7 @@ #include #include -static int soc_init(void) +void soc_prep_hook(void) { mec5_soc_common_init(); - return 0; } - -/* Enabling HW debug and initializing the MEC interrupt aggregator should be done - * before driver are loaded to not overwrite driver interrupt configuration. - * Use early initialization category called soon after Zephyr z_cstart and before - * Zephyr starts making driver initialization calls. - */ -SYS_INIT(soc_init, EARLY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); diff --git a/soc/microchip/mec/mech172x/Kconfig b/soc/microchip/mec/mech172x/Kconfig index 0bc04fbed20..d58d267e9cc 100644 --- a/soc/microchip/mec/mech172x/Kconfig +++ b/soc/microchip/mec/mech172x/Kconfig @@ -12,6 +12,7 @@ config SOC_SERIES_MECH172X select HAS_SWO select HAS_MEC5_HAL select HAS_PM + select SOC_PREP_HOOK if SOC_SERIES_MECH172X diff --git a/soc/microchip/mec/mech172x/soc.c b/soc/microchip/mec/mech172x/soc.c index 6d7a502b082..f4d0db790d6 100644 --- a/soc/microchip/mec/mech172x/soc.c +++ b/soc/microchip/mec/mech172x/soc.c @@ -10,15 +10,7 @@ #include #include -static int soc_init(void) +void soc_prep_hook(void) { mec5_soc_common_init(); - return 0; } - -/* Enabling HW debug and initializing the MEC interrupt aggregator should be done - * before driver are loaded to not overwrite driver interrupt configuration. - * Use early initialization category called soon after Zephyr z_cstart and before - * Zephyr starts making driver initialization calls. - */ -SYS_INIT(soc_init, EARLY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);