Skip to content

Commit

Permalink
soc: intel_adsp: call framework callback function for restore
Browse files Browse the repository at this point in the history
When exiting power gated state, call the CPU start function
passed to arch_start_cpu().

Signed-off-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
  • Loading branch information
RanderWang authored and nashif committed Jan 17, 2024
1 parent 2cdd448 commit 6a0b1da
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions soc/xtensa/intel_adsp/ace/power.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ static ALWAYS_INLINE void _restore_core_context(void)
}

void dsp_restore_vector(void);
void mp_resume_entry(void);

void power_gate_entry(uint32_t core_id)
{
Expand Down Expand Up @@ -180,6 +181,11 @@ void power_gate_exit(void)
cpu_early_init();
sys_cache_data_flush_and_invd_all();
_restore_core_context();

/* Secondary core is resumed by set_dx */
if (arch_proc_id()) {
mp_resume_entry();
}
}

__asm__(".align 4\n\t"
Expand Down
6 changes: 6 additions & 0 deletions soc/xtensa/intel_adsp/cavs/power.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ LOG_MODULE_REGISTER(soc);
* @biref FW entry point called by ROM during normal boot flow
*/
extern void rom_entry(void);
void mp_resume_entry(void);

struct core_state {
uint32_t a0;
Expand Down Expand Up @@ -104,6 +105,11 @@ void power_gate_exit(void)
cpu_early_init();
sys_cache_data_flush_and_invd_all();
_restore_core_context();

/* Secondary core is resumed by set_dx */
if (arch_proc_id()) {
mp_resume_entry();
}
}

__asm__(".align 4\n\t"
Expand Down
5 changes: 5 additions & 0 deletions soc/xtensa/intel_adsp/common/multiprocessing.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ __imr void z_mp_entry(void)
__ASSERT(false, "arch_start_cpu() handler should never return");
}

void mp_resume_entry(void)
{
start_rec.fn(start_rec.arg);
}

bool arch_cpu_active(int cpu_num)
{
return soc_cpus_active[cpu_num];
Expand Down

0 comments on commit 6a0b1da

Please sign in to comment.