Skip to content

Commit

Permalink
zephyr: cpu: only run z_init_cpu() on boot for MTL
Browse files Browse the repository at this point in the history
Only run z_init_cpu() on boot for MTL by replacing the check for
IMR_CONTEXT_SAVE with a check for ACE. Therefore,

- on MTL, only run z_init_cpu() on boot, not when waking up from D3,
  regardless whether saving to IMR is enabled or not.

- on other platforms, run z_init_cpu() both on boot and on waking up
  from D3.

The difference is caused by differnet Zephyr implementations between
MTL and other platforms.

Moreover, saving context to IMR is a feature for MTL only, not available
for other platorms.

Signed-off-by: Mengdong Lin <[email protected]>
  • Loading branch information
mengdonglin committed Sep 5, 2023
1 parent d964b7b commit 2a8c046
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zephyr/lib/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ int cpu_enable_core(int id)
* initialization. By reinitializing the idle thread, we would overwrite the kernel structs
* and the idle thread stack.
*/
if (!IS_ENABLED(CONFIG_ADSP_IMR_CONTEXT_SAVE) ||
if (!defined(CONFIG_ACE) ||
pm_state_next_get(id)->state == PM_STATE_ACTIVE)
z_init_cpu(id);
#endif
Expand Down

0 comments on commit 2a8c046

Please sign in to comment.