Skip to content

Commit 11532e5

Browse files
nashifgmarull
authored andcommitted
[nrf fromtree] soc: snps: 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 49f7204)
1 parent 53b26fb commit 11532e5

File tree

4 files changed

+8
-14
lines changed

4 files changed

+8
-14
lines changed

soc/snps/arc_iot/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ config SOC_ARC_IOT
66
select ARC
77
select CPU_HAS_MPU
88
select CPU_HAS_FPU
9+
select SOC_EARLY_INIT_HOOK

soc/snps/arc_iot/soc.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,7 @@
1515

1616
#define CPU_FREQ DT_PROP(DT_PATH(cpus, cpu_0), clock_frequency)
1717

18-
static int arc_iot_init(void)
18+
void soc_early_init_hook(void)
1919
{
20-
21-
if (arc_iot_pll_fout_config(CPU_FREQ / 1000000) < 0) {
22-
return -1;
23-
}
24-
25-
return 0;
20+
arc_iot_pll_fout_config(CPU_FREQ / 1000000);
2621
}
27-
28-
SYS_INIT(arc_iot_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);

soc/snps/emsk/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@
44

55
config SOC_EMSK
66
select ARC
7+
select SOC_EARLY_INIT_HOOK
78

89
config SOC_EMSK_EM7D
910
select CPU_HAS_MPU
11+
select SOC_EARLY_INIT_HOOK
1012

1113
config SOC_EMSK_EM9D
1214
select CPU_HAS_FPU
15+
select SOC_EARLY_INIT_HOOK
1316

1417
config SOC_EMSK_EM11D
1518
select CPU_HAS_FPU
19+
select SOC_EARLY_INIT_HOOK

soc/snps/emsk/soc_config.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#ifdef CONFIG_UART_NS16550
1313

14-
static int uart_ns16550_init(void)
14+
void soc_early_init_hook(void)
1515
{
1616

1717
/* On ARC EM Starter kit board,
@@ -25,10 +25,6 @@ static int uart_ns16550_init(void)
2525
sys_write32(0, DT_REG_ADDR(DT_INST(1, ns16550))+0x4);
2626
sys_write32(0, DT_REG_ADDR(DT_INST(1, ns16550))+0x10);
2727
#endif /* DT_NODE_HAS_STATUS(DT_INST(1, ns16550), okay) */
28-
29-
return 0;
3028
}
3129

32-
SYS_INIT(uart_ns16550_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
33-
3430
#endif /* CONFIG_UART_NS16550 */

0 commit comments

Comments
 (0)