soc: ti: pm33xx: AM437X: Add rtc_only with ddr in self-refresh support
authorKeerthy <j-keerthy@ti.com>
Wed, 3 Apr 2019 04:57:42 +0000 (10:27 +0530)
committerTony Lindgren <tony@atomide.com>
Mon, 8 Apr 2019 17:39:01 +0000 (10:39 -0700)
commit5a99ae0092fe24fd581fdb6b9c2b48f94f92cf32
treea944d2b28f56550f5af773a48bef676670ce11fe
parent1c6c03545089ef13a5dd6ef85900765be64aea49
soc: ti: pm33xx: AM437X: Add rtc_only with ddr in self-refresh support

During RTC-only suspend, power is lost to the wkup domain, so we need to
save and restore the state of that domain. We also need to store some
information within the RTC registers so that u-boot can do the right thing
at powerup.

The state is entered by getting the RTC to bring the pmic_power_en line low
which will instruct the PMIC to disable the appropriate power rails after
putting DDR into self-refresh mode. To bring pmic_power_en low, we need to
get an ALARM2 event. Since we are running from SRAM at that point, it means
calculating what the next second is (via ASM) and programming that into the
RTC. This patch also adds support for wake up source detection.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/soc/ti/Kconfig
drivers/soc/ti/pm33xx.c