2018-01-30 21:22:04

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v2 0/4] ARM/arm64: exynos: Fix missing missing reg warning for syscon restart nodes


Hi,

Changes since v1:
1. New patch (1/4) calling devm_of_platform_populate() in PMU driver,
following Rob's advice.
2. The DTS patches moving reboot/poweroff nodes (3/4 and 4/4) now depend
on this.

Best regards,
Krzysztof


Krzysztof Kozlowski (4):
soc: samsung: pmu: Populate children syscon nodes
ARM: dts: exynos: Remove duplicated inclusion of syscon restart nodes
on Exynos5410
ARM: dts: exynos: Fix missing missing reg warning for syscon restart
nodes
arm64: dts: exynos: Fix missing missing reg warning for syscon restart
nodes

.../devicetree/bindings/arm/samsung/pmu.txt | 6 +++++
arch/arm/boot/dts/exynos-syscon-restart.dtsi | 28 ++++++++++------------
arch/arm/boot/dts/exynos3250.dtsi | 2 +-
arch/arm/boot/dts/exynos4.dtsi | 3 ++-
arch/arm/boot/dts/exynos5.dtsi | 1 -
arch/arm/boot/dts/exynos5250.dtsi | 1 +
arch/arm/boot/dts/exynos5410.dtsi | 2 +-
arch/arm/boot/dts/exynos5420.dtsi | 1 +
arch/arm64/boot/dts/exynos/exynos5433.dtsi | 14 +++++------
arch/arm64/boot/dts/exynos/exynos7.dtsi | 12 +++++-----
drivers/soc/samsung/exynos-pmu.c | 3 +++
11 files changed, 40 insertions(+), 33 deletions(-)

--
2.11.0



2018-01-30 21:20:45

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v2 2/4] ARM: dts: exynos: Remove duplicated inclusion of syscon restart nodes on Exynos5410

The exynos-syscon-restart.dtsi is already included by exynos5.dtsi
(through exynos54xx.dtsi).

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
arch/arm/boot/dts/exynos5410.dtsi | 1 -
1 file changed, 1 deletion(-)

diff --git a/arch/arm/boot/dts/exynos5410.dtsi b/arch/arm/boot/dts/exynos5410.dtsi
index 1886aa00b2db..1e6b57d013c4 100644
--- a/arch/arm/boot/dts/exynos5410.dtsi
+++ b/arch/arm/boot/dts/exynos5410.dtsi
@@ -11,7 +11,6 @@
*/

#include "exynos54xx.dtsi"
-#include "exynos-syscon-restart.dtsi"
#include <dt-bindings/clock/exynos5410.h>
#include <dt-bindings/clock/exynos-audss-clk.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
--
2.11.0


2018-01-30 21:20:53

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v2 1/4] soc: samsung: pmu: Populate children syscon nodes

The syscon poweroff and restart nodes logically belong to the Power
Management Unit so populate possible children.

This also requires providing compatibles for Exynos5410 and Exynos7 so
the PMU device and its children will be instantiated for them as well.
Just like Exynos5433, these chipsets are not yet supported by the PMU
driver.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
Documentation/devicetree/bindings/arm/samsung/pmu.txt | 6 ++++++
drivers/soc/samsung/exynos-pmu.c | 7 +++++++
2 files changed, 13 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/samsung/pmu.txt b/Documentation/devicetree/bindings/arm/samsung/pmu.txt
index 779f5614bcee..16685787d2bd 100644
--- a/Documentation/devicetree/bindings/arm/samsung/pmu.txt
+++ b/Documentation/devicetree/bindings/arm/samsung/pmu.txt
@@ -43,6 +43,12 @@ following properties:
- interrupt-parent: a phandle indicating which interrupt controller
this PMU signals interrupts to.

+
+Optional nodes:
+
+- nodes defining the restart and poweroff syscon children
+
+
Example :
pmu_system_controller: system-controller@10040000 {
compatible = "samsung,exynos5250-pmu", "syscon";
diff --git a/drivers/soc/samsung/exynos-pmu.c b/drivers/soc/samsung/exynos-pmu.c
index f56adbd9fb8b..d34ca201b8b7 100644
--- a/drivers/soc/samsung/exynos-pmu.c
+++ b/drivers/soc/samsung/exynos-pmu.c
@@ -85,10 +85,14 @@ static const struct of_device_id exynos_pmu_of_device_ids[] = {
.compatible = "samsung,exynos5250-pmu",
.data = exynos_pmu_data_arm_ptr(exynos5250_pmu_data),
}, {
+ .compatible = "samsung,exynos5410-pmu",
+ }, {
.compatible = "samsung,exynos5420-pmu",
.data = exynos_pmu_data_arm_ptr(exynos5420_pmu_data),
}, {
.compatible = "samsung,exynos5433-pmu",
+ }, {
+ .compatible = "samsung,exynos7-pmu",
},
{ /*sentinel*/ },
};
@@ -126,6 +130,9 @@ static int exynos_pmu_probe(struct platform_device *pdev)

platform_set_drvdata(pdev, pmu_context);

+ if (devm_of_platform_populate(dev))
+ dev_err(dev, "Error populating children, reboot and poweroff might not work properly\n");
+
dev_dbg(dev, "Exynos PMU Driver probe done\n");
return 0;
}
--
2.11.0


2018-01-30 21:21:14

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v2 4/4] arm64: dts: exynos: Fix missing missing reg warning for syscon restart nodes

Fix DTC warnings like:

arch/arm64/boot/dts/exynos/exynos7-espresso.dtb: Warning (simple_bus_reg):
Node /soc/syscon-reboot missing or empty reg/ranges property

by moving the syscon restart node into the PMU (Power Management Unit)
node. The PMU node is the actual block responsible for power
management, including typical Exynos on/off/restart procedures.
Therefore the syscon restart node logically belongs to it.

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

---

Not tested. All tests are welcomed.
---
arch/arm64/boot/dts/exynos/exynos5433.dtsi | 14 +++++++-------
arch/arm64/boot/dts/exynos/exynos7.dtsi | 12 ++++++------
2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/arch/arm64/boot/dts/exynos/exynos5433.dtsi b/arch/arm64/boot/dts/exynos/exynos5433.dtsi
index 62f276970174..0f3ec7e4b0f7 100644
--- a/arch/arm64/boot/dts/exynos/exynos5433.dtsi
+++ b/arch/arm64/boot/dts/exynos/exynos5433.dtsi
@@ -231,13 +231,6 @@
cpu_on = <0xC4000003>;
};

- reboot: syscon-reboot {
- compatible = "syscon-reboot";
- regmap = <&pmu_system_controller>;
- offset = <0x400>; /* SWRESET */
- mask = <0x1>;
- };
-
soc: soc {
compatible = "simple-bus";
#address-cells = <1>;
@@ -799,6 +792,13 @@
#clock-cells = <1>;
clock-names = "clkout16";
clocks = <&xxti>;
+
+ reboot: syscon-reboot {
+ compatible = "syscon-reboot";
+ regmap = <&pmu_system_controller>;
+ offset = <0x400>; /* SWRESET */
+ mask = <0x1>;
+ };
};

gic: interrupt-controller@11001000 {
diff --git a/arch/arm64/boot/dts/exynos/exynos7.dtsi b/arch/arm64/boot/dts/exynos/exynos7.dtsi
index ad9dce6894ce..0b98d2334cad 100644
--- a/arch/arm64/boot/dts/exynos/exynos7.dtsi
+++ b/arch/arm64/boot/dts/exynos/exynos7.dtsi
@@ -494,13 +494,13 @@
pmu_system_controller: system-controller@105c0000 {
compatible = "samsung,exynos7-pmu", "syscon";
reg = <0x105c0000 0x5000>;
- };

- reboot: syscon-reboot {
- compatible = "syscon-reboot";
- regmap = <&pmu_system_controller>;
- offset = <0x0400>;
- mask = <0x1>;
+ reboot: syscon-reboot {
+ compatible = "syscon-reboot";
+ regmap = <&pmu_system_controller>;
+ offset = <0x0400>;
+ mask = <0x1>;
+ };
};

rtc: rtc@10590000 {
--
2.11.0


2018-01-30 22:14:54

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v2 3/4] ARM: dts: exynos: Fix missing missing reg warning for syscon restart nodes

Fix DTC warnings like:

arch/arm/boot/dts/exynos4412-trats2.dtb: Warning (simple_bus_reg):
Node /soc/syscon-poweroff missing or empty reg/ranges property
arch/arm/boot/dts/exynos4412-trats2.dtb: Warning (simple_bus_reg):
Node /soc/syscon-reboot missing or empty reg/ranges property

by moving the syscon poweroff and restart nodes into the PMU (Power
Management Unit) node. The PMU node is the actual block responsible for
power management, including typical Exynos on/off/restart procedures.
Therefore the syscon poweroff and restart nodes logically belong to it.

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

---

Tested on Exynos5410, Exynos5420 and Exynos4412. Other tests are welcomed.
---
arch/arm/boot/dts/exynos-syscon-restart.dtsi | 28 ++++++++++++----------------
arch/arm/boot/dts/exynos3250.dtsi | 2 +-
arch/arm/boot/dts/exynos4.dtsi | 3 ++-
arch/arm/boot/dts/exynos5.dtsi | 1 -
arch/arm/boot/dts/exynos5250.dtsi | 1 +
arch/arm/boot/dts/exynos5410.dtsi | 1 +
arch/arm/boot/dts/exynos5420.dtsi | 1 +
7 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/arch/arm/boot/dts/exynos-syscon-restart.dtsi b/arch/arm/boot/dts/exynos-syscon-restart.dtsi
index 09a2040054ed..279ea09f4fe2 100644
--- a/arch/arm/boot/dts/exynos-syscon-restart.dtsi
+++ b/arch/arm/boot/dts/exynos-syscon-restart.dtsi
@@ -6,22 +6,18 @@
* published by the Free Software Foundation.
*/

-/ {
- soc {
- compatible = "simple-bus";
-
- poweroff: syscon-poweroff {
- compatible = "syscon-poweroff";
- regmap = <&pmu_system_controller>;
- offset = <0x330C>; /* PS_HOLD_CONTROL */
- mask = <0x5200>; /* reset value */
- };
+&pmu_system_controller {
+ poweroff: syscon-poweroff {
+ compatible = "syscon-poweroff";
+ regmap = <&pmu_system_controller>;
+ offset = <0x330C>; /* PS_HOLD_CONTROL */
+ mask = <0x5200>; /* reset value */
+ };

- reboot: syscon-reboot {
- compatible = "syscon-reboot";
- regmap = <&pmu_system_controller>;
- offset = <0x0400>; /* SWRESET */
- mask = <0x1>;
- };
+ reboot: syscon-reboot {
+ compatible = "syscon-reboot";
+ regmap = <&pmu_system_controller>;
+ offset = <0x0400>; /* SWRESET */
+ mask = <0x1>;
};
};
diff --git a/arch/arm/boot/dts/exynos3250.dtsi b/arch/arm/boot/dts/exynos3250.dtsi
index b8fb94f5daa8..df76624fd382 100644
--- a/arch/arm/boot/dts/exynos3250.dtsi
+++ b/arch/arm/boot/dts/exynos3250.dtsi
@@ -15,7 +15,6 @@
*/

#include "exynos4-cpu-thermal.dtsi"
-#include "exynos-syscon-restart.dtsi"
#include <dt-bindings/clock/exynos3250.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/interrupt-controller/irq.h>
@@ -914,3 +913,4 @@
};

#include "exynos3250-pinctrl.dtsi"
+#include "exynos-syscon-restart.dtsi"
diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi
index 6d59cc827649..98af5592cc6d 100644
--- a/arch/arm/boot/dts/exynos4.dtsi
+++ b/arch/arm/boot/dts/exynos4.dtsi
@@ -20,7 +20,6 @@
#include <dt-bindings/clock/exynos-audss-clk.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/interrupt-controller/irq.h>
-#include "exynos-syscon-restart.dtsi"

/ {
interrupt-parent = <&gic>;
@@ -1010,3 +1009,5 @@
clock-names = "secss";
};
};
+
+#include "exynos-syscon-restart.dtsi"
diff --git a/arch/arm/boot/dts/exynos5.dtsi b/arch/arm/boot/dts/exynos5.dtsi
index f8d7de1144f1..359f49bdd4e2 100644
--- a/arch/arm/boot/dts/exynos5.dtsi
+++ b/arch/arm/boot/dts/exynos5.dtsi
@@ -12,7 +12,6 @@

#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/interrupt-controller/irq.h>
-#include "exynos-syscon-restart.dtsi"

/ {
interrupt-parent = <&gic>;
diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi
index 56626d1a4235..037aceee5959 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -1114,3 +1114,4 @@
};

#include "exynos5250-pinctrl.dtsi"
+#include "exynos-syscon-restart.dtsi"
diff --git a/arch/arm/boot/dts/exynos5410.dtsi b/arch/arm/boot/dts/exynos5410.dtsi
index 1e6b57d013c4..fb7fa217a05b 100644
--- a/arch/arm/boot/dts/exynos5410.dtsi
+++ b/arch/arm/boot/dts/exynos5410.dtsi
@@ -439,3 +439,4 @@
};

#include "exynos5410-pinctrl.dtsi"
+#include "exynos-syscon-restart.dtsi"
diff --git a/arch/arm/boot/dts/exynos5420.dtsi b/arch/arm/boot/dts/exynos5420.dtsi
index 2f3cb2a97f71..71e2b154a244 100644
--- a/arch/arm/boot/dts/exynos5420.dtsi
+++ b/arch/arm/boot/dts/exynos5420.dtsi
@@ -1531,3 +1531,4 @@
};

#include "exynos5420-pinctrl.dtsi"
+#include "exynos-syscon-restart.dtsi"
--
2.11.0


2018-02-05 06:10:01

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH v2 1/4] soc: samsung: pmu: Populate children syscon nodes

On Tue, Jan 30, 2018 at 10:18:16PM +0100, Krzysztof Kozlowski wrote:
> The syscon poweroff and restart nodes logically belong to the Power
> Management Unit so populate possible children.
>
> This also requires providing compatibles for Exynos5410 and Exynos7 so
> the PMU device and its children will be instantiated for them as well.
> Just like Exynos5433, these chipsets are not yet supported by the PMU
> driver.
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>
> ---
> Documentation/devicetree/bindings/arm/samsung/pmu.txt | 6 ++++++
> drivers/soc/samsung/exynos-pmu.c | 7 +++++++
> 2 files changed, 13 insertions(+)

Reviewed-by: Rob Herring <[email protected]>

2018-02-08 13:47:41

by Marek Szyprowski

[permalink] [raw]
Subject: Re: [PATCH v2 0/4] ARM/arm64: exynos: Fix missing missing reg warning for syscon restart nodes

Hi Krzysztof,

On 2018-01-30 22:18, Krzysztof Kozlowski wrote:
> Hi,
>
> Changes since v1:
> 1. New patch (1/4) calling devm_of_platform_populate() in PMU driver,
> following Rob's advice.
> 2. The DTS patches moving reboot/poweroff nodes (3/4 and 4/4) now depend
> on this.

Tested-by: Marek Szyprowski <[email protected]>

Tested following boards and reboot works fine:
Exynos3250 (artik5-eval)
Exynos4412 (trats2)
Exynos5410 (odroid xu)
Exynos5422 (odroid xu3/xu4)
Exynos5433 (tm2)

> Best regards,
> Krzysztof
>
>
> Krzysztof Kozlowski (4):
> soc: samsung: pmu: Populate children syscon nodes
> ARM: dts: exynos: Remove duplicated inclusion of syscon restart nodes
> on Exynos5410
> ARM: dts: exynos: Fix missing missing reg warning for syscon restart
> nodes
> arm64: dts: exynos: Fix missing missing reg warning for syscon restart
> nodes
>
> .../devicetree/bindings/arm/samsung/pmu.txt | 6 +++++
> arch/arm/boot/dts/exynos-syscon-restart.dtsi | 28 ++++++++++------------
> arch/arm/boot/dts/exynos3250.dtsi | 2 +-
> arch/arm/boot/dts/exynos4.dtsi | 3 ++-
> arch/arm/boot/dts/exynos5.dtsi | 1 -
> arch/arm/boot/dts/exynos5250.dtsi | 1 +
> arch/arm/boot/dts/exynos5410.dtsi | 2 +-
> arch/arm/boot/dts/exynos5420.dtsi | 1 +
> arch/arm64/boot/dts/exynos/exynos5433.dtsi | 14 +++++------
> arch/arm64/boot/dts/exynos/exynos7.dtsi | 12 +++++-----
> drivers/soc/samsung/exynos-pmu.c | 3 +++
> 11 files changed, 40 insertions(+), 33 deletions(-)
>

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


2018-02-09 10:50:26

by Adam Borowski

[permalink] [raw]
Subject: Re: [PATCH v2 0/4] ARM/arm64: exynos: Fix missing missing reg warning for syscon restart nodes

On Thu, Feb 08, 2018 at 02:46:32PM +0100, Marek Szyprowski wrote:
> Hi Krzysztof,
>
> On 2018-01-30 22:18, Krzysztof Kozlowski wrote:
> > Hi,
> >
> > Changes since v1:
> > 1. New patch (1/4) calling devm_of_platform_populate() in PMU driver,
> > following Rob's advice.
> > 2. The DTS patches moving reboot/poweroff nodes (3/4 and 4/4) now depend
> > on this.
>
> Tested-by: Marek Szyprowski <[email protected]>
>
> Tested following boards and reboot works fine:
> Exynos3250 (artik5-eval)
> Exynos4412 (trats2)
> Exynos5410 (odroid xu)
> Exynos5422 (odroid xu3/xu4)
> Exynos5433 (tm2)

Doesn't seem to work on mine:
Exynos4412 (odroid u2)

Rebooting worked correctly with 3.8 + gazillion non-mainlined patches (as
shipped with providen images), never did with mainline.

Tested on current mid-of-the-merge-window, plus these four patches.


It's possible that I'm doing something wrong; might need an updated u-boot,
etc. Log of a boot-till-reboot+hang session attached.


Meow!
--
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢰⠒⠀⣿⡁ Imagine there are bandits in your house, your kid is bleeding out,
⢿⡄⠘⠷⠚⠋⠀ the house is on fire, and seven big-ass trumpets are playing in the
⠈⠳⣄⠀⠀⠀⠀ sky. Your cat demands food. The priority should be obvious...


Attachments:
(No filename) (1.30 kB)
kholdan.log (28.11 kB)
Download all attachments

2018-02-09 11:18:52

by Marek Szyprowski

[permalink] [raw]
Subject: Re: [PATCH v2 0/4] ARM/arm64: exynos: Fix missing missing reg warning for syscon restart nodes

Hi Adam,

On 2018-02-09 11:48, Adam Borowski wrote:
> On Thu, Feb 08, 2018 at 02:46:32PM +0100, Marek Szyprowski wrote:
>> On 2018-01-30 22:18, Krzysztof Kozlowski wrote:
>>> Changes since v1:
>>> 1. New patch (1/4) calling devm_of_platform_populate() in PMU driver,
>>> following Rob's advice.
>>> 2. The DTS patches moving reboot/poweroff nodes (3/4 and 4/4) now depend
>>> on this.
>> Tested-by: Marek Szyprowski <[email protected]>
>>
>> Tested following boards and reboot works fine:
>> Exynos3250 (artik5-eval)
>> Exynos4412 (trats2)
>> Exynos5410 (odroid xu)
>> Exynos5422 (odroid xu3/xu4)
>> Exynos5433 (tm2)
> Doesn't seem to work on mine:
> Exynos4412 (odroid u2)
>
> Rebooting worked correctly with 3.8 + gazillion non-mainlined patches (as
> shipped with providen images), never did with mainline.
>
> Tested on current mid-of-the-merge-window, plus these four patches.
>
>
> It's possible that I'm doing something wrong; might need an updated u-boot,
> etc. Log of a boot-till-reboot+hang session attached.

Reboot on Odroid X2/U2/U3 doesn't work now. It is broken by devfreq since
a few kernel releases. Please disable devfreq in your .config and reboot
should also work. That's why I didn't put Odroid U3 on the above list.

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


2018-02-13 17:58:37

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v2 0/4] ARM/arm64: exynos: Fix missing missing reg warning for syscon restart nodes

On Thu, Feb 08, 2018 at 02:46:32PM +0100, Marek Szyprowski wrote:
> Hi Krzysztof,
>
> On 2018-01-30 22:18, Krzysztof Kozlowski wrote:
> > Hi,
> >
> > Changes since v1:
> > 1. New patch (1/4) calling devm_of_platform_populate() in PMU driver,
> > following Rob's advice.
> > 2. The DTS patches moving reboot/poweroff nodes (3/4 and 4/4) now depend
> > on this.
>
> Tested-by: Marek Szyprowski <[email protected]>
>
> Tested following boards and reboot works fine:
> Exynos3250 (artik5-eval)
> Exynos4412 (trats2)
> Exynos5410 (odroid xu)
> Exynos5422 (odroid xu3/xu4)
> Exynos5433 (tm2)

Thanks for testing. I applied 1/4 and 2/4. The remaining DTS patches
depend on 1/4 so they will wait till next release.

Best regards,
Krzysztof