From patchwork Mon Jun 20 18:46:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 638220 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3rYKcY0qZNz9sR8 for ; Tue, 21 Jun 2016 04:48:13 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751428AbcFTSsM (ORCPT ); Mon, 20 Jun 2016 14:48:12 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:40604 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752283AbcFTSsK (ORCPT ); Mon, 20 Jun 2016 14:48:10 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id u5KIjZau022992; Mon, 20 Jun 2016 13:45:35 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id u5KIkF8j007192; Mon, 20 Jun 2016 13:46:15 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.294.0; Mon, 20 Jun 2016 13:46:15 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id u5KIkE2k003755; Mon, 20 Jun 2016 13:46:14 -0500 Received: from localhost (uda0226330.am.dhcp.ti.com [128.247.83.53]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id u5KIkE318317; Mon, 20 Jun 2016 13:46:14 -0500 (CDT) From: "Andrew F. Davis" To: Philipp Zabel , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Suman Anna CC: , , "Andrew F. Davis" Subject: [PATCH v4 1/2] Documentation: dt: reset: Add TI syscon reset binding Date: Mon, 20 Jun 2016 13:46:06 -0500 Message-ID: <20160620184607.4380-2-afd@ti.com> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160620184607.4380-1-afd@ti.com> References: <20160620184607.4380-1-afd@ti.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add TI syscon reset controller binding. This will hook to the reset framework and use syscon/regmap to set reset bits. This allows reset control of individual SoC subsytems and devices with memory-mapped reset registers in a common register memory space. Signed-off-by: Andrew F. Davis [s-anna@ti.com: revise the binding format] Signed-off-by: Suman Anna --- .../devicetree/bindings/reset/ti-syscon-reset.txt | 83 ++++++++++++++++++++++ include/dt-bindings/reset/ti-syscon.h | 30 ++++++++ 2 files changed, 113 insertions(+) create mode 100644 Documentation/devicetree/bindings/reset/ti-syscon-reset.txt create mode 100644 include/dt-bindings/reset/ti-syscon.h diff --git a/Documentation/devicetree/bindings/reset/ti-syscon-reset.txt b/Documentation/devicetree/bindings/reset/ti-syscon-reset.txt new file mode 100644 index 0000000..eb95bb5 --- /dev/null +++ b/Documentation/devicetree/bindings/reset/ti-syscon-reset.txt @@ -0,0 +1,83 @@ +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 "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 5 cells for each reset exposed to + consumers, defined as: + Cell #1 : register offset of the reset control + register from the syscon register base + Cell #2 : bit shift value for the reset in the + respective reset control register + Cell #3 : register offset of the reset status + register from the syscon register base + Cell #4 : bit shift value for the reset in the + respective reset status register + Cell #5 : Flags used to control reset behavior, + availible flags defined in the DT include + file + +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 a phandle to a + reset specifier node 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,k2l-pscrst", "syscon-reset"; + #reset-cells = <1>; + + ti,reset-bits = < + 0xa3c 8 0x83c 8 RESET_ASSERT_CLEAR /* 0: pcrst-dsp0 */ + 0xa40 5 0 0 RESET_TRIGGER_SET /* 1: pcrst-example */ + >; + }; + }; + + dsp0: dsp0 { + ... + resets = <&pscrst 0>; + ... + }; + }; +}; diff --git a/include/dt-bindings/reset/ti-syscon.h b/include/dt-bindings/reset/ti-syscon.h new file mode 100644 index 0000000..fedcfb7 --- /dev/null +++ b/include/dt-bindings/reset/ti-syscon.h @@ -0,0 +1,30 @@ +/* + * TI Syscon Reset definitions + * + * Copyright (C) 2015-2016 Texas Instruments Incorporated - http://www.ti.com/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef __DT_BINDINGS_RESET_TI_SYSCON_H__ +#define __DT_BINDINGS_RESET_TI_SYSCON_H__ + +/* The reset is asserted by setting (vs clearing) the described bit */ +#define RESET_SET (1 << 0) +/* This reset does not have a readable status bit */ +#define RESET_TRIGGER (1 << 1) + +#define RESET_ASSERT_CLEAR 0 +#define RESET_ASSERT_SET RESET_SET +#define RESET_TRIGGER_CLEAR RESET_TRIGGER +#define RESET_TRIGGER_SET (RESET_TRIGGER | RESET_SET) + +#endif