From 911d5532bb3b4588b3ad334536dd81d1664f70b7 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Tue, 10 Sep 2024 09:42:41 -0400 Subject: [PATCH] soc: openisa: move init code from SYS_INIT to hooks Replace SYS_INIT with SoC hooks and adapt SoC init code Signed-off-by: Anas Nashif --- soc/openisa/rv32m1/Kconfig | 1 + soc/openisa/rv32m1/soc.c | 6 +----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/soc/openisa/rv32m1/Kconfig b/soc/openisa/rv32m1/Kconfig index 199d13ba744..0ee9dd7565a 100644 --- a/soc/openisa/rv32m1/Kconfig +++ b/soc/openisa/rv32m1/Kconfig @@ -20,3 +20,4 @@ config SOC_OPENISA_RV32M1 select RISCV_ISA_EXT_C select RISCV_ISA_EXT_ZICSR select RISCV_ISA_EXT_ZIFENCEI + select SOC_EARLY_INIT_HOOK diff --git a/soc/openisa/rv32m1/soc.c b/soc/openisa/rv32m1/soc.c index 95edf0c5383..cfcc6a0387b 100644 --- a/soc/openisa/rv32m1/soc.c +++ b/soc/openisa/rv32m1/soc.c @@ -218,7 +218,7 @@ static void rv32m1_setup_peripheral_clocks(void) * * @return 0 */ -static int soc_rv32m1_init(void) +void soc_early_init_hook(void) { unsigned int key; @@ -239,8 +239,4 @@ static int soc_rv32m1_init(void) rv32m1_setup_peripheral_clocks(); irq_unlock(key); - - return 0; } - -SYS_INIT(soc_rv32m1_init, PRE_KERNEL_1, 0);