Skip to content

Commit 4904668

Browse files
nashif57300
authored andcommitted
[nrf fromtree] soc: ti: move init code from SYS_INIT to hooks
Replace SYS_INIT with SoC hooks and adapt SoC init code Signed-off-by: Anas Nashif <[email protected]> (cherry picked from commit b73c557)
1 parent 7cf18b0 commit 4904668

File tree

10 files changed

+10
-24
lines changed

10 files changed

+10
-24
lines changed

soc/ti/k3/am6x/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ config SOC_SERIES_AM6X_M4
1717
select EXTERNAL_ADDRESS_TRANSLATION
1818
select MM_DRV
1919
select MM_TI_RAT
20+
select SOC_PREP_HOOK
2021

2122
config SOC_PART_NUMBER
2223
default "AM6234" if SOC_AM6234_A53

soc/ti/k3/am6x/m4/soc.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,9 @@ static void am6x_mmr_unlock(void)
6262
sys_write32(KICK1_UNLOCK_VAL, kickAddr); /* KICK 1 */
6363
}
6464

65-
static int am6x_m4_init(void)
65+
void soc_prep_hook(void)
6666
{
6767
sys_mm_drv_ti_rat_init(am6x_region_config, ADDR_TRANSLATE_RAT_BASE_ADDR,
6868
ARRAY_SIZE(am6x_region_config));
6969
am6x_mmr_unlock();
70-
return 0;
7170
}
72-
73-
SYS_INIT(am6x_m4_init, EARLY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);

soc/ti/simplelink/cc13x2_cc26x2/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ config SOC_SERIES_CC13X2_CC26X2
1414
select HAS_SEGGER_RTT if ZEPHYR_SEGGER_MODULE
1515
select HAS_PM
1616
select HAS_POWEROFF
17+
select SOC_EARLY_INIT_HOOK
1718

1819
menu "Customer Configuration (CCFG)"
1920
depends on SOC_SERIES_CC13X2_CC26X2

soc/ti/simplelink/cc13x2_cc26x2/soc.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,9 @@
88

99
#include <driverlib/setup.h>
1010

11-
static int ti_cc13x2_cc26x2_init(void)
11+
void soc_early_init_hook(void)
1212
{
1313

1414
/* Performs necessary trim of the device. */
1515
SetupTrimDevice();
16-
17-
return 0;
1816
}
19-
20-
SYS_INIT(ti_cc13x2_cc26x2_init, PRE_KERNEL_1, 0);

soc/ti/simplelink/cc13x2x7_cc26x2x7/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ config SOC_SERIES_CC13X2X7_CC26X2X7
1414
select HAS_TI_CCFG if !BOOTLOADER_MCUBOOT
1515
select HAS_SEGGER_RTT if ZEPHYR_SEGGER_MODULE
1616
select HAS_PM
17+
select SOC_EARLY_INIT_HOOK
1718

1819
menu "Customer Configuration (CCFG)"
1920
depends on SOC_SERIES_CC13X2X7_CC26X2X7

soc/ti/simplelink/cc13x2x7_cc26x2x7/soc.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,9 @@
88

99
#include <driverlib/setup.h>
1010

11-
static int ti_cc13x7_cc26x7_init(void)
11+
void soc_early_init_hook(void)
1212
{
1313

1414
/* Performs necessary trim of the device. */
1515
SetupTrimDevice();
16-
17-
return 0;
1816
}
19-
20-
SYS_INIT(ti_cc13x7_cc26x7_init, PRE_KERNEL_1, 0);

soc/ti/simplelink/cc32xx/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ config SOC_SERIES_CC32XX
77
select CPU_CORTEX_M4
88
select CPU_CORTEX_M_HAS_DWT
99
select DYNAMIC_INTERRUPTS
10+
select SOC_EARLY_INIT_HOOK
1011

1112
config SOC_CC3220SF
1213
select HAS_CC3220SDK

soc/ti/simplelink/cc32xx/soc.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ void sys_arch_reboot(int type)
1818
MAP_PRCMMCUReset(!!type);
1919
}
2020

21-
static int ti_cc32xx_init(void)
21+
void soc_early_init_hook(void)
2222
{
2323

2424
/* Note: This function also performs CC3220 Initialization */
@@ -32,8 +32,4 @@ static int ti_cc32xx_init(void)
3232
MAP_PRCMPeripheralClkEnable(PRCM_UARTA0, PRCM_RUN_MODE_CLK |
3333
PRCM_SLP_MODE_CLK);
3434
#endif
35-
36-
return 0;
3735
}
38-
39-
SYS_INIT(ti_cc32xx_init, PRE_KERNEL_1, 0);

soc/ti/simplelink/msp432p4xx/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ config SOC_SERIES_MSP432P4XX
99
select DYNAMIC_INTERRUPTS
1010
select CPU_HAS_FPU
1111
select CPU_HAS_ARM_MPU
12+
select SOC_EARLY_INIT_HOOK
1213

1314
config SOC_MSP432P401R
1415
select HAS_MSP432P4XXSDK

soc/ti/simplelink/msp432p4xx/soc.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,8 @@
99
#include <zephyr/init.h>
1010
#include <soc.h>
1111

12-
static int ti_msp432p4xx_init(void)
12+
void soc_early_init_hook(void)
1313
{
1414

1515
SystemInit();
16-
17-
return 0;
1816
}
19-
20-
SYS_INIT(ti_msp432p4xx_init, PRE_KERNEL_1, 0);

0 commit comments

Comments
 (0)