Commit c344771d authored by Anas Nashif's avatar Anas Nashif Committed by Henrik Brix Andersen
Browse files

soc: intel: move init code from SYS_INIT to hooks



Replace SYS_INIT with SoC hooks and adapt SoC init code

Signed-off-by: default avatarAnas Nashif <anas.nashif@intel.com>
parent e6506619
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -15,6 +15,8 @@ config SOC_SERIES_INTEL_ADSP_ACE
	select XTENSA_CPU_HAS_HIFI3
	select XTENSA_CPU_HAS_HIFI4
	select ARCH_HAS_RESERVED_PAGE_FRAMES if MMU
	select SOC_LATE_INIT_HOOK
	select SOC_EARLY_INIT_HOOK

config SOC_INTEL_COMM_WIDGET
	bool "Intel Communication Widget driver"
+3 −3
Original line number Diff line number Diff line
@@ -108,11 +108,11 @@ void soc_mp_init(void)
	soc_cpus_active[0] = true;
}

static int host_runtime_get(void)
void soc_late_init_hook(void)
{
	return pm_device_runtime_get(INTEL_ADSP_HST_DOMAIN_DEV);
	pm_device_runtime_get(INTEL_ADSP_HST_DOMAIN_DEV);
}
SYS_INIT(host_runtime_get, POST_KERNEL, 99);


#ifdef CONFIG_ADSP_IMR_CONTEXT_SAVE
/*
+1 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ config SOC_SERIES_INTEL_ADSP_CAVS
	select ATOMIC_OPERATIONS_ARCH if "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "xcc"
	select ARCH_HAS_COHERENCE
	select HAS_PM
	select SOC_EARLY_INIT_HOOK

config SOC_INTEL_CAVS_V25
	select XTENSA_WAITI_BUG
+0 −2
Original line number Diff line number Diff line
@@ -28,5 +28,3 @@ int boot_complete(void)

	return 0;
}

SYS_INIT(boot_complete, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
+3 −5
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
#include <zephyr/init.h>
#include <zephyr/linker/section_tags.h>

extern int boot_complete(void);
extern void power_init(void);
extern void adsp_clock_init(void);

@@ -13,8 +14,9 @@ extern void adsp_clock_init(void);
extern void soc_mp_init(void);
#endif

static __imr int soc_init(void)
void soc_early_init_hook(void)
{
	(void)boot_complete();
	power_init();

#ifdef CONFIG_ADSP_CLOCK
@@ -24,8 +26,4 @@ static __imr int soc_init(void)
#if CONFIG_MP_MAX_NUM_CPUS > 1
	soc_mp_init();
#endif

	return 0;
}

SYS_INIT(soc_init, PRE_KERNEL_1, 99);
Loading