soc: microchip: 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:
Anas Nashif 2024-09-10 09:42:38 -04:00 committed by Henrik Brix Andersen
commit 1d7910352d
10 changed files with 10 additions and 37 deletions

View file

@ -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

View file

@ -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);

View file

@ -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

View file

@ -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);

View file

@ -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

View file

@ -10,15 +10,7 @@
#include <soc.h>
#include <soc_cmn_init.h>
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);

View file

@ -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

View file

@ -10,15 +10,7 @@
#include <soc.h>
#include <soc_cmn_init.h>
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);

View file

@ -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

View file

@ -10,15 +10,7 @@
#include <soc.h>
#include <soc_cmn_init.h>
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);