2024-05-19 18:42:45

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 0/8] dt-bindings: mfd: syscon: Document more compatibles and require simpe-mfd description

Hi,

Dependency
==========
Depends on https://lore.kernel.org/r/[email protected]
because it touches the same lines.

Merging
=======
1. Bindings: preferrably everything via MFD tree (file/context dependencies).
2. DTS: via subarch maintainers (no dependencies).

Description/problem
===================
Simple syscon nodes can be documented in common syscon.yaml, however
devices with simple-mfd compatible, thus some children, should have
their own schema listing these children. Such listing makes the binding
specific, allows better validation (so the incorrect child would not
appear in the simple-mfd node) and actually enforces repeated rule for
simple-mfd devices:

"simple-mfd" is only for simple devices, where the children do not
depend on the parent.

Currently the syscon+simple-mfd binding is quite broad and allows
any child or property, thus above rule cannot be enforced.

Solution
========
1. Split the syscon.yaml binding into common syscon properties, used
potentially by many bindings, and only simple syscon devices (NO
simple-mfd!).
2. Move some known simple-mfd bindings from syscon.yaml to dedicated
files.

This patchset might introduce new dtbs_check warnings for devices having
simple-mfd and being part of syscon.yaml previously. I fixed some of
them, but probably not all.

Best regards,
Krzysztof

To: Lee Jones <[email protected]>
To: Rob Herring <[email protected]>
To: Krzysztof Kozlowski <[email protected]>
To: Conor Dooley <[email protected]>
To: Lars Povlsen <[email protected]>
To: Steen Hegelund <[email protected]>
To: Daniel Machon <[email protected]>
To: [email protected]
To: Nishanth Menon <[email protected]>
To: Matthias Brugger <[email protected]>
To: AngeloGioacchino Del Regno <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
Krzysztof Kozlowski (8):
dt-bindings: mfd: syscon: Drop hwlocks
dt-bindings: soc: sprd: sc9863a-glbregs: Document SC9863A syscon
dt-bindings: soc: intel: lgm-syscon: Move to dedicated schema
dt-bindings: soc: microchip: sparx5-cpu-syscon: Move to dedicated schema
dt-bindings: soc: ti: am654-serdes-ctrl: Move to dedicated schema
dt-bindings: mfd: syscon: Split and enforce documenting MFD children
dt-bindings: mfd: syscon: Add APM poweroff mailbox
arm64: dts: apm: Add dedicated syscon poweroff compatibles

.../devicetree/bindings/mfd/syscon-common.yaml | 72 +++++++
Documentation/devicetree/bindings/mfd/syscon.yaml | 222 +++++++++------------
.../bindings/soc/intel/intel,lgm-syscon.yaml | 53 +++++
.../soc/microchip/microchip,sparx5-cpu-syscon.yaml | 49 +++++
.../bindings/soc/sprd/sprd,sc9863a-glbregs.yaml | 55 +++++
.../bindings/soc/ti/ti,am654-serdes-ctrl.yaml | 42 ++++
arch/arm64/boot/dts/apm/apm-merlin.dts | 2 +-
arch/arm64/boot/dts/apm/apm-mustang.dts | 2 +-
8 files changed, 365 insertions(+), 132 deletions(-)
---
base-commit: ca42fd4fd365cbaf798f17f655aee3d8192829f3
change-id: 20240517-dt-bindings-mfd-syscon-split-37e23996523d

Best regards,
--
Krzysztof Kozlowski <[email protected]>



2024-05-19 18:42:56

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 1/8] dt-bindings: mfd: syscon: Drop hwlocks

Apparently there is no in-tree DTS syscon node having hwlocks, so drop
the property to simplify the binding.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
Documentation/devicetree/bindings/mfd/syscon.yaml | 5 -----
1 file changed, 5 deletions(-)

diff --git a/Documentation/devicetree/bindings/mfd/syscon.yaml b/Documentation/devicetree/bindings/mfd/syscon.yaml
index 4d289935c08f..622ea0f1b08e 100644
--- a/Documentation/devicetree/bindings/mfd/syscon.yaml
+++ b/Documentation/devicetree/bindings/mfd/syscon.yaml
@@ -141,11 +141,6 @@ properties:
resets:
maxItems: 1

- hwlocks:
- maxItems: 1
- description:
- Reference to a phandle of a hardware spinlock provider node.
-
required:
- compatible
- reg

--
2.43.0


2024-05-19 18:43:08

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 2/8] dt-bindings: soc: sprd: sc9863a-glbregs: Document SC9863A syscon

Document sprd,sc9863a-glbregs compatible already used in DTS and other
bindings example.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
.../bindings/soc/sprd/sprd,sc9863a-glbregs.yaml | 55 ++++++++++++++++++++++
1 file changed, 55 insertions(+)

diff --git a/Documentation/devicetree/bindings/soc/sprd/sprd,sc9863a-glbregs.yaml b/Documentation/devicetree/bindings/soc/sprd/sprd,sc9863a-glbregs.yaml
new file mode 100644
index 000000000000..49add564e5e1
--- /dev/null
+++ b/Documentation/devicetree/bindings/soc/sprd/sprd,sc9863a-glbregs.yaml
@@ -0,0 +1,55 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/soc/sprd/sprd,sc9863a-glbregs.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: SC9863A Syscon
+
+maintainers:
+ - Orson Zhai <[email protected]>
+ - Baolin Wang <[email protected]>
+ - Chunyan Zhang <[email protected]>
+
+properties:
+ compatible:
+ items:
+ - const: sprd,sc9863a-glbregs
+ - const: syscon
+ - const: simple-mfd
+
+ reg:
+ maxItems: 1
+
+ ranges: true
+
+ "#address-cells":
+ const: 1
+
+ "#size-cells":
+ const: 1
+
+patternProperties:
+ "@[0-9a-f]+$":
+ $ref: /schemas/clock/sprd,sc9863a-clk.yaml
+ description: Clock controllers
+
+additionalProperties: false
+
+examples:
+ - |
+ syscon@20e00000 {
+ compatible = "sprd,sc9863a-glbregs", "syscon", "simple-mfd";
+ reg = <0x20e00000 0x4000>;
+ ranges = <0 0x20e00000 0x4000>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ apahb_gate: apahb-gate@0 {
+ compatible = "sprd,sc9863a-apahb-gate";
+ reg = <0x0 0x1020>;
+ #clock-cells = <1>;
+ };
+ };
+
+...

--
2.43.0


2024-05-19 18:43:19

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 3/8] dt-bindings: soc: intel: lgm-syscon: Move to dedicated schema

intel,lgm-syscon is not a simple syscon device - it has children - thus
it should be fully documented in its own binding.

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

---

Context might depend on
https://lore.kernel.org/r/[email protected]
and also further patches here depend on this one.
---
Documentation/devicetree/bindings/mfd/syscon.yaml | 1 -
.../bindings/soc/intel/intel,lgm-syscon.yaml | 53 ++++++++++++++++++++++
2 files changed, 53 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/mfd/syscon.yaml b/Documentation/devicetree/bindings/mfd/syscon.yaml
index 622ea0f1b08e..5a0aeae24a50 100644
--- a/Documentation/devicetree/bindings/mfd/syscon.yaml
+++ b/Documentation/devicetree/bindings/mfd/syscon.yaml
@@ -77,7 +77,6 @@ properties:
- hisilicon,pcie-sas-subctrl
- hisilicon,peri-subctrl
- hpe,gxp-sysreg
- - intel,lgm-syscon
- loongson,ls1b-syscon
- loongson,ls1c-syscon
- lsi,axxia-syscon
diff --git a/Documentation/devicetree/bindings/soc/intel/intel,lgm-syscon.yaml b/Documentation/devicetree/bindings/soc/intel/intel,lgm-syscon.yaml
new file mode 100644
index 000000000000..aa8d24074fd7
--- /dev/null
+++ b/Documentation/devicetree/bindings/soc/intel/intel,lgm-syscon.yaml
@@ -0,0 +1,53 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/soc/intel/intel,lgm-syscon.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Intel Lightning Mountain(LGM) Syscon
+
+maintainers:
+ - Ramuthevar Vadivel Murugan <[email protected]>
+
+properties:
+ compatible:
+ items:
+ - const: intel,lgm-syscon
+ - const: syscon
+
+ reg:
+ maxItems: 1
+
+ "#address-cells":
+ const: 1
+
+ "#size-cells":
+ const: 1
+
+patternProperties:
+ "^emmc-phy@[0-9a-f]+$":
+ $ref: /schemas/phy/intel,lgm-emmc-phy.yaml#
+
+required:
+ - compatible
+ - reg
+ - "#address-cells"
+ - "#size-cells"
+
+additionalProperties: false
+
+examples:
+ - |
+ chiptop@e0200000 {
+ compatible = "intel,lgm-syscon", "syscon";
+ reg = <0xe0200000 0x100>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ emmc-phy@a8 {
+ compatible = "intel,lgm-emmc-phy";
+ reg = <0x00a8 0x10>;
+ clocks = <&emmc>;
+ #phy-cells = <0>;
+ };
+ };

--
2.43.0


2024-05-19 18:43:34

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 4/8] dt-bindings: soc: microchip: sparx5-cpu-syscon: Move to dedicated schema

microchip,sparx5-cpu-syscon is not a simple syscon device - it has
children and implements simple-mfd compatible - thus it should be fully
documented in its own binding.

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

---

Context might depend on
https://lore.kernel.org/r/[email protected]
and also further patches here depend on this one.
---
Documentation/devicetree/bindings/mfd/syscon.yaml | 1 -
.../soc/microchip/microchip,sparx5-cpu-syscon.yaml | 49 ++++++++++++++++++++++
2 files changed, 49 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/mfd/syscon.yaml b/Documentation/devicetree/bindings/mfd/syscon.yaml
index 5a0aeae24a50..91adf781e8ba 100644
--- a/Documentation/devicetree/bindings/mfd/syscon.yaml
+++ b/Documentation/devicetree/bindings/mfd/syscon.yaml
@@ -95,7 +95,6 @@ properties:
- microchip,lan966x-cpu-syscon
- microchip,sam9x60-sfr
- microchip,sama7g5-ddr3phy
- - microchip,sparx5-cpu-syscon
- mscc,ocelot-cpu-syscon
- mstar,msc313-pmsleep
- nuvoton,ma35d1-sys
diff --git a/Documentation/devicetree/bindings/soc/microchip/microchip,sparx5-cpu-syscon.yaml b/Documentation/devicetree/bindings/soc/microchip/microchip,sparx5-cpu-syscon.yaml
new file mode 100644
index 000000000000..1f0b542d2296
--- /dev/null
+++ b/Documentation/devicetree/bindings/soc/microchip/microchip,sparx5-cpu-syscon.yaml
@@ -0,0 +1,49 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/soc/microchip/microchip,sparx5-cpu-syscon.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Microchip Sparx5 CPU Syscon
+
+maintainers:
+ - Lars Povlsen <[email protected]>
+
+properties:
+ compatible:
+ items:
+ - const: microchip,sparx5-cpu-syscon
+ - const: syscon
+ - const: simple-mfd
+
+ reg:
+ maxItems: 1
+
+ mux-controller:
+ $ref: /schemas/mux/reg-mux.yaml#
+
+required:
+ - compatible
+ - reg
+ - mux-controller
+
+additionalProperties: false
+
+examples:
+ - |
+ soc {
+ #address-cells = <2>;
+ #size-cells = <1>;
+
+ syscon@600000000 {
+ compatible = "microchip,sparx5-cpu-syscon", "syscon",
+ "simple-mfd";
+ reg = <0x6 0x00000000 0xd0>;
+
+ mux: mux-controller {
+ compatible = "mmio-mux";
+ #mux-control-cells = <1>;
+ mux-reg-masks = <0x88 0xf0>;
+ };
+ };
+ };

--
2.43.0


2024-05-19 18:43:49

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 5/8] dt-bindings: soc: ti: am654-serdes-ctrl: Move to dedicated schema

ti,am654-serdes-ctrl is not a simple syscon device - it has children -
thus it should be fully documented in its own binding.

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

---

Context might depend on
https://lore.kernel.org/r/[email protected]
and also further patches here depend on this one.
---
Documentation/devicetree/bindings/mfd/syscon.yaml | 1 -
.../bindings/soc/ti/ti,am654-serdes-ctrl.yaml | 42 ++++++++++++++++++++++
2 files changed, 42 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/mfd/syscon.yaml b/Documentation/devicetree/bindings/mfd/syscon.yaml
index 91adf781e8ba..b17fa0487178 100644
--- a/Documentation/devicetree/bindings/mfd/syscon.yaml
+++ b/Documentation/devicetree/bindings/mfd/syscon.yaml
@@ -116,7 +116,6 @@ properties:
- ti,am62-usb-phy-ctrl
- ti,am62p-cpsw-mac-efuse
- ti,am654-dss-oldi-io-ctrl
- - ti,am654-serdes-ctrl
- ti,j784s4-pcie-ctrl
- ti,keystone-pllctrl

diff --git a/Documentation/devicetree/bindings/soc/ti/ti,am654-serdes-ctrl.yaml b/Documentation/devicetree/bindings/soc/ti/ti,am654-serdes-ctrl.yaml
new file mode 100644
index 000000000000..a10a3b89ae05
--- /dev/null
+++ b/Documentation/devicetree/bindings/soc/ti/ti,am654-serdes-ctrl.yaml
@@ -0,0 +1,42 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/soc/ti/ti,am654-serdes-ctrl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments AM654 Serdes Control Syscon
+
+maintainers:
+ - Nishanth Menon <[email protected]>
+
+properties:
+ compatible:
+ items:
+ - const: ti,am654-serdes-ctrl
+ - const: syscon
+
+ reg:
+ maxItems: 1
+
+ mux-controller:
+ $ref: /schemas/mux/reg-mux.yaml#
+
+required:
+ - compatible
+ - reg
+ - mux-controller
+
+additionalProperties: false
+
+examples:
+ - |
+ clock@4080 {
+ compatible = "ti,am654-serdes-ctrl", "syscon";
+ reg = <0x4080 0x4>;
+
+ mux-controller {
+ compatible = "mmio-mux";
+ #mux-control-cells = <1>;
+ mux-reg-masks = <0x0 0x3>; /* lane select */
+ };
+ };

--
2.43.0


2024-05-19 18:44:04

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 6/8] dt-bindings: mfd: syscon: Split and enforce documenting MFD children

Simple syscon nodes can be documented in common syscon.yaml, however
devices with simple-mfd compatible, thus with some children, should have
their own schema listing these children. Such listing makes the binding
specific, allows better validation (so the incorrect child would not
appear in the simple-mfd node) and actually enforces repeated rule for
simple-mfd devices:

"simple-mfd" is only for simple devices, where the children do not
depend on the parent.

Currently the syscon+simple-mfd binding is quite broad and allows
any child or property, thus above rule cannot be enforced.

Split the syscon.yaml binding into:
1. Common syscon properties, used potentially by many bindings.
2. Simple syscon devices (NO simple-mfd!).

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

---

Depends on:
1. https://lore.kernel.org/r/[email protected]
2. Previous patches in the series.
---
.../devicetree/bindings/mfd/syscon-common.yaml | 72 +++++++
Documentation/devicetree/bindings/mfd/syscon.yaml | 212 +++++++++------------
2 files changed, 162 insertions(+), 122 deletions(-)

diff --git a/Documentation/devicetree/bindings/mfd/syscon-common.yaml b/Documentation/devicetree/bindings/mfd/syscon-common.yaml
new file mode 100644
index 000000000000..c3ff3a7afce3
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/syscon-common.yaml
@@ -0,0 +1,72 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/syscon-common.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: System Controller Registers R/W Common Properties
+
+description: |
+ System controller node represents a register region containing a set
+ of miscellaneous registers. The registers are not cohesive enough to
+ represent as any specific type of device. The typical use-case is
+ for some other node's driver, or platform-specific code, to acquire
+ a reference to the syscon node (e.g. by phandle, node path, or
+ search using a specific compatible value), interrogate the node (or
+ associated OS driver) to determine the location of the registers,
+ and access the registers directly.
+
+maintainers:
+ - Lee Jones <[email protected]>
+
+select:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - syscon
+
+ required:
+ - compatible
+
+properties:
+ compatible:
+ contains:
+ const: syscon
+ minItems: 2
+ maxItems: 5 # Should be enough
+
+ reg:
+ maxItems: 1
+
+ reg-io-width:
+ description: |
+ The size (in bytes) of the IO accesses that should be performed
+ on the device.
+ enum: [1, 2, 4, 8]
+
+required:
+ - compatible
+ - reg
+
+allOf:
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: simple-mfd
+ then:
+ properties:
+ compatible:
+ minItems: 3
+ maxItems: 5
+
+additionalProperties: true
+
+examples:
+ - |
+ syscon: syscon@1c00000 {
+ compatible = "allwinner,sun8i-h3-system-controller", "syscon";
+ reg = <0x01c00000 0x1000>;
+ };
+...
diff --git a/Documentation/devicetree/bindings/mfd/syscon.yaml b/Documentation/devicetree/bindings/mfd/syscon.yaml
index b17fa0487178..70e3961bc96f 100644
--- a/Documentation/devicetree/bindings/mfd/syscon.yaml
+++ b/Documentation/devicetree/bindings/mfd/syscon.yaml
@@ -4,7 +4,7 @@
$id: http://devicetree.org/schemas/mfd/syscon.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

-title: System Controller Registers R/W
+title: System Controller Devices

description: |
System controller node represents a register region containing a set
@@ -19,122 +19,99 @@ description: |
maintainers:
- Lee Jones <[email protected]>

-select:
- properties:
- compatible:
- contains:
- enum:
- - syscon
-
- required:
- - compatible
-
properties:
compatible:
- anyOf:
- - items:
- - enum:
- - al,alpine-sysfabric-service
- - allwinner,sun8i-a83t-system-controller
- - allwinner,sun8i-h3-system-controller
- - allwinner,sun8i-v3s-system-controller
- - allwinner,sun50i-a64-system-controller
- - altr,l3regs
- - altr,sdr-ctl
- - amd,pensando-elba-syscon
- - amlogic,meson-mx-assist
- - amlogic,meson-mx-bootrom
- - amlogic,meson8-analog-top
- - amlogic,meson8b-analog-top
- - amlogic,meson8-pmu
- - amlogic,meson8b-pmu
- - apm,xgene-csw
- - apm,xgene-efuse
- - apm,xgene-mcb
- - apm,xgene-rb
- - apm,xgene-scu
- - atmel,sama5d2-sfrbu
- - atmel,sama5d3-nfc-io
- - atmel,sama5d3-sfrbu
- - atmel,sama5d4-sfrbu
- - axis,artpec6-syscon
- - brcm,cru-clkset
- - brcm,sr-cdru
- - brcm,sr-mhb
- - cirrus,ep7209-syscon1
- - cirrus,ep7209-syscon2
- - cirrus,ep7209-syscon3
- - cnxt,cx92755-uc
- - freecom,fsg-cs2-system-controller
- - fsl,imx93-aonmix-ns-syscfg
- - fsl,imx93-wakeupmix-syscfg
- - fsl,ls1088a-reset
- - fsl,vf610-anatop
- - fsl,vf610-mscm-cpucfg
- - hisilicon,dsa-subctrl
- - hisilicon,hi6220-sramctrl
- - hisilicon,hip04-ppe
- - hisilicon,pcie-sas-subctrl
- - hisilicon,peri-subctrl
- - hpe,gxp-sysreg
- - loongson,ls1b-syscon
- - loongson,ls1c-syscon
- - lsi,axxia-syscon
- - marvell,armada-3700-cpu-misc
- - marvell,armada-3700-nb-pm
- - marvell,armada-3700-avs
- - marvell,armada-3700-usb2-host-misc
- - marvell,dove-global-config
- - mediatek,mt2701-pctl-a-syscfg
- - mediatek,mt2712-pctl-a-syscfg
- - mediatek,mt6397-pctl-pmic-syscfg
- - mediatek,mt8135-pctl-a-syscfg
- - mediatek,mt8135-pctl-b-syscfg
- - mediatek,mt8173-pctl-a-syscfg
- - mediatek,mt8365-syscfg
- - microchip,lan966x-cpu-syscon
- - microchip,sam9x60-sfr
- - microchip,sama7g5-ddr3phy
- - mscc,ocelot-cpu-syscon
- - mstar,msc313-pmsleep
- - nuvoton,ma35d1-sys
- - nuvoton,wpcm450-shm
- - rockchip,px30-qos
- - rockchip,rk3036-qos
- - rockchip,rk3066-qos
- - rockchip,rk3128-qos
- - rockchip,rk3228-qos
- - rockchip,rk3288-qos
- - rockchip,rk3368-qos
- - rockchip,rk3399-qos
- - rockchip,rk3568-qos
- - rockchip,rk3588-qos
- - rockchip,rv1126-qos
- - st,spear1340-misc
- - stericsson,nomadik-pmu
- - starfive,jh7100-sysmain
- - ti,am62-usb-phy-ctrl
- - ti,am62p-cpsw-mac-efuse
- - ti,am654-dss-oldi-io-ctrl
- - ti,j784s4-pcie-ctrl
- - ti,keystone-pllctrl
-
- - const: syscon
-
- - contains:
- const: syscon
- minItems: 2
- maxItems: 5 # Should be enough
+ items:
+ - enum:
+ - al,alpine-sysfabric-service
+ - allwinner,sun8i-a83t-system-controller
+ - allwinner,sun8i-h3-system-controller
+ - allwinner,sun8i-v3s-system-controller
+ - allwinner,sun50i-a64-system-controller
+ - altr,l3regs
+ - altr,sdr-ctl
+ - amd,pensando-elba-syscon
+ - amlogic,meson-mx-assist
+ - amlogic,meson-mx-bootrom
+ - amlogic,meson8-analog-top
+ - amlogic,meson8b-analog-top
+ - amlogic,meson8-pmu
+ - amlogic,meson8b-pmu
+ - apm,xgene-csw
+ - apm,xgene-efuse
+ - apm,xgene-mcb
+ - apm,xgene-rb
+ - apm,xgene-scu
+ - atmel,sama5d2-sfrbu
+ - atmel,sama5d3-nfc-io
+ - atmel,sama5d3-sfrbu
+ - atmel,sama5d4-sfrbu
+ - axis,artpec6-syscon
+ - brcm,cru-clkset
+ - brcm,sr-cdru
+ - brcm,sr-mhb
+ - cirrus,ep7209-syscon1
+ - cirrus,ep7209-syscon2
+ - cirrus,ep7209-syscon3
+ - cnxt,cx92755-uc
+ - freecom,fsg-cs2-system-controller
+ - fsl,imx93-aonmix-ns-syscfg
+ - fsl,imx93-wakeupmix-syscfg
+ - fsl,ls1088a-reset
+ - fsl,vf610-anatop
+ - fsl,vf610-mscm-cpucfg
+ - hisilicon,dsa-subctrl
+ - hisilicon,hi6220-sramctrl
+ - hisilicon,hip04-ppe
+ - hisilicon,pcie-sas-subctrl
+ - hisilicon,peri-subctrl
+ - hpe,gxp-sysreg
+ - loongson,ls1b-syscon
+ - loongson,ls1c-syscon
+ - lsi,axxia-syscon
+ - marvell,armada-3700-cpu-misc
+ - marvell,armada-3700-nb-pm
+ - marvell,armada-3700-avs
+ - marvell,armada-3700-usb2-host-misc
+ - marvell,dove-global-config
+ - mediatek,mt2701-pctl-a-syscfg
+ - mediatek,mt2712-pctl-a-syscfg
+ - mediatek,mt6397-pctl-pmic-syscfg
+ - mediatek,mt8135-pctl-a-syscfg
+ - mediatek,mt8135-pctl-b-syscfg
+ - mediatek,mt8173-pctl-a-syscfg
+ - mediatek,mt8365-syscfg
+ - microchip,lan966x-cpu-syscon
+ - microchip,sam9x60-sfr
+ - microchip,sama7g5-ddr3phy
+ - mscc,ocelot-cpu-syscon
+ - mstar,msc313-pmsleep
+ - nuvoton,ma35d1-sys
+ - nuvoton,wpcm450-shm
+ - rockchip,px30-qos
+ - rockchip,rk3036-qos
+ - rockchip,rk3066-qos
+ - rockchip,rk3128-qos
+ - rockchip,rk3228-qos
+ - rockchip,rk3288-qos
+ - rockchip,rk3368-qos
+ - rockchip,rk3399-qos
+ - rockchip,rk3568-qos
+ - rockchip,rk3588-qos
+ - rockchip,rv1126-qos
+ - st,spear1340-misc
+ - stericsson,nomadik-pmu
+ - starfive,jh7100-sysmain
+ - ti,am62-usb-phy-ctrl
+ - ti,am62p-cpsw-mac-efuse
+ - ti,am654-dss-oldi-io-ctrl
+ - ti,j784s4-pcie-ctrl
+ - ti,keystone-pllctrl
+ - const: syscon

reg:
maxItems: 1

- reg-io-width:
- description: |
- The size (in bytes) of the IO accesses that should be performed
- on the device.
- enum: [1, 2, 4, 8]
-
resets:
maxItems: 1

@@ -143,18 +120,9 @@ required:
- reg

allOf:
- - if:
- properties:
- compatible:
- contains:
- const: simple-mfd
- then:
- properties:
- compatible:
- minItems: 3
- maxItems: 5
+ - $ref: syscon-common.yaml#

-additionalProperties: true
+unevaluatedProperties: false

examples:
- |

--
2.43.0


2024-05-19 18:44:12

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 7/8] dt-bindings: mfd: syscon: Add APM poweroff mailbox

Add compatible for an already used syscon poweroff/mailbox block in APM.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
Documentation/devicetree/bindings/mfd/syscon.yaml | 2 ++
1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/mfd/syscon.yaml b/Documentation/devicetree/bindings/mfd/syscon.yaml
index 70e3961bc96f..dd35e613d633 100644
--- a/Documentation/devicetree/bindings/mfd/syscon.yaml
+++ b/Documentation/devicetree/bindings/mfd/syscon.yaml
@@ -37,6 +37,8 @@ properties:
- amlogic,meson8b-analog-top
- amlogic,meson8-pmu
- amlogic,meson8b-pmu
+ - apm,merlin-poweroff-mailbox
+ - apm,mustang-poweroff-mailbox
- apm,xgene-csw
- apm,xgene-efuse
- apm,xgene-mcb

--
2.43.0


2024-05-19 18:44:26

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 8/8] arm64: dts: apm: Add dedicated syscon poweroff compatibles

syscon nodes should always have dedicated compatible for full/accurate
hardware description.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
arch/arm64/boot/dts/apm/apm-merlin.dts | 2 +-
arch/arm64/boot/dts/apm/apm-mustang.dts | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/apm/apm-merlin.dts b/arch/arm64/boot/dts/apm/apm-merlin.dts
index 6e05cf1a3df6..b1160780a2a6 100644
--- a/arch/arm64/boot/dts/apm/apm-merlin.dts
+++ b/arch/arm64/boot/dts/apm/apm-merlin.dts
@@ -32,7 +32,7 @@ button {
};

poweroff_mbox: poweroff_mbox@10548000 {
- compatible = "syscon";
+ compatible = "apm,merlin-poweroff-mailbox", "syscon";
reg = <0x0 0x10548000 0x0 0x30>;
};

diff --git a/arch/arm64/boot/dts/apm/apm-mustang.dts b/arch/arm64/boot/dts/apm/apm-mustang.dts
index e7644cddf06f..2ef658796746 100644
--- a/arch/arm64/boot/dts/apm/apm-mustang.dts
+++ b/arch/arm64/boot/dts/apm/apm-mustang.dts
@@ -32,7 +32,7 @@ button {
};

poweroff_mbox: poweroff_mbox@10548000 {
- compatible = "syscon";
+ compatible = "apm,mustang-poweroff-mailbox", "syscon";
reg = <0x0 0x10548000 0x0 0x30>;
};


--
2.43.0


2024-05-20 21:05:40

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 1/8] dt-bindings: mfd: syscon: Drop hwlocks


On Sun, 19 May 2024 20:42:16 +0200, Krzysztof Kozlowski wrote:
> Apparently there is no in-tree DTS syscon node having hwlocks, so drop
> the property to simplify the binding.
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>
> ---
> Documentation/devicetree/bindings/mfd/syscon.yaml | 5 -----
> 1 file changed, 5 deletions(-)
>

Acked-by: Rob Herring (Arm) <[email protected]>


2024-05-20 21:06:29

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 2/8] dt-bindings: soc: sprd: sc9863a-glbregs: Document SC9863A syscon


On Sun, 19 May 2024 20:42:17 +0200, Krzysztof Kozlowski wrote:
> Document sprd,sc9863a-glbregs compatible already used in DTS and other
> bindings example.
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>
> ---
> .../bindings/soc/sprd/sprd,sc9863a-glbregs.yaml | 55 ++++++++++++++++++++++
> 1 file changed, 55 insertions(+)
>

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


2024-05-20 21:07:37

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 3/8] dt-bindings: soc: intel: lgm-syscon: Move to dedicated schema

On Sun, May 19, 2024 at 08:42:18PM +0200, Krzysztof Kozlowski wrote:
> intel,lgm-syscon is not a simple syscon device - it has children - thus
> it should be fully documented in its own binding.
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>
>
> ---
>
> Context might depend on
> https://lore.kernel.org/r/[email protected]
> and also further patches here depend on this one.
> ---
> Documentation/devicetree/bindings/mfd/syscon.yaml | 1 -
> .../bindings/soc/intel/intel,lgm-syscon.yaml | 53 ++++++++++++++++++++++
> 2 files changed, 53 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/mfd/syscon.yaml b/Documentation/devicetree/bindings/mfd/syscon.yaml
> index 622ea0f1b08e..5a0aeae24a50 100644
> --- a/Documentation/devicetree/bindings/mfd/syscon.yaml
> +++ b/Documentation/devicetree/bindings/mfd/syscon.yaml
> @@ -77,7 +77,6 @@ properties:
> - hisilicon,pcie-sas-subctrl
> - hisilicon,peri-subctrl
> - hpe,gxp-sysreg
> - - intel,lgm-syscon
> - loongson,ls1b-syscon
> - loongson,ls1c-syscon
> - lsi,axxia-syscon
> diff --git a/Documentation/devicetree/bindings/soc/intel/intel,lgm-syscon.yaml b/Documentation/devicetree/bindings/soc/intel/intel,lgm-syscon.yaml
> new file mode 100644
> index 000000000000..aa8d24074fd7
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/soc/intel/intel,lgm-syscon.yaml
> @@ -0,0 +1,53 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/soc/intel/intel,lgm-syscon.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Intel Lightning Mountain(LGM) Syscon
> +
> +maintainers:
> + - Ramuthevar Vadivel Murugan <[email protected]>
> +
> +properties:
> + compatible:
> + items:
> + - const: intel,lgm-syscon
> + - const: syscon
> +
> + reg:
> + maxItems: 1
> +
> + "#address-cells":
> + const: 1
> +
> + "#size-cells":
> + const: 1

Should have ranges.

> +
> +patternProperties:
> + "^emmc-phy@[0-9a-f]+$":
> + $ref: /schemas/phy/intel,lgm-emmc-phy.yaml#
> +
> +required:
> + - compatible
> + - reg
> + - "#address-cells"
> + - "#size-cells"
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + chiptop@e0200000 {
> + compatible = "intel,lgm-syscon", "syscon";
> + reg = <0xe0200000 0x100>;
> + #address-cells = <1>;
> + #size-cells = <1>;
> +
> + emmc-phy@a8 {
> + compatible = "intel,lgm-emmc-phy";
> + reg = <0x00a8 0x10>;
> + clocks = <&emmc>;
> + #phy-cells = <0>;
> + };
> + };
>
> --
> 2.43.0
>

2024-05-20 21:08:29

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 4/8] dt-bindings: soc: microchip: sparx5-cpu-syscon: Move to dedicated schema


On Sun, 19 May 2024 20:42:19 +0200, Krzysztof Kozlowski wrote:
> microchip,sparx5-cpu-syscon is not a simple syscon device - it has
> children and implements simple-mfd compatible - thus it should be fully
> documented in its own binding.
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>
>
> ---
>
> Context might depend on
> https://lore.kernel.org/r/[email protected]
> and also further patches here depend on this one.
> ---
> Documentation/devicetree/bindings/mfd/syscon.yaml | 1 -
> .../soc/microchip/microchip,sparx5-cpu-syscon.yaml | 49 ++++++++++++++++++++++
> 2 files changed, 49 insertions(+), 1 deletion(-)
>

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


2024-05-20 21:08:57

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 5/8] dt-bindings: soc: ti: am654-serdes-ctrl: Move to dedicated schema


On Sun, 19 May 2024 20:42:20 +0200, Krzysztof Kozlowski wrote:
> ti,am654-serdes-ctrl is not a simple syscon device - it has children -
> thus it should be fully documented in its own binding.
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>
>
> ---
>
> Context might depend on
> https://lore.kernel.org/r/[email protected]
> and also further patches here depend on this one.
> ---
> Documentation/devicetree/bindings/mfd/syscon.yaml | 1 -
> .../bindings/soc/ti/ti,am654-serdes-ctrl.yaml | 42 ++++++++++++++++++++++
> 2 files changed, 42 insertions(+), 1 deletion(-)
>

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


2024-05-20 21:22:19

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 7/8] dt-bindings: mfd: syscon: Add APM poweroff mailbox


On Sun, 19 May 2024 20:42:22 +0200, Krzysztof Kozlowski wrote:
> Add compatible for an already used syscon poweroff/mailbox block in APM.
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>
> ---
> Documentation/devicetree/bindings/mfd/syscon.yaml | 2 ++
> 1 file changed, 2 insertions(+)
>

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


2024-05-20 21:30:55

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 6/8] dt-bindings: mfd: syscon: Split and enforce documenting MFD children

On Sun, May 19, 2024 at 08:42:21PM +0200, Krzysztof Kozlowski wrote:
> Simple syscon nodes can be documented in common syscon.yaml, however
> devices with simple-mfd compatible, thus with some children, should have
> their own schema listing these children. Such listing makes the binding
> specific, allows better validation (so the incorrect child would not
> appear in the simple-mfd node) and actually enforces repeated rule for
> simple-mfd devices:
>
> "simple-mfd" is only for simple devices, where the children do not
> depend on the parent.
>
> Currently the syscon+simple-mfd binding is quite broad and allows
> any child or property, thus above rule cannot be enforced.
>
> Split the syscon.yaml binding into:
> 1. Common syscon properties, used potentially by many bindings.
> 2. Simple syscon devices (NO simple-mfd!).
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>
>
> ---
>
> Depends on:
> 1. https://lore.kernel.org/r/[email protected]
> 2. Previous patches in the series.
> ---
> .../devicetree/bindings/mfd/syscon-common.yaml | 72 +++++++
> Documentation/devicetree/bindings/mfd/syscon.yaml | 212 +++++++++------------
> 2 files changed, 162 insertions(+), 122 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/mfd/syscon-common.yaml b/Documentation/devicetree/bindings/mfd/syscon-common.yaml
> new file mode 100644
> index 000000000000..c3ff3a7afce3
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mfd/syscon-common.yaml
> @@ -0,0 +1,72 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mfd/syscon-common.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: System Controller Registers R/W Common Properties
> +
> +description: |
> + System controller node represents a register region containing a set
> + of miscellaneous registers. The registers are not cohesive enough to
> + represent as any specific type of device. The typical use-case is
> + for some other node's driver, or platform-specific code, to acquire
> + a reference to the syscon node (e.g. by phandle, node path, or
> + search using a specific compatible value), interrogate the node (or
> + associated OS driver) to determine the location of the registers,
> + and access the registers directly.
> +
> +maintainers:
> + - Lee Jones <[email protected]>
> +
> +select:
> + properties:
> + compatible:
> + contains:
> + enum:
> + - syscon
> +
> + required:
> + - compatible
> +
> +properties:
> + compatible:
> + contains:
> + const: syscon
> + minItems: 2
> + maxItems: 5 # Should be enough
> +
> + reg:
> + maxItems: 1
> +
> + reg-io-width:
> + description: |
> + The size (in bytes) of the IO accesses that should be performed
> + on the device.
> + enum: [1, 2, 4, 8]
> +
> +required:
> + - compatible
> + - reg
> +
> +allOf:
> + - if:
> + properties:
> + compatible:
> + contains:
> + const: simple-mfd
> + then:
> + properties:
> + compatible:
> + minItems: 3
> + maxItems: 5
> +
> +additionalProperties: true
> +
> +examples:
> + - |
> + syscon: syscon@1c00000 {
> + compatible = "allwinner,sun8i-h3-system-controller", "syscon";
> + reg = <0x01c00000 0x1000>;
> + };
> +...
> diff --git a/Documentation/devicetree/bindings/mfd/syscon.yaml b/Documentation/devicetree/bindings/mfd/syscon.yaml
> index b17fa0487178..70e3961bc96f 100644
> --- a/Documentation/devicetree/bindings/mfd/syscon.yaml
> +++ b/Documentation/devicetree/bindings/mfd/syscon.yaml
> @@ -4,7 +4,7 @@
> $id: http://devicetree.org/schemas/mfd/syscon.yaml#
> $schema: http://devicetree.org/meta-schemas/core.yaml#
>
> -title: System Controller Registers R/W
> +title: System Controller Devices
>
> description: |
> System controller node represents a register region containing a set
> @@ -19,122 +19,99 @@ description: |
> maintainers:
> - Lee Jones <[email protected]>
>
> -select:
> - properties:
> - compatible:
> - contains:
> - enum:
> - - syscon
> -
> - required:
> - - compatible
> -

Removing this is only going to work with v2024.04. The only way it
works for older versions is listing all the compatibles here. That's a
bit new for us to require it.

Rob

2024-05-21 08:01:02

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 3/8] dt-bindings: soc: intel: lgm-syscon: Move to dedicated schema

On 20/05/2024 23:07, Rob Herring wrote:
> On Sun, May 19, 2024 at 08:42:18PM +0200, Krzysztof Kozlowski wrote:
>> intel,lgm-syscon is not a simple syscon device - it has children - thus
>> it should be fully documented in its own binding.
>>
>> Signed-off-by: Krzysztof Kozlowski <[email protected]>

..

>> +
>> +maintainers:
>> + - Ramuthevar Vadivel Murugan <[email protected]>
>> +
>> +properties:
>> + compatible:
>> + items:
>> + - const: intel,lgm-syscon
>> + - const: syscon
>> +
>> + reg:
>> + maxItems: 1
>> +
>> + "#address-cells":
>> + const: 1
>> +
>> + "#size-cells":
>> + const: 1
>
> Should have ranges.

ack

Best regards,
Krzysztof


2024-05-21 08:02:29

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 6/8] dt-bindings: mfd: syscon: Split and enforce documenting MFD children

On 20/05/2024 23:20, Rob Herring wrote:
> On Sun, May 19, 2024 at 08:42:21PM +0200, Krzysztof Kozlowski wrote:
>> Simple syscon nodes can be documented in common syscon.yaml, however
>> devices with simple-mfd compatible, thus with some children, should have
>> their own schema listing these children. Such listing makes the binding
>> specific, allows better validation (so the incorrect child would not
>> appear in the simple-mfd node) and actually enforces repeated rule for
>> simple-mfd devices:
>>
>> "simple-mfd" is only for simple devices, where the children do not
>> depend on the parent.
>>
>> Currently the syscon+simple-mfd binding is quite broad and allows
>> any child or property, thus above rule cannot be enforced.
>>
>> Split the syscon.yaml binding into:
>> 1. Common syscon properties, used potentially by many bindings.
>> 2. Simple syscon devices (NO simple-mfd!).
>>
>> Signed-off-by: Krzysztof Kozlowski <[email protected]>

..


>>
>> description: |
>> System controller node represents a register region containing a set
>> @@ -19,122 +19,99 @@ description: |
>> maintainers:
>> - Lee Jones <[email protected]>
>>
>> -select:
>> - properties:
>> - compatible:
>> - contains:
>> - enum:
>> - - syscon
>> -
>> - required:
>> - - compatible
>> -
>
> Removing this is only going to work with v2024.04. The only way it
> works for older versions is listing all the compatibles here. That's a
> bit new for us to require it.

I'll keep it, in such case. Anyway its removal is not really related to
main concept of this patch.

Best regards,
Krzysztof