diff --git a/soc/snps/arc_iot/Kconfig b/soc/snps/arc_iot/Kconfig index 362d2d1ae71..0ea361d2325 100644 --- a/soc/snps/arc_iot/Kconfig +++ b/soc/snps/arc_iot/Kconfig @@ -6,3 +6,4 @@ config SOC_ARC_IOT select ARC select CPU_HAS_MPU select CPU_HAS_FPU + select SOC_EARLY_INIT_HOOK diff --git a/soc/snps/arc_iot/soc.c b/soc/snps/arc_iot/soc.c index 832c6df5f51..d42ed3f9d9c 100644 --- a/soc/snps/arc_iot/soc.c +++ b/soc/snps/arc_iot/soc.c @@ -15,14 +15,7 @@ #define CPU_FREQ DT_PROP(DT_PATH(cpus, cpu_0), clock_frequency) -static int arc_iot_init(void) +void soc_early_init_hook(void) { - - if (arc_iot_pll_fout_config(CPU_FREQ / 1000000) < 0) { - return -1; - } - - return 0; + arc_iot_pll_fout_config(CPU_FREQ / 1000000); } - -SYS_INIT(arc_iot_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); diff --git a/soc/snps/emsk/Kconfig b/soc/snps/emsk/Kconfig index 88cdfe70671..014d5357f0a 100644 --- a/soc/snps/emsk/Kconfig +++ b/soc/snps/emsk/Kconfig @@ -4,12 +4,16 @@ config SOC_EMSK select ARC + select SOC_EARLY_INIT_HOOK config SOC_EMSK_EM7D select CPU_HAS_MPU + select SOC_EARLY_INIT_HOOK config SOC_EMSK_EM9D select CPU_HAS_FPU + select SOC_EARLY_INIT_HOOK config SOC_EMSK_EM11D select CPU_HAS_FPU + select SOC_EARLY_INIT_HOOK diff --git a/soc/snps/emsk/soc_config.c b/soc/snps/emsk/soc_config.c index adca19b683c..c43942facb0 100644 --- a/soc/snps/emsk/soc_config.c +++ b/soc/snps/emsk/soc_config.c @@ -11,7 +11,7 @@ #ifdef CONFIG_UART_NS16550 -static int uart_ns16550_init(void) +void soc_early_init_hook(void) { /* On ARC EM Starter kit board, @@ -25,10 +25,6 @@ static int uart_ns16550_init(void) sys_write32(0, DT_REG_ADDR(DT_INST(1, ns16550))+0x4); sys_write32(0, DT_REG_ADDR(DT_INST(1, ns16550))+0x10); #endif /* DT_NODE_HAS_STATUS(DT_INST(1, ns16550), okay) */ - - return 0; } -SYS_INIT(uart_ns16550_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); - #endif /* CONFIG_UART_NS16550 */