Add support for SYSCON reset
Subsystems (2)
v5 cover Add support for SYSCON reset
Some SoCs contain reset controls for modules that are memory-mapped to areas shared with other module configuration settings. This requires synchronization across all drivers accessing this memory area. This series adds a generic SYSCON reset driver to allow resets toggled by bits in memory-mapped registers through SYSCON.
Changes from v4:
- Added two more cells to DT ti,reset-bits property
- Re-organized ti,reset-bits flag property defines
- Moved TI_SYSCON_RESET in Kconfig
- Other small fixes based on comments on v4
Changes from v3:
- Add depends on HAS_IOMEM to Kconfig
- Re-worked naming to be more TI specific for now
- Changed DT binding to Philipp's suggestion
Changes from v2:
- Rebased on v4.7-rc1
- Removed the need to give reset specifier nodes an index address
Changes from v1:
- Reset control information is now described in the reset node, this keeps the reset information centralized for easy verification
- Other small fixups
Andrew F. Davis (2):
Documentation: dt: reset: Add TI syscon reset binding
reset: add TI SYSCON based reset driver
.../devicetree/bindings/reset/ti-syscon-reset.txt | 91 ++++++++ drivers/reset/Kconfig | 10 + drivers/reset/Makefile | 1 + drivers/reset/reset-ti-syscon.c | 237 +++++++++++++++++++++ include/dt-bindings/reset/ti-syscon.h | 38 ++++ 5 files changed, 377 insertions(+) create mode 100644 Documentation/devicetree/bindings/reset/ti-syscon-reset.txt create mode 100644 drivers/reset/reset-ti-syscon.c create mode 100644 include/dt-bindings/reset/ti-syscon.h
Signature · 1 line
2.9.0
PATCH v5 1/2 Documentation: dt: reset: Add TI syscon reset binding
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.
--- .../devicetree/bindings/reset/ti-syscon-reset.txt | 91 ++++++++++++++++++++++ include/dt-bindings/reset/ti-syscon.h | 38 +++++++++ 2 files changed, 129 insertions(+) create mode 100644 Documentation/devicetree/bindings/reset/ti-syscon-reset.txt create mode 100644 include/dt-bindings/reset/ti-syscon.h
Documentation/devicetree/bindings/reset/ti-syscon-reset.txt new file +91 -0
@@ -0,0 +1,91 @@ +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>; + ... + }; + }; +};
include/dt-bindings/reset/ti-syscon.h new file +38 -0
@@ -0,0 +1,38 @@ +/* +* 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 does not support the feature and corresponding +* values are not valid +*/ +#define ASSERT_NONE (1 << 0) +#define DEASSERT_NONE (1 << 1) +#define STATUS_NONE (1 << 2) + +/* When set this function is activated by setting(vs clearing) this bit */ +#define ASSERT_SET (1 << 3) +#define DEASSERT_SET (1 << 4) +#define STATUS_SET (1 << 5) + +/* The following are the inverse of the above and are added for consistency */ +#define ASSERT_CLEAR (0 << 3) +#define DEASSERT_CLEAR (0 << 4) +#define STATUS_CLEAR (0 << 5) + +#endif
Signature · 1 line
2.9.0
Re: [PATCH v5 1/2] Documentation: dt: reset: Add TI syscon reset binding
Quoted 5 lines · Andrew F. Davis
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.
Quoted 8 lines
Signed-off-by Andrew F. Davis <[email protected]>Signed-off-by Suman Anna <[email protected]>--- .../devicetree/bindings/reset/ti-syscon-reset.txt | 91 ++++++++++++++++++++++ include/dt-bindings/reset/ti-syscon.h | 38 +++++++++ 2 files changed, 129 insertions(+) create mode 100644 Documentation/devicetree/bindings/reset/ti-syscon-reset.txt create mode 100644 include/dt-bindings/reset/ti-syscon.h
PATCH v5 2/2 reset: add TI SYSCON based reset driver
In reply to Andrew F. DavisAdd a reset-controller driver for performing reset management of various devices present on the SoC, with the reset registers shared between devices in a common register memory space. This driver uses the syscon/regmap frameworks to actually implement the various reset functionalities needed by the reset consumer devices.
--- drivers/reset/Kconfig | 10 ++ drivers/reset/Makefile | 1 + drivers/reset/reset-ti-syscon.c | 237 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 248 insertions(+) create mode 100644 drivers/reset/reset-ti-syscon.c
drivers/reset/Kconfig +10 -0
@@ -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"
drivers/reset/Makefile +1 -0
@@ -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
drivers/reset/reset-ti-syscon.c new file +237 -0
237 lines not on this page · raw message
Signature · 1 line
2.9.0
Philipp Zabel
maintainerHi Andrew,
Am Montag, den 27.06.2016, 12:12 -0500 schrieb Andrew F. Davis:
Quoted 11 lines
Some SoCs contain reset controls for modules that are memory-mapped to areas shared with other module configuration settings. This requires synchronization across all drivers accessing this memory area. This series adds a generic SYSCON reset driver to allow resets toggled by bits in memory-mapped registers through SYSCON.
Changes from v4:
- Added two more cells to DT ti,reset-bits property
- Re-organized ti,reset-bits flag property defines
- MovedTI_SYSCON_RESETinKconfig
- Other small fixes based on comments on v4
Thank you, I have applied both togit://git.pengutronix.de/git/pza/linux.git reset/next with Rob's ack.
regards
Philipp
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html