intel_adsp: power: SoC restores the clock

The SoC restores the clock only when leaving soft-off only.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2024-04-30 15:50:40 -07:00 committed by Carles Cufí
commit 5ca3bc92c8
4 changed files with 16 additions and 8 deletions

View file

@ -212,7 +212,6 @@ void smp_timer_init(void)
{ {
} }
/* Runs on core 0 only */
static int sys_clock_driver_init(void) static int sys_clock_driver_init(void)
{ {
uint64_t curr = count(); uint64_t curr = count();
@ -224,14 +223,11 @@ static int sys_clock_driver_init(void)
return 0; return 0;
} }
#ifdef CONFIG_PM /* Runs on core 0 only */
void intel_adsp_clock_soft_off_exit(void)
void sys_clock_idle_exit(void)
{ {
sys_clock_driver_init(); (void)sys_clock_driver_init();
} }
#endif
SYS_INIT(sys_clock_driver_init, PRE_KERNEL_2, SYS_INIT(sys_clock_driver_init, PRE_KERNEL_2,
CONFIG_SYSTEM_CLOCK_INIT_PRIORITY); CONFIG_SYSTEM_CLOCK_INIT_PRIORITY);

View file

@ -88,6 +88,12 @@ static ALWAYS_INLINE bool soc_cpu_is_powered(int cpu_num)
return (ACE_PWRSTS->dsphpxpgs & BIT(cpu_num)) == BIT(cpu_num); return (ACE_PWRSTS->dsphpxpgs & BIT(cpu_num)) == BIT(cpu_num);
} }
/**
* @brief Restore timer after leaving soft-off.
*
*/
void intel_adsp_clock_soft_off_exit(void);
/** /**
* @brief Retrieve node identifier for Intel ADSP HOST power domain. * @brief Retrieve node identifier for Intel ADSP HOST power domain.
*/ */

View file

@ -89,6 +89,12 @@ static ALWAYS_INLINE bool soc_cpu_is_powered(int cpu_num)
return (ACE_PWRSTS->dsphpxpgs & BIT(cpu_num)) == BIT(cpu_num); return (ACE_PWRSTS->dsphpxpgs & BIT(cpu_num)) == BIT(cpu_num);
} }
/**
* @brief Restore timer after leaving soft-off.
*
*/
void intel_adsp_clock_soft_off_exit(void);
/** /**
* @brief Retrieve node identifier for Intel ADSP HOST power domain. * @brief Retrieve node identifier for Intel ADSP HOST power domain.
*/ */

View file

@ -388,7 +388,7 @@ void pm_state_exit_post_ops(enum pm_state state, uint8_t substate_id)
imr_layout->imr_state.header.adsp_imr_magic = 0; imr_layout->imr_state.header.adsp_imr_magic = 0;
imr_layout->imr_state.header.imr_restore_vector = NULL; imr_layout->imr_state.header.imr_restore_vector = NULL;
imr_layout->imr_state.header.imr_ram_storage = NULL; imr_layout->imr_state.header.imr_ram_storage = NULL;
sys_clock_idle_exit(); intel_adsp_clock_soft_off_exit();
mem_window_idle_exit(); mem_window_idle_exit();
soc_mp_on_d3_exit(); soc_mp_on_d3_exit();
} }