Standby current to high, rails keep enabled
I'm trying to enter standby (DDR off or on) on my custom board, containing a STM32MP151 and a STPMIC1B.
This is my STPMIC/suspend entry in the device tree of OPTEE:
&i2c4 {
compatible = "st,stm32mp15-i2c-non-secure";
pinctrl-names = "default";
pinctrl-0 = <&i2c4_pins_z_mx>;
//pinctrl-1 = <&i2c4_sleep_pins_a>;
i2c-scl-rising-time-ns = <185>;
i2c-scl-falling-time-ns = <20>;
clock-frequency = <400000>;
status = "okay";
/* spare dmas for other usage */
/delete-property/dmas;
/delete-property/dma-names;
pmic: stpmic@33 {
compatible = "st,stpmic1";
reg = <0x33>;
interrupts-extended = <&gpioa 0 IRQ_TYPE_EDGE_FALLING>;
interrupt-controller;
#interrupt-cells = <2>;
status = "okay";
regulators {
compatible = "st,stpmic1-regulators";
buck1-supply = <&vin>;
buck2-supply = <&vin>;
buck3-supply = <&vin>;
ldo3-supply = <&vdd>;
ldo2-supply = <&vin>;
ldo4-supply = <&bst_out>;
boost-supply = <&vin>;
vref_ddr-supply = <&vdd_ddr>;
vddcore: buck1 {
regulator-name = "vddcore";
regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <1200000>;
regulator-always-on;
regulator-initial-mode = <0>;
regulator-over-current-protection;
};
vdd_ddr: buck2 {
regulator-name = "vdd_ddr";
regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <1200000>;
regulator-always-on;
regulator-initial-mode = <0>;
regulator-over-current-protection;
};
vdd: buck3 {
regulator-name = "vdd";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-always-on;
st,mask-reset;
regulator-initial-mode = <0>;
regulator-over-current-protection;
};
vdd_ddr_1v8: ldo3 {
regulator-name = "vdd_ddr_1v8";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-always-on;
regulator-over-current-protection;
};
vdd_emmc: ldo2 {
regulator-name = "vdd_emmc";
regulator-min-microvolt = <2900000>;
regulator-max-microvolt = <2900000>;
regulator-always-on;
regulator-over-current-protection;
interrupts = <IT_CURLIM_LDO2 0>;
};
bst_out: boost {
regulator-name = "bst_out";
interrupts = <IT_OCP_BOOST 0>;
};
vdd_usb: ldo4 {
regulator-name = "vdd_usb";
interrupts = <IT_CURLIM_LDO4 0>;
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
};
vref_ddr: vref_ddr {
regulator-name = "vref_ddr";
regulator-always-on;
};
};
onkey {
compatible = "st,stpmic1-onkey";
interrupts = <IT_PONKEY_F 0>, <IT_PONKEY_R 0>;
interrupt-names = "onkey-falling", "onkey-rising";
power-off-time-sec = <10>;
status = "enabled";
};
watchdog {
compatible = "st,stpmic1-wdt";
status = "disabled";
};
};
};
&pwr_regulators{
status = "okay";
/* USER CODE BEGIN pwr_regulators */
system_suspend_supported_soc_modes = <
STM32_PM_CSLEEP_RUN
STM32_PM_CSTOP_ALLOW_LP_STOP
STM32_PM_CSTOP_ALLOW_STANDBY_DDR_SR
>;
system_off_soc_mode = <STM32_PM_CSTOP_ALLOW_STANDBY_DDR_OFF>;
vdd-supply = <&vdd>;
vdd_3v3_usbfs-supply = <&vdd_usb>;
/* USER CODE END pwr_regulators */
};
&vddcore {
lp-stop {
regulator-on-in-suspend;
};
standby-ddr-sr {
regulator-off-in-suspend;
};
standby-ddr-off {
regulator-off-in-suspend;
};
};
&vdd_ddr {
lp-stop {
regulator-on-in-suspend;
};
standby-ddr-sr {
regulator-on-in-suspend;
};
standby-ddr-off {
regulator-off-in-suspend;
};
};
&vdd {
lp-stop {
regulator-on-in-suspend;
};
standby-ddr-sr {
regulator-on-in-suspend;
};
standby-ddr-off {
regulator-off-in-suspend;
};
};
&vdd_ddr_1v8 {
lp-stop {
regulator-on-in-suspend;
};
standby-ddr-sr {
regulator-on-in-suspend;
};
standby-ddr-off {
regulator-off-in-suspend;
};
};
&vdd_emmc {
lp-stop {
regulator-on-in-suspend;
};
standby-ddr-sr {
regulator-off-in-suspend;
};
standby-ddr-off {
regulator-off-in-suspend;
};
};
&bst_out {
lp-stop {
regulator-off-in-suspend;
};
standby-ddr-sr {
regulator-off-in-suspend;
};
standby-ddr-off {
regulator-off-in-suspend;
};
};
&vdd_usb {
lp-stop {
regulator-off-in-suspend;
};
standby-ddr-sr {
regulator-off-in-suspend;
};
standby-ddr-off {
regulator-off-in-suspend;
};
};
&vref_ddr {
lp-stop {
regulator-on-in-suspend;
};
standby-ddr-sr {
regulator-on-in-suspend;
};
standby-ddr-off {
regulator-off-in-suspend;
};
};
When I run
echo mem > /sys/power/state
I get the following message:
[ 47.699035] PM: suspend entry (deep)
[ 47.797158] Filesystems sync: 0.095 seconds
[ 47.807093] Freezing user space processes
[ 47.812012] Freezing user space processes completed (elapsed 0.002 seconds)
[ 47.817707] OOM killer disabled.
[ 47.820762] Freezing remaining freezable tasks
[ 47.827030] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
[ 47.833040] printk: Suspending console(s) (use no_console_suspend to debug)
After this i am not able to wake, and the power supply rails are not at the expected levels:
VDDCORE is at 1.2V
VDD_DDR is at 0V
VDD is at ~300mV
VDD_DDR_1V8 is at 0V
VDD_EMMC is at 2.9V
VDD_USB is at 3.3V
Questions:
- How to debug this? Why could some rails still be enabled?
- Is only the device tree of optee important for standby?
- Do I have to disable peripherals explicitly in optee device tree when they are enabled in kernel?
