u-boot/arch/arm/mach-stm32mp/include/mach
Marek Vasut 715e709038 ARM: stm32: Add IWDG handling into PSCI suspend code
In case the IWDG is enabled by either U-Boot or Linux, the IWDG can never
be disabled again. That includes low power states, which means that if the
IWDG is enabled, the SoC would reset itself after a while in suspend via
the IWDG. This is not desired behavior.

It is possible to enable IWDG pre-timeout IRQ which is routed into the EXTI,
and use that IRQ to wake the CPU up before the IWDG timeout is reached and
reset is triggered. This pre-timeout IRQ can be used to reload the WDT and
then suspend the CPU again every once in a while.

Implement this functionality for both IWDG1 and IWDG2 by reading out all
the unmasked IRQs, comparing the list with currently pending IRQs in GICv3:
- If any IRQ is pending and it is NOT IWDG1 or IWDG2 pre-timeout IRQ,
  wake up and let OS handle the IRQs
- If IWDG1 or IWDG2 IRQ is pending and no other IRQ is pending,
  ping the respective IWDG and suspend again

This does not seem to have any adverse impact on power consumption in suspend.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2023-06-16 11:09:28 +02:00
..
bsec.h stm32mp: Add OP-TEE support in bsec driver 2023-01-12 16:37:13 +01:00
ddr.h ram: stm32mp1: increase vdd2_ddr: buck2 for 32bits LPDDR 2020-03-24 14:20:50 +01:00
stm32.h ARM: stm32: Add IWDG handling into PSCI suspend code 2023-06-16 11:09:28 +02:00
stm32mp1_smc.h arm: stm32mp: improve the error message for smc 2020-03-24 14:05:35 +01:00
stm32prog.h stm32mp: stm32prog: Remove tee_detected from stm32prog_data struct 2023-06-16 11:01:16 +02:00
sys_proto.h ARM: stm32: Factor out save_boot_params 2023-01-13 13:46:57 +01:00
tzc.h arm: stm32mp: Implement support for TZC 400 controller 2021-07-27 09:48:09 +02:00