Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

soc: intel_adsp: replace icache ISR workaround with custom idle solution #71332

Merged
merged 1 commit into from
Apr 15, 2024
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
5 changes: 0 additions & 5 deletions arch/xtensa/include/xtensa_asm2_s.h
Original file line number Diff line number Diff line change
Expand Up @@ -609,11 +609,6 @@ _Level\LVL\()Vector:
s32i a2, a1, ___xtensa_irq_bsa_t_a2_OFFSET
s32i a3, a1, ___xtensa_irq_bsa_t_a3_OFFSET

#ifdef CONFIG_ADSP_IDLE_CLOCK_GATING
/* Needed when waking from low-power waiti state */
isync
#endif

/* Level "1" is the exception handler, which uses a different
* calling convention. No special register holds the
* interrupted PS, instead we just assume that the CPU has
Expand Down
1 change: 1 addition & 0 deletions soc/intel/intel_adsp/ace/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ config SOC_SERIES_INTEL_ADSP_ACE
select ATOMIC_OPERATIONS_BUILTIN if "$(ZEPHYR_TOOLCHAIN_VARIANT)" != "xcc"
select ARCH_HAS_COHERENCE
select SCHED_IPI_SUPPORTED
select ARCH_CPU_IDLE_CUSTOM
select DW_ICTL_ACE
select SOC_HAS_RUNTIME_NUM_CPUS
select HAS_PM
Expand Down
22 changes: 22 additions & 0 deletions soc/intel/intel_adsp/ace/power.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,3 +437,25 @@ void pm_state_exit_post_ops(enum pm_state state, uint8_t substate_id)
}

#endif /* CONFIG_PM */

#ifdef CONFIG_ARCH_CPU_IDLE_CUSTOM

__no_optimization
void arch_cpu_idle(void)
{
uint32_t cpu = arch_proc_id();

sys_trace_idle();

/*
* unlock and invalidate icache if clock gating is allowed
*/
if (!(DSPCS.bootctl[cpu].bctl & DSPBR_BCTL_WAITIPCG)) {
xthal_icache_all_unlock();
xthal_icache_all_invalidate();
}

__asm__ volatile ("waiti 0");
}

#endif /* CONFIG_ARCH_CPU_IDLE_CUSTOM */
Loading