2019-06-21 15:59:33

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v2 3/4] ARM: dts: exynos: Add regulator suspend configuration to Odroid XU3/XU4/HC1 family

Add the PMIC regulator suspend configuration to entire Odroid
XU3/XU4/HC1 family of boards to reduce power usage during suspend. The
configuration is based on vendor (Hardkernel) reference kernel.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
Tested-by: Marek Szyprowski <[email protected]>

---

Tested on XU3 and HC1 with SD card.

---

Changes since v1:
1. Add Marek's tag.
---
arch/arm/boot/dts/exynos5422-odroid-core.dtsi | 92 +++++++++++++++++++
1 file changed, 92 insertions(+)

diff --git a/arch/arm/boot/dts/exynos5422-odroid-core.dtsi b/arch/arm/boot/dts/exynos5422-odroid-core.dtsi
index 0f967259ad29..5a4f7dd2568b 100644
--- a/arch/arm/boot/dts/exynos5422-odroid-core.dtsi
+++ b/arch/arm/boot/dts/exynos5422-odroid-core.dtsi
@@ -177,6 +177,10 @@
regulator-name = "vdd_adc";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
};

ldo5_reg: LDO5 {
@@ -184,6 +188,10 @@
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-always-on;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
};

ldo6_reg: LDO6 {
@@ -191,6 +199,10 @@
regulator-min-microvolt = <1000000>;
regulator-max-microvolt = <1000000>;
regulator-always-on;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
};

ldo7_reg: LDO7 {
@@ -198,6 +210,10 @@
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-always-on;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
};

ldo8_reg: LDO8 {
@@ -205,6 +221,10 @@
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-always-on;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
};

ldo9_reg: LDO9 {
@@ -212,6 +232,10 @@
regulator-min-microvolt = <3000000>;
regulator-max-microvolt = <3000000>;
regulator-always-on;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
};

ldo10_reg: LDO10 {
@@ -219,6 +243,10 @@
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-always-on;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
};

ldo11_reg: LDO11 {
@@ -226,6 +254,10 @@
regulator-min-microvolt = <1000000>;
regulator-max-microvolt = <1000000>;
regulator-always-on;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
};

ldo12_reg: LDO12 {
@@ -239,6 +271,10 @@
regulator-name = "vddq_mmc2";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <2800000>;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
};

ldo14_reg: LDO14 {
@@ -253,6 +289,10 @@
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-always-on;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
};

ldo16_reg: LDO16 {
@@ -267,18 +307,30 @@
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-always-on;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
};

ldo18_reg: LDO18 {
regulator-name = "vdd_emmc_1V8";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
};

ldo19_reg: LDO19 {
regulator-name = "vdd_sd";
regulator-min-microvolt = <2800000>;
regulator-max-microvolt = <2800000>;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
};

ldo20_reg: LDO20 {
@@ -307,6 +359,10 @@
regulator-min-microvolt = <1100000>;
regulator-max-microvolt = <1100000>;
regulator-always-on;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
};

ldo24_reg: LDO24 {
@@ -328,6 +384,10 @@
regulator-name = "vdd_ldo26";
regulator-min-microvolt = <800000>;
regulator-max-microvolt = <3950000>;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
};

ldo27_reg: LDO27 {
@@ -335,6 +395,10 @@
regulator-min-microvolt = <1000000>;
regulator-max-microvolt = <1000000>;
regulator-always-on;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
};

ldo28_reg: LDO28 {
@@ -342,6 +406,10 @@
regulator-name = "vdd_ldo28";
regulator-min-microvolt = <800000>;
regulator-max-microvolt = <3950000>;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
};

ldo29_reg: LDO29 {
@@ -420,6 +488,10 @@
regulator-max-microvolt = <1300000>;
regulator-always-on;
regulator-boot-on;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
};

buck2_reg: BUCK2 {
@@ -428,6 +500,10 @@
regulator-max-microvolt = <1500000>;
regulator-always-on;
regulator-boot-on;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
};

buck3_reg: BUCK3 {
@@ -436,6 +512,10 @@
regulator-max-microvolt = <1400000>;
regulator-always-on;
regulator-boot-on;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
};

buck4_reg: BUCK4 {
@@ -444,6 +524,10 @@
regulator-max-microvolt = <1400000>;
regulator-always-on;
regulator-boot-on;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
};

buck5_reg: BUCK5 {
@@ -460,6 +544,10 @@
regulator-max-microvolt = <1500000>;
regulator-always-on;
regulator-boot-on;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
};

buck7_reg: BUCK7 {
@@ -490,6 +578,10 @@
regulator-name = "vdd_vmem";
regulator-min-microvolt = <2850000>;
regulator-max-microvolt = <2850000>;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
};
};
};
--
2.17.1


2019-06-23 16:05:08

by Anand Moon

[permalink] [raw]
Subject: Re: [PATCH v2 3/4] ARM: dts: exynos: Add regulator suspend configuration to Odroid XU3/XU4/HC1 family

Hi Krzysztof,

Thanks for this patch. Please add my

Tested-by: Anand Moon <[email protected]>

[snip]

Could you integrate below small changes into this patch.
with these below changes suspend and resume work correctly at my end.

[1] XU4_suspendresume.patch

As per S2MPS11B PMIC 1.2.1 Regulator (Features)
Fix the min max value for *Buck7* and *Buck8*

-- Buck7 (VDD_1.0V_LDO) 1.5 A (1.2 V to 1.5 V, 12.5 mV step, default on 1.35 V)
-- Buck8 (VDD_1.8V_LDO) 2.5 A (1.8 V to 2.1 V, 12.5 mV step, default on 2.0 V)

Also add suspend-off for *Buck9*
Buck9 internally controls the power of USB hub.
Adding suspend the this node help proper reset of USB hub on Odroid
XU4 / HC1/ XU3
during suspend and resume. Below it the logs from my testing.

[2] https://pastebin.com/pRJJmWL6

Best Regards
-Anand


Attachments:
xu4_suspend_resume.txt (9.30 kB)
XU4_suspendresume.patch (1.01 kB)
Download all attachments

2019-06-24 07:22:33

by Marek Szyprowski

[permalink] [raw]
Subject: Re: [PATCH v2 3/4] ARM: dts: exynos: Add regulator suspend configuration to Odroid XU3/XU4/HC1 family

Hi Anand,

On 2019-06-23 18:02, Anand Moon wrote:
> Thanks for this patch. Please add my
>
> Tested-by: Anand Moon <[email protected]>
>
> [snip]
>
> Could you integrate below small changes into this patch.
> with these below changes suspend and resume work correctly at my end.
>
> [1] XU4_suspendresume.patch
>
> As per S2MPS11B PMIC 1.2.1 Regulator (Features)
> Fix the min max value for *Buck7* and *Buck8*
>
> -- Buck7 (VDD_1.0V_LDO) 1.5 A (1.2 V to 1.5 V, 12.5 mV step, default on 1.35 V)
> -- Buck8 (VDD_1.8V_LDO) 2.5 A (1.8 V to 2.1 V, 12.5 mV step, default on 2.0 V)

Could you elaborate why such change for Buck7 and Buck8 is needed?

> Also add suspend-off for *Buck9*
> Buck9 internally controls the power of USB hub.
> Adding suspend the this node help proper reset of USB hub on Odroid
> XU4 / HC1/ XU3
> during suspend and resume. Below it the logs from my testing.

Disabling Buck9 in suspend indeed reduces the power consumed by the
board during suspend-to-ram from about 80mA to as little as 7-10mA, what
matches the results of OdroidXU3. Thanks for the hint!

Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland

2019-06-24 07:43:13

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v2 3/4] ARM: dts: exynos: Add regulator suspend configuration to Odroid XU3/XU4/HC1 family

On Mon, 24 Jun 2019 at 09:20, Marek Szyprowski <[email protected]> wrote:
>
> Hi Anand,
>
> On 2019-06-23 18:02, Anand Moon wrote:
> > Thanks for this patch. Please add my
> >
> > Tested-by: Anand Moon <[email protected]>
> >
> > [snip]
> >
> > Could you integrate below small changes into this patch.
> > with these below changes suspend and resume work correctly at my end.
> >
> > [1] XU4_suspendresume.patch
> >
> > As per S2MPS11B PMIC 1.2.1 Regulator (Features)
> > Fix the min max value for *Buck7* and *Buck8*
> >
> > -- Buck7 (VDD_1.0V_LDO) 1.5 A (1.2 V to 1.5 V, 12.5 mV step, default on 1.35 V)
> > -- Buck8 (VDD_1.8V_LDO) 2.5 A (1.8 V to 2.1 V, 12.5 mV step, default on 2.0 V)
>
> Could you elaborate why such change for Buck7 and Buck8 is needed?

Anand has here valid point - the constraints in DTS do not match
hardware manual. This leads to question whether voltage table in
driver is proper... Another point is the voltage itself. The
schematics describes them as at specific voltage (1.35 V and 2.0 V)
but after boot they are 1.2 V and 1.85 V. Maybe this shift comes from
the problem above.

>
> > Also add suspend-off for *Buck9*
> > Buck9 internally controls the power of USB hub.
> > Adding suspend the this node help proper reset of USB hub on Odroid
> > XU4 / HC1/ XU3
> > during suspend and resume. Below it the logs from my testing.
>
> Disabling Buck9 in suspend indeed reduces the power consumed by the
> board during suspend-to-ram from about 80mA to as little as 7-10mA, what
> matches the results of OdroidXU3. Thanks for the hint!

Although I did not get what is the difference in the logs (Anand
pasted two logs but they look the same) but the power consumption is
reason is good enough. I would be happy to put in the changelog entire
consumption difference. I can measure it on XU3-Lite but can you give
me the XU4 (before and after)?

Best regards,
Krzysztof

2019-06-24 09:04:59

by Marek Szyprowski

[permalink] [raw]
Subject: Re: [PATCH v2 3/4] ARM: dts: exynos: Add regulator suspend configuration to Odroid XU3/XU4/HC1 family

Hi Krzysztof,

On 2019-06-24 09:41, Krzysztof Kozlowski wrote:
> On Mon, 24 Jun 2019 at 09:20, Marek Szyprowski <[email protected]> wrote:
>> On 2019-06-23 18:02, Anand Moon wrote:
>>> Thanks for this patch. Please add my
>>>
>>> Tested-by: Anand Moon <[email protected]>
>>>
>>> [snip]
>>>
>>> Could you integrate below small changes into this patch.
>>> with these below changes suspend and resume work correctly at my end.
>>>
>>> [1] XU4_suspendresume.patch
>>>
>>> As per S2MPS11B PMIC 1.2.1 Regulator (Features)
>>> Fix the min max value for *Buck7* and *Buck8*
>>>
>>> -- Buck7 (VDD_1.0V_LDO) 1.5 A (1.2 V to 1.5 V, 12.5 mV step, default on 1.35 V)
>>> -- Buck8 (VDD_1.8V_LDO) 2.5 A (1.8 V to 2.1 V, 12.5 mV step, default on 2.0 V)
>> Could you elaborate why such change for Buck7 and Buck8 is needed?
> Anand has here valid point - the constraints in DTS do not match
> hardware manual. This leads to question whether voltage table in
> driver is proper... Another point is the voltage itself. The
> schematics describes them as at specific voltage (1.35 V and 2.0 V)
> but after boot they are 1.2 V and 1.85 V. Maybe this shift comes from
> the problem above.
>
>>> Also add suspend-off for *Buck9*
>>> Buck9 internally controls the power of USB hub.
>>> Adding suspend the this node help proper reset of USB hub on Odroid
>>> XU4 / HC1/ XU3
>>> during suspend and resume. Below it the logs from my testing.
>> Disabling Buck9 in suspend indeed reduces the power consumed by the
>> board during suspend-to-ram from about 80mA to as little as 7-10mA, what
>> matches the results of OdroidXU3. Thanks for the hint!
> Although I did not get what is the difference in the logs (Anand
> pasted two logs but they look the same) but the power consumption is
> reason is good enough. I would be happy to put in the changelog entire
> consumption difference. I can measure it on XU3-Lite but can you give
> me the XU4 (before and after)?\


HC1:

next-20190620: 120mA (@5V)
this patchset: 72mA (@5V)
this patchset + fixup from Anand: 7-10mA (@5V)

XU4 (SDcard):

next-20190620: 88mA (@5V)
this patchset: 74mA (@5V), sometimes 42mA (@5V)
this patchset + fixup from Anand: 6-9mA (@5V)


XU4 (eMMC):

next-20190620: 100mA (@5V)
this patchset: 72mA (@5V), sometimes 41mA (@5V)
this patchset + fixup from Anand: 6-9mA (@5V)


Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland

2019-06-24 14:16:18

by Anand Moon

[permalink] [raw]
Subject: Re: [PATCH v2 3/4] ARM: dts: exynos: Add regulator suspend configuration to Odroid XU3/XU4/HC1 family

Hi Marek / Krzysztof,

On Mon, 24 Jun 2019 at 14:31, Marek Szyprowski <[email protected]> wrote:
>
> Hi Krzysztof,
>
> On 2019-06-24 09:41, Krzysztof Kozlowski wrote:
> > On Mon, 24 Jun 2019 at 09:20, Marek Szyprowski <[email protected]> wrote:
> >> On 2019-06-23 18:02, Anand Moon wrote:
> >>> Thanks for this patch. Please add my
> >>>
> >>> Tested-by: Anand Moon <[email protected]>
> >>>
> >>> [snip]
> >>>
> >>> Could you integrate below small changes into this patch.
> >>> with these below changes suspend and resume work correctly at my end.
> >>>
> >>> [1] XU4_suspendresume.patch
> >>>
> >>> As per S2MPS11B PMIC 1.2.1 Regulator (Features)
> >>> Fix the min max value for *Buck7* and *Buck8*
> >>>
> >>> -- Buck7 (VDD_1.0V_LDO) 1.5 A (1.2 V to 1.5 V, 12.5 mV step, default on 1.35 V)
> >>> -- Buck8 (VDD_1.8V_LDO) 2.5 A (1.8 V to 2.1 V, 12.5 mV step, default on 2.0 V)
> >> Could you elaborate why such change for Buck7 and Buck8 is needed?
> > Anand has here valid point - the constraints in DTS do not match
> > hardware manual. This leads to question whether voltage table in
> > driver is proper... Another point is the voltage itself. The
> > schematics describes them as at specific voltage (1.35 V and 2.0 V)
> > but after boot they are 1.2 V and 1.85 V. Maybe this shift comes from
> > the problem above.
> >
> >>> Also add suspend-off for *Buck9*
> >>> Buck9 internally controls the power of USB hub.
> >>> Adding suspend the this node help proper reset of USB hub on Odroid
> >>> XU4 / HC1/ XU3
> >>> during suspend and resume. Below it the logs from my testing.
> >> Disabling Buck9 in suspend indeed reduces the power consumed by the
> >> board during suspend-to-ram from about 80mA to as little as 7-10mA, what
> >> matches the results of OdroidXU3. Thanks for the hint!
> > Although I did not get what is the difference in the logs (Anand
> > pasted two logs but they look the same) but the power consumption is
> > reason is good enough. I would be happy to put in the changelog entire
> > consumption difference. I can measure it on XU3-Lite but can you give
> > me the XU4 (before and after)?\
>
>
> HC1:
>
> next-20190620: 120mA (@5V)
> this patchset: 72mA (@5V)
> this patchset + fixup from Anand: 7-10mA (@5V)
>
> XU4 (SDcard):
>
> next-20190620: 88mA (@5V)
> this patchset: 74mA (@5V), sometimes 42mA (@5V)
> this patchset + fixup from Anand: 6-9mA (@5V)
>
>
> XU4 (eMMC):
>
> next-20190620: 100mA (@5V)
> this patchset: 72mA (@5V), sometimes 41mA (@5V)
> this patchset + fixup from Anand: 6-9mA (@5V)
>
>
> Best regards
> --
> Marek Szyprowski, PhD
> Samsung R&D Institute Poland
>

Thanks for this results.

Best Regards
-Anand