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:
parent
8a16c72023
commit
1d7910352d
10 changed files with 10 additions and 37 deletions
|
@ -9,6 +9,7 @@ config SOC_SERIES_MEC15XX
|
||||||
select CPU_CORTEX_M_HAS_DWT
|
select CPU_CORTEX_M_HAS_DWT
|
||||||
select CPU_HAS_ARM_MPU
|
select CPU_HAS_ARM_MPU
|
||||||
select HAS_PM
|
select HAS_PM
|
||||||
|
select SOC_EARLY_INIT_HOOK
|
||||||
|
|
||||||
config SOC_MEC1501_HSZ
|
config SOC_MEC1501_HSZ
|
||||||
select HAS_MEC_HAL
|
select HAS_MEC_HAL
|
||||||
|
|
|
@ -71,7 +71,7 @@ static void configure_debug_interface(void)
|
||||||
#endif /* CONFIG_SOC_MEC1501_DEBUG_WITHOUT_TRACING */
|
#endif /* CONFIG_SOC_MEC1501_DEBUG_WITHOUT_TRACING */
|
||||||
}
|
}
|
||||||
|
|
||||||
static int soc_init(void)
|
void soc_early_init_hook(void)
|
||||||
{
|
{
|
||||||
uint32_t isave;
|
uint32_t isave;
|
||||||
|
|
||||||
|
@ -94,8 +94,4 @@ static int soc_init(void)
|
||||||
if (!isave) {
|
if (!isave) {
|
||||||
__enable_irq();
|
__enable_irq();
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SYS_INIT(soc_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ config SOC_SERIES_MEC172X
|
||||||
select CPU_HAS_ARM_MPU
|
select CPU_HAS_ARM_MPU
|
||||||
select HAS_SWO
|
select HAS_SWO
|
||||||
select HAS_PM
|
select HAS_PM
|
||||||
|
select SOC_EARLY_INIT_HOOK
|
||||||
|
|
||||||
if SOC_SERIES_MEC172X
|
if SOC_SERIES_MEC172X
|
||||||
|
|
||||||
|
|
|
@ -38,12 +38,8 @@ static void configure_debug_interface(void)
|
||||||
#endif /* CONFIG_SOC_MEC172X_DEBUG_DISABLED */
|
#endif /* CONFIG_SOC_MEC172X_DEBUG_DISABLED */
|
||||||
}
|
}
|
||||||
|
|
||||||
static int soc_init(void)
|
void soc_early_init_hook(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
configure_debug_interface();
|
configure_debug_interface();
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SYS_INIT(soc_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ config SOC_SERIES_MEC174X
|
||||||
select HAS_SWO
|
select HAS_SWO
|
||||||
select HAS_MEC5_HAL
|
select HAS_MEC5_HAL
|
||||||
select HAS_PM
|
select HAS_PM
|
||||||
|
select SOC_PREP_HOOK
|
||||||
|
|
||||||
if SOC_SERIES_MEC174X
|
if SOC_SERIES_MEC174X
|
||||||
|
|
||||||
|
|
|
@ -10,15 +10,7 @@
|
||||||
#include <soc.h>
|
#include <soc.h>
|
||||||
#include <soc_cmn_init.h>
|
#include <soc_cmn_init.h>
|
||||||
|
|
||||||
static int soc_init(void)
|
void soc_prep_hook(void)
|
||||||
{
|
{
|
||||||
mec5_soc_common_init();
|
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);
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ config SOC_SERIES_MEC175X
|
||||||
select HAS_SWO
|
select HAS_SWO
|
||||||
select HAS_MEC5_HAL
|
select HAS_MEC5_HAL
|
||||||
select HAS_PM
|
select HAS_PM
|
||||||
|
select SOC_PREP_HOOK
|
||||||
|
|
||||||
if SOC_SERIES_MEC175X
|
if SOC_SERIES_MEC175X
|
||||||
|
|
||||||
|
|
|
@ -10,15 +10,7 @@
|
||||||
#include <soc.h>
|
#include <soc.h>
|
||||||
#include <soc_cmn_init.h>
|
#include <soc_cmn_init.h>
|
||||||
|
|
||||||
static int soc_init(void)
|
void soc_prep_hook(void)
|
||||||
{
|
{
|
||||||
mec5_soc_common_init();
|
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);
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ config SOC_SERIES_MECH172X
|
||||||
select HAS_SWO
|
select HAS_SWO
|
||||||
select HAS_MEC5_HAL
|
select HAS_MEC5_HAL
|
||||||
select HAS_PM
|
select HAS_PM
|
||||||
|
select SOC_PREP_HOOK
|
||||||
|
|
||||||
if SOC_SERIES_MECH172X
|
if SOC_SERIES_MECH172X
|
||||||
|
|
||||||
|
|
|
@ -10,15 +10,7 @@
|
||||||
#include <soc.h>
|
#include <soc.h>
|
||||||
#include <soc_cmn_init.h>
|
#include <soc_cmn_init.h>
|
||||||
|
|
||||||
static int soc_init(void)
|
void soc_prep_hook(void)
|
||||||
{
|
{
|
||||||
mec5_soc_common_init();
|
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);
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue