Re: [U-Boot] [PATCH 10/25] reset: Introduce TI System Control Interface (TI SCI) reset driver

2018-08-24 Thread Tom Rini
On Tue, Aug 21, 2018 at 08:01:48PM +0530, Lokesh Vutla wrote:

> From: Andreas Dannenberg 
> 
> Some TI Keystone 2 and K3 family of SoCs contain a system controller
> (like the Power Management Micro Controller (PMMC) on 66AK2G SoCs and
> the Device Management and Security Controller on AM65x SoCs) that manage
> the low-level device control (like clocks, resets etc) for the various
> hardware modules present on the SoC. These device control operations are
> provided to the host processor OS through a communication protocol
> called the TI System Control Interface (TI SCI) protocol.
> 
> This patch adds a reset driver that communicates to the system
> controller over the TI SCI protocol for performing reset management of
> various devices present on the SoC. Various reset functionalities are
> achieved by the means of different TI SCI device operations provided by
> the TI SCI framework.
> 
> This code is loosely based on the drivers/reset/reset-ti-sci.c driver of
> the Linux kernel.
> 
> Signed-off-by: Andreas Dannenberg 
> Signed-off-by: Lokesh Vutla 

Reviewed-by: Tom Rini 

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 10/25] reset: Introduce TI System Control Interface (TI SCI) reset driver

2018-08-21 Thread Lokesh Vutla
From: Andreas Dannenberg 

Some TI Keystone 2 and K3 family of SoCs contain a system controller
(like the Power Management Micro Controller (PMMC) on 66AK2G SoCs and
the Device Management and Security Controller on AM65x SoCs) that manage
the low-level device control (like clocks, resets etc) for the various
hardware modules present on the SoC. These device control operations are
provided to the host processor OS through a communication protocol
called the TI System Control Interface (TI SCI) protocol.

This patch adds a reset driver that communicates to the system
controller over the TI SCI protocol for performing reset management of
various devices present on the SoC. Various reset functionalities are
achieved by the means of different TI SCI device operations provided by
the TI SCI framework.

This code is loosely based on the drivers/reset/reset-ti-sci.c driver of
the Linux kernel.

Signed-off-by: Andreas Dannenberg 
Signed-off-by: Lokesh Vutla 
---
 .../reset/ti,sci-reset.txt|  54 +
 drivers/reset/Kconfig |   8 +
 drivers/reset/Makefile|   1 +
 drivers/reset/reset-ti-sci.c  | 206 ++
 4 files changed, 269 insertions(+)
 create mode 100644 doc/device-tree-bindings/reset/ti,sci-reset.txt
 create mode 100644 drivers/reset/reset-ti-sci.c

diff --git a/doc/device-tree-bindings/reset/ti,sci-reset.txt 
b/doc/device-tree-bindings/reset/ti,sci-reset.txt
new file mode 100644
index 00..e7e2d13f9f
--- /dev/null
+++ b/doc/device-tree-bindings/reset/ti,sci-reset.txt
@@ -0,0 +1,54 @@
+Texas Instruments TI SCI Reset Controller
+=
+
+Some TI SoCs contain a system controller (like the SYSFW, etc...) that is
+responsible for controlling the state of the IPs that are present.
+Communication between the host processor running an OS and the system
+controller happens through a protocol known as TI SCI [1].
+
+[1] http://processors.wiki.ti.com/index.php/TISCI
+
+Reset Controller Node
+=
+The reset controller node represents the resets of various hardware modules
+present on the SoC managed by the SYSFW. Because this relies on the TI SCI
+protocol to communicate with the SYSFW it must be a child of the sysfw node.
+
+Required Properties:
+
+ - compatible: Must be "ti,sci-reset"
+ - #reset-cells: Must be 2. Please see the reset consumer node below for
+usage details.
+
+Example (AM65x):
+
+   sysfw: sysfw {
+   compatible = "ti,am654-system-controller";
+   ...
+   k3_reset: reset-controller {
+   compatible = "ti,sci-reset";
+   #reset-cells = <2>;
+   };
+   };
+
+Reset Consumers
+===
+Each of the reset consumer nodes should have the following properties,
+in addition to their own properties.
+
+Required Properties:
+
+ - resets: A phandle and reset specifier pair, one pair for each reset signal
+  that affects the device, or that the device manages. The phandle
+  should point to the TI SCI reset controller node, and the reset
+  specifier should have 2 cell-values. The first cell should contain
+  the device ID. The second cell should contain the reset mask value
+  used by system controller.
+
+Example (AM65x):
+
+   uart2: serial@0280 {
+   compatible = "ti,omap4-uart";
+   ...
+   resets = <_reset 5 1>;
+   };
diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig
index 33c39b7fb6..9c5208b7da 100644
--- a/drivers/reset/Kconfig
+++ b/drivers/reset/Kconfig
@@ -49,6 +49,14 @@ config TEGRA186_RESET
  Enable support for manipulating Tegra's on-SoC reset signals via IPC
  requests to the BPMP (Boot and Power Management Processor).
 
+config RESET_TI_SCI
+   bool "TI System Control Interface (TI SCI) reset driver"
+   depends on DM_RESET && TI_SCI_PROTOCOL
+   help
+ This enables the reset driver support over TI System Control Interface
+ available on some new TI's SoCs. If you wish to use reset resources
+ managed by the TI System Controller, say Y here. Otherwise, say N.
+
 config RESET_BCM6345
bool "Reset controller driver for BCM6345"
depends on DM_RESET && ARCH_BMIPS
diff --git a/drivers/reset/Makefile b/drivers/reset/Makefile
index ad08be4c8c..abdfa0c663 100644
--- a/drivers/reset/Makefile
+++ b/drivers/reset/Makefile
@@ -9,6 +9,7 @@ obj-$(CONFIG_STI_RESET) += sti-reset.o
 obj-$(CONFIG_STM32_RESET) += stm32-reset.o
 obj-$(CONFIG_TEGRA_CAR_RESET) += tegra-car-reset.o
 obj-$(CONFIG_TEGRA186_RESET) += tegra186-reset.o
+obj-$(CONFIG_RESET_TI_SCI) += reset-ti-sci.o
 obj-$(CONFIG_RESET_BCM6345) += reset-bcm6345.o
 obj-$(CONFIG_RESET_UNIPHIER) += reset-uniphier.o
 obj-$(CONFIG_AST2500_RESET) +=