ARM: STi: STiH415: Add reset controller support.
authorSrinivas Kandagatla <srinivas.kandagatla@st.com>
Tue, 11 Mar 2014 09:24:55 +0000 (09:24 +0000)
committerSrinivas Kandagatla <srinivas.kandagatla@st.com>
Tue, 11 Mar 2014 10:02:51 +0000 (10:02 +0000)
This patch adds a reset controller node to the SOC device tree and also
adds new header files with reset lines required for other device tree
nodes.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
Documentation/devicetree/bindings/reset/st,sti-powerdown.txt [new file with mode: 0644]
arch/arm/boot/dts/stih415.dtsi
include/dt-bindings/reset-controller/stih415-resets.h [new file with mode: 0644]

diff --git a/Documentation/devicetree/bindings/reset/st,sti-powerdown.txt b/Documentation/devicetree/bindings/reset/st,sti-powerdown.txt
new file mode 100644 (file)
index 0000000..5ab26b7
--- /dev/null
@@ -0,0 +1,47 @@
+STMicroelectronics STi family Sysconfig Peripheral Powerdown Reset Controller
+=============================================================================
+
+This binding describes a reset controller device that is used to enable and
+disable on-chip peripheral controllers such as USB and SATA, using
+"powerdown" control bits found in the STi family SoC system configuration
+registers. These have been grouped together into a single reset controller
+device for convenience.
+
+The actual action taken when powerdown is asserted is hardware dependent.
+However, when asserted it may not be possible to access the hardware's
+registers and after an assert/deassert sequence the hardware's previous state
+may no longer be valid.
+
+Please refer to reset.txt in this directory for common reset
+controller binding usage.
+
+Required properties:
+- compatible: Should be "st,<chip>-powerdown"
+       ex: "st,stih415-powerdown", "st,stih416-powerdown"
+- #reset-cells: 1, see below
+
+example:
+
+       powerdown: powerdown-controller {
+               #reset-cells = <1>;
+               compatible = "st,stih415-powerdown";
+       };
+
+
+Specifying powerdown control of devices
+=======================================
+
+Device nodes should specify the reset channel required in their "resets"
+property, containing a phandle to the powerdown device node and an
+index specifying which channel to use, as described in reset.txt
+
+example:
+
+       usb1: usb@fe200000 {
+               resets  = <&powerdown STIH41X_USB1_POWERDOWN>;
+       };
+
+Macro definitions for the supported reset channels can be found in:
+
+include/dt-bindings/reset-controller/stih415-resets.h
+include/dt-bindings/reset-controller/stih416-resets.h
index d9c7dd1d95a4545a083874f8d0a4193f96063198..19e29f4af9d6461bbabe1abd16db52abd909f615 100644 (file)
@@ -10,6 +10,7 @@
 #include "stih415-clock.dtsi"
 #include "stih415-pinctrl.dtsi"
 #include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/reset-controller/stih415-resets.h>
 / {
 
        L2: cache-controller {
                ranges;
                compatible      = "simple-bus";
 
+               powerdown: powerdown-controller {
+                       #reset-cells = <1>;
+                       compatible = "st,stih415-powerdown";
+               };
+
                syscfg_sbc: sbc-syscfg@fe600000{
                        compatible      = "st,stih415-sbc-syscfg", "syscon";
                        reg             = <0xfe600000 0xb4>;
diff --git a/include/dt-bindings/reset-controller/stih415-resets.h b/include/dt-bindings/reset-controller/stih415-resets.h
new file mode 100644 (file)
index 0000000..2d54e68
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * This header provides constants for the reset controller
+ * based peripheral powerdown requests on the STMicroelectronics
+ * STiH415 SoC.
+ */
+#ifndef _DT_BINDINGS_RESET_CONTROLLER_STIH415
+#define _DT_BINDINGS_RESET_CONTROLLER_STIH415
+
+#define STIH415_EMISS_POWERDOWN                0
+#define STIH415_NAND_POWERDOWN         1
+#define STIH415_KEYSCAN_POWERDOWN      2
+#define STIH415_USB0_POWERDOWN         3
+#define STIH415_USB1_POWERDOWN         4
+#define STIH415_USB2_POWERDOWN         5
+#define STIH415_SATA0_POWERDOWN                6
+#define STIH415_SATA1_POWERDOWN                7
+#define STIH415_PCIE_POWERDOWN         8
+
+#endif /* _DT_BINDINGS_RESET_CONTROLLER_STIH415 */