Skip to contentSkip to conversation

dt-bindings: reset: convert Hisilicon reset controller bindings to json-schema

PATCH Superseded Zhen Lei 3 participants 11 messages Dec 4, 2020 – Dec 8, 2020

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Zhen Lei

author
#0 lore raw

v2 cover dt-bindings: reset: convert Hisilicon reset controller bindings to json-schema

v1 --> v2:
Merge the driver and DT modification(correct vendor prefix hisi to hisilicon) into one patch.

v1:
Patch 1-3 change the vendor prefix from "hisi" to "hisilicon", to eliminate below warnings:
crg_rst_controller: 'hisi,rst-syscon' does not match any of the regexes: '^#.*', ... , '^hisilicon,.*', ... From schema: /root/leizhen/linux-next/Documentation/devicetree/bindings/vendor-prefixes.yaml

Patch 4 does the json-schema conversion.

Zhen Lei (3):
reset: hisilicon: correct vendor prefix
dt-bindings: reset: correct vendor prefix hisi to hisilicon
dt-bindings: reset: convert Hisilicon reset controller bindings to
json-schema

 .../bindings/reset/hisilicon,hi3660-reset.txt      | 44 -------------
 .../bindings/reset/hisilicon,hi3660-reset.yaml     | 77 ++++++++++++++++++++++
 arch/arm64/boot/dts/hisilicon/hi3660.dtsi          |  4 +-
 arch/arm64/boot/dts/hisilicon/hi3670.dtsi          |  2 +-
 drivers/reset/hisilicon/reset-hi3660.c             |  2 +-
 5 files changed, 81 insertions(+), 48 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/reset/hisilicon,hi3660-reset.txt
 create mode 100644 Documentation/devicetree/bindings/reset/hisilicon,hi3660-reset.yaml
Signature · 1 line
1.8.3
author
#1 lore raw

PATCH v2 1/3 reset: hisilicon: correct vendor prefix

The vendor prefix of "Hisilicon Limited" is "hisilicon", it is clearly stated in "vendor-prefixes.yaml".

Fixes 1527058736fa ("reset: hisilicon: add reset-hi3660")
Fixes 35ca8168133c ("arm64: dts: Add dts files for Hisilicon Hi3660 SoC")
Fixes dd8c7b78c11b ("arm64: dts: Add devicetree for Hisilicon Hi3670 SoC")
Cc Zhangfei Gao <[email protected]>
Cc Chen Feng <[email protected]>
Cc Manivannan Sadhasivam <[email protected]>
---
 arch/arm64/boot/dts/hisilicon/hi3660.dtsi | 4 ++--
 arch/arm64/boot/dts/hisilicon/hi3670.dtsi | 2 +-
 drivers/reset/hisilicon/reset-hi3660.c    | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/hisilicon/hi3660.dtsi +2 -2
index 49c19c6879f95ce..bfb1375426d2b58 100644
@@ -345,7 +345,7 @@
 		crg_rst: crg_rst_controller {
 			compatible = "hisilicon,hi3660-reset";
 			#reset-cells = <2>;
-			hisi,rst-syscon = <&crg_ctrl>;
+			hisilicon,rst-syscon = <&crg_ctrl>;
 		};
 
 
@@ -376,7 +376,7 @@
 
 		iomcu_rst: reset {
 			compatible = "hisilicon,hi3660-reset";
-			hisi,rst-syscon = <&iomcu>;
+			hisilicon,rst-syscon = <&iomcu>;
 			#reset-cells = <2>;
 		};
 
arch/arm64/boot/dts/hisilicon/hi3670.dtsi +1 -1
index 85b0dfb35d6d396..5c5a5dc964ea848 100644
@@ -155,7 +155,7 @@
 			compatible = "hisilicon,hi3670-reset",
 				     "hisilicon,hi3660-reset";
 			#reset-cells = <2>;
-			hisi,rst-syscon = <&crg_ctrl>;
+			hisilicon,rst-syscon = <&crg_ctrl>;
 		};
 
 		pctrl: pctrl@e8a09000 {
drivers/reset/hisilicon/reset-hi3660.c +1 -1
index a7d4445924e558c..8f1953159a65b31 100644
@@ -83,7 +83,7 @@ static int hi3660_reset_probe(struct platform_device *pdev)
 	if (!rc)
 		return -ENOMEM;
 
-	rc->map = syscon_regmap_lookup_by_phandle(np, "hisi,rst-syscon");
+	rc->map = syscon_regmap_lookup_by_phandle(np, "hisilicon,rst-syscon");
 	if (IS_ERR(rc->map)) {
 		dev_err(dev, "failed to get hi3660,rst-syscon\n");
 		return PTR_ERR(rc->map);
Signature · 1 line
1.8.3
maintainer
#2 lore raw

Re: [PATCH v2 1/3] reset: hisilicon: correct vendor prefix

Quoted 2 lines · Zhen Lei

The vendor prefix of "Hisilicon Limited" is "hisilicon", it is clearly stated in "vendor-prefixes.yaml".

Yes, but you can't fix this as changing it breaks compability between DTBs and kernels.

hisi has to be documented and marked 'deprecated'.

Quoted 66 lines
Fixes 1527058736fa ("reset: hisilicon: add reset-hi3660")
Fixes 35ca8168133c ("arm64: dts: Add dts files for Hisilicon Hi3660 SoC")
Fixes dd8c7b78c11b ("arm64: dts: Add devicetree for Hisilicon Hi3670 SoC")
Cc Zhangfei Gao <[email protected]>
Cc Chen Feng <[email protected]>
Cc Manivannan Sadhasivam <[email protected]>
---
 arch/arm64/boot/dts/hisilicon/hi3660.dtsi | 4 ++--
 arch/arm64/boot/dts/hisilicon/hi3670.dtsi | 2 +-
 drivers/reset/hisilicon/reset-hi3660.c    | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/hisilicon/hi3660.dtsi +2 -2
index 49c19c6879f95ce..bfb1375426d2b58 100644
@@ -345,7 +345,7 @@
 		crg_rst: crg_rst_controller {
 			compatible = "hisilicon,hi3660-reset";
 			#reset-cells = <2>;
-			hisi,rst-syscon = <&crg_ctrl>;
+			hisilicon,rst-syscon = <&crg_ctrl>;
 		};
 
 
@@ -376,7 +376,7 @@
 
 		iomcu_rst: reset {
 			compatible = "hisilicon,hi3660-reset";
-			hisi,rst-syscon = <&iomcu>;
+			hisilicon,rst-syscon = <&iomcu>;
 			#reset-cells = <2>;
 		};
 
arch/arm64/boot/dts/hisilicon/hi3670.dtsi +1 -1
index 85b0dfb35d6d396..5c5a5dc964ea848 100644
@@ -155,7 +155,7 @@
 			compatible = "hisilicon,hi3670-reset",
 				     "hisilicon,hi3660-reset";
 			#reset-cells = <2>;
-			hisi,rst-syscon = <&crg_ctrl>;
+			hisilicon,rst-syscon = <&crg_ctrl>;
 		};
 
 		pctrl: pctrl@e8a09000 {
drivers/reset/hisilicon/reset-hi3660.c +1 -1
index a7d4445924e558c..8f1953159a65b31 100644
@@ -83,7 +83,7 @@ static int hi3660_reset_probe(struct platform_device *pdev)
 	if (!rc)
 		return -ENOMEM;
 
-	rc->map = syscon_regmap_lookup_by_phandle(np, "hisi,rst-syscon");
+	rc->map = syscon_regmap_lookup_by_phandle(np, "hisilicon,rst-syscon");
 	if (IS_ERR(rc->map)) {
 		dev_err(dev, "failed to get hi3660,rst-syscon\n");
 		return PTR_ERR(rc->map);
Signature · 1 line
1.8.3
#3 lore raw

Re: [PATCH v2 1/3] reset: hisilicon: correct vendor prefix

Quoted 8 lines · Rob Herring
Quoted 2 lines · Zhen Lei

The vendor prefix of "Hisilicon Limited" is "hisilicon", it is clearly stated in "vendor-prefixes.yaml".

Yes, but you can't fix this as changing it breaks compability between DTBs and kernels.

hisi has to be documented and marked 'deprecated'.

I searched, and this is the only place that uses the hisi prefix. Currently, YAML check will report warnings due to mismatch any of the regexes defined in Documentation/devicetree/bindings/vendor-prefixes.yaml

Is it not good to add hisi prefix to clear warnings? "^hisi,.*":
description: Hisilicon Limited, deprecated.

By the way, Hi Rob:
The license information in some YAML files is incorrect. Can you correct it in v5.11? For example:
WARNING: DT binding documents should be licensed (GPL-2.0-only OR BSD-2-Clause) #26: FILE: Documentation/devicetree/bindings/thermal/allwinner,sun8i-a83t-ths.yaml:1:
+# SPDX-License-Identifier: GPL-2.0

Quoted 70 lines
Quoted 67 lines
Fixes 1527058736fa ("reset: hisilicon: add reset-hi3660")
Fixes 35ca8168133c ("arm64: dts: Add dts files for Hisilicon Hi3660 SoC")
Fixes dd8c7b78c11b ("arm64: dts: Add devicetree for Hisilicon Hi3670 SoC")
Cc Zhangfei Gao <[email protected]>
Cc Chen Feng <[email protected]>
Cc Manivannan Sadhasivam <[email protected]>
---
 arch/arm64/boot/dts/hisilicon/hi3660.dtsi | 4 ++--
 arch/arm64/boot/dts/hisilicon/hi3670.dtsi | 2 +-
 drivers/reset/hisilicon/reset-hi3660.c    | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/hisilicon/hi3660.dtsi +2 -2
index 49c19c6879f95ce..bfb1375426d2b58 100644
@@ -345,7 +345,7 @@
 		crg_rst: crg_rst_controller {
 			compatible = "hisilicon,hi3660-reset";
 			#reset-cells = <2>;
-			hisi,rst-syscon = <&crg_ctrl>;
+			hisilicon,rst-syscon = <&crg_ctrl>;
 		};
 
 
@@ -376,7 +376,7 @@
 
 		iomcu_rst: reset {
 			compatible = "hisilicon,hi3660-reset";
-			hisi,rst-syscon = <&iomcu>;
+			hisilicon,rst-syscon = <&iomcu>;
 			#reset-cells = <2>;
 		};
 
arch/arm64/boot/dts/hisilicon/hi3670.dtsi +1 -1
index 85b0dfb35d6d396..5c5a5dc964ea848 100644
@@ -155,7 +155,7 @@
 			compatible = "hisilicon,hi3670-reset",
 				     "hisilicon,hi3660-reset";
 			#reset-cells = <2>;
-			hisi,rst-syscon = <&crg_ctrl>;
+			hisilicon,rst-syscon = <&crg_ctrl>;
 		};
 
 		pctrl: pctrl@e8a09000 {
drivers/reset/hisilicon/reset-hi3660.c +1 -1
index a7d4445924e558c..8f1953159a65b31 100644
@@ -83,7 +83,7 @@ static int hi3660_reset_probe(struct platform_device *pdev)
 	if (!rc)
 		return -ENOMEM;
 
-	rc->map = syscon_regmap_lookup_by_phandle(np, "hisi,rst-syscon");
+	rc->map = syscon_regmap_lookup_by_phandle(np, "hisilicon,rst-syscon");
 	if (IS_ERR(rc->map)) {
 		dev_err(dev, "failed to get hi3660,rst-syscon\n");
 		return PTR_ERR(rc->map);
Signature · 1 line
1.8.3

.

maintainer
#4 lore raw

Re: [PATCH v2 1/3] reset: hisilicon: correct vendor prefix

Quoted 22 lines · Leizhen (ThunderTown)
Quoted 8 lines · Rob Herring
Quoted 2 lines · Zhen Lei

The vendor prefix of "Hisilicon Limited" is "hisilicon", it is clearly stated in "vendor-prefixes.yaml".

Yes, but you can't fix this as changing it breaks compability between DTBs and kernels.

hisi has to be documented and marked 'deprecated'.

I searched, and this is the only place that uses the hisi prefix. Currently, YAML check will report warnings due to mismatch any of the regexes defined in Documentation/devicetree/bindings/vendor-prefixes.yaml

Is it not good to add hisi prefix to clear warnings? "^hisi,.*":
description: Hisilicon Limited, deprecated.

Quoted 6 lines

By the way, Hi Rob:
The license information in some YAML files is incorrect. Can you correct it in v5.11? For example:
WARNING: DT binding documents should be licensed (GPL-2.0-only OR BSD-2-Clause) #26: FILE: Documentation/devicetree/bindings/thermal/allwinner,sun8i-a83t-ths.yaml:1:
+# SPDX-License-Identifier: GPL-2.0

No, I can't change them. I'm not the copyright holder. The ones that are not dual licensed are most likely converted from the old text bindings which were default GPL2.

Rob

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

maintainer
#5 lore raw

Re: [PATCH v2 1/3] reset: hisilicon: correct vendor prefix

In reply to Zhen Lei

Hi Zhen,

Quoted 10 lines · Zhen Lei

The vendor prefix of "Hisilicon Limited" is "hisilicon", it is clearly stated in "vendor-prefixes.yaml".

Fixes 1527058736fa ("reset: hisilicon: add reset-hi3660")
Fixes 35ca8168133c ("arm64: dts: Add dts files for Hisilicon Hi3660 SoC")
Fixes dd8c7b78c11b ("arm64: dts: Add devicetree for Hisilicon Hi3670 SoC")
Cc Zhangfei Gao <[email protected]>
Cc Chen Feng <[email protected]>
Cc Manivannan Sadhasivam <[email protected]>
Quoted 4 lines
---
 arch/arm64/boot/dts/hisilicon/hi3660.dtsi | 4 ++--
 arch/arm64/boot/dts/hisilicon/hi3670.dtsi | 2 +-
 drivers/reset/hisilicon/reset-hi3660.c    | 2 +-

Please keep device tree patches and reset driver patch separate, as they were in v1.

Quoted 42 lines
 3 files changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/hisilicon/hi3660.dtsi +2 -2
index 49c19c6879f95ce..bfb1375426d2b58 100644
@@ -345,7 +345,7 @@
 		crg_rst: crg_rst_controller {
 			compatible = "hisilicon,hi3660-reset";
 			#reset-cells = <2>;
-			hisi,rst-syscon = <&crg_ctrl>;
+			hisilicon,rst-syscon = <&crg_ctrl>;
 		};
 
 
@@ -376,7 +376,7 @@
 
 		iomcu_rst: reset {
 			compatible = "hisilicon,hi3660-reset";
-			hisi,rst-syscon = <&iomcu>;
+			hisilicon,rst-syscon = <&iomcu>;
 			#reset-cells = <2>;
 		};
 
arch/arm64/boot/dts/hisilicon/hi3670.dtsi +1 -1
index 85b0dfb35d6d396..5c5a5dc964ea848 100644
@@ -155,7 +155,7 @@
 			compatible = "hisilicon,hi3670-reset",
 				     "hisilicon,hi3660-reset";
 			#reset-cells = <2>;
-			hisi,rst-syscon = <&crg_ctrl>;
+			hisilicon,rst-syscon = <&crg_ctrl>;
 		};
 
 		pctrl: pctrl@e8a09000 {
drivers/reset/hisilicon/reset-hi3660.c +0 -0
index a7d4445924e558c..8f1953159a65b31 100644

drivers/reset/hisilicon/reset-hi3660.c static int hi3660_reset_probe(struct platform_device *pdev) · line 86

Quoted 5 lines
drivers/reset/hisilicon/reset-hi3660.c +1 -1
@@ -83,7 +83,7 @@ static int hi3660_reset_probe(struct platform_device *pdev)
 	if (!rc)
 		return -ENOMEM;
 
-	rc->map = syscon_regmap_lookup_by_phandle(np, "hisi,rst-syscon");
+	rc->map = syscon_regmap_lookup_by_phandle(np, "hisilicon,rst-syscon");

This should fall back to the deprecated compatible, for example:

	rc->map = syscon_regmap_lookup_by_phandle(np, "hisilicon,rst-syscon");
	if (PTR_ERR(rc->map) == -ENODEV)
		rc->map = syscon_regmap_lookup_by_phandle(np, "hisi,rst-

syscon");

drivers/reset/hisilicon/reset-hi3660.c static int hi3660_reset_probe(struct platform_device *pdev) · line 89

Quoted 3 lines
drivers/reset/hisilicon/reset-hi3660.c +0 -0
 	if (IS_ERR(rc->map)) {
 		dev_err(dev, "failed to get hi3660,rst-syscon\n");
 		return PTR_ERR(rc->map);

regards
Philipp

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#6 lore raw

Re: [PATCH v2 1/3] reset: hisilicon: correct vendor prefix

Quoted 18 lines · Philipp Zabel

Hi Zhen,

Quoted 10 lines · Zhen Lei

The vendor prefix of "Hisilicon Limited" is "hisilicon", it is clearly stated in "vendor-prefixes.yaml".

Fixes 1527058736fa ("reset: hisilicon: add reset-hi3660")
Fixes 35ca8168133c ("arm64: dts: Add dts files for Hisilicon Hi3660 SoC")
Fixes dd8c7b78c11b ("arm64: dts: Add devicetree for Hisilicon Hi3670 SoC")
Cc Zhangfei Gao <[email protected]>
Cc Chen Feng <[email protected]>
Cc Manivannan Sadhasivam <[email protected]>
Quoted 4 lines
---
 arch/arm64/boot/dts/hisilicon/hi3660.dtsi | 4 ++--
 arch/arm64/boot/dts/hisilicon/hi3670.dtsi | 2 +-
 drivers/reset/hisilicon/reset-hi3660.c    | 2 +-
Quoted 2 lines

Please keep device tree patches and reset driver patch separate, as they were in v1.

OK

Quoted 51 lines
Quoted 43 lines
 3 files changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/hisilicon/hi3660.dtsi +2 -2
index 49c19c6879f95ce..bfb1375426d2b58 100644
@@ -345,7 +345,7 @@
 		crg_rst: crg_rst_controller {
 			compatible = "hisilicon,hi3660-reset";
 			#reset-cells = <2>;
-			hisi,rst-syscon = <&crg_ctrl>;
+			hisilicon,rst-syscon = <&crg_ctrl>;
 		};
 
 
@@ -376,7 +376,7 @@
 
 		iomcu_rst: reset {
 			compatible = "hisilicon,hi3660-reset";
-			hisi,rst-syscon = <&iomcu>;
+			hisilicon,rst-syscon = <&iomcu>;
 			#reset-cells = <2>;
 		};
 
arch/arm64/boot/dts/hisilicon/hi3670.dtsi +1 -1
index 85b0dfb35d6d396..5c5a5dc964ea848 100644
@@ -155,7 +155,7 @@
 			compatible = "hisilicon,hi3670-reset",
 				     "hisilicon,hi3660-reset";
 			#reset-cells = <2>;
-			hisi,rst-syscon = <&crg_ctrl>;
+			hisilicon,rst-syscon = <&crg_ctrl>;
 		};
 
 		pctrl: pctrl@e8a09000 {
drivers/reset/hisilicon/reset-hi3660.c +0 -0
index a7d4445924e558c..8f1953159a65b31 100644

drivers/reset/hisilicon/reset-hi3660.c static int hi3660_reset_probe(struct platform_device *pdev) · line 86

Quoted 5 lines
drivers/reset/hisilicon/reset-hi3660.c +1 -1
@@ -83,7 +83,7 @@ static int hi3660_reset_probe(struct platform_device *pdev)
 	if (!rc)
 		return -ENOMEM;
 
-	rc->map = syscon_regmap_lookup_by_phandle(np, "hisi,rst-syscon");
+	rc->map = syscon_regmap_lookup_by_phandle(np, "hisilicon,rst-syscon");

This should fall back to the deprecated compatible, for example:

Quoted 4 lines
	rc->map = syscon_regmap_lookup_by_phandle(np, "hisilicon,rst-syscon");
	if (PTR_ERR(rc->map) == -ENODEV)
		rc->map = syscon_regmap_lookup_by_phandle(np, "hisi,rst-

syscon");

Oh, thanks. I misunderstood your suggestion the other day. I'll fix it right away.

Quoted 10 lines

drivers/reset/hisilicon/reset-hi3660.c static int hi3660_reset_probe(struct platform_device *pdev) · line 89

Quoted 4 lines
drivers/reset/hisilicon/reset-hi3660.c +0 -0
 	if (IS_ERR(rc->map)) {
 		dev_err(dev, "failed to get hi3660,rst-syscon\n");
 		return PTR_ERR(rc->map);

regards
Philipp

.

author
#7 lore raw

PATCH v2 2/3 dt-bindings: reset: correct vendor prefix hisi to hisilicon

In reply to Zhen Lei

The vendor prefix of "Hisilicon Limited" is "hisilicon", it is clearly stated in "vendor-prefixes.yaml".

Fixes 1527058736fa ("reset: hisilicon: add reset-hi3660")
Fixes 836e23549583 ("dt-bindings: Document the hi3660 reset bindings")
Cc Zhangfei Gao <[email protected]>
---
 Documentation/devicetree/bindings/reset/hisilicon,hi3660-reset.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/reset/hisilicon,hi3660-reset.txt +2 -2
index 2df4bddeb688918..aefd26710f9e87d 100644
@@ -11,7 +11,7 @@ Required properties:
 - compatible: should be one of the following:
 		 "hisilicon,hi3660-reset" for HI3660
 		 "hisilicon,hi3670-reset", "hisilicon,hi3660-reset" for HI3670
-- hisi,rst-syscon: phandle of the reset's syscon.
+- hisilicon,rst-syscon: phandle of the reset's syscon.
 - #reset-cells : Specifies the number of cells needed to encode a
   reset source.  The type shall be a <u32> and the value shall be 2.
 
@@ -29,7 +29,7 @@ Example:
 
 	iomcu_rst: iomcu_rst_controller {
 		compatible = "hisilicon,hi3660-reset";
-		hisi,rst-syscon = <&iomcu>;
+		hisilicon,rst-syscon = <&iomcu>;
 		#reset-cells = <2>;
 	};
 
Signature · 1 line
1.8.3
author
#8 lore raw

PATCH v2 3/3 dt-bindings: reset: convert Hisilicon reset controller bindings to json-schema

In reply to Zhen Lei

Convert the Hisilicon reset controller binding to DT schema format using json-schema.

---
 .../bindings/reset/hisilicon,hi3660-reset.txt      | 44 -------------
 .../bindings/reset/hisilicon,hi3660-reset.yaml     | 77 ++++++++++++++++++++++
 2 files changed, 77 insertions(+), 44 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/reset/hisilicon,hi3660-reset.txt
 create mode 100644 Documentation/devicetree/bindings/reset/hisilicon,hi3660-reset.yaml
Documentation/devicetree/bindings/reset/hisilicon,hi3660-reset.txt deleted +0 -44
deleted file mode 100644
index aefd26710f9e87d..000000000000000
@@ -1,44 +0,0 @@
-Hisilicon System Reset Controller
-======================================
-
-Please also refer to reset.txt in this directory for common reset
-controller binding usage.
-
-The reset controller registers are part of the system-ctl block on
-hi3660 and hi3670 SoCs.
-
-Required properties:
-- compatible: should be one of the following:
-		 "hisilicon,hi3660-reset" for HI3660
-		 "hisilicon,hi3670-reset", "hisilicon,hi3660-reset" for HI3670
-- hisilicon,rst-syscon: phandle of the reset's syscon.
-- #reset-cells : Specifies the number of cells needed to encode a
-  reset source.  The type shall be a <u32> and the value shall be 2.
-
-	 Cell #1 : offset of the reset assert control
-	           register from the syscon register base
-		   offset + 4: deassert control register
-		   offset + 8: status control register
-	 Cell #2 : bit position of the reset in the reset control register
-
-Example:
-	iomcu: iomcu@ffd7e000 {
-		compatible = "hisilicon,hi3660-iomcu", "syscon";
-		reg = <0x0 0xffd7e000 0x0 0x1000>;
-	};
-
-	iomcu_rst: iomcu_rst_controller {
-		compatible = "hisilicon,hi3660-reset";
-		hisilicon,rst-syscon = <&iomcu>;
-		#reset-cells = <2>;
-	};
-
-Specifying reset lines connected to IP modules
-==============================================
-example:
-
-        i2c0: i2c@..... {
-                ...
-		resets = <&iomcu_rst 0x20 3>; /* offset: 0x20; bit: 3 */
-                ...
-        };
Documentation/devicetree/bindings/reset/hisilicon,hi3660-reset.yaml new file +77 -0

77 lines not on this page · raw message

Signature · 1 line
1.8.3
maintainer
#9 lore raw
Quoted 116 lines · Zhen Lei

Convert the Hisilicon reset controller binding to DT schema format using json-schema.

---
 .../bindings/reset/hisilicon,hi3660-reset.txt      | 44 -------------
 .../bindings/reset/hisilicon,hi3660-reset.yaml     | 77 ++++++++++++++++++++++
 2 files changed, 77 insertions(+), 44 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/reset/hisilicon,hi3660-reset.txt
 create mode 100644 Documentation/devicetree/bindings/reset/hisilicon,hi3660-reset.yaml
Documentation/devicetree/bindings/reset/hisilicon,hi3660-reset.txt deleted +0 -44
deleted file mode 100644
index aefd26710f9e87d..000000000000000
@@ -1,44 +0,0 @@
-Hisilicon System Reset Controller
-======================================
-
-Please also refer to reset.txt in this directory for common reset
-controller binding usage.
-
-The reset controller registers are part of the system-ctl block on
-hi3660 and hi3670 SoCs.
-
-Required properties:
-- compatible: should be one of the following:
-		 "hisilicon,hi3660-reset" for HI3660
-		 "hisilicon,hi3670-reset", "hisilicon,hi3660-reset" for HI3670
-- hisilicon,rst-syscon: phandle of the reset's syscon.
-- #reset-cells : Specifies the number of cells needed to encode a
-  reset source.  The type shall be a <u32> and the value shall be 2.
-
-	 Cell #1 : offset of the reset assert control
-	           register from the syscon register base
-		   offset + 4: deassert control register
-		   offset + 8: status control register
-	 Cell #2 : bit position of the reset in the reset control register
-
-Example:
-	iomcu: iomcu@ffd7e000 {
-		compatible = "hisilicon,hi3660-iomcu", "syscon";
-		reg = <0x0 0xffd7e000 0x0 0x1000>;
-	};
-
-	iomcu_rst: iomcu_rst_controller {
-		compatible = "hisilicon,hi3660-reset";
-		hisilicon,rst-syscon = <&iomcu>;
-		#reset-cells = <2>;
-	};
-
-Specifying reset lines connected to IP modules
-==============================================
-example:
-
-        i2c0: i2c@..... {
-                ...
-		resets = <&iomcu_rst 0x20 3>; /* offset: 0x20; bit: 3 */
-                ...
-        };
Documentation/devicetree/bindings/reset/hisilicon,hi3660-reset.yaml new file +49 -0
new file mode 100644
index 000000000000000..9bf40952e5b7d28
@@ -0,0 +1,77 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/reset/hisilicon,hi3660-reset.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Hisilicon System Reset Controller
+
+maintainers:
+  - Wei Xu <[email protected]>
+
+description: |
+  Please also refer to reset.txt in this directory for common reset
+  controller binding usage.
+  The reset controller registers are part of the system-ctl block on
+  hi3660 and hi3670 SoCs.
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - const: hisilicon,hi3660-reset
+      - items:
+          - const: hisilicon,hi3670-reset
+          - const: hisilicon,hi3660-reset
+
+  hisilicon,rst-syscon:
+    description: phandle of the reset's syscon.
+    $ref: /schemas/types.yaml#/definitions/phandle
+
+  '#reset-cells':
+    description: |
+      Specifies the number of cells needed to encode a reset source.
+      Cell #1 : offset of the reset assert control register from the syscon
+                register base
+                offset + 4: deassert control register
+                offset + 8: status control register
+      Cell #2 : bit position of the reset in the reset control register
+    const: 2
+
+required:
+  - compatible
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>

Documentation/devicetree/bindings/reset/hisilicon,hi3660-reset.yaml line 59

Quoted 10 lines
Documentation/devicetree/bindings/reset/hisilicon,hi3660-reset.yaml new file +10 -0
+    #include <dt-bindings/clock/hi3660-clock.h>
+
+    iomcu: iomcu@ffd7e000 {
+        compatible = "hisilicon,hi3660-iomcu", "syscon";
+        reg = <0xffd7e000 0x1000>;
+    };
+
+    iomcu_rst: iomcu_rst_controller {
+        compatible = "hisilicon,hi3660-reset";
+        hisilicon,rst-syscon = <&iomcu>;

Really, if you are going to break things, this node should be a child of iomcu instead and you don't need this property (just get the parent). Or just add '#reset-cells' to iomcu.

Quoted 22 lines
Documentation/devicetree/bindings/reset/hisilicon,hi3660-reset.yaml new file +18 -0
+        #reset-cells = <2>;
+    };
+
+    /* Specifying reset lines connected to IP modules */
+    i2c@ffd71000 {
+        compatible = "snps,designware-i2c";
+        reg = <0xffd71000 0x1000>;
+        interrupts = <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>;
+        #address-cells = <1>;
+        #size-cells = <0>;
+        clock-frequency = <400000>;
+        clocks = <&crg_ctrl HI3660_CLK_GATE_I2C0>;
+        resets = <&iomcu_rst 0x20 3>;
+        pinctrl-names = "default";
+        pinctrl-0 = <&i2c0_pmx_func &i2c0_cfg_func>;
+        status = "disabled";
+    };
+...
Signature · 1 line
1.8.3
#10 lore raw
Quoted 123 lines · Rob Herring
Quoted 122 lines · Zhen Lei

Convert the Hisilicon reset controller binding to DT schema format using json-schema.

---
 .../bindings/reset/hisilicon,hi3660-reset.txt      | 44 -------------
 .../bindings/reset/hisilicon,hi3660-reset.yaml     | 77 ++++++++++++++++++++++
 2 files changed, 77 insertions(+), 44 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/reset/hisilicon,hi3660-reset.txt
 create mode 100644 Documentation/devicetree/bindings/reset/hisilicon,hi3660-reset.yaml
Documentation/devicetree/bindings/reset/hisilicon,hi3660-reset.txt deleted +0 -44
deleted file mode 100644
index aefd26710f9e87d..000000000000000
@@ -1,44 +0,0 @@
-Hisilicon System Reset Controller
-======================================
-
-Please also refer to reset.txt in this directory for common reset
-controller binding usage.
-
-The reset controller registers are part of the system-ctl block on
-hi3660 and hi3670 SoCs.
-
-Required properties:
-- compatible: should be one of the following:
-		 "hisilicon,hi3660-reset" for HI3660
-		 "hisilicon,hi3670-reset", "hisilicon,hi3660-reset" for HI3670
-- hisilicon,rst-syscon: phandle of the reset's syscon.
-- #reset-cells : Specifies the number of cells needed to encode a
-  reset source.  The type shall be a <u32> and the value shall be 2.
-
-	 Cell #1 : offset of the reset assert control
-	           register from the syscon register base
-		   offset + 4: deassert control register
-		   offset + 8: status control register
-	 Cell #2 : bit position of the reset in the reset control register
-
-Example:
-	iomcu: iomcu@ffd7e000 {
-		compatible = "hisilicon,hi3660-iomcu", "syscon";
-		reg = <0x0 0xffd7e000 0x0 0x1000>;
-	};
-
-	iomcu_rst: iomcu_rst_controller {
-		compatible = "hisilicon,hi3660-reset";
-		hisilicon,rst-syscon = <&iomcu>;
-		#reset-cells = <2>;
-	};
-
-Specifying reset lines connected to IP modules
-==============================================
-example:
-
-        i2c0: i2c@..... {
-                ...
-		resets = <&iomcu_rst 0x20 3>; /* offset: 0x20; bit: 3 */
-                ...
-        };
Documentation/devicetree/bindings/reset/hisilicon,hi3660-reset.yaml new file +55 -0
new file mode 100644
index 000000000000000..9bf40952e5b7d28
@@ -0,0 +1,77 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/reset/hisilicon,hi3660-reset.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Hisilicon System Reset Controller
+
+maintainers:
+  - Wei Xu <[email protected]>
+
+description: |
+  Please also refer to reset.txt in this directory for common reset
+  controller binding usage.
+  The reset controller registers are part of the system-ctl block on
+  hi3660 and hi3670 SoCs.
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - const: hisilicon,hi3660-reset
+      - items:
+          - const: hisilicon,hi3670-reset
+          - const: hisilicon,hi3660-reset
+
+  hisilicon,rst-syscon:
+    description: phandle of the reset's syscon.
+    $ref: /schemas/types.yaml#/definitions/phandle
+
+  '#reset-cells':
+    description: |
+      Specifies the number of cells needed to encode a reset source.
+      Cell #1 : offset of the reset assert control register from the syscon
+                register base
+                offset + 4: deassert control register
+                offset + 8: status control register
+      Cell #2 : bit position of the reset in the reset control register
+    const: 2
+
+required:
+  - compatible
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/clock/hi3660-clock.h>
+
+    iomcu: iomcu@ffd7e000 {
+        compatible = "hisilicon,hi3660-iomcu", "syscon";
+        reg = <0xffd7e000 0x1000>;
+    };
Quoted 8 lines

Documentation/devicetree/bindings/reset/hisilicon,hi3660-reset.yaml line 59

Quoted 4 lines
Documentation/devicetree/bindings/reset/hisilicon,hi3660-reset.yaml new file +4 -0
+
+    iomcu_rst: iomcu_rst_controller {
+        compatible = "hisilicon,hi3660-reset";
+        hisilicon,rst-syscon = <&iomcu>;

Really, if you are going to break things, this node should be a child of iomcu instead and you don't need this property (just get the parent). Or just add '#reset-cells' to iomcu.

There are two compatible strings, which belong to two different functional modules. This should be done to keep the code architecture clear.

drivers/clk/hisilicon/clk-hi3660.c //compatible = "hisilicon,hi3660-iomcu"
drivers/reset/hisilicon/reset-hi3660.c //compatible = "hisilicon,hi3660-reset"

Quoted 26 lines
Quoted 23 lines
Documentation/devicetree/bindings/reset/hisilicon,hi3660-reset.yaml new file +18 -0
+        #reset-cells = <2>;
+    };
+
+    /* Specifying reset lines connected to IP modules */
+    i2c@ffd71000 {
+        compatible = "snps,designware-i2c";
+        reg = <0xffd71000 0x1000>;
+        interrupts = <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>;
+        #address-cells = <1>;
+        #size-cells = <0>;
+        clock-frequency = <400000>;
+        clocks = <&crg_ctrl HI3660_CLK_GATE_I2C0>;
+        resets = <&iomcu_rst 0x20 3>;
+        pinctrl-names = "default";
+        pinctrl-0 = <&i2c0_pmx_func &i2c0_cfg_func>;
+        status = "disabled";
+    };
+...
Signature · 1 line
1.8.3

.