soc: ti: wkup_m3_ipc: Add support for toggling VTT regulator
authorDave Gerlach <d-gerlach@ti.com>
Sat, 9 Apr 2022 21:12:15 +0000 (14:12 -0700)
committerNishanth Menon <nm@ti.com>
Fri, 22 Apr 2022 23:12:35 +0000 (18:12 -0500)
commitf226041424cf87245d39a1b2dfae304308b36b6b
treefebf01dd536de03e3b004e5d1100d01b367e1a4d
parent12eeb74925da70eb39d90abead9de9793be3d4c8
soc: ti: wkup_m3_ipc: Add support for toggling VTT regulator

Some boards like the AM335x EVM-SK and AM437x GP EVM provide software
control via a GPIO pin to toggle the DDR VTT regulator to reduce power
consumption in low power states.

The VTT regulator should be disabled after enabling self-refresh on
suspend, and should be enabled before disabling self-refresh on resume.
This is to allow proper self-refresh entry/exit commands to be
transmitted to the memory.

The "ti,vtt-gpio-pin" device tree property in the wkup_m3_ipc node
specifies which GPIO pin to use. This property is communicated to the
Wakeup Cortex M3 co-processor where the actual toggling of the GPIO pin
happens in CM3 firmware [1].

Please note that the GPIO pin must be on the GPIO0 module as that module
is in the wakeup power domain.

[1] https://git.ti.com/cgit/processor-firmware/ti-amx3-cm3-pm-firmware/tree/src/pm_services/ddr.c?h=08.02.00.006#n190

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
[dfustini: remove the unnecessary "ti,needs-vtt-toggle" property]
Signed-off-by: Drew Fustini <dfustini@baylibre.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Link: https://lore.kernel.org/r/20220409211215.2529387-3-dfustini@baylibre.com
drivers/soc/ti/wkup_m3_ipc.c
include/linux/wkup_m3_ipc.h