Skip to content
Merged
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
6 changes: 6 additions & 0 deletions soc/intel/intel_adsp/ace/multiprocessing.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <zephyr/arch/cpu.h>
#include <zephyr/arch/xtensa/arch.h>
#include <zephyr/pm/pm.h>
#include <zephyr/pm/policy.h>
#include <zephyr/pm/device_runtime.h>
#include <ksched.h>

Expand Down Expand Up @@ -147,6 +148,11 @@ void soc_start_core(int cpu_num)
} else {
*rom_jump_vector = (uint32_t) dsp_restore_vector;
}

/* The primary core cannot enter power gating if any of the secondary cores are
* active.
*/
pm_policy_state_lock_get(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So each secondary gets a lock reference and when the last gives up its reference, idle is allowed, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Exactly.

#else
*rom_jump_vector = (uint32_t) z_soc_mp_asm_entry;
#endif
Expand Down
17 changes: 11 additions & 6 deletions soc/intel/intel_adsp/ace/power.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/
#include <zephyr/kernel.h>
#include <zephyr/pm/pm.h>
#include <zephyr/pm/policy.h>
#include <zephyr/pm/device_runtime.h>
#include <zephyr/device.h>
#include <zephyr/debug/sparse.h>
Expand Down Expand Up @@ -81,17 +82,17 @@ void power_down(bool disable_lpsram, bool disable_hpsram, bool response_to_ipc);
*/
extern void platform_context_restore(void);

/*
/**
* @brief pointer to a persistent storage space, to be set by platform code
*/
uint8_t *global_imr_ram_storage;

/*8
* @biref a d3 restore boot entry point
/**
* @brief a d3 restore boot entry point
*/
extern void boot_entry_d3_restore(void);

/*
/**
* @brief re-enables IDC interrupt for all cores after exiting D3 state
*
* Called once from core 0
Expand All @@ -100,8 +101,8 @@ extern void soc_mp_on_d3_exit(void);

#else

/*
* @biref FW entry point called by ROM during normal boot flow
/**
* @brief FW entry point called by ROM during normal boot flow
*/
extern void rom_entry(void);

Expand Down Expand Up @@ -342,6 +343,10 @@ void pm_state_set(enum pm_state state, uint8_t substate_id)
/* do power down - this function won't return */
power_down(true, IS_ENABLED(CONFIG_ADSP_POWER_DOWN_HPSRAM), true);
} else {
/* When all secondary cores are turned off, power gating for the primary
* core will be re-enabled.
*/
pm_policy_state_lock_put(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES);
power_gate_entry(cpu);
}
break;
Expand Down
4 changes: 2 additions & 2 deletions soc/intel/intel_adsp/cavs/power.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ LOG_MODULE_REGISTER(soc);

#define ALL_USED_INT_LEVELS_MASK (L2_INTERRUPT_MASK | L3_INTERRUPT_MASK)

/*
* @biref FW entry point called by ROM during normal boot flow
/**
* @brief FW entry point called by ROM during normal boot flow
*/
extern void rom_entry(void);
void mp_resume_entry(void);
Expand Down