Skip to content

Commit c344771

Browse files
nashifhenrikbrixandersen
authored andcommitted
soc: intel: 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]>
1 parent e650661 commit c344771

File tree

10 files changed

+14
-25
lines changed

10 files changed

+14
-25
lines changed

soc/intel/intel_adsp/ace/Kconfig

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ config SOC_SERIES_INTEL_ADSP_ACE
1515
select XTENSA_CPU_HAS_HIFI3
1616
select XTENSA_CPU_HAS_HIFI4
1717
select ARCH_HAS_RESERVED_PAGE_FRAMES if MMU
18+
select SOC_LATE_INIT_HOOK
19+
select SOC_EARLY_INIT_HOOK
1820

1921
config SOC_INTEL_COMM_WIDGET
2022
bool "Intel Communication Widget driver"

soc/intel/intel_adsp/ace/multiprocessing.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,11 @@ void soc_mp_init(void)
108108
soc_cpus_active[0] = true;
109109
}
110110

111-
static int host_runtime_get(void)
111+
void soc_late_init_hook(void)
112112
{
113-
return pm_device_runtime_get(INTEL_ADSP_HST_DOMAIN_DEV);
113+
pm_device_runtime_get(INTEL_ADSP_HST_DOMAIN_DEV);
114114
}
115-
SYS_INIT(host_runtime_get, POST_KERNEL, 99);
115+
116116

117117
#ifdef CONFIG_ADSP_IMR_CONTEXT_SAVE
118118
/*

soc/intel/intel_adsp/cavs/Kconfig

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ config SOC_SERIES_INTEL_ADSP_CAVS
1111
select ATOMIC_OPERATIONS_ARCH if "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "xcc"
1212
select ARCH_HAS_COHERENCE
1313
select HAS_PM
14+
select SOC_EARLY_INIT_HOOK
1415

1516
config SOC_INTEL_CAVS_V25
1617
select XTENSA_WAITI_BUG

soc/intel/intel_adsp/common/boot_complete.c

-2
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,3 @@ int boot_complete(void)
2828

2929
return 0;
3030
}
31-
32-
SYS_INIT(boot_complete, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);

soc/intel/intel_adsp/common/soc.c

+3-5
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@
66
#include <zephyr/init.h>
77
#include <zephyr/linker/section_tags.h>
88

9+
extern int boot_complete(void);
910
extern void power_init(void);
1011
extern void adsp_clock_init(void);
1112

1213
#if CONFIG_MP_MAX_NUM_CPUS > 1
1314
extern void soc_mp_init(void);
1415
#endif
1516

16-
static __imr int soc_init(void)
17+
void soc_early_init_hook(void)
1718
{
19+
(void)boot_complete();
1820
power_init();
1921

2022
#ifdef CONFIG_ADSP_CLOCK
@@ -24,8 +26,4 @@ static __imr int soc_init(void)
2426
#if CONFIG_MP_MAX_NUM_CPUS > 1
2527
soc_mp_init();
2628
#endif
27-
28-
return 0;
2929
}
30-
31-
SYS_INIT(soc_init, PRE_KERNEL_1, 99);

soc/intel/intel_ish/Kconfig

+1
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ config SOC_FAMILY_INTEL_ISH
1313
select INTEL_HAL
1414
select HAS_PM
1515
select HAS_COVERAGE_SUPPORT
16+
select SOC_EARLY_INIT_HOOK

soc/intel/intel_ish/intel_ish5/pm/power.c

+1-5
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,7 @@ void sys_arch_reboot(int type)
7272

7373
extern void sedi_pm_init(void);
7474

75-
static int ish_sedi_pm_init(void)
75+
void soc_early_init_hook(void)
7676
{
7777
sedi_pm_init();
78-
79-
return 0;
8078
}
81-
82-
SYS_INIT(ish_sedi_pm_init, PRE_KERNEL_2, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);

soc/intel/intel_ish/intel_ish5/soc.c

+1-5
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,9 @@
1111
#include "sedi_driver_hpet.h"
1212
#endif
1313

14-
static int intel_ish_init(void)
14+
void soc_early_init_hook(void)
1515
{
1616
#if defined(CONFIG_HPET_TIMER)
1717
sedi_hpet_set_min_delay(HPET_CMP_MIN_DELAY);
1818
#endif
19-
20-
return 0;
2119
}
22-
23-
SYS_INIT(intel_ish_init, PRE_KERNEL_2, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);

soc/intel/intel_socfpga_std/cyclonev/Kconfig

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ config SOC_SERIES_CYCLONEV
77
select ARM_AARCH32_MMU
88
select ARM_ARCH_TIMER_ERRATUM_740657 if ARM_ARCH_TIMER
99
select ARCH_HAS_RESERVED_PAGE_FRAMES
10+
select SOC_EARLY_INIT_HOOK

soc/intel/intel_socfpga_std/cyclonev/soc.c

+1-5
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,12 @@ const struct arm_mmu_config mmu_config = {
7070
*
7171
* @return 0
7272
*/
73-
static int soc_intel_cyclonev_init(void)
73+
void soc_early_init_hook(void)
7474
{
7575
unsigned int sctlr = __get_SCTLR(); /* modifying some registers prior to initialization */
7676

7777
sctlr &= ~SCTLR_A_Msk;
7878
__set_SCTLR(sctlr);
7979
__set_VBAR(0);
80-
return 0;
8180
}
82-
83-
SYS_INIT(soc_intel_cyclonev_init, PRE_KERNEL_1,
84-
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
8581
/* EOF */

0 commit comments

Comments
 (0)