Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/boards/intel_adsp_ace15_mtpm.conf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ CONFIG_PM_POLICY_CUSTOM=y
CONFIG_POWER_DOMAIN=y
CONFIG_POWER_DOMAIN_INTEL_ADSP=y

CONFIG_ADSP_IMR_CONTEXT_SAVE=y
CONFIG_ADSP_IMR_CONTEXT_SAVE=n

# enable Zephyr drivers
CONFIG_ZEPHYR_NATIVE_DRIVERS=y
Expand Down
11 changes: 9 additions & 2 deletions zephyr/lib/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,19 @@ int cpu_enable_core(int id)
return 0;

#if ZEPHYR_VERSION(3, 0, 99) <= ZEPHYR_VERSION_CODE
/* During kernel initialization, the next pm state is set to ACTIVE. By checking this
/* Zephyr implementations on secondary cores initialzation are
* different between MTL+ and other platforms.
*
* On MTL+ platforms, only run z_init_cpu() on boot, not when waking up from D3,
* regardless whether saving to IMR is enabled or not.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that seems wrong to me @mengdonglin

What is the difference between 'boot' and 'waking up from D3' if there is no context saved in IMR?

* During kernel initialization, the next pm state is set to ACTIVE. By checking this
* value, we determine if this is the first core boot, if not, we need to skip idle thread
* initialization. By reinitializing the idle thread, we would overwrite the kernel structs
* and the idle thread stack.
*
* On other platforms, run z_init_cpu() both on boot and on waking up from D3.
*/
if (!IS_ENABLED(CONFIG_ADSP_IMR_CONTEXT_SAVE) ||
if (!IS_ENABLED(CONFIG_ACE) ||
pm_state_next_get(id)->state == PM_STATE_ACTIVE)
z_init_cpu(id);
#endif
Expand Down