Add support for SYSCON reset
Subsystems (2)
v3 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 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 syscon reset binding
reset: add a SYSCON based reset driver
.../devicetree/bindings/reset/syscon-reset.txt | 105 ++++++++ drivers/reset/Kconfig | 10 + drivers/reset/Makefile | 1 + drivers/reset/reset-syscon.c | 289 +++++++++++++++++++++ include/dt-bindings/reset/syscon.h | 23 ++ 5 files changed, 428 insertions(+) create mode 100644 Documentation/devicetree/bindings/reset/syscon-reset.txt create mode 100644 drivers/reset/reset-syscon.c create mode 100644 include/dt-bindings/reset/syscon.h
Signature · 1 line
2.8.3
PATCH v3 1/2 Documentation: dt: reset: Add syscon reset binding
Add 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/syscon-reset.txt | 105 +++++++++++++++++++++ include/dt-bindings/reset/syscon.h | 23 +++++ 2 files changed, 128 insertions(+) create mode 100644 Documentation/devicetree/bindings/reset/syscon-reset.txt create mode 100644 include/dt-bindings/reset/syscon.h
Documentation/devicetree/bindings/reset/syscon-reset.txt new file +105 -0
@@ -0,0 +1,105 @@ +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 + +SysCon Reset Child Node +============================ +Each reset provider/controller node should have a child node for each reset +it would like to expose to consumers. + +Required properties: +-------------------- + - reset-control : Contains the reset control register information + Should contain 3 cells defined as: + Cell #1 : register offset of the reset + control/status register from the syscon + register base + Cell #2 : bit shift value for the reset in the + respective reset control/status register + Cell #3 : polarity of the reset bit. Should be 1 or + RESET_ASSERT_SET for resets that are + asserted when the bit is set, 0 or + RESET_ASSERT_CLEAR for resets that are + asserted when the bit is cleared + +Optional properties: +-------------------- + - reset-status : Contains the reset status register information. The + contents of this property are the equivalent to + reset-control as defined above. If this property is + not present and the toggle flag is not set, the + reset register is assumed to be the same as the + control register + - toggle : Mark this reset as a toggle only reset, this is used + when no status register is available. + +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 +Hawking SoC. + +/ { + soc { + psc: power-sleep-controller@02350000 { + compatible = "syscon", "simple-mfd"; + reg = <0x02350000 0x1000>; + + pscrst: psc-reset { + compatible = "syscon-reset"; + #reset-cells = <1>; + + pscrst-dsp: dsp { + reset-control = <0xa3c 8 RESET_ASSERT_CLEAR>; + reset-status = <0x83c 8 RESET_ASSERT_CLEAR>; + }; + + pscrst-example: example { + reset-control = <0xa40 5 RESET_ASSERT_SET>; + toggle; + }; + }; + }; + + dsp0: dsp0 { + ... + resets = <&pscrst &pscrst-dsp>; + ... + }; + }; +};
include/dt-bindings/reset/syscon.h new file +23 -0
@@ -0,0 +1,23 @@ +/* +* 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_SYSCON_H__ +#define __DT_BINDINGS_RESET_SYSCON_H__ + +#define RESET_ASSERT_CLEAR 0x0 +#define RESET_ASSERT_SET 0x1 + +#endif
Signature · 1 line
2.8.3
PATCH v3 2/2 reset: add a 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-syscon.c | 289 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 300 insertions(+) create mode 100644 drivers/reset/reset-syscon.c
drivers/reset/Kconfig +10 -0
@@ -15,5 +15,15 @@ menuconfig RESET_CONTROLLER config RESET_OXNAS bool +config SYSCON_RESET + tristate "SYSCON Reset Driver" + depends on RESET_CONTROLLER + select MFD_SYSCON + help + This enables the reset driver support for 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
@@ -9,3 +9,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_SYSCON_RESET) += reset-syscon.o
drivers/reset/reset-syscon.c new file +289 -0
289 lines not on this page · raw message
Signature · 6 lines
2.8.3 -- 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
Re: [PATCH v3 2/2] reset: add a SYSCON based reset driver
Hi Andrew,
Quoted 21 lines · Andrew F. Davis
Add 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.
Signed-off-by Andrew F. Davis <[email protected]>[[email protected]: add documentation, syscon name change]Signed-off-by Suman Anna <[email protected]>--- drivers/reset/Kconfig | 10 ++ drivers/reset/Makefile | 1 + drivers/reset/reset-syscon.c | 289 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 300 insertions(+) create mode 100644 drivers/reset/reset-syscon.cdrivers/reset/Kconfig +0
-0
drivers/reset/Kconfig menuconfig RESET_CONTROLLER · line 20
Quoted 6 lines
drivers/reset/Kconfig +3
-0@@ -15,5 +15,15 @@ menuconfig RESET_CONTROLLER config RESET_OXNAS bool +config SYSCON_RESET + tristate "SYSCON Reset Driver" + depends on RESET_CONTROLLER
Please add a depends on HAS_IOMEM here that you seem to have missed from our local patches.
regards
Suman
Quoted 7 lines
drivers/reset/Kconfig +7
-0+ select MFD_SYSCON + help + This enables the reset driver support for 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. +
Re: [PATCH v3 2/2] reset: add a SYSCON based reset driver
Quoted 27 lines · Suman Anna
Hi Andrew,
Quoted 24 lines · Andrew F. Davis
Add 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.
Signed-off-by Andrew F. Davis <[email protected]>[[email protected]: add documentation, syscon name change]Signed-off-by Suman Anna <[email protected]>--- drivers/reset/Kconfig | 10 ++ drivers/reset/Makefile | 1 + drivers/reset/reset-syscon.c | 289 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 300 insertions(+) create mode 100644 drivers/reset/reset-syscon.cdrivers/reset/Kconfig +0
-0@@ -15,5 +15,15 @@ menuconfig RESET_CONTROLLER config RESET_OXNAS bool
Quoted 7 lines
drivers/reset/Kconfig menuconfig RESET_CONTROLLER · line 20
Quoted 3 lines
drivers/reset/Kconfig +3
-0+config SYSCON_RESET + tristate "SYSCON Reset Driver" + depends on RESET_CONTROLLERPlease add a depends on
HAS_IOMEMhere that you seem to have missed from our local patches.
Will add for v4.
Thanks,
Andrew
Quoted 19 lines · Andrew F. Davis
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 v2:
- Rebased on v4.7-rc1
- Removed the need to give reset specifier nodes an index addressChanges from v1:
- Reset control information is now described in the reset node, this keeps the reset information centralized for easy verification
- Other small fixupsAndrew F. Davis (2):
Documentation: dt: reset: Add syscon reset binding
reset: add a SYSCON based reset driver
Quoted 10 lines
.../devicetree/bindings/reset/syscon-reset.txt | 105 ++++++++ drivers/reset/Kconfig | 10 + drivers/reset/Makefile | 1 + drivers/reset/reset-syscon.c | 289 +++++++++++++++++++++ include/dt-bindings/reset/syscon.h | 23 ++ 5 files changed, 428 insertions(+) create mode 100644 Documentation/devicetree/bindings/reset/syscon-reset.txt create mode 100644 drivers/reset/reset-syscon.c create mode 100644 include/dt-bindings/reset/syscon.h
Is there any additional feedback for this driver? I normally try to refrain from pings, but this may begin to block further upstreaming of IPs that uses this reset if it can not be taken this cycle.
If there is still an objection to calling this a generic reset solution we would not strongly object to relabeling this to something implying more TI exclusivity.
Thanks,
Andrew
Philipp Zabel
maintainerHi Andrew,
Am Mittwoch, den 15.06.2016, 10:48 -0500 schrieb Andrew F. Davis:
Quoted 31 lines · Andrew F. Davis
Quoted 19 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 v2:
- Rebased on v4.7-rc1
- Removed the need to give reset specifier nodes an index addressChanges from v1:
- Reset control information is now described in the reset node, this keeps the reset information centralized for easy verification
- Other small fixupsAndrew F. Davis (2):
Documentation: dt: reset: Add syscon reset binding
reset: add a SYSCON based reset driverQuoted 10 lines
.../devicetree/bindings/reset/syscon-reset.txt | 105 ++++++++ drivers/reset/Kconfig | 10 + drivers/reset/Makefile | 1 + drivers/reset/reset-syscon.c | 289 +++++++++++++++++++++ include/dt-bindings/reset/syscon.h | 23 ++ 5 files changed, 428 insertions(+) create mode 100644 Documentation/devicetree/bindings/reset/syscon-reset.txt create mode 100644 drivers/reset/reset-syscon.c create mode 100644 include/dt-bindings/reset/syscon.h
Quoted 3 lines
Is there any additional feedback for this driver? I normally try to refrain from pings, but this may begin to block further upstreaming of IPs that uses this reset if it can not be taken this cycle.
There's still Rob's concern that this binding needs a device tree node per single register bit in the worst case, which seems a bit overkill.
I'd still prefer to have this information hidden in the drivers, but if you absolutely have to put it in the device tree, maybe an approach more similar to pinctrl-simple, where you could list all resets, one per line, in a single property, would be more acceptable:
pscrst: reset-controller {
compatible = "ti,<chip>-pscrst", "syscon-reset";
/* syscon-reset,bits = <ctrl_reg ctrl_bit stat_reg stat_bit flags>; */
syscon-reset,bits = <0xa3c 8 0x83c 8 RESET_ASSERT_CLEAR /* 0: pcrst-dsp */
0xa40 5 0 0 RESET_TRIGGER_SET>; /* 1: pcrst-example */
};dsp0: dsp {
resets = <&pscrst 0>;
};Quoted 3 lines
If there is still an objection to calling this a generic reset solution we would not strongly object to relabeling this to something implying more TI exclusivity.
Good. Right now there don't seem to be that many reset controllers in the wild for which this binding would be a good fit. If this turns out to be useful for others, we can add more compatibles to the driver.
regards
Philipp
Quoted 34 lines · Philipp Zabel
Hi Andrew,
Am Mittwoch, den 15.06.2016, 10:48 -0500 schrieb Andrew F. Davis:
Quoted 31 lines · Andrew F. Davis
Quoted 29 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 v2:
- Rebased on v4.7-rc1
- Removed the need to give reset specifier nodes an index addressChanges from v1:
- Reset control information is now described in the reset node, this keeps the reset information centralized for easy verification
- Other small fixupsAndrew F. Davis (2):
Documentation: dt: reset: Add syscon reset binding
reset: add a SYSCON based reset driver.../devicetree/bindings/reset/syscon-reset.txt | 105 ++++++++ drivers/reset/Kconfig | 10 + drivers/reset/Makefile | 1 + drivers/reset/reset-syscon.c | 289 +++++++++++++++++++++ include/dt-bindings/reset/syscon.h | 23 ++ 5 files changed, 428 insertions(+) create mode 100644 Documentation/devicetree/bindings/reset/syscon-reset.txt create mode 100644 drivers/reset/reset-syscon.c create mode 100644 include/dt-bindings/reset/syscon.h
Quoted 6 lines
Quoted 3 lines
Is there any additional feedback for this driver? I normally try to refrain from pings, but this may begin to block further upstreaming of IPs that uses this reset if it can not be taken this cycle.
There's still Rob's concern that this binding needs a device tree node per single register bit in the worst case, which seems a bit overkill.
Yes, that's still my concern with this.
Quoted 9 lines
I'd still prefer to have this information hidden in the drivers, but if you absolutely have to put it in the device tree, maybe an approach more similar to pinctrl-simple, where you could list all resets, one per line, in a single property, would be more acceptable:
pscrst: reset-controller { compatible = "ti,<chip>-pscrst", "syscon-reset"; /* syscon-reset,bits = <ctrl_reg ctrl_bit stat_reg stat_bit flags>; */
ti,reset-bits
Quoted 7 lines
syscon-reset,bits = <0xa3c 8 0x83c 8 RESET_ASSERT_CLEAR /* 0: pcrst-dsp */ 0xa40 5 0 0 RESET_TRIGGER_SET>; /* 1: pcrst-example */ };dsp0: dsp { resets = <&pscrst 0>; };
Otherwise, this seems okay. It is more concise.
Quoted 8 lines
Quoted 4 lines
If there is still an objection to calling this a generic reset solution we would not strongly object to relabeling this to something implying more TI exclusivity.
Good. Right now there don't seem to be that many reset controllers in the wild for which this binding would be a good fit. If this turns out to be useful for others, we can add more compatibles to the driver.
Certainly other users would make a generic solution more compelling.
Rob
Quoted 60 lines · Rob Herring
Quoted 34 lines · Philipp Zabel
Hi Andrew,
Am Mittwoch, den 15.06.2016, 10:48 -0500 schrieb Andrew F. Davis:
Quoted 31 lines · Andrew F. Davis
Quoted 29 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 v2:
- Rebased on v4.7-rc1
- Removed the need to give reset specifier nodes an index addressChanges from v1:
- Reset control information is now described in the reset node, this keeps the reset information centralized for easy verification
- Other small fixupsAndrew F. Davis (2):
Documentation: dt: reset: Add syscon reset binding
reset: add a SYSCON based reset driver.../devicetree/bindings/reset/syscon-reset.txt | 105 ++++++++ drivers/reset/Kconfig | 10 + drivers/reset/Makefile | 1 + drivers/reset/reset-syscon.c | 289 +++++++++++++++++++++ include/dt-bindings/reset/syscon.h | 23 ++ 5 files changed, 428 insertions(+) create mode 100644 Documentation/devicetree/bindings/reset/syscon-reset.txt create mode 100644 drivers/reset/reset-syscon.c create mode 100644 include/dt-bindings/reset/syscon.hQuoted 6 lines
Quoted 3 lines
Is there any additional feedback for this driver? I normally try to refrain from pings, but this may begin to block further upstreaming of IPs that uses this reset if it can not be taken this cycle.
There's still Rob's concern that this binding needs a device tree node per single register bit in the worst case, which seems a bit overkill.
Yes, that's still my concern with this.
Quoted 9 lines
I'd still prefer to have this information hidden in the drivers, but if you absolutely have to put it in the device tree, maybe an approach more similar to pinctrl-simple, where you could list all resets, one per line, in a single property, would be more acceptable:
pscrst: reset-controller { compatible = "ti,<chip>-pscrst", "syscon-reset"; /* syscon-reset,bits = <ctrl_reg ctrl_bit stat_reg stat_bit flags>; */ti,reset-bits
Quoted 4 lines
syscon-reset,bits = <0xa3c 8 0x83c 8 RESET_ASSERT_CLEAR /* 0: pcrst-dsp */ 0xa40 5 0 0 RESET_TRIGGER_SET>; /* 1: pcrst-example */ };
Quoted 6 lines
Quoted 3 lines
dsp0: dsp { resets = <&pscrst 0>; };Otherwise, this seems okay. It is more concise.
If this is what you would both be okay with then I'll do it this way, pushing v4 in a moment.
Quoted 11 lines
Quoted 8 lines
Quoted 4 lines
If there is still an objection to calling this a generic reset solution we would not strongly object to relabeling this to something implying more TI exclusivity.
Good. Right now there don't seem to be that many reset controllers in the wild for which this binding would be a good fit. If this turns out to be useful for others, we can add more compatibles to the driver.
Certainly other users would make a generic solution more compelling.
I believe some other current reset drivers could have made use of this without having resorted to new drivers, I guess we will have to just wait to see if it gets traction with new platforms or not, before we can decide if this solution is really as general as I think it can be.
Andrew
--
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