Skip to contentSkip to conversation

Add Armada8K reset controller support

PATCH Superseded Wilson Ding 3 participants 15 messages Feb 20, 2025 – Feb 24, 2025

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover Add Armada8K reset controller support

Armada8K has one simple register for unit soft reset, which is part of the system controller register area. The simple reset code doesn't support register access via regmap for the syscon devices. This patch series created a new driver based on the simple reset code, and add Armada8K support then.

Thanks,
Wilson

---

Changes in v2:
- Created a new driver for SYSCON device instead of extending the simple reset code.
- Allow to retreive the register offset from the 'reg' property as an alternative to the 'offset' property.
- Allow to retrevie the register size from the 'reg' property to calculate the number of reset lines.
- Added the new dt-binding files to document the device-tree scheme and fix DT check issues.
- Updated the device-tree node name to 'reset-controller' to follow the name conventions.

Changes in v1:
- Init version.

Wilson Ding (4):
dt-bindings: reset: Add Armada8K reset controller
dt-bindings: cp110: Document the reset controller
reset: Add support for Armada8K reset controller
arm64: dts: marvell: cp11x: Add reset controller node

 .../arm/marvell/cp110-system-controller.txt   |  43 ++++
 .../reset/marvell,armada8k-reset.yaml         |  45 ++++
 arch/arm64/boot/dts/marvell/armada-cp11x.dtsi |   6 +
 drivers/reset/Kconfig                         |  12 ++
 drivers/reset/Makefile                        |   1 +
 drivers/reset/reset-simple-syscon.c           | 195 ++++++++++++++++++
 include/linux/reset/reset-simple.h            |   3 +
 7 files changed, 305 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/marvell,armada8k-reset.yaml
 create mode 100644 drivers/reset/reset-simple-syscon.c
Signature · 1 line
2.43.0
#1 lore raw

PATCH v2 1/4 dt-bindings: reset: Add Armada8K reset controller

Add device-tree binding documentation for the Armada8K reset driver.

---
 .../reset/marvell,armada8k-reset.yaml         | 45 +++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/marvell,armada8k-reset.yaml
Documentation/devicetree/bindings/reset/marvell,armada8k-reset.yaml new file +45 -0
new file mode 100644
index 000000000000..b9f7f3c24d3c
@@ -0,0 +1,45 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+# Copyright 2025 Wilson Ding <[email protected]>
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/reset/marvell,armada8k-reset.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Marvell Armada8K reset controller
+
+maintainers:
+  - Wilson Ding <[email protected]>
+
+description: The reset controller node must be a sub-node of the system
+  controller node on Armada7K/8K or CN913x SoCs.
+
+properties:
+  compatible:
+    const: marvell,armada8k-reset
+
+  offset:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Offset in the register map for the gpio registers (in bytes)
+
+  "#reset-cells":
+    const: 1
+
+required:
+  - compatible
+  - offset
+  - "#reset-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    syscon0: system-controller@440000 {
+      compatible = "syscon", "simple-mfd";
+      reg = <0x440000 0x2000>;
+
+        unit_swrst: reset-controller@268 {
+            compatible = "marvell,armada8k-reset";
+            offset = <0x268>;
+            #reset-cells = <1>;
+        };
+    };
Signature · 1 line
2.43.0
#2 lore raw

Re: [PATCH v2 1/4] dt-bindings: reset: Add Armada8K reset controller

Quoted 8 lines · Wilson Ding

Add device-tree binding documentation for the Armada8K reset driver.

---
 .../reset/marvell,armada8k-reset.yaml         | 45 +++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/marvell,armada8k-reset.yaml

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/reset/marvell,armada8k-reset.example.dts:22.46-26.15: Warning (unit_address_vs_reg): /example-0/system-controller@440000/reset-controller@268: node has a unit name, but no reg or ranges property /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/reset/marvell,armada8k-reset.example.dtb: system-controller@440000: compatible: ['syscon', 'simple-mfd'] is too short
from schema $id: http://devicetree.org/schemas/mfd/syscon-common.yaml#

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]

The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.

#3 lore raw

Re: [PATCH v2 1/4] dt-bindings: reset: Add Armada8K reset controller

In reply to Wilson Ding
Quoted 26 lines · Wilson Ding

Add device-tree binding documentation for the Armada8K reset driver.

---
 .../reset/marvell,armada8k-reset.yaml         | 45 +++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/marvell,armada8k-reset.yaml
Documentation/devicetree/bindings/reset/marvell,armada8k-reset.yaml new file +12 -0
new file mode 100644
index 000000000000..b9f7f3c24d3c
@@ -0,0 +1,45 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+# Copyright 2025 Wilson Ding <[email protected]>
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/reset/marvell,armada8k-reset.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Marvell Armada8K reset controller
+
+maintainers:
+  - Wilson Ding <[email protected]>
+

Documentation/devicetree/bindings/reset/marvell,armada8k-reset.yaml line 22

Quoted 10 lines
Documentation/devicetree/bindings/reset/marvell,armada8k-reset.yaml new file +10 -0
+description: The reset controller node must be a sub-node of the system
+  controller node on Armada7K/8K or CN913x SoCs.
+
+properties:
+  compatible:
+    const: marvell,armada8k-reset
+
+  offset:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Offset in the register map for the gpio registers (in bytes)

That's neither correct nor needed. Your device knows ofsset based on the compatible.

Best regards,
Krzysztof

maintainer
#4 lore raw

Re: [PATCH v2 1/4] dt-bindings: reset: Add Armada8K reset controller

Quoted 32 lines · Krzysztof Kozlowski
Quoted 31 lines · Wilson Ding

Add device-tree binding documentation for the Armada8K reset driver.

---
 .../reset/marvell,armada8k-reset.yaml         | 45 +++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/marvell,armada8k-reset.yaml
Documentation/devicetree/bindings/reset/marvell,armada8k-reset.yaml new file +17 -0
new file mode 100644
index 000000000000..b9f7f3c24d3c
@@ -0,0 +1,45 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+# Copyright 2025 Wilson Ding <[email protected]>
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/reset/marvell,armada8k-reset.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Marvell Armada8K reset controller
+
+maintainers:
+  - Wilson Ding <[email protected]>
+
+description: The reset controller node must be a sub-node of the system
+  controller node on Armada7K/8K or CN913x SoCs.
+
+properties:
+  compatible:
Quoted 8 lines

Documentation/devicetree/bindings/reset/marvell,armada8k-reset.yaml line 22

Quoted 5 lines
Documentation/devicetree/bindings/reset/marvell,armada8k-reset.yaml new file +5 -0
+    const: marvell,armada8k-reset
+
+  offset:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Offset in the register map for the gpio registers (in bytes)

That's neither correct nor needed. Your device knows ofsset based on the compatible.

Or use 'reg'.

But really, just add #reset-cells to the parent node. There's no need for a child node here. The parent needs a specific compatible though.

Rob

#5 lore raw

Re: [PATCH v2 1/4] dt-bindings: reset: Add Armada8K reset controller

Quoted 88 lines

-----Original Message-----
From: Rob Herring <[email protected]>
Sent: Friday, February 21, 2025 3:41 PM
To: Krzysztof Kozlowski <[email protected]>
Cc: Wilson Ding <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Sanghoon Lee <[email protected]>; Geethasowjanya Akula <[email protected]>
Subject: [EXTERNAL] Re: [PATCH v2 1/4] dt-bindings: reset: Add Armada8K reset controller

On Fri, Feb 21, 2025 at 09: 46: 01AM +0100, Krzysztof Kozlowski wrote: > On Thu, Feb 20, 2025 at 03: 25: 24PM -0800, Wilson Ding wrote: > > Add device- tree binding documentation for the Armada8K reset driver. > > > > Signed-off- by:

Quoted 19 lines · Krzysztof Kozlowski
Quoted 18 lines · Wilson Ding

Add device-tree binding documentation for the Armada8K reset driver.

---
 .../reset/marvell,armada8k-reset.yaml         | 45 +++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644

Documentation/devicetree/bindings/reset/marvell,armada8k-reset.yaml

diff --git a/Documentation/devicetree/bindings/reset/marvell,armada8k-reset.yam l b/Documentation/devicetree/bindings/reset/marvell,armada8k-reset.yam l
new file mode 100644
index 000000000000..b9f7f3c24d3c

Documentation/devicetree/bindings/reset/marvell,armada8k-reset new file +0 -0
Quoted 8 lines

Documentation/devicetree/bindings/reset/marvell,armada8k-reset line 6

Quoted 8 lines

+++ .yaml

Documentation/devicetree/bindings/reset/marvell,armada8k-reset new file +6 -0
@@ -0,0 +1,45 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) # Copyright
+2025 Wilson Ding <[email protected]> %YAML 1.2
+---
+$id:
+https://urldefense.proofpoint.com/v2/url?u=http-3A__devicetree.org_
+schemas_reset_marvell-2Carmada8k-2Dreset.yaml-

23&d=DwIBAg&c=nKjWec2

Quoted 1 line
Quoted 1 line

+b6R0mOyPaz7xtfQ&r=sXDQZu4GyqNVDlFUXakSGJl0Dh81ZIPlU26YS4KHGIA &m=Q8Y

Quoted 1 line
Quoted 1 line

+WjAVZaKSaPD0B9Hb3Il6KsiVTSpeB9Br9zI5bqQ9MyW0LQnEdiE2kzdfMRQfa &s=VRF

Quoted 4 lines

Documentation/devicetree/bindings/reset/marvell,armada8k-reset

Quoted 4 lines
Documentation/devicetree/bindings/reset/marvell,armada8k-reset new file +4 -0
+OPAwNVByPfjGNG1IWJt_mAet2LVsQmFVALenV7Ck&e=
+$schema:
+https://urldefense.proofpoint.com/v2/url?u=http-3A__devicetree.org_
+meta-2Dschemas_core.yaml-

23&d=DwIBAg&c=nKjWec2b6R0mOyPaz7xtfQ&r=sXD

Quoted 1 line
Quoted 1 line

+QZu4GyqNVDlFUXakSGJl0Dh81ZIPlU26YS4KHGIA&m=Q8YWjAVZaKSaPD0B 9Hb3Il6K

Quoted 1 line
Quoted 1 line

+siVTSpeB9Br9zI5bqQ9MyW0LQnEdiE2kzdfMRQfa&s=3F_XMbPCmCHx0pRO vv0KP1cZ

Quoted 14 lines
Quoted 14 lines
Documentation/devicetree/bindings/reset/marvell,armada8k-reset new file +14 -0
+tvjQBFPSBpdty-yVZjY&e=
+
+title: Marvell Armada8K reset controller
+
+maintainers:
+  - Wilson Ding <[email protected]>
+
+description: The reset controller node must be a sub-node of the
+system
+  controller node on Armada7K/8K or CN913x SoCs.
+
+properties:
+  compatible:
+    const: marvell,armada8k-reset
Quoted 8 lines

Documentation/devicetree/bindings/reset/marvell,armada8k-reset

Quoted 5 lines
Documentation/devicetree/bindings/reset/marvell,armada8k-reset new file +5 -0
+
+  offset:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Offset in the register map for the gpio registers
+ (in bytes)

That's neither correct nor needed. Your device knows ofsset based on the compatible.

Quoted 5 lines

Or use 'reg'.

But really, just add #reset-cells to the parent node. There's no need for a child node here. The parent needs a specific compatible though.

I am not inventing the 'offset' property. I just tried to follow the other existing sub-nodes under the same parent node (system-controller). The mvebu-gpio driver also uses 'offset' instead of 'reg' for the syscon device (see below). But it seems also not correct from your point of view. Now, I am a bit confused what should be the right scheme for the Armada's system-controller, including GPIO and Reset controller. And dt_binding_check complains "system-controller@ 440000: compatible: ['syscon', 'simple-mfd'] is too short". Can you point me any reference for me to fix these issues.

CP110_LABEL(syscon0): system-controller@440000 {
	compatible = "syscon", "simple-mfd";
	reg = <0x440000 0x1000>;

	CP110_LABEL(clk): clock {
		compatible = "marvell,cp110-clock";
		#clock-cells = <2>;
	};

	CP110_LABEL(pinctrl): pinctrl {
		compatible = "marvell,armada-8k-cpm-pinctrl";
	};

	CP110_LABEL(gpio1): gpio@100 {
		compatible = "marvell,armada-8k-gpio";
		offset = <0x100>;
		#gpio-cells = <2>;
		...
	};

	CP11X_LABEL(unit_swrst): reset-controller@268 {
		compatible = "marvell,armada8k-reset";
		offset = <0x268>;
		#reset-cells = <1>;
	};

};

Quoted 1 line

Rob

#6 lore raw

Re: [PATCH v2 1/4] dt-bindings: reset: Add Armada8K reset controller

Quoted 10 lines · Wilson Ding
Quoted 10 lines
Quoted 7 lines

Documentation/devicetree/bindings/reset/marvell,armada8k-reset.yaml

Quoted 4 lines
Documentation/devicetree/bindings/reset/marvell,armada8k-reset.yaml new file +4 -0
+  offset:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Offset in the register map for the gpio registers
+ (in bytes)

That's neither correct nor needed. Your device knows ofsset based on the compatible.

Or use 'reg'.

Quoted 7 lines
Quoted 3 lines

But really, just add #reset-cells to the parent node. There's no need for a child node here. The parent needs a specific compatible though.

I am not inventing the 'offset' property. I just tried to follow the other existing sub-nodes under the same parent node (system-controller). The mvebu-gpio driver also uses 'offset' instead of 'reg' for the syscon device (see below). But it

You never answered why do you need offset and why it cannot work without.

Quoted 5 lines

seems also not correct from your point of view. Now, I am a bit confused what should be the right scheme for the Armada's system-controller, including GPIO and Reset controller. And dt_binding_check complains "system-controller@ 440000: compatible: ['syscon', 'simple-mfd'] is too short". Can you point me any reference for me to fix these issues.

See all other syscon devices. 'git grep simple-mfd' or for syscon

Quoted 4 lines
CP110_LABEL(syscon0): system-controller@440000 {
	compatible = "syscon", "simple-mfd";
	reg = <0x440000 0x1000>;

Best regards,
Krzysztof

#7 lore raw

Re: [PATCH v2 1/4] dt-bindings: reset: Add Armada8K reset controller

Quoted 34 lines

-----Original Message-----
From: Krzysztof Kozlowski <[email protected]>
Sent: Sunday, February 23, 2025 12:49 AM
To: Wilson Ding <[email protected]>; Rob Herring <[email protected]>
Cc: [email protected]; [email protected]; linux-arm- [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Sanghoon Lee <[email protected]>; Geethasowjanya Akula <[email protected]>
Subject: [EXTERNAL] Re: [PATCH v2 1/4] dt-bindings: reset: Add Armada8K reset controller

On 22/02/2025 21: 57, Wilson Ding wrote: >>>> + offset: >>>> + $ref:
/schemas/types. yaml#/definitions/uint32 >>>> + description: Offset in the register map for the gpio registers >>>> + (in bytes)

Quoted 14 lines · Wilson Ding
Quoted 13 lines
Quoted 7 lines

Documentation/devicetree/bindings/reset/marvell,armada8k-reset.yaml

Quoted 4 lines
Documentation/devicetree/bindings/reset/marvell,armada8k-reset.yaml new file +4 -0
+  offset:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Offset in the register map for the gpio registers
+ (in bytes)

That's neither correct nor needed. Your device knows ofsset based on the compatible.

Or use 'reg'.

But really, just add #reset-cells to the parent node. There's no need for a child node here. The parent needs a specific compatible though.

Quoted 8 lines
Quoted 4 lines

I am not inventing the 'offset' property. I just tried to follow the other existing sub-nodes under the same parent node (system-controller). The mvebu-gpio driver also uses 'offset' instead of 'reg' for the syscon device (see below). But it

You never answered why do you need offset and why it cannot work without.

I see. You're right. I don't have to use 'offset'. The reason I choose 'offset' over 'reg' is that the Armada's GPIO driver use it. And I thought what was accepted would be easier to be accepted again. I will change it in next version.

Quoted 18 lines
Quoted 6 lines

seems also not correct from your point of view. Now, I am a bit confused what should be the right scheme for the Armada's system-controller, including GPIO and Reset controller. And dt_binding_check complains "system-controller@
440000: compatible: ['syscon', 'simple-mfd'] is too short". Can you point me any reference for me to fix these issues.

See all other syscon devices. 'git grep simple-mfd' or for syscon

Quoted 4 lines
CP110_LABEL(syscon0): system-controller@440000 {
	compatible = "syscon", "simple-mfd";
	reg = <0x440000 0x1000>;

Best regards,
Krzysztof

#8 lore raw

PATCH v2 2/4 dt-bindings: cp110: Document the reset controller

In reply to Wilson Ding

Add reset-controller sub-node into the system controller node, and document the supported reset lines.

---
 .../arm/marvell/cp110-system-controller.txt   | 43 +++++++++++++++++++
 1 file changed, 43 insertions(+)
Documentation/devicetree/bindings/arm/marvell/cp110-system-controller.txt +43 -0
index 9d5d70c98058..5e2c2f2b147c 100644
@@ -164,6 +164,43 @@ Required properties:
 
 - offset: offset address inside the syscon block
 
+Reset Controller:
+-----------------
+
+For common binding part and usage, refer to
+Documentation/devicetree/bindings/reset/marvell,armada8k-reset.yaml.
+
+The Device Tree node representing this System Controller 0 provides a
+number of reset lines:
+
+The following reset lines are available:
+
+-  0: Audio Software RESETn
+-  1: TDM Software RESETn
+-  2: Interrupt controller unit Software RESETn
+-  3: Packet processor Software RESETn
+-  4: SDIO Software RESETn
+-  7: XOR-1 engine Software RESETn
+-  8: XOR-0 engine Software RESETn
+- 11: PCIe-0 Gen.3 x1 Software RESETn
+- 12: PCIe-1 Gen.3 x1 Software RESETn
+- 13: PCIe Gen.3 x4 Software RESETn
+- 15: SATA port 0 and port 1 Software RESETn
+- 22: USB3 Host 0 Software RESETn
+- 23: USB3 Host 1 Software RESETn
+- 24: USB3 Device Software RESETn
+- 25: EIP150F Software RESETn
+- 26: EIP197 Software RESETn
+- 29: MSS Software RESETn
+
+Required properties:
+
+ - compatible: "marvell,armada8k-reset"
+
+ - offset: offset address inside the syscon block
+
+ - #reset-cells: must be set to 1
+
 Example:
 
 CP110_LABEL(syscon0): system-controller@440000 {
@@ -188,6 +225,12 @@ CP110_LABEL(syscon0): system-controller@440000 {
 		gpio-ranges = <&CP110_LABEL(pinctrl) 0 0 32>;
 	};
 
+	CP11X_LABEL(unit_swrst): reset-controller@268 {
+		compatible = "marvell,armada8k-reset";
+		offset = <0x268>;
+		#reset-cells = <1>;
+	};
+
 };
 
 SYSTEM CONTROLLER 1
Signature · 1 line
2.43.0
#9 lore raw

Re: [PATCH v2 2/4] dt-bindings: cp110: Document the reset controller

Quoted 6 lines · Wilson Ding

Add reset-controller sub-node into the system controller node, and document the supported reset lines.

---
 .../arm/marvell/cp110-system-controller.txt   | 43 +++++++++++++++++++

NAK.

You already got feedback that TXT bindings are not accepted.

Best regards,
Krzysztof

#10 lore raw

RE: [EXTERNAL] Re: [PATCH v2 2/4] dt-bindings: cp110: Document the reset controller

Quoted 22 lines

-----Original Message-----
From: Krzysztof Kozlowski <[email protected]>
Sent: Friday, February 21, 2025 12:47 AM
To: Wilson Ding <[email protected]>
Cc: [email protected]; [email protected]; linux-arm- [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Sanghoon Lee <[email protected]>; Geethasowjanya Akula <[email protected]>
Subject: [EXTERNAL] Re: [PATCH v2 2/4] dt-bindings: cp110: Document the reset controller

On Thu, Feb 20, 2025 at 03: 25: 25PM -0800, Wilson Ding wrote: > Add reset- controller sub-node into the system controller node, and > document the supported reset lines. > > Signed-off-by: Wilson Ding
<dingwei@ marvell. com> >

Quoted 3 lines · Wilson Ding

Add reset-controller sub-node into the system controller node, and document the supported reset lines.

Quoted 8 lines
Quoted 3 lines
---
 .../arm/marvell/cp110-system-controller.txt   | 43 +++++++++++++++++++

NAK.

You already got feedback that TXT bindings are not accepted.

I am not trying to use this TXT for dt-binding. But as you can see this file describes all the sub-nodes details, such as mpps, clocks information. So that I add the reset line info here. If this is not the right place, where shall I put this information. I wonder if you are asking to convert this txt into yaml.

Quoted 2 lines

Best regards,
Krzysztof

#11 lore raw

Re: [EXTERNAL] Re: [PATCH v2 2/4] dt-bindings: cp110: Document the reset controller

Quoted 28 lines · Wilson Ding
Quoted 28 lines

-----Original Message-----
From: Krzysztof Kozlowski <[email protected]>
Sent: Friday, February 21, 2025 12:47 AM
To: Wilson Ding <[email protected]>
Cc: [email protected]; [email protected]; linux-arm- [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Sanghoon Lee <[email protected]>; Geethasowjanya Akula <[email protected]>
Subject: [EXTERNAL] Re: [PATCH v2 2/4] dt-bindings: cp110: Document the reset controller

On Thu, Feb 20, 2025 at 03: 25: 25PM -0800, Wilson Ding wrote: > Add reset- controller sub-node into the system controller node, and > document the supported reset lines. > > Signed-off-by: Wilson Ding
<dingwei@ marvell. com> >

Quoted 6 lines · Wilson Ding

Add reset-controller sub-node into the system controller node, and document the supported reset lines.

---
 .../arm/marvell/cp110-system-controller.txt   | 43 +++++++++++++++++++

NAK.

Quoted 8 lines
Quoted 2 lines

You already got feedback that TXT bindings are not accepted.

I am not trying to use this TXT for dt-binding. But as you can see this file describes all the sub-nodes details, such as mpps, clocks information. So that I add the reset line info here. If this is not the right place, where shall I put this information. I wonder if you are asking to convert this txt into yaml.

You just duplicated the YAML binding in TXT. If you wanted to reference the child, you would say something that there is a reset device in binding foo.yaml.

But yeah, ideally this entire binding should be also converted to DT Schema / YAML.

Best regards,
Krzysztof

#12 lore raw

PATCH v2 3/4 reset: Add support for Armada8K reset controller

In reply to Wilson Ding

Armada8K has one register for unit soft-reset configuration within the system controller register area. This patch created a new driver based on the simple-reset driver to support the reset controller of a SYSCON device.

---
 drivers/reset/Kconfig               |  12 ++
 drivers/reset/Makefile              |   1 +
 drivers/reset/reset-simple-syscon.c | 195 ++++++++++++++++++++++++++++
 include/linux/reset/reset-simple.h  |   3 +
 4 files changed, 211 insertions(+)
 create mode 100644 drivers/reset/reset-simple-syscon.c
drivers/reset/Kconfig +12 -0
index 5b3abb6db248..e98b22195317 100644
@@ -248,6 +248,18 @@ config RESET_SIMPLE
 	   - SiFive FU740 SoCs
 	   - Sophgo SoCs
 
+config RESET_SIMPLE_SYSCON
+	bool "Simple SYSCON Reset Controller Driver" if COMPILE_TEST || EXPERT
+	depends on HAS_IOMEM
+	select MFD_SYSCON
+	help
+	  This enables a simple reset controller driver for reset lines that
+	  that can be asserted and deasserted by toggling bits in a contiguous,
+	  exclusive register space.
+
+	  Currently this driver supports:
+	   - Marvell Armada8K SoCs
+
 config RESET_SOCFPGA
 	bool "SoCFPGA Reset Driver" if COMPILE_TEST && (!ARM || !ARCH_INTEL_SOCFPGA)
 	default ARM && ARCH_INTEL_SOCFPGA
drivers/reset/Makefile +1 -0
index 677c4d1e2632..c43642fe4d9b 100644
@@ -32,6 +32,7 @@ obj-$(CONFIG_RESET_RASPBERRYPI) += reset-raspberrypi.o
 obj-$(CONFIG_RESET_RZG2L_USBPHY_CTRL) += reset-rzg2l-usbphy-ctrl.o
 obj-$(CONFIG_RESET_SCMI) += reset-scmi.o
 obj-$(CONFIG_RESET_SIMPLE) += reset-simple.o
+obj-$(CONFIG_RESET_SIMPLE_SYSCON) += reset-simple-syscon.o
 obj-$(CONFIG_RESET_SOCFPGA) += reset-socfpga.o
 obj-$(CONFIG_RESET_SUNPLUS) += reset-sunplus.o
 obj-$(CONFIG_RESET_SUNXI) += reset-sunxi.o
drivers/reset/reset-simple-syscon.c new file +195 -0

195 lines not on this page · raw message

include/linux/reset/reset-simple.h +3 -0
index c3e44f45b0f7..9a8eebd5892f 100644
@@ -13,6 +13,7 @@
 #define __RESET_SIMPLE_H__
 
 #include <linux/io.h>
+#include <linux/regmap.h>
 #include <linux/reset-controller.h>
 #include <linux/spinlock.h>
 
@@ -37,6 +38,8 @@
 struct reset_simple_data {
 	spinlock_t			lock;
 	void __iomem			*membase;
+	struct regmap			*regmap;
+	u32				reg_offset;
 	struct reset_controller_dev	rcdev;
 	bool				active_low;
 	bool				status_active_low;
Signature · 1 line
2.43.0
#13 lore raw

PATCH v2 4/4 arm64: dts: marvell: cp11x: Add reset controller node

In reply to Wilson Ding

Add the reset controller node as a sub-node to the system controller node.

---
 arch/arm64/boot/dts/marvell/armada-cp11x.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/marvell/armada-cp11x.dtsi +6 -0
index 161beec0b6b0..4cd900c02b3b 100644
@@ -273,6 +273,12 @@ CP11X_LABEL(gpio2): gpio@140 {
 					 <&CP11X_LABEL(clk) 1 17>;
 				status = "disabled";
 			};
+
+			CP11X_LABEL(unit_swrst): reset-controller@268 {
+				compatible = "marvell,armada8k-reset";
+				offset = <0x268>;
+				#reset-cells = <1>;
+			};
 		};
 
 		CP11X_LABEL(syscon1): system-controller@400000 {
Signature · 1 line
2.43.0
#14 lore raw

Re: [PATCH v2 4/4] arm64: dts: marvell: cp11x: Add reset controller node

Quoted 13 lines · Wilson Ding

Add the reset controller node as a sub-node to the system controller node.

---
 arch/arm64/boot/dts/marvell/armada-cp11x.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/marvell/armada-cp11x.dtsi +0 -0
index 161beec0b6b0..4cd900c02b3b 100644

arch/arm64/boot/dts/marvell/armada-cp11x.dtsi CP11X_LABEL(gpio2): gpio@140 { · line 277

Quoted 5 lines
arch/arm64/boot/dts/marvell/armada-cp11x.dtsi +2 -0
@@ -273,6 +273,12 @@ CP11X_LABEL(gpio2): gpio@140 {
 					 <&CP11X_LABEL(clk) 1 17>;
 				status = "disabled";
 			};
+
+			CP11X_LABEL(unit_swrst): reset-controller@268 {

Test your patches before posting. You have here warnings - see W=1.

Best regards,
Krzysztof