diff options
author | Tom Rini <trini@konsulko.com> | 2024-06-24 13:34:52 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2024-06-24 13:34:52 -0600 |
commit | a7eada24327a40f7ef6c55c220e119839c9d4227 (patch) | |
tree | efbea0c3cb6845fe9b5841b100c2770a60cb3f68 /arch/arm/mach-stm32mp/stm32mp1/psci.c | |
parent | d3c610fa462a76880845920e7c535133a264448a (diff) | |
parent | 9e9f78f7aa0124ef0e622532043acf87e84008dc (diff) |
Merge tag 'v2024.07-rc5' into next
Prepare v2024.07-rc5
Diffstat (limited to 'arch/arm/mach-stm32mp/stm32mp1/psci.c')
-rw-r--r-- | arch/arm/mach-stm32mp/stm32mp1/psci.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/arm/mach-stm32mp/stm32mp1/psci.c b/arch/arm/mach-stm32mp/stm32mp1/psci.c index 7772546b2fe..bfbf420fdb5 100644 --- a/arch/arm/mach-stm32mp/stm32mp1/psci.c +++ b/arch/arm/mach-stm32mp/stm32mp1/psci.c @@ -809,6 +809,27 @@ void __secure psci_system_suspend(u32 __always_unused function_id, clrbits_le32(STM32_SYSCFG_BASE + SYSCFG_CMPCR, SYSCFG_CMPCR_SW_CTRL); /* + * Make sure the OS would not get any spurious IWDG pretimeout IRQ + * right after the system wakes up. This may happen in case the SoC + * got woken up by another source than the IWDG pretimeout and the + * pretimeout IRQ arrived immediately afterward, but too late to be + * handled by the main loop above. In case either of the IWDG is + * enabled, ping it first and then return to the OS. + */ + + /* Ping IWDG1 and ACK pretimer IRQ */ + if (gic_enabled[4] & BIT(22)) { + writel(IWDG_KR_RELOAD_KEY, STM32_IWDG1_BASE + IWDG_KR); + writel(IWDG_EWCR_EWIC, STM32_IWDG1_BASE + IWDG_EWCR); + } + + /* Ping IWDG2 and ACK pretimer IRQ */ + if (gic_enabled[4] & BIT(23)) { + writel(IWDG_KR_RELOAD_KEY, STM32_IWDG2_BASE + IWDG_KR); + writel(IWDG_EWCR_EWIC, STM32_IWDG2_BASE + IWDG_EWCR); + } + + /* * The system has resumed successfully. Rewrite LR register stored * on stack with 'ep' value, so that on return from this PSCI call, * the code would jump to that 'ep' resume entry point code path |