diff --git a/soc/ti/k3/am6x/Kconfig b/soc/ti/k3/am6x/Kconfig index f5596944bf87b8..39eaf92c858203 100644 --- a/soc/ti/k3/am6x/Kconfig +++ b/soc/ti/k3/am6x/Kconfig @@ -17,6 +17,7 @@ config SOC_SERIES_AM6X_M4 select EXTERNAL_ADDRESS_TRANSLATION select MM_DRV select MM_TI_RAT + select SOC_PREP_HOOK config SOC_PART_NUMBER default "AM6234" if SOC_AM6234_A53 diff --git a/soc/ti/k3/am6x/m4/soc.c b/soc/ti/k3/am6x/m4/soc.c index b2e261a4e9ce03..519a3fab21b60b 100644 --- a/soc/ti/k3/am6x/m4/soc.c +++ b/soc/ti/k3/am6x/m4/soc.c @@ -62,12 +62,9 @@ static void am6x_mmr_unlock(void) sys_write32(KICK1_UNLOCK_VAL, kickAddr); /* KICK 1 */ } -static int am6x_m4_init(void) +void soc_prep_hook(void) { sys_mm_drv_ti_rat_init(am6x_region_config, ADDR_TRANSLATE_RAT_BASE_ADDR, ARRAY_SIZE(am6x_region_config)); am6x_mmr_unlock(); - return 0; } - -SYS_INIT(am6x_m4_init, EARLY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); diff --git a/soc/ti/simplelink/cc13x2_cc26x2/Kconfig b/soc/ti/simplelink/cc13x2_cc26x2/Kconfig index 01acc8f48d87bf..6885038cc16656 100644 --- a/soc/ti/simplelink/cc13x2_cc26x2/Kconfig +++ b/soc/ti/simplelink/cc13x2_cc26x2/Kconfig @@ -14,6 +14,7 @@ config SOC_SERIES_CC13X2_CC26X2 select HAS_SEGGER_RTT if ZEPHYR_SEGGER_MODULE select HAS_PM select HAS_POWEROFF + select SOC_EARLY_INIT_HOOK menu "Customer Configuration (CCFG)" depends on SOC_SERIES_CC13X2_CC26X2 diff --git a/soc/ti/simplelink/cc13x2_cc26x2/soc.c b/soc/ti/simplelink/cc13x2_cc26x2/soc.c index 452c73254e72e8..c896cf2691f215 100644 --- a/soc/ti/simplelink/cc13x2_cc26x2/soc.c +++ b/soc/ti/simplelink/cc13x2_cc26x2/soc.c @@ -8,13 +8,9 @@ #include -static int ti_cc13x2_cc26x2_init(void) +void soc_early_init_hook(void) { /* Performs necessary trim of the device. */ SetupTrimDevice(); - - return 0; } - -SYS_INIT(ti_cc13x2_cc26x2_init, PRE_KERNEL_1, 0); diff --git a/soc/ti/simplelink/cc13x2x7_cc26x2x7/Kconfig b/soc/ti/simplelink/cc13x2x7_cc26x2x7/Kconfig index e5c5a01eedff0a..d1b2fc58bd3730 100644 --- a/soc/ti/simplelink/cc13x2x7_cc26x2x7/Kconfig +++ b/soc/ti/simplelink/cc13x2x7_cc26x2x7/Kconfig @@ -14,6 +14,7 @@ config SOC_SERIES_CC13X2X7_CC26X2X7 select HAS_TI_CCFG if !BOOTLOADER_MCUBOOT select HAS_SEGGER_RTT if ZEPHYR_SEGGER_MODULE select HAS_PM + select SOC_EARLY_INIT_HOOK menu "Customer Configuration (CCFG)" depends on SOC_SERIES_CC13X2X7_CC26X2X7 diff --git a/soc/ti/simplelink/cc13x2x7_cc26x2x7/soc.c b/soc/ti/simplelink/cc13x2x7_cc26x2x7/soc.c index 8c2ea2f5350df2..22efa243e67910 100644 --- a/soc/ti/simplelink/cc13x2x7_cc26x2x7/soc.c +++ b/soc/ti/simplelink/cc13x2x7_cc26x2x7/soc.c @@ -8,13 +8,9 @@ #include -static int ti_cc13x7_cc26x7_init(void) +void soc_early_init_hook(void) { /* Performs necessary trim of the device. */ SetupTrimDevice(); - - return 0; } - -SYS_INIT(ti_cc13x7_cc26x7_init, PRE_KERNEL_1, 0); diff --git a/soc/ti/simplelink/cc32xx/Kconfig b/soc/ti/simplelink/cc32xx/Kconfig index d8ec2f2071592c..8698ddd3452f47 100644 --- a/soc/ti/simplelink/cc32xx/Kconfig +++ b/soc/ti/simplelink/cc32xx/Kconfig @@ -7,6 +7,7 @@ config SOC_SERIES_CC32XX select CPU_CORTEX_M4 select CPU_CORTEX_M_HAS_DWT select DYNAMIC_INTERRUPTS + select SOC_EARLY_INIT_HOOK config SOC_CC3220SF select HAS_CC3220SDK diff --git a/soc/ti/simplelink/cc32xx/soc.c b/soc/ti/simplelink/cc32xx/soc.c index f95141f5ddda4b..7e127ddfcba59f 100644 --- a/soc/ti/simplelink/cc32xx/soc.c +++ b/soc/ti/simplelink/cc32xx/soc.c @@ -18,7 +18,7 @@ void sys_arch_reboot(int type) MAP_PRCMMCUReset(!!type); } -static int ti_cc32xx_init(void) +void soc_early_init_hook(void) { /* Note: This function also performs CC3220 Initialization */ @@ -32,8 +32,4 @@ static int ti_cc32xx_init(void) MAP_PRCMPeripheralClkEnable(PRCM_UARTA0, PRCM_RUN_MODE_CLK | PRCM_SLP_MODE_CLK); #endif - - return 0; } - -SYS_INIT(ti_cc32xx_init, PRE_KERNEL_1, 0); diff --git a/soc/ti/simplelink/msp432p4xx/Kconfig b/soc/ti/simplelink/msp432p4xx/Kconfig index 9b44c5f34ab830..d4a9b6cfac95a5 100644 --- a/soc/ti/simplelink/msp432p4xx/Kconfig +++ b/soc/ti/simplelink/msp432p4xx/Kconfig @@ -9,6 +9,7 @@ config SOC_SERIES_MSP432P4XX select DYNAMIC_INTERRUPTS select CPU_HAS_FPU select CPU_HAS_ARM_MPU + select SOC_EARLY_INIT_HOOK config SOC_MSP432P401R select HAS_MSP432P4XXSDK diff --git a/soc/ti/simplelink/msp432p4xx/soc.c b/soc/ti/simplelink/msp432p4xx/soc.c index 8faf547fdb1132..185124d7ec0dc4 100644 --- a/soc/ti/simplelink/msp432p4xx/soc.c +++ b/soc/ti/simplelink/msp432p4xx/soc.c @@ -9,12 +9,8 @@ #include #include -static int ti_msp432p4xx_init(void) +void soc_early_init_hook(void) { SystemInit(); - - return 0; } - -SYS_INIT(ti_msp432p4xx_init, PRE_KERNEL_1, 0);