Skip to contentSkip to conversation

ARM: prima2: move to generic reset controller driver framework

PATCH New Barry Song 1 participant 1 message Jan 10, 2014

Subsystems (4)
lore
Share & tools
lore

Barry Song

author
#0 lore raw

PATCH v5 1/1 ARM: prima2: move to generic reset controller driver framework

this moves to generic IP module reset framework, and make other drivers use common device_reset() API.

---
-v5: move to subsys_init according to Arnd's feedback

 .../devicetree/bindings/reset/sirf,rstc.txt        |   42 +++++++++
 arch/arm/boot/dts/atlas6.dtsi                      |    3 +-
 arch/arm/boot/dts/marco.dtsi                       |    3 +-
 arch/arm/boot/dts/prima2.dtsi                      |    3 +-
 arch/arm/mach-prima2/Kconfig                       |    1 +
 arch/arm/mach-prima2/common.c                      |    2 +-
 arch/arm/mach-prima2/rstc.c                        |   93 ++++++++++++-------
 7 files changed, 109 insertions(+), 38 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/reset/sirf,rstc.txt
Documentation/devicetree/bindings/reset/sirf,rstc.txt new file +42 -0
new file mode 100644
index 0000000..0505de7
@@ -0,0 +1,42 @@
+CSR SiRFSoC Reset Controller
+======================================
+
+Please also refer to reset.txt in this directory for common reset
+controller binding usage.
+
+Required properties:
+- compatible: Should be "sirf,prima2-rstc" or "sirf,marco-rstc"
+- reg: should be register base and length as documented in the
+  datasheet
+- #reset-cells: 1, see below
+
+example:
+
+rstc: reset-controller at 88010000 {
+	compatible = "sirf,prima2-rstc";
+	reg = <0x88010000 0x1000>;
+	#reset-cells = <1>;
+};
+
+Specifying reset lines connected to IP modules
+==============================================
+
+The reset controller(rstc) manages various reset sources. This module provides
+reset signals for most blocks in system. Those device nodes should specify the
+reset line on the rstc in their resets property, containing a phandle to the
+rstc device node and a RESET_INDEX specifying which module to reset, as described
+in reset.txt.
+
+For SiRFSoC, RESET_INDEX is just reset_bit defined in SW_RST0 and SW_RST1 registers.
+For modules whose rest_bit is in SW_RST0, its RESET_INDEX is 0~31. For modules whose
+rest_bit is in SW_RST1, its RESET_INDEX is 32~63.
+
+example:
+
+vpp at 90020000 {
+	compatible = "sirf,prima2-vpp";
+	reg = <0x90020000 0x10000>;
+	interrupts = <31>;
+	clocks = <&clks 35>;
+	resets = <&rstc 6>;
+};
arch/arm/boot/dts/atlas6.dtsi +2 -1
index 978bab4..b63cfef 100644
@@ -56,9 +56,10 @@
 				#clock-cells = <1>;
 			};
 
-			reset-controller at 88010000 {
+			rstc: reset-controller at 88010000 {
 				compatible = "sirf,prima2-rstc";
 				reg = <0x88010000 0x1000>;
+				#reset-cells = <1>;
 			};
 
 			rsc-controller at 88020000 {
arch/arm/boot/dts/marco.dtsi +2 -1
index 1579c34..0c9647d 100644
@@ -58,9 +58,10 @@
 			#size-cells = <1>;
 			ranges = <0xc2000000 0xc2000000 0x1000000>;
 
-			reset-controller at c2000000 {
+			rstc: reset-controller at c2000000 {
 				compatible = "sirf,marco-rstc";
 				reg = <0xc2000000 0x10000>;
+				#reset-cells = <1>;
 			};
 		};
 
arch/arm/boot/dts/prima2.dtsi +2 -1
index daee5894..b292a5c 100644
@@ -67,9 +67,10 @@
 				#clock-cells = <1>;
 			};
 
-			reset-controller at 88010000 {
+			rstc: reset-controller at 88010000 {
 				compatible = "sirf,prima2-rstc";
 				reg = <0x88010000 0x1000>;
+				#reset-cells = <1>;
 			};
 
 			rsc-controller at 88020000 {
arch/arm/mach-prima2/Kconfig +1 -0
index 6988b11..f37a1de 100644
@@ -1,5 +1,6 @@
 config ARCH_SIRF
 	bool "CSR SiRF" if ARCH_MULTI_V7
+	select ARCH_HAS_RESET_CONTROLLER
 	select ARCH_REQUIRE_GPIOLIB
 	select GENERIC_CLOCKEVENTS
 	select GENERIC_IRQ_CHIP
arch/arm/mach-prima2/common.c +1 -1
index d49aff7..26c6123 100644
@@ -15,7 +15,7 @@
 #include <linux/of_platform.h>
 #include "common.h"
 
-void __init sirfsoc_init_late(void)
+static void __init sirfsoc_init_late(void)
 {
 	sirfsoc_pm_init();
 }
arch/arm/mach-prima2/rstc.c +59 -34

131 lines not on this page · raw message

Signature · 1 line
1.7.5.4