Skip to content

Commit b818ec2

Browse files
committed
zephyr: cavs: add secondary core context save support
Register pm_state_notifier to set ready_flag for secondary core when it is powered up for second time after first fw boot. We can remove CONFIG_ADSP_IMR_CONTEXT_SAVE check for cavs platform for this feature. Signed-off-by: Rander Wang <rander.wang@intel.com>
1 parent 49377e8 commit b818ec2

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/platform/intel/cavs/platform.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ int platform_boot_complete(uint32_t boot_message)
102102
return 0;
103103
}
104104

105+
static struct pm_notifier pm_state_notifier = {
106+
.state_exit = cpu_notify_state_exit,
107+
};
108+
105109
/* Runs on the primary core only */
106110
int platform_init(struct sof *sof)
107111
{
@@ -150,6 +154,9 @@ int platform_init(struct sof *sof)
150154
if (ret < 0)
151155
return ret;
152156

157+
/* register power states exit notifiers */
158+
pm_notifier_register(&pm_state_notifier);
159+
153160
/* initialize the host IPC mechanisms */
154161
trace_point(TRACE_BOOT_PLATFORM_IPC);
155162
ipc_init(sof);

zephyr/lib/cpu.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,7 @@ int cpu_enable_core(int id)
148148
* initialization. By reinitializing the idle thread, we would overwrite the kernel structs
149149
* and the idle thread stack.
150150
*/
151-
if (!IS_ENABLED(CONFIG_ADSP_IMR_CONTEXT_SAVE) ||
152-
pm_state_next_get(id)->state == PM_STATE_ACTIVE)
151+
if (pm_state_next_get(id)->state == PM_STATE_ACTIVE)
153152
z_init_cpu(id);
154153
#endif
155154

0 commit comments

Comments
 (0)