Skip to contentSkip to conversation

Add DT bindings documentation for hi6220 SoC reset controller.

PATCH Superseded Chen Feng 2 participants 5 messages Oct 27, 2015 – Oct 29, 2015

Subsystems (3)

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Chen Feng

author
#0 lore raw

PATCH v5 1/3 Add DT bindings documentation for hi6220 SoC reset controller.

docs: dts: Added documentation for hi6220 Reset Controller

---
 .../bindings/reset/hisilicon,hi6220-reset.txt      | 32 ++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/hisilicon,hi6220-reset.txt
Documentation/devicetree/bindings/reset/hisilicon,hi6220-reset.txt new file +32 -0
new file mode 100644
index 0000000..02a8dae
@@ -0,0 +1,32 @@
+Hisilicon System Reset Controller
+======================================
+
+Please also refer to reset.txt in this directory for common reset
+controller binding usage.
+
+The reset controller node must be a sub-node of the chip controller
+node on SoCs.
+
+Required properties:
+- compatible: may be "hisilicon,hi6220-reset-ctl"
+- reg: should be register base and length as documented in the
+  datasheet
+- #reset-cells: 1, see below
+
+Example:
+
+reset_ctrl: reset_ctrl@f7030000 {
+compatible = "hisilicon,hi6220-reset-ctl";
+reg = <0x0 0xf7030000 0x0 0x1000>;
+#reset-cells = <1>;
+};
+
+Specifying reset lines connected to IP modules
+==============================================
+example:
+
+        uart1: uart1@..... {
+                ...
+                resets = <&reset_ctrl 0x305>;
+                ...
+        };
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH v5 2/3 Add reset controller for hi6220 SoC platform.

reset: add driver for hi6220 reset controller

---
 drivers/reset/Kconfig                          |   1 +
 drivers/reset/Makefile                         |   1 +
 drivers/reset/hisilicon/Kconfig                |   5 ++
 drivers/reset/hisilicon/Makefile               |   1 +
 drivers/reset/hisilicon/hi6220_reset.c         | 107 +++++++++++++++++++++++++
 include/dt-bindings/reset/hisi,hi6220-resets.h |  67 ++++++++++++++++
 6 files changed, 182 insertions(+)
 create mode 100644 drivers/reset/hisilicon/Kconfig
 create mode 100644 drivers/reset/hisilicon/Makefile
 create mode 100644 drivers/reset/hisilicon/hi6220_reset.c
 create mode 100644 include/dt-bindings/reset/hisi,hi6220-resets.h
drivers/reset/Kconfig +1 -0
index 0615f50..df37212 100644
@@ -13,3 +13,4 @@ menuconfig RESET_CONTROLLER
 	  If unsure, say no.
 
 source "drivers/reset/sti/Kconfig"
+source "drivers/reset/hisilicon/Kconfig"
drivers/reset/Makefile +1 -0
index 85d5904..99e18c8 100644
@@ -4,5 +4,6 @@ obj-$(CONFIG_ARCH_SOCFPGA) += reset-socfpga.o
 obj-$(CONFIG_ARCH_BERLIN) += reset-berlin.o
 obj-$(CONFIG_ARCH_SUNXI) += reset-sunxi.o
 obj-$(CONFIG_ARCH_STI) += sti/
+obj-$(CONFIG_ARCH_HISI) += hisilicon/
 obj-$(CONFIG_ARCH_ZYNQ) += reset-zynq.o
 obj-$(CONFIG_ATH79) += reset-ath79.o
drivers/reset/hisilicon/Kconfig new file +5 -0
new file mode 100644
index 0000000..26bf95a
@@ -0,0 +1,5 @@
+config COMMON_RESET_HI6220
+	tristate "Hi6220 Reset Driver"
+	depends on (ARCH_HISI && RESET_CONTROLLER)
+	help
+	  Build the Hisilicon Hi6220 reset driver.
drivers/reset/hisilicon/Makefile new file +1 -0
new file mode 100644
index 0000000..c932f86
@@ -0,0 +1 @@
+obj-$(CONFIG_COMMON_RESET_HI6220) += hi6220_reset.o
drivers/reset/hisilicon/hi6220_reset.c new file +107 -0

107 lines not on this page · raw message

include/dt-bindings/reset/hisi,hi6220-resets.h new file +67 -0

67 lines not on this page · raw message

Signature · 1 line
1.9.1
author
#2 lore raw

PATCH v5 3/3 Add reset controller for hi6220 SoC platform.

In reply to Chen Feng

reset: add driver for hi6220 reset controller

---
 arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm64/boot/dts/hisilicon/hi6220.dtsi +7 -0
index 3f03380..3f055e2 100644
@@ -167,5 +167,12 @@
 			clocks = <&ao_ctrl 36>, <&ao_ctrl 36>;
 			clock-names = "uartclk", "apb_pclk";
 		};
+
+		reset_ctrl: reset_ctrl@f7030000 {
+			compatible = "hisilicon,hi6220-reset-ctl";
+			reg = <0x0 0xf7030000 0x0 0x1000>;
+			#reset-cells = <1>;
+		};
+
 	};
 };
Signature · 1 line
1.9.1
maintainer
#3 lore raw

Re: [PATCH V5 Base on RC7 3/3] Add reset controller for hi6220 SoC platform.

Am Dienstag, den 27.10.2015, 17:51 +0800 schrieb Chen Feng:

Quoted 12 lines

reset: add driver for hi6220 reset controller

---
 arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm64/boot/dts/hisilicon/hi6220.dtsi +0 -0
index 3f03380..3f055e2 100644

arch/arm64/boot/dts/hisilicon/hi6220.dtsi line 176

Quoted 10 lines
arch/arm64/boot/dts/hisilicon/hi6220.dtsi +7 -0
@@ -167,5 +167,12 @@
 			clocks = <&ao_ctrl 36>, <&ao_ctrl 36>;
 			clock-names = "uartclk", "apb_pclk";
 		};
+
+		reset_ctrl: reset_ctrl@f7030000 {
+			compatible = "hisilicon,hi6220-reset-ctl";
+			reg = <0x0 0xf7030000 0x0 0x1000>;
+			#reset-cells = <1>;
+		};
+

While applying I just noticed that the device tree already contains a node claiming the same address space:

	sys_ctrl: sys_ctrl@f7030000 {
		compatible = "hisilicon,hi6220-sysctrl", "syscon";
		reg = <0x0 0xf7030000 0x0 0x2000>;
		#clock-cells = <1>;
	};

It is documented in Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt and Documentation/devicetree/bindings/clock/hi6220-clock.txt.

Could you clarify whether the reset controls are just part of the sys_ctrl block? If so, I think you should add #reset-cells = <1> to the sys_ctrl node instead.

regards
Philipp

author
#4 lore raw

Re: [PATCH V5 Base on RC7 3/3] Add reset controller for hi6220 SoC platform.

Thanks.

Quoted 33 lines · Philipp Zabel

Am Dienstag, den 27.10.2015, 17:51 +0800 schrieb Chen Feng:

Quoted 12 lines

reset: add driver for hi6220 reset controller

---
 arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm64/boot/dts/hisilicon/hi6220.dtsi +0 -0
index 3f03380..3f055e2 100644

arch/arm64/boot/dts/hisilicon/hi6220.dtsi line 176

Quoted 10 lines
arch/arm64/boot/dts/hisilicon/hi6220.dtsi +7 -0
@@ -167,5 +167,12 @@
 			clocks = <&ao_ctrl 36>, <&ao_ctrl 36>;
 			clock-names = "uartclk", "apb_pclk";
 		};
+
+		reset_ctrl: reset_ctrl@f7030000 {
+			compatible = "hisilicon,hi6220-reset-ctl";
+			reg = <0x0 0xf7030000 0x0 0x1000>;
+			#reset-cells = <1>;
+		};
+

While applying I just noticed that the device tree already contains a node claiming the same address space:

	sys_ctrl: sys_ctrl@f7030000 {
		compatible = "hisilicon,hi6220-sysctrl", "syscon";
		reg = <0x0 0xf7030000 0x0 0x2000>;
		#clock-cells = <1>;
	};
Quoted 8 lines

It is documented in Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt and Documentation/devicetree/bindings/clock/hi6220-clock.txt.

Could you clarify whether the reset controls are just part of the sys_ctrl block? If so, I think you should add #reset-cells = <1> to the sys_ctrl node instead.

Yes, It's a part of the sys_ctrl block, I will do as your advice.

Quoted 6 lines

regards
Philipp

.