Skip to content

Commit

Permalink
soc: ti: move init code from SYS_INIT to hooks
Browse files Browse the repository at this point in the history
Replace SYS_INIT with SoC hooks and adapt SoC init code

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
  • Loading branch information
nashif authored and henrikbrixandersen committed Sep 20, 2024
1 parent 6624ebd commit b73c557
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 24 deletions.
1 change: 1 addition & 0 deletions soc/ti/k3/am6x/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions soc/ti/k3/am6x/m4/soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
1 change: 1 addition & 0 deletions soc/ti/simplelink/cc13x2_cc26x2/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions soc/ti/simplelink/cc13x2_cc26x2/soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@

#include <driverlib/setup.h>

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);
1 change: 1 addition & 0 deletions soc/ti/simplelink/cc13x2x7_cc26x2x7/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions soc/ti/simplelink/cc13x2x7_cc26x2x7/soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@

#include <driverlib/setup.h>

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);
1 change: 1 addition & 0 deletions soc/ti/simplelink/cc32xx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions soc/ti/simplelink/cc32xx/soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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);
1 change: 1 addition & 0 deletions soc/ti/simplelink/msp432p4xx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 1 addition & 5 deletions soc/ti/simplelink/msp432p4xx/soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@
#include <zephyr/init.h>
#include <soc.h>

static int ti_msp432p4xx_init(void)
void soc_early_init_hook(void)
{

SystemInit();

return 0;
}

SYS_INIT(ti_msp432p4xx_init, PRE_KERNEL_1, 0);

0 comments on commit b73c557

Please sign in to comment.