Skip to contentSkip to conversation

Adding support for Zynq Reset Controller

RFC Applied Moritz Fischer 4 participants 16 messages Jul 31, 2015 – Aug 6, 2015

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

v3 cover Adding support for Zynq Reset Controller

Hi all,

I made another RFC addressing most of the feedback that I got so far.

I haven't completly given up on S?ren's idea of getting rid of having some sort of protection against people using wrong bits by accident, but haven't come up with a clean way to do so yet (especially when looking at the possiblity of also supporting the upcoming Zynq's reset controller).

I changed the reg property to <0x200 0x48> but I'm not sure if that's correct. At 0x24C there's the RS_AWDT_CTRL which is not a reset. The last legit one is A9_CPU_RST_CTRL at 0x244.

As Michal requested I removed the #include syntax from the devicetree bindings.

Thanks for your reviews,

Moritz

Moritz Fischer (4):
docs: dts: Added documentation for Xilinx Zynq Reset Controller
bindings.
dts: zynq: Add devicetree entry for Xilinx Zynq reset controller.
reset: reset-zynq: Adding support for Xilinx Zynq reset controller.
ARM: zynq: Select ARCH_HAS_RESET_CONTROLLER

 .../devicetree/bindings/reset/zynq-reset.txt       |  68 +++++++++
 arch/arm/boot/dts/zynq-7000.dtsi                   |   8 ++
 arch/arm/mach-zynq/Kconfig                         |   1 +
 drivers/reset/Makefile                             |   1 +
 drivers/reset/reset-zynq.c                         | 155 +++++++++++++++++++++
 5 files changed, 233 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/zynq-reset.txt
 create mode 100644 drivers/reset/reset-zynq.c
Signature · 1 line
2.4.3
#1 lore raw

RFC v3 1/4 docs: dts: Added documentation for Xilinx Zynq Reset Controller bindings.

---
 .../devicetree/bindings/reset/zynq-reset.txt       | 68 ++++++++++++++++++++++
 1 file changed, 68 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/zynq-reset.txt
Documentation/devicetree/bindings/reset/zynq-reset.txt new file +68 -0
new file mode 100644
index 0000000..498c037a
@@ -0,0 +1,68 @@
+Xilinx Zynq Reset Manager
+
+The Zynq AP-SoC has several different resets.
+
+See Chapter 26 of the Zynq TRM (UG585) for more information about Zynq resets.
+
+Required properties:
+- compatible: "xlnx,zynq-reset"
+- reg: SLCR offset and size taken via syscon <0x200 0x48>
+- syscon: <&slcr>
+  This should be a phandle to the Zynq's SLCR register.
+- #reset-cells: Must be 1
+
+The Zynq Reset Manager needs to be a childnode of the SLCR.
+
+Example:
+	rstc: rstc at 200 {
+		compatible = "xlnx,zynq-reset";
+		reg = <0x200 0x48>;
+		#reset-cells = <1>;
+		syscon = <&slcr>;
+	};
+
+Reset outputs:
+ 0  : soft reset
+ 32 : ddr reset
+ 64 : topsw reset
+ 96 : dmac reset
+ 128: usb0 reset
+ 129: usb1 reset
+ 160: gem0 reset
+ 161: gem1 reset
+ 164: gem0 rx reset
+ 165: gem1 rx reset
+ 166: gem0 ref reset
+ 167: gem1 ref reset
+ 192: sdio0 reset
+ 193: sdio1 reset
+ 196: sdio0 ref reset
+ 197: sdio1 ref reset
+ 224: spi0 reset
+ 225: spi1 reset
+ 226: spi0 ref reset
+ 227: spi1 ref reset
+ 256: can0 reset
+ 257: can1 reset
+ 258: can0 ref reset
+ 259: can1 ref reset
+ 288: i2c0 reset
+ 289: i2c1 reset
+ 320: uart0 reset
+ 321: uart1 reset
+ 322: uart0 ref reset
+ 323: uart1 ref reset
+ 352: gpio reset
+ 384: lqspi reset
+ 385: qspi ref reset
+ 416: smc reset
+ 417: smc ref reset
+ 448: ocm reset
+ 512: fpga0 out reset
+ 513: fpga1 out reset
+ 514: fpga2 out reset
+ 515: fpga3 out reset
+ 544: a9 reset 0
+ 545: a9 reset 1
+ 552: peri reset
+
Signature · 1 line
2.4.3
#8 lore raw

RFC v3 2/4 dts: zynq: Add devicetree entry for Xilinx Zynq reset controller.

In reply to Moritz Fischer
---
 arch/arm/boot/dts/zynq-7000.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/boot/dts/zynq-7000.dtsi +8 -0
index 0691508..6bebf02 100644
@@ -1,5 +1,6 @@
 /*
  *  Copyright (C) 2011 - 2014 Xilinx
+ *  Copyright (C) 2015 National Instruments Corp.
  *
  * This software is licensed under the terms of the GNU General Public
  * License version 2, as published by the Free Software Foundation, and
@@ -258,6 +259,13 @@
 				reg = <0x100 0x100>;
 			};
 
+			rstc: rstc at 200 {
+				compatible = "xlnx,zynq-reset";
+				reg = <0x200 0x48>;
+				#reset-cells = <1>;
+				syscon = <&slcr>;
+			};
+
 			pinctrl0: pinctrl at 700 {
 				compatible = "xlnx,pinctrl-zynq";
 				reg = <0x700 0x200>;
Signature · 1 line
2.4.3
#10 lore raw

RFC v3 3/4 reset: reset-zynq: Adding support for Xilinx Zynq reset controller.

In reply to Moritz Fischer

This adds a reset controller driver to control the Xilinx Zynq AP-SoC's various resets.

---
 drivers/reset/Makefile     |   1 +
 drivers/reset/reset-zynq.c | 155 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 156 insertions(+)
 create mode 100644 drivers/reset/reset-zynq.c
drivers/reset/Makefile +1 -0
index 157d421..3fe50e7 100644
@@ -3,3 +3,4 @@ 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_ZYNQ) += reset-zynq.o
drivers/reset/reset-zynq.c new file +155 -0

155 lines not on this page · raw message

Signature · 1 line
2.4.3
#11 lore raw

RFC v3 4/4 ARM: zynq: Select ARCH_HAS_RESET_CONTROLLER

In reply to Moritz Fischer
---
 arch/arm/mach-zynq/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-zynq/Kconfig +1 -0
index 78e5e00..77d7df7 100644
@@ -1,5 +1,6 @@
 config ARCH_ZYNQ
 	bool "Xilinx Zynq ARM Cortex A9 Platform" if ARCH_MULTI_V7
+	select ARCH_HAS_RESET_CONTROLLER
 	select ARCH_SUPPORTS_BIG_ENDIAN
 	select ARM_AMBA
 	select ARM_GIC
Signature · 1 line
2.4.3
Reviewed-by on v3 4/4
#12 lore raw

Re: [RFCv3 4/4] ARM: zynq: Select ARCH_HAS_RESET_CONTROLLER

Quoted 11 lines · Moritz Fischer
---
 arch/arm/mach-zynq/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-zynq/Kconfig +0 -0
index 78e5e00..77d7df7 100644

arch/arm/mach-zynq/Kconfig line 6

Quoted 6 lines
arch/arm/mach-zynq/Kconfig +1 -0
@@ -1,5 +1,6 @@
 config ARCH_ZYNQ
 	bool "Xilinx Zynq ARM Cortex A9 Platform" if ARCH_MULTI_V7
+	select ARCH_HAS_RESET_CONTROLLER
 	select ARCH_SUPPORTS_BIG_ENDIAN
 	select ARM_AMBA
 	select ARM_GIC

Thanks,
Michal

#13 lore raw

Re: [RFCv3 4/4] ARM: zynq: Select ARCH_HAS_RESET_CONTROLLER

Quoted 6 lines · Michal Simek
Quoted 5 lines · Moritz Fischer
---
 arch/arm/mach-zynq/Kconfig | 1 +
 1 file changed, 1 insertion(+)
Quoted 14 lines

arch/arm/mach-zynq/Kconfig line 6

Quoted 12 lines
arch/arm/mach-zynq/Kconfig +1 -0
index 78e5e00..77d7df7 100644
@@ -1,5 +1,6 @@
 config ARCH_ZYNQ
 	bool "Xilinx Zynq ARM Cortex A9 Platform" if ARCH_MULTI_V7
+	select ARCH_HAS_RESET_CONTROLLER
 	select ARCH_SUPPORTS_BIG_ENDIAN
 	select ARM_AMBA
 	select ARM_GIC

I personally, would prefer to decouple the logical outputs of the reset-controller from the HW. But, as Moritz pointed out, that seems rather uncommon for reset controllers. I think this is good to go.

Thanks,
S?ren

maintainer
#2 lore raw

Re: [RFCv3 1/4] docs: dts: Added documentation for Xilinx Zynq Reset Controller bindings.

In reply to Moritz Fischer

Hi Moritz,

Am Donnerstag, den 30.07.2015, 18:13 -0700 schrieb Moritz Fischer:

Quoted 13 lines
---
 .../devicetree/bindings/reset/zynq-reset.txt       | 68 ++++++++++++++++++++++
 1 file changed, 68 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/zynq-reset.txt
Documentation/devicetree/bindings/reset/zynq-reset.txt new file +1 -0
new file mode 100644
index 0000000..498c037a
@@ -0,0 +1,68 @@
+Xilinx Zynq Reset Manager

Documentation/devicetree/bindings/reset/zynq-reset.txt line 11

Quoted 10 lines
Documentation/devicetree/bindings/reset/zynq-reset.txt new file +10 -0
+
+The Zynq AP-SoC has several different resets.
+
+See Chapter 26 of the Zynq TRM (UG585) for more information about Zynq resets.
+
+Required properties:
+- compatible: "xlnx,zynq-reset"
+- reg: SLCR offset and size taken via syscon <0x200 0x48>
+- syscon: <&slcr>
+  This should be a phandle to the Zynq's SLCR register.

^ register singular?

I still think the syscon phandle property is superfluous, but I'm fine with keeping it for consistency.
It could always be made optional later.

Quoted 47 lines
Documentation/devicetree/bindings/reset/zynq-reset.txt new file +47 -0
+- #reset-cells: Must be 1
+
+The Zynq Reset Manager needs to be a childnode of the SLCR.
+
+Example:
+	rstc: rstc at 200 {
+		compatible = "xlnx,zynq-reset";
+		reg = <0x200 0x48>;
+		#reset-cells = <1>;
+		syscon = <&slcr>;
+	};
+
+Reset outputs:
+ 0  : soft reset
+ 32 : ddr reset
+ 64 : topsw reset
+ 96 : dmac reset
+ 128: usb0 reset
+ 129: usb1 reset
+ 160: gem0 reset
+ 161: gem1 reset
+ 164: gem0 rx reset
+ 165: gem1 rx reset
+ 166: gem0 ref reset
+ 167: gem1 ref reset
+ 192: sdio0 reset
+ 193: sdio1 reset
+ 196: sdio0 ref reset
+ 197: sdio1 ref reset
+ 224: spi0 reset
+ 225: spi1 reset
+ 226: spi0 ref reset
+ 227: spi1 ref reset
+ 256: can0 reset
+ 257: can1 reset
+ 258: can0 ref reset
+ 259: can1 ref reset
+ 288: i2c0 reset
+ 289: i2c1 reset
+ 320: uart0 reset
+ 321: uart1 reset
+ 322: uart0 ref reset
+ 323: uart1 ref reset
+ 352: gpio reset
+ 384: lqspi reset
+ 385: qspi ref reset
+ 416: smc reset

Documentation/devicetree/bindings/reset/zynq-reset.txt line 68

Quoted 10 lines
Documentation/devicetree/bindings/reset/zynq-reset.txt new file +10 -0
+ 417: smc ref reset
+ 448: ocm reset
+ 512: fpga0 out reset
+ 513: fpga1 out reset
+ 514: fpga2 out reset
+ 515: fpga3 out reset
+ 544: a9 reset 0
+ 545: a9 reset 1
+ 552: peri reset
+

regards
Philipp

Acked-by on v3 2/4
#9 lore raw

Re: [RFCv3 2/4] dts: zynq: Add devicetree entry for Xilinx Zynq reset controller.

In reply to Moritz Fischer
Quoted 21 lines · Moritz Fischer
---
 arch/arm/boot/dts/zynq-7000.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/boot/dts/zynq-7000.dtsi +1 -0
index 0691508..6bebf02 100644
@@ -1,5 +1,6 @@
 /*
  *  Copyright (C) 2011 - 2014 Xilinx
+ *  Copyright (C) 2015 National Instruments Corp.
  *
  * This software is licensed under the terms of the GNU General Public
  * License version 2, as published by the Free Software Foundation, and
@@ -258,6 +259,13 @@
 				reg = <0x100 0x100>;
 			};
 

arch/arm/boot/dts/zynq-7000.dtsi line 271

Quoted 10 lines
arch/arm/boot/dts/zynq-7000.dtsi +7 -0
+			rstc: rstc at 200 {
+				compatible = "xlnx,zynq-reset";
+				reg = <0x200 0x48>;
+				#reset-cells = <1>;
+				syscon = <&slcr>;
+			};
+
 			pinctrl0: pinctrl at 700 {
 				compatible = "xlnx,pinctrl-zynq";
 				reg = <0x700 0x200>;

Thanks,
Michal

#3 lore raw

Re: [RFCv3 1/4] docs: dts: Added documentation for Xilinx Zynq Reset Controller bindings.

In reply to Philipp Zabel
Quoted 29 lines · Philipp Zabel

Hi Moritz,

Am Donnerstag, den 30.07.2015, 18:13 -0700 schrieb Moritz Fischer:

Quoted 13 lines
---
 .../devicetree/bindings/reset/zynq-reset.txt       | 68 ++++++++++++++++++++++
 1 file changed, 68 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/zynq-reset.txt
Documentation/devicetree/bindings/reset/zynq-reset.txt new file +1 -0
new file mode 100644
index 0000000..498c037a
@@ -0,0 +1,68 @@
+Xilinx Zynq Reset Manager

Documentation/devicetree/bindings/reset/zynq-reset.txt line 11

Quoted 10 lines
Documentation/devicetree/bindings/reset/zynq-reset.txt new file +10 -0
+
+The Zynq AP-SoC has several different resets.
+
+See Chapter 26 of the Zynq TRM (UG585) for more information about Zynq resets.
+
+Required properties:
+- compatible: "xlnx,zynq-reset"
+- reg: SLCR offset and size taken via syscon <0x200 0x48>
+- syscon: <&slcr>
+  This should be a phandle to the Zynq's SLCR register.

^ register singular?

Quoted 3 lines

I still think the syscon phandle property is superfluous, but I'm fine with keeping it for consistency.
It could always be made optional later.

Great.

Philipp: I expect you want to take at least 1/4 and 3/4 via your tree. I am fine if you also want to add 2/4 and 4/4 via your tree. If you think that they should go via arm-soc please let me know and I will add them to the queue.

Thanks,
Michal

#15 lore raw

Re: [RFCv3 4/4] ARM: zynq: Select ARCH_HAS_RESET_CONTROLLER

Hi Philipp,

Quoted 9 lines · Philipp Zabel

Hi,

Am Freitag, den 31.07.2015, 09:47 -0700 schrieb S?ren Brinkmann:

Quoted 1 line · Michal Simek

[...]

Quoted 2 lines
Quoted 1 line

I'll assume these apply to the whole series and queue patches 1 and 3.

For me, yes, that was meant for the whole series. Sorry, for not making that obvious.

Thanks,
S?ren

#4 lore raw

Re: [RFCv3 1/4] docs: dts: Added documentation for Xilinx Zynq Reset Controller bindings.

In reply to Philipp Zabel

Hi Philip,

Quoted 20 lines · Philipp Zabel

Hi Moritz,

Am Donnerstag, den 30.07.2015, 18:13 -0700 schrieb Moritz Fischer:

Quoted 17 lines
---
 .../devicetree/bindings/reset/zynq-reset.txt       | 68 ++++++++++++++++++++++
 1 file changed, 68 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/zynq-reset.txt
Documentation/devicetree/bindings/reset/zynq-reset.txt new file +5 -0
new file mode 100644
index 0000000..498c037a
@@ -0,0 +1,68 @@
+Xilinx Zynq Reset Manager
+
+The Zynq AP-SoC has several different resets.
+
+See Chapter 26 of the Zynq TRM (UG585) for more information about Zynq resets.
Quoted 8 lines

Documentation/devicetree/bindings/reset/zynq-reset.txt line 11

Quoted 6 lines
Documentation/devicetree/bindings/reset/zynq-reset.txt new file +6 -0
+
+Required properties:
+- compatible: "xlnx,zynq-reset"
+- reg: SLCR offset and size taken via syscon <0x200 0x48>
+- syscon: <&slcr>
+  This should be a phandle to the Zynq's SLCR register.

^ register singular?

Do you want me to resend the entire set, or are you cool with just git amending the 's' for registers?

Quoted 2 lines

I still think the syscon phandle property is superfluous, but I'm fine with keeping it for consistency.

Thanks.

Quoted 54 lines

It could always be made optional later.

Quoted 52 lines
Documentation/devicetree/bindings/reset/zynq-reset.txt new file +52 -0
+- #reset-cells: Must be 1
+
+The Zynq Reset Manager needs to be a childnode of the SLCR.
+
+Example:
+     rstc: rstc at 200 {
+             compatible = "xlnx,zynq-reset";
+             reg = <0x200 0x48>;
+             #reset-cells = <1>;
+             syscon = <&slcr>;
+     };
+
+Reset outputs:
+ 0  : soft reset
+ 32 : ddr reset
+ 64 : topsw reset
+ 96 : dmac reset
+ 128: usb0 reset
+ 129: usb1 reset
+ 160: gem0 reset
+ 161: gem1 reset
+ 164: gem0 rx reset
+ 165: gem1 rx reset
+ 166: gem0 ref reset
+ 167: gem1 ref reset
+ 192: sdio0 reset
+ 193: sdio1 reset
+ 196: sdio0 ref reset
+ 197: sdio1 ref reset
+ 224: spi0 reset
+ 225: spi1 reset
+ 226: spi0 ref reset
+ 227: spi1 ref reset
+ 256: can0 reset
+ 257: can1 reset
+ 258: can0 ref reset
+ 259: can1 ref reset
+ 288: i2c0 reset
+ 289: i2c1 reset
+ 320: uart0 reset
+ 321: uart1 reset
+ 322: uart0 ref reset
+ 323: uart1 ref reset
+ 352: gpio reset
+ 384: lqspi reset
+ 385: qspi ref reset
+ 416: smc reset
+ 417: smc ref reset
+ 448: ocm reset
+ 512: fpga0 out reset
+ 513: fpga1 out reset
+ 514: fpga2 out reset
Quoted 9 lines

Documentation/devicetree/bindings/reset/zynq-reset.txt line 68

Quoted 5 lines
Documentation/devicetree/bindings/reset/zynq-reset.txt new file +5 -0
+ 515: fpga3 out reset
+ 544: a9 reset 0
+ 545: a9 reset 1
+ 552: peri reset
+

regards
Philipp

Cheers,

Moritz

maintainer
#5 lore raw

Re: [RFCv3 1/4] docs: dts: Added documentation for Xilinx Zynq Reset Controller bindings.

Hi Moritz,

Am Dienstag, den 04.08.2015, 08:05 -0700 schrieb Moritz Fischer:

Quoted 6 lines

Hi Philip,

Quoted 3 lines · Philipp Zabel

Hi Moritz,

Am Donnerstag, den 30.07.2015, 18:13 -0700 schrieb Moritz Fischer:

[...]

Quoted 9 lines
Quoted 7 lines

Documentation/devicetree/bindings/reset/zynq-reset.txt line 11

Quoted 5 lines
Documentation/devicetree/bindings/reset/zynq-reset.txt new file +5 -0
+Required properties:
+- compatible: "xlnx,zynq-reset"
+- reg: SLCR offset and size taken via syscon <0x200 0x48>
+- syscon: <&slcr>
+  This should be a phandle to the Zynq's SLCR register.

^ register singular?

Do you want me to resend the entire set, or are you cool with just git amending the 's' for registers?

Amended and applied, thanks.

regards
Philipp

#6 lore raw

Re: [RFCv3 1/4] docs: dts: Added documentation for Xilinx Zynq Reset Controller bindings.

Michal,

Quoted 16 lines · Philipp Zabel

Hi Moritz,

Am Dienstag, den 04.08.2015, 08:05 -0700 schrieb Moritz Fischer:

Quoted 6 lines

Hi Philip,

Quoted 3 lines · Philipp Zabel

Hi Moritz,

Am Donnerstag, den 30.07.2015, 18:13 -0700 schrieb Moritz Fischer:

[...]

Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Documentation/devicetree/bindings/reset/zynq-reset.txt new file +5 -0
+Required properties:
+- compatible: "xlnx,zynq-reset"
+- reg: SLCR offset and size taken via syscon <0x200 0x48>
+- syscon: <&slcr>
+  This should be a phandle to the Zynq's SLCR register.
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

^ register singular?

Do you want me to resend the entire set, or are you cool with just git amending the 's' for registers?

Amended and applied, thanks.

Will you take 4/4 and 2/4 via your tree?

Quoted 4 lines

regards
Philipp

Thanks,

Moritz

Applied
#7 lore raw

Re: [RFCv3 1/4] docs: dts: Added documentation for Xilinx Zynq Reset Controller bindings.

Quoted 19 lines · Moritz Fischer

Michal,

Quoted 16 lines · Philipp Zabel

Hi Moritz,

Am Dienstag, den 04.08.2015, 08:05 -0700 schrieb Moritz Fischer:

Quoted 6 lines

Hi Philip,

Quoted 3 lines · Philipp Zabel

Hi Moritz,

Am Donnerstag, den 30.07.2015, 18:13 -0700 schrieb Moritz Fischer:

[...]

Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Documentation/devicetree/bindings/reset/zynq-reset.txt new file +5 -0
+Required properties:
+- compatible: "xlnx,zynq-reset"
+- reg: SLCR offset and size taken via syscon <0x200 0x48>
+- syscon: <&slcr>
+  This should be a phandle to the Zynq's SLCR register.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

^ register singular?

Do you want me to resend the entire set, or are you cool with just git amending the 's' for registers?

Amended and applied, thanks.

Will you take 4/4 and 2/4 via your tree?

Applied to zynq/dt and zynq/soc.

Thanks,
Michal