Skip to contentSkip to conversation

arm64: dts: meson: Switch simple-mfd and syscon order

PATCH Applied Neil Armstrong 5 participants 8 messages Jul 26, 2018 – Sep 13, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: dts: meson: Switch simple-mfd and syscon order

The order between "syscon" and "simple-mfd" is important because in these particular cases, the node needs to be first a "simple-mfd" to expose it's sub-nodes, and later on a "syscon" to permit other nodes to access this register space through the "syscon" mechanism.

---
This also has a consequence for U-Boot since the U-Boot DM is much simpler and can only associate a single device to a node, thus here we want these nodes to be an mfd bus to be able to probe the sub-nodes.

 arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 4 ++--
 arch/arm64/boot/dts/amlogic/meson-gx.dtsi  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/amlogic/meson-axg.dtsi +2 -2
index 6adc8d3..3f0de9d 100644
@@ -342,7 +342,7 @@
 			ranges = <0x0 0x0 0x0 0xff63c000 0x0 0x1c00>;
 
 			sysctrl: system-controller at 0 {
-				compatible = "amlogic,meson-axg-hhi-sysctrl", "syscon", "simple-mfd";
+				compatible = "amlogic,meson-axg-hhi-sysctrl", "simple-mfd", "syscon";
 				reg = <0 0 0 0x400>;
 
 				clkc: clock-controller {
@@ -1180,7 +1180,7 @@
 			ranges = <0x0 0x0 0x0 0xff800000 0x0 0x100000>;
 
 			sysctrl_AO: sys-ctrl at 0 {
-				compatible = "amlogic,meson-axg-ao-sysctrl", "syscon", "simple-mfd";
+				compatible = "amlogic,meson-axg-ao-sysctrl", "simple-mfd", "syscon";
 				reg =  <0x0 0x0 0x0 0x100>;
 
 				clkc_AO: clock-controller {
arch/arm64/boot/dts/amlogic/meson-gx.dtsi +2 -2
index b8dc4db..d88699f 100644
@@ -344,7 +344,7 @@
 			ranges = <0x0 0x0 0x0 0xc8100000 0x0 0x100000>;
 
 			sysctrl_AO: sys-ctrl at 0 {
-				compatible = "amlogic,meson-gx-ao-sysctrl", "syscon", "simple-mfd";
+				compatible = "amlogic,meson-gx-ao-sysctrl", "simple-mfd", "syscon";
 				reg =  <0x0 0x0 0x0 0x100>;
 
 				pwrc_vpu: power-controller-vpu {
@@ -431,7 +431,7 @@
 			ranges = <0x0 0x0 0x0 0xc883c000 0x0 0x2000>;
 
 			sysctrl: system-controller at 0 {
-				compatible = "amlogic,meson-gx-hhi-sysctrl", "syscon", "simple-mfd";
+				compatible = "amlogic,meson-gx-hhi-sysctrl", "simple-mfd", "syscon";
 				reg = <0 0 0 0x400>;
 			};
 
Signature · 1 line
2.7.4
#1 lore raw

HI Neil

Quoted 5 lines · Neil Armstrong

The order between "syscon" and "simple-mfd" is important because in these particular cases, the node needs to be first a "simple-mfd" to expose it's sub-nodes, and later on a "syscon" to permit other nodes to access this register space through the "syscon" mechanism.

could you explain a bit which specific case that it need compatible "simple-mfd" come first? is this a problem in kernel side? because I see you have a comment below about problem in U-Boot..

also while Rob review the mmc-clkc patch, he raise a suggestion to drop "syscon" in drivers/mfd/syscon.c, see [1], will that solve or affect your problem?

[1]
https://lkml.kernel.org/r/CAL_Jsq+r+7BaJAPBn3L26sdxATVyDiuC=V3xE+yz0-27q0RJhA at mail.gmail.com

Quoted 55 lines

---
This also has a consequence for U-Boot since the U-Boot DM is much simpler and can only associate a single device to a node, thus here we want these nodes to be an mfd bus to be able to probe the sub-nodes.

 arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 4 ++--
 arch/arm64/boot/dts/amlogic/meson-gx.dtsi  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/amlogic/meson-axg.dtsi +2 -2
index 6adc8d3..3f0de9d 100644
@@ -342,7 +342,7 @@
 			ranges = <0x0 0x0 0x0 0xff63c000 0x0 0x1c00>;
 
 			sysctrl: system-controller at 0 {
-				compatible = "amlogic,meson-axg-hhi-sysctrl", "syscon", "simple-mfd";
+				compatible = "amlogic,meson-axg-hhi-sysctrl", "simple-mfd", "syscon";
 				reg = <0 0 0 0x400>;
 
 				clkc: clock-controller {
@@ -1180,7 +1180,7 @@
 			ranges = <0x0 0x0 0x0 0xff800000 0x0 0x100000>;
 
 			sysctrl_AO: sys-ctrl at 0 {
-				compatible = "amlogic,meson-axg-ao-sysctrl", "syscon", "simple-mfd";
+				compatible = "amlogic,meson-axg-ao-sysctrl", "simple-mfd", "syscon";
 				reg =  <0x0 0x0 0x0 0x100>;
 
 				clkc_AO: clock-controller {
arch/arm64/boot/dts/amlogic/meson-gx.dtsi +2 -2
index b8dc4db..d88699f 100644
@@ -344,7 +344,7 @@
 			ranges = <0x0 0x0 0x0 0xc8100000 0x0 0x100000>;
 
 			sysctrl_AO: sys-ctrl at 0 {
-				compatible = "amlogic,meson-gx-ao-sysctrl", "syscon", "simple-mfd";
+				compatible = "amlogic,meson-gx-ao-sysctrl", "simple-mfd", "syscon";
 				reg =  <0x0 0x0 0x0 0x100>;
 
 				pwrc_vpu: power-controller-vpu {
@@ -431,7 +431,7 @@
 			ranges = <0x0 0x0 0x0 0xc883c000 0x0 0x2000>;
 
 			sysctrl: system-controller at 0 {
-				compatible = "amlogic,meson-gx-hhi-sysctrl", "syscon", "simple-mfd";
+				compatible = "amlogic,meson-gx-hhi-sysctrl", "simple-mfd", "syscon";
 				reg = <0 0 0 0x400>;
 			};
 
#2 lore raw

Hi,

Quoted 9 lines · Yixun Lan

HI Neil

Quoted 5 lines · Neil Armstrong

The order between "syscon" and "simple-mfd" is important because in these particular cases, the node needs to be first a "simple-mfd" to expose it's sub-nodes, and later on a "syscon" to permit other nodes to access this register space through the "syscon" mechanism.

Quoted 3 lines

could you explain a bit which specific case that it need compatible "simple-mfd" come first? is this a problem in kernel side? because I see you have a comment below about problem in U-Boot..

It's not a problem for Linux, but Linux is just an implementation, the device tree should work on multiple OSs like U-Boot or BSD kernels. We should base ourselves on the bindings documentation and the Device tree specification to specify the HW.

In this case, we need to switch the order to specify it correctly.

Quoted 5 lines

also while Rob review the mmc-clkc patch, he raise a suggestion to drop "syscon" in drivers/mfd/syscon.c, see [1], will that solve or affect your problem?

Rob wants us to drop the "syscon" because he wants us to move all nodes depending of HHI as subnode, which is impossible for HDMI and the VPU power controller, they are only "syscon" clients, their own registers are not in HHI.

Neil

Quoted 60 lines

[1]
https://lkml.kernel.org/r/CAL_Jsq+r+7BaJAPBn3L26sdxATVyDiuC=V3xE+yz0-27q0RJhA at mail.gmail.com

Quoted 55 lines

---
This also has a consequence for U-Boot since the U-Boot DM is much simpler and can only associate a single device to a node, thus here we want these nodes to be an mfd bus to be able to probe the sub-nodes.

 arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 4 ++--
 arch/arm64/boot/dts/amlogic/meson-gx.dtsi  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/amlogic/meson-axg.dtsi +2 -2
index 6adc8d3..3f0de9d 100644
@@ -342,7 +342,7 @@
 			ranges = <0x0 0x0 0x0 0xff63c000 0x0 0x1c00>;
 
 			sysctrl: system-controller at 0 {
-				compatible = "amlogic,meson-axg-hhi-sysctrl", "syscon", "simple-mfd";
+				compatible = "amlogic,meson-axg-hhi-sysctrl", "simple-mfd", "syscon";
 				reg = <0 0 0 0x400>;
 
 				clkc: clock-controller {
@@ -1180,7 +1180,7 @@
 			ranges = <0x0 0x0 0x0 0xff800000 0x0 0x100000>;
 
 			sysctrl_AO: sys-ctrl at 0 {
-				compatible = "amlogic,meson-axg-ao-sysctrl", "syscon", "simple-mfd";
+				compatible = "amlogic,meson-axg-ao-sysctrl", "simple-mfd", "syscon";
 				reg =  <0x0 0x0 0x0 0x100>;
 
 				clkc_AO: clock-controller {
arch/arm64/boot/dts/amlogic/meson-gx.dtsi +2 -2
index b8dc4db..d88699f 100644
@@ -344,7 +344,7 @@
 			ranges = <0x0 0x0 0x0 0xc8100000 0x0 0x100000>;
 
 			sysctrl_AO: sys-ctrl at 0 {
-				compatible = "amlogic,meson-gx-ao-sysctrl", "syscon", "simple-mfd";
+				compatible = "amlogic,meson-gx-ao-sysctrl", "simple-mfd", "syscon";
 				reg =  <0x0 0x0 0x0 0x100>;
 
 				pwrc_vpu: power-controller-vpu {
@@ -431,7 +431,7 @@
 			ranges = <0x0 0x0 0x0 0xc883c000 0x0 0x2000>;
 
 			sysctrl: system-controller at 0 {
-				compatible = "amlogic,meson-gx-hhi-sysctrl", "syscon", "simple-mfd";
+				compatible = "amlogic,meson-gx-hhi-sysctrl", "simple-mfd", "syscon";
 				reg = <0 0 0 0x400>;
 			};
 
#4 lore raw
In reply to Neil Armstrong
Quoted 20 lines · Neil Armstrong

The order between "syscon" and "simple-mfd" is important because in these particular cases, the node needs to be first a "simple-mfd" to expose it's sub-nodes, and later on a "syscon" to permit other nodes to access this register space through the "syscon" mechanism.

---
This also has a consequence for U-Boot since the U-Boot DM is much simpler and can only associate a single device to a node, thus here we want these nodes to be an mfd bus to be able to probe the sub-nodes.

 arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 4 ++--
 arch/arm64/boot/dts/amlogic/meson-gx.dtsi  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/amlogic/meson-axg.dtsi +0 -0
index 6adc8d3..3f0de9d 100644

arch/arm64/boot/dts/amlogic/meson-axg.dtsi line 345

Quoted 5 lines
arch/arm64/boot/dts/amlogic/meson-axg.dtsi +1 -1
@@ -342,7 +342,7 @@
 			ranges = <0x0 0x0 0x0 0xff63c000 0x0 0x1c00>;
 
 			sysctrl: system-controller at 0 {
-				compatible = "amlogic,meson-axg-hhi-sysctrl", "syscon", "simple-mfd";
+				compatible = "amlogic,meson-axg-hhi-sysctrl", "simple-mfd", "syscon";

I must profess, I haven't looked at the code recently so can't really comment on the semantics - I'll leave that to Rob et. al.

However, if the ordering is important, you should add a comment to prevent anyone re-jigging it or reverting the patch for some reason.

Signature · 4 lines
Lee Jones [???]
Linaro Services Technical Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
maintainer Applied
#5 lore raw
In reply to Neil Armstrong
Quoted 6 lines · Neil Armstrong

The order between "syscon" and "simple-mfd" is important because in these particular cases, the node needs to be first a "simple-mfd" to expose it's sub-nodes, and later on a "syscon" to permit other nodes to access this register space through the "syscon" mechanism.

Applied to v4.20/dt64,

Kevin

#3 lore raw
In reply to Neil Armstrong
Quoted 17 lines · Neil Armstrong

Hi,

Quoted 9 lines · Yixun Lan

HI Neil

Quoted 5 lines · Neil Armstrong

The order between "syscon" and "simple-mfd" is important because in these particular cases, the node needs to be first a "simple-mfd" to expose it's sub-nodes, and later on a "syscon" to permit other nodes to access this register space through the "syscon" mechanism.

Quoted 3 lines

could you explain a bit which specific case that it need compatible "simple-mfd" come first? is this a problem in kernel side? because I see you have a comment below about problem in U-Boot..

Quoted 5 lines

It's not a problem for Linux, but Linux is just an implementation, the device tree should work on multiple OSs like U-Boot or BSD kernels. We should base ourselves on the bindings documentation and the Device tree specification to specify the HW.

In this case, we need to switch the order to specify it correctly.

syscon on Linux works because syscon is not a full blown device driver in the driver model. It is just a set of APIs wrapping regmap.

Quoted 9 lines
Quoted 5 lines

also while Rob review the mmc-clkc patch, he raise a suggestion to drop "syscon" in drivers/mfd/syscon.c, see [1], will that solve or affect your problem?

Rob wants us to drop the "syscon" because he wants us to move all nodes depending of HHI as subnode, which is impossible for HDMI and the VPU power controller, they are only "syscon" clients, their own registers are not in HHI.

You can have whatever device driver this is bound to export regmaps for clients to consume. This gives you finer control over what registers can be accessed.

See the following example.

Provider: https://elixir.bootlin.com/linux/v4.19-rc3/source/drivers/clk/sunxi-ng/ccu-sun8i-r40.c#L1315
Client: https://elixir.bootlin.com/linux/v4.19-rc3/source/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c#L1035

Hope this helps.

ChenYu

Quoted 68 lines

Neil

Quoted 52 lines

[1]
https://lkml.kernel.org/r/CAL_Jsq+r+7BaJAPBn3L26sdxATVyDiuC=V3xE+yz0-27q0RJhA at mail.gmail.com

Quoted 48 lines

---
This also has a consequence for U-Boot since the U-Boot DM is much simpler and can only associate a single device to a node, thus here we want these nodes to be an mfd bus to be able to probe the sub-nodes.

 arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 4 ++--
 arch/arm64/boot/dts/amlogic/meson-gx.dtsi  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/amlogic/meson-axg.dtsi +2 -2
index 6adc8d3..3f0de9d 100644
@@ -342,7 +342,7 @@
                     ranges = <0x0 0x0 0x0 0xff63c000 0x0 0x1c00>;
 
                     sysctrl: system-controller at 0 {
-                            compatible = "amlogic,meson-axg-hhi-sysctrl", "syscon", "simple-mfd";
+                            compatible = "amlogic,meson-axg-hhi-sysctrl", "simple-mfd", "syscon";
                             reg = <0 0 0 0x400>;
 
                             clkc: clock-controller {
@@ -1180,7 +1180,7 @@
                     ranges = <0x0 0x0 0x0 0xff800000 0x0 0x100000>;
 
                     sysctrl_AO: sys-ctrl at 0 {
-                            compatible = "amlogic,meson-axg-ao-sysctrl", "syscon", "simple-mfd";
+                            compatible = "amlogic,meson-axg-ao-sysctrl", "simple-mfd", "syscon";
                             reg =  <0x0 0x0 0x0 0x100>;
 
                             clkc_AO: clock-controller {
arch/arm64/boot/dts/amlogic/meson-gx.dtsi +1 -1
index b8dc4db..d88699f 100644
@@ -344,7 +344,7 @@
                     ranges = <0x0 0x0 0x0 0xc8100000 0x0 0x100000>;
 
                     sysctrl_AO: sys-ctrl at 0 {
-                            compatible = "amlogic,meson-gx-ao-sysctrl", "syscon", "simple-mfd";
+                            compatible = "amlogic,meson-gx-ao-sysctrl", "simple-mfd", "syscon";
                             reg =  <0x0 0x0 0x0 0x100>;
 
                             pwrc_vpu: power-controller-vpu {
@@ -431,7 +431,7 @@
                     ranges = <0x0 0x0 0x0 0xc883c000 0x0 0x2000>;
 
Quoted 8 lines

arch/arm64/boot/dts/amlogic/meson-gx.dtsi line 437

Quoted 7 lines
arch/arm64/boot/dts/amlogic/meson-gx.dtsi +1 -1
                     sysctrl: system-controller at 0 {
-                            compatible = "amlogic,meson-gx-hhi-sysctrl", "syscon", "simple-mfd";
+                            compatible = "amlogic,meson-gx-hhi-sysctrl", "simple-mfd", "syscon";
                             reg = <0 0 0 0x400>;
                     };
 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

maintainer
#6 lore raw
In reply to Kevin Hilman
Quoted 12 lines · Kevin Hilman
Quoted 6 lines · Neil Armstrong

The order between "syscon" and "simple-mfd" is important because in these particular cases, the node needs to be first a "simple-mfd" to expose it's sub-nodes, and later on a "syscon" to permit other nodes to access this register space through the "syscon" mechanism.

Applied to v4.20/dt64,

I spoke too soon, this doesn't apply cleanly on top of Jeromes reorder/cleanup. Please respin/resend.

Kevin

#7 lore raw

Hi Kevin,

Quoted 9 lines · Kevin Hilman
Quoted 8 lines · Kevin Hilman
Quoted 5 lines · Neil Armstrong

The order between "syscon" and "simple-mfd" is important because in these particular cases, the node needs to be first a "simple-mfd" to expose it's sub-nodes, and later on a "syscon" to permit other nodes to access this register space through the "syscon" mechanism.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Applied to v4.20/dt64,

I spoke too soon, this doesn't apply cleanly on top of Jeromes reorder/cleanup. Please respin/resend.

I'll respin.

Neil

Quoted 3 lines

Kevin