stm32: power: SoC restores the clock
Clock must be restored as soon as the SoC leaves standby. Keep the logic inside the SoC instead of delegate it to the pm subsystem. Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
parent
5ca3bc92c8
commit
e1685bb421
3 changed files with 12 additions and 4 deletions
|
@ -50,8 +50,9 @@ void config_plli2s(void);
|
||||||
#endif
|
#endif
|
||||||
void config_enable_default_clocks(void);
|
void config_enable_default_clocks(void);
|
||||||
|
|
||||||
/* function exported to the soc power.c */
|
/* functions exported to the soc power.c */
|
||||||
int stm32_clock_control_init(const struct device *dev);
|
int stm32_clock_control_init(const struct device *dev);
|
||||||
|
void stm32_clock_control_standby_exit(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -550,14 +550,21 @@ static int sys_clock_driver_init(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sys_clock_idle_exit(void)
|
void stm32_clock_control_standby_exit(void)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_STM32_LPTIM_STDBY_TIMER
|
#ifdef CONFIG_STM32_LPTIM_STDBY_TIMER
|
||||||
if (clock_control_get_status(clk_ctrl,
|
if (clock_control_get_status(clk_ctrl,
|
||||||
(clock_control_subsys_t) &lptim_clk[0])
|
(clock_control_subsys_t) &lptim_clk[0])
|
||||||
!= CLOCK_CONTROL_STATUS_ON) {
|
!= CLOCK_CONTROL_STATUS_ON) {
|
||||||
sys_clock_driver_init();
|
sys_clock_driver_init();
|
||||||
} else if (timeout_stdby) {
|
}
|
||||||
|
#endif /* CONFIG_STM32_LPTIM_STDBY_TIMER */
|
||||||
|
}
|
||||||
|
|
||||||
|
void sys_clock_idle_exit(void)
|
||||||
|
{
|
||||||
|
#ifdef CONFIG_STM32_LPTIM_STDBY_TIMER
|
||||||
|
if (timeout_stdby) {
|
||||||
cycle_t missed_lptim_cnt;
|
cycle_t missed_lptim_cnt;
|
||||||
uint32_t stdby_timer_diff, stdby_timer_post, dticks;
|
uint32_t stdby_timer_diff, stdby_timer_post, dticks;
|
||||||
uint64_t stdby_timer_us;
|
uint64_t stdby_timer_us;
|
||||||
|
|
|
@ -118,7 +118,7 @@ static void set_mode_suspend_to_ram(void)
|
||||||
|
|
||||||
/* Execution is restored at this point after wake up */
|
/* Execution is restored at this point after wake up */
|
||||||
/* Restore system clock as soon as we exit standby mode */
|
/* Restore system clock as soon as we exit standby mode */
|
||||||
sys_clock_idle_exit();
|
stm32_clock_control_standby_exit();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue