Skip to contentSkip to conversation

Add TI SCI Reset Driver

PATCH In review Suman Anna 2 participants 5 messages May 24, 2017 – Jun 6, 2017

Subsystems (3)
lore
Share & tools
lore

Suman Anna

author
#0 lore raw

v5 cover Add TI SCI Reset Driver

Hi Philipp,

This series adds a reset controller driver that uses the TI SCI protocol to manage resets on some TI SoCs. It is a repost of the previous v4 [1] submission that has already been acked by Rob and Santosh, but with some minor changes. This series has been waiting for the ti-sci-pm-domains series to make it to mainline and because of the dependencies against a DT header file including the device id values. The ti-sci-pm-domains series is now merged and available in 4.12-rc1.

The main changes in v5 is to drop the include/dt-bindings/reset/k2g.h file based on some comments received from Arnd on a similar header usage in the ti-sci-pm-domains series. The ti-sci-pm-domains usage is being addressed in [2] and this reset series is refreshed to follow the same rule and drop the reset header file.

Patches are on top of 4.12-rc1 plus the recent Kconfig name change on the TI SYSCON reset driver [3].

Rob, Santosh,
I have retained the Acks received from you on v4, but I am not sure since there are some minor changes to the series. Please provide any comments if you do not agree with the changes.

regards
Suman

Changes from v4 [1]:
- Removed the include/dt-bindings/reset/k2g.h, and updated the bindings document
- Minor checkpatch fixes to the driver patch

Changes from v3:
- Addressed Rob Herring's comments
- Added Santosh Shilimkar's Ack

Changes from v2:
- Merged DT binding patch and reset header patch
- Added locking for reset bit mask

Changes from v1:
- Revised dt binding
- CC Linux ARM list

[1] http://marc.info/?l=devicetree&m=147976458332492&w=2
[2] http://marc.info/?l=linux-arm-kernel&m=149547831708124&w=2
[3] https://patchwork.kernel.org/patch/9744909/

Andrew F. Davis (2):
Documentation: dt: reset: Add TI SCI reset binding
reset: Add the TI SCI reset driver

 .../devicetree/bindings/reset/ti,sci-reset.txt     |  62 +++++
 MAINTAINERS                                        |   2 +
 drivers/reset/Kconfig                              |   8 +
 drivers/reset/Makefile                             |   1 +
 drivers/reset/reset-ti-sci.c                       | 269 +++++++++++++++++++++
 5 files changed, 342 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/ti,sci-reset.txt
 create mode 100644 drivers/reset/reset-ti-sci.c
Signature · 1 line
2.12.0
author
#1 lore raw

PATCH v5 1/2 Documentation: dt: reset: Add TI SCI reset binding

From: "Andrew F. Davis" <[email protected]>

Add TI SCI reset controller binding. This describes the DT binding details for a reset controller node providing reset management services to hardware blocks (reset consumers) using the Texas Instrument's System Control Interface (TI SCI) protocol to communicate to a system controller block present on the SoC.

---
Changes in v5:
- Dropped the include/dt-bindings/reset/k2g.h file and its references
- Updated description for the resets property in the TI-SCI Reset Consumer Nodes section
- Updated the example as well to not use the macros from before

 .../devicetree/bindings/reset/ti,sci-reset.txt     | 62 ++++++++++++++++++++++
 MAINTAINERS                                        |  1 +
 2 files changed, 63 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/ti,sci-reset.txt
Documentation/devicetree/bindings/reset/ti,sci-reset.txt new file +62 -0
new file mode 100644
index 000000000000..8b1cf022f18a
@@ -0,0 +1,62 @@
+Texas Instruments System Control Interface (TI-SCI) Reset Controller
+=====================================================================
+
+Some TI SoCs contain a system controller (like the Power Management Micro
+Controller (PMMC) on Keystone 66AK2G SoC) that are responsible for controlling
+the state of the various hardware modules present on the SoC. Communication
+between the host processor running an OS and the system controller happens
+through a protocol called TI System Control Interface (TI-SCI protocol).
+For TI SCI details, please refer to the document,
+Documentation/devicetree/bindings/arm/keystone/ti,sci.txt
+
+TI-SCI Reset Controller Node
+============================
+This reset controller node uses the TI SCI protocol to perform the reset
+management of various hardware modules present on the SoC. Must be a child
+node of the associated TI-SCI system controller node.
+
+Required properties:
+--------------------
+ - compatible	: Should be "ti,sci-reset"
+ - #reset-cells	: Should be 2. Please see the reset consumer node below for
+		  usage details.
+
+TI-SCI Reset Consumer Nodes
+===========================
+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.
+		  Please refer to the protocol documentation for these values
+		  to be used for different devices,
+		  http://processors.wiki.ti.com/index.php/TISCI#66AK2G02_Data
+
+Please also refer to Documentation/devicetree/bindings/reset/reset.txt for
+common reset controller usage by consumers.
+
+Example:
+--------
+The following example demonstrates both a TI-SCI reset controller node and a
+consumer (a DSP device) on the 66AK2G SoC.
+
+pmmc: pmmc {
+	compatible = "ti,k2g-sci";
+
+	k2g_reset: reset-controller {
+		compatible = "ti,sci-reset";
+		#reset-cells = <2>;
+	};
+};
+
+dsp0: dsp at 10800000 {
+	...
+	resets = <&k2g_reset 0x0046 0x1>;
+	...
+};
MAINTAINERS +1 -0
index f7d568b8f133..a4c48ec23a11 100644
@@ -12630,6 +12630,7 @@ F:	include/linux/soc/ti/ti_sci_protocol.h
 F:	Documentation/devicetree/bindings/soc/ti/sci-pm-domain.txt
 F:	include/dt-bindings/genpd/k2g.h
 F:	drivers/soc/ti/ti_sci_pm_domains.c
+F:	Documentation/devicetree/bindings/reset/ti,sci-reset.txt
 
 THANKO'S RAREMONO AM/FM/SW RADIO RECEIVER USB DRIVER
 M:	Hans Verkuil <[email protected]>
Signature · 1 line
2.12.0
author
#2 lore raw

PATCH v5 2/2 reset: Add the TI SCI reset driver

In reply to Suman Anna

From: "Andrew F. Davis" <[email protected]>

Some TI Keystone family of SoCs contain a system controller (like the Power Management Micro Controller (PMMC) on 66AK2G 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.

[s-anna at ti.com: documentation changes, revised commit message]

---
v5 Changes:
- Dropped the dependency line on RESET_CONTROLLER in Kconfig
- Updated license year to include 2017
- Checkpatch fixes at the dev_ops->get_device_resets callsites

 MAINTAINERS                  |   1 +
 drivers/reset/Kconfig        |   8 ++
 drivers/reset/Makefile       |   1 +
 drivers/reset/reset-ti-sci.c | 269 +++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 279 insertions(+)
 create mode 100644 drivers/reset/reset-ti-sci.c
MAINTAINERS +1 -0
index a4c48ec23a11..545ab28f006a 100644
@@ -12631,6 +12631,7 @@ F:	Documentation/devicetree/bindings/soc/ti/sci-pm-domain.txt
 F:	include/dt-bindings/genpd/k2g.h
 F:	drivers/soc/ti/ti_sci_pm_domains.c
 F:	Documentation/devicetree/bindings/reset/ti,sci-reset.txt
+F:	drivers/reset/reset-ti-sci.c
 
 THANKO'S RAREMONO AM/FM/SW RADIO RECEIVER USB DRIVER
 M:	Hans Verkuil <[email protected]>
drivers/reset/Kconfig +8 -0
index 42d5631c6da0..671ef2a01529 100644
@@ -80,6 +80,14 @@ config RESET_SUNXI
 	help
 	  This enables the reset driver for Allwinner SoCs.
 
+config RESET_TI_SCI
+	tristate "TI System Control Interface (TI-SCI) reset driver"
+	depends on 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_TI_SYSCON
 	tristate "TI SYSCON Reset Driver"
 	depends on HAS_IOMEM
drivers/reset/Makefile +1 -0
index 26270e0f8342..063dfdc7c400 100644
@@ -13,6 +13,7 @@ obj-$(CONFIG_RESET_PISTACHIO) += reset-pistachio.o
 obj-$(CONFIG_RESET_SOCFPGA) += reset-socfpga.o
 obj-$(CONFIG_RESET_STM32) += reset-stm32.o
 obj-$(CONFIG_RESET_SUNXI) += reset-sunxi.o
+obj-$(CONFIG_RESET_TI_SCI) += reset-ti-sci.o
 obj-$(CONFIG_RESET_TI_SYSCON) += reset-ti-syscon.o
 obj-$(CONFIG_RESET_UNIPHIER) += reset-uniphier.o
 obj-$(CONFIG_RESET_ZX2967) += reset-zx2967.o
drivers/reset/reset-ti-sci.c new file +269 -0

269 lines not on this page · raw message

Signature · 1 line
2.12.0
author
#3 lore raw
In reply to Suman Anna

Hi Philipp,

Quoted 44 lines · Suman Anna

Hi Philipp,

This series adds a reset controller driver that uses the TI SCI protocol to manage resets on some TI SoCs. It is a repost of the previous v4 [1] submission that has already been acked by Rob and Santosh, but with some minor changes. This series has been waiting for the ti-sci-pm-domains series to make it to mainline and because of the dependencies against a DT header file including the device id values. The ti-sci-pm-domains series is now merged and available in 4.12-rc1.

The main changes in v5 is to drop the include/dt-bindings/reset/k2g.h file based on some comments received from Arnd on a similar header usage in the ti-sci-pm-domains series. The ti-sci-pm-domains usage is being addressed in [2] and this reset series is refreshed to follow the same rule and drop the reset header file.

Patches are on top of 4.12-rc1 plus the recent Kconfig name change on the TI SYSCON reset driver [3].

Rob, Santosh,
I have retained the Acks received from you on v4, but I am not sure since there are some minor changes to the series. Please provide any comments if you do not agree with the changes.

regards
Suman

Changes from v4 [1]:
- Removed the include/dt-bindings/reset/k2g.h, and updated the bindings document
- Minor checkpatch fixes to the driver patch

Changes from v3:
- Addressed Rob Herring's comments
- Added Santosh Shilimkar's Ack

Changes from v2:
- Merged DT binding patch and reset header patch
- Added locking for reset bit mask

Changes from v1:
- Revised dt binding
- CC Linux ARM list

Quoted 8 lines

[1] http://marc.info/?l=devicetree&m=147976458332492&w=2
[2] http://marc.info/?l=linux-arm-kernel&m=149547831708124&w=2
[3] https://patchwork.kernel.org/patch/9744909/

Andrew F. Davis (2):
Documentation: dt: reset: Add TI SCI reset binding
reset: Add the TI SCI reset driver

Can you pick up this series for v4.13 if there are no comments. Btw, [2] is acked by Rob. Will appreciate if you can fixup the patch header from "Documentation: dt: reset: ..." to "dt-bindings: reset: ..." on the first patch when applying. Thanks in advance.

regards
Suman

maintainer
#4 lore raw

Hi Suman,

On Fri, 2017-06-02 at 11:45 -0500, Suman Anna wrote:
[...]

Quoted 9 lines
Quoted 8 lines

[1] http://marc.info/?l=devicetree&m=147976458332492&w=2
[2] http://marc.info/?l=linux-arm-kernel&m=149547831708124&w=2
[3] https://patchwork.kernel.org/patch/9744909/

Andrew F. Davis (2):
Documentation: dt: reset: Add TI SCI reset binding
reset: Add the TI SCI reset driver

Quoted 4 lines

Can you pick up this series for v4.13 if there are no comments. Btw, [2] is acked by Rob. Will appreciate if you can fixup the patch header from "Documentation: dt: reset: ..." to "dt-bindings: reset: ..." on the first patch when applying. Thanks in advance.

Thank you for the reminder, I've now applied both to the reset/next branch. I've fixed the dt-bindings patch commit message as you suggested and made the struct reset_control_ops const in the driver patch.

regards
Philipp