Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7dccd2ec authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

Merge tag 'reset-for-4.8-3' of git://git.pengutronix.de/git/pza/linux into next/drivers

Merge "Reset controller changes for v4.8, part 3" from Philipp Zabel:

- change request API to be more explicit about the difference between
  exclusive and shared resets (the former guarantee the reset line is
  asserted immediately when reset_control_assert is called, the latter
  are refcounted and do not guarantee this).
- add Hisilicon hi6220 media subsystem reset controller support
- add TI SYSCON based reset controller support

* tag 'reset-for-4.8-3' of git://git.pengutronix.de/git/pza/linux:
  reset: add TI SYSCON based reset driver
  Documentation: dt: reset: Add TI syscon reset binding
  reset: hisilicon: Add hi6220 media subsystem reset support
  reset: hisilicon: Change to syscon register access
  arm64: dts: hi6220: Add media subsystem reset dts
  reset: hisilicon: Add media reset controller binding
  reset: TRIVIAL: Add line break at same place for similar APIs
  reset: Supply *_shared variant calls when using *_optional APIs
  reset: Supply *_shared variant calls when using of_* API
  reset: Ensure drivers are explicit when requesting reset lines
  reset: Reorder inline reset_control_get*() wrappers
parents 358c7917 af3e1629
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -8,7 +8,9 @@ The reset controller registers are part of the system-ctl block on
hi6220 SoC.

Required properties:
- compatible: may be "hisilicon,hi6220-sysctrl"
- compatible: should be one of the following:
  - "hisilicon,hi6220-sysctrl", "syscon" : For peripheral reset controller.
  - "hisilicon,hi6220-mediactrl", "syscon" : For media reset controller.
- reg: should be register base and length as documented in the
  datasheet
- #reset-cells: 1, see below
+91 −0
Original line number Diff line number Diff line
TI SysCon Reset Controller
=======================

Almost all SoCs have hardware modules that require reset control in addition
to clock and power control for their functionality. The reset control is
typically provided by means of memory-mapped I/O registers. These registers are
sometimes a part of a larger register space region implementing various
functionalities. This register range is best represented as a syscon node to
allow multiple entities to access their relevant registers in the common
register space.

A SysCon Reset Controller node defines a device that uses a syscon node
and provides reset management functionality for various hardware modules
present on the SoC.

SysCon Reset Controller Node
============================
Each of the reset provider/controller nodes should be a child of a syscon
node and have the following properties.

Required properties:
--------------------
 - compatible		: Should be,
			    "ti,k2e-pscrst"
			    "ti,k2l-pscrst"
			    "ti,k2hk-pscrst"
			    "ti,syscon-reset"
 - #reset-cells		: Should be 1. Please see the reset consumer node below
			  for usage details
 - ti,reset-bits	: Contains the reset control register information
			  Should contain 7 cells for each reset exposed to
			  consumers, defined as:
			    Cell #1 : offset of the reset assert control
			              register from the syscon register base
			    Cell #2 : bit position of the reset in the reset
			              assert control register
			    Cell #3 : offset of the reset deassert control
			              register from the syscon register base
			    Cell #4 : bit position of the reset in the reset
			              deassert control register
			    Cell #5 : offset of the reset status register
			              from the syscon register base
			    Cell #6 : bit position of the reset in the
			              reset status register
			    Cell #7 : Flags used to control reset behavior,
			              availible flags defined in the DT include
			              file <dt-bindings/reset/ti-syscon.h>

SysCon 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 to the reset controller node and an index number
		  to a reset specifier as defined above.

Please also refer to Documentation/devicetree/bindings/reset/reset.txt for
common reset controller usage by consumers.

Example:
--------
The following example demonstrates a syscon node, the reset controller node
using the syscon node, and a consumer (a DSP device) on the TI Keystone 2
Edison SoC.

/ {
	soc {
		psc: power-sleep-controller@02350000 {
			compatible = "syscon", "simple-mfd";
			reg = <0x02350000 0x1000>;

			pscrst: psc-reset {
				compatible = "ti,k2e-pscrst", "ti,syscon-reset";
				#reset-cells = <1>;

				ti,reset-bits = <
					0xa3c 8 0xa3c 8 0x83c 8 (ASSERT_SET|DEASSERT_CLEAR|STATUS_SET)   /* 0: pcrst-dsp0 */
					0xa40 5 0xa44 3 0     0 (ASSERT_SET|DEASSERT_CLEAR|STATUS_NONE)  /* 1: pcrst-example */
				>;
			};
		};

		dsp0: dsp0 {
			...
			resets = <&pscrst 0>;
			...
		};
	};
};
+2 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@
 */

#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/reset/hisi,hi6220-resets.h>
#include <dt-bindings/clock/hi6220-clock.h>
#include <dt-bindings/pinctrl/hisi.h>
#include <dt-bindings/thermal/thermal.h>
@@ -252,6 +253,7 @@
			compatible = "hisilicon,hi6220-mediactrl", "syscon";
			reg = <0x0 0xf4410000 0x0 0x1000>;
			#clock-cells = <1>;
			#reset-cells = <1>;
		};

		pm_ctrl: pm_ctrl@f7032000 {
+10 −0
Original line number Diff line number Diff line
@@ -17,6 +17,16 @@ if RESET_CONTROLLER
config RESET_OXNAS
	bool

config TI_SYSCON_RESET
	tristate "TI SYSCON Reset Driver"
	depends on HAS_IOMEM
	select MFD_SYSCON
	help
	  This enables the reset driver support for TI devices with
	  memory-mapped reset registers as part of a syscon device node. If
	  you wish to use the reset framework for such memory-mapped devices,
	  say Y here. Otherwise, say N.

source "drivers/reset/sti/Kconfig"
source "drivers/reset/hisilicon/Kconfig"

+1 −0
Original line number Diff line number Diff line
@@ -10,3 +10,4 @@ obj-$(CONFIG_ARCH_HISI) += hisilicon/
obj-$(CONFIG_ARCH_ZYNQ) += reset-zynq.o
obj-$(CONFIG_ATH79) += reset-ath79.o
obj-$(CONFIG_RESET_OXNAS) += reset-oxnas.o
obj-$(CONFIG_TI_SYSCON_RESET) += reset-ti-syscon.o
Loading