ARM: prima2: move to generic reset controller driver framework
PATCH v5 1/1 ARM: prima2: move to generic reset controller driver framework
this moves to generic IP module reset framework, and make other drivers use common device_reset() API.
Cc Srinivas Kandagatla <[email protected]>
Signed-off-by Barry Song <[email protected]>
Signed-off-by Bin Shi <[email protected]>
Acked-by Philipp Zabel <[email protected]>
---
-v5: move to subsys_init according to Arnd's feedback
.../devicetree/bindings/reset/sirf,rstc.txt | 42 +++++++++ arch/arm/boot/dts/atlas6.dtsi | 3 +- arch/arm/boot/dts/marco.dtsi | 3 +- arch/arm/boot/dts/prima2.dtsi | 3 +- arch/arm/mach-prima2/Kconfig | 1 + arch/arm/mach-prima2/common.c | 2 +- arch/arm/mach-prima2/rstc.c | 93 ++++++++++++------- 7 files changed, 109 insertions(+), 38 deletions(-) create mode 100644 Documentation/devicetree/bindings/reset/sirf,rstc.txt
Documentation/devicetree/bindings/reset/sirf,rstc.txt new file +42 -0
@@ -0,0 +1,42 @@ +CSR SiRFSoC Reset Controller +====================================== + +Please also refer to reset.txt in this directory for common reset +controller binding usage. + +Required properties: +- compatible: Should be "sirf,prima2-rstc" or "sirf,marco-rstc" +- reg: should be register base and length as documented in the + datasheet +- #reset-cells: 1, see below + +example: + +rstc: reset-controller at 88010000 { + compatible = "sirf,prima2-rstc"; + reg = <0x88010000 0x1000>; + #reset-cells = <1>; +}; + +Specifying reset lines connected to IP modules +============================================== + +The reset controller(rstc) manages various reset sources. This module provides +reset signals for most blocks in system. Those device nodes should specify the +reset line on the rstc in their resets property, containing a phandle to the +rstc device node and a RESET_INDEX specifying which module to reset, as described +in reset.txt. + +For SiRFSoC, RESET_INDEX is just reset_bit defined in SW_RST0 and SW_RST1 registers. +For modules whose rest_bit is in SW_RST0, its RESET_INDEX is 0~31. For modules whose +rest_bit is in SW_RST1, its RESET_INDEX is 32~63. + +example: + +vpp at 90020000 { + compatible = "sirf,prima2-vpp"; + reg = <0x90020000 0x10000>; + interrupts = <31>; + clocks = <&clks 35>; + resets = <&rstc 6>; +};
arch/arm/boot/dts/atlas6.dtsi +2 -1
@@ -56,9 +56,10 @@ #clock-cells = <1>; }; - reset-controller at 88010000 { + rstc: reset-controller at 88010000 { compatible = "sirf,prima2-rstc"; reg = <0x88010000 0x1000>; + #reset-cells = <1>; }; rsc-controller at 88020000 {
arch/arm/boot/dts/marco.dtsi +2 -1
@@ -58,9 +58,10 @@ #size-cells = <1>; ranges = <0xc2000000 0xc2000000 0x1000000>; - reset-controller at c2000000 { + rstc: reset-controller at c2000000 { compatible = "sirf,marco-rstc"; reg = <0xc2000000 0x10000>; + #reset-cells = <1>; }; };
arch/arm/boot/dts/prima2.dtsi +2 -1
@@ -67,9 +67,10 @@ #clock-cells = <1>; }; - reset-controller at 88010000 { + rstc: reset-controller at 88010000 { compatible = "sirf,prima2-rstc"; reg = <0x88010000 0x1000>; + #reset-cells = <1>; }; rsc-controller at 88020000 {
arch/arm/mach-prima2/Kconfig +1 -0
@@ -1,5 +1,6 @@ config ARCH_SIRF bool "CSR SiRF" if ARCH_MULTI_V7 + select ARCH_HAS_RESET_CONTROLLER select ARCH_REQUIRE_GPIOLIB select GENERIC_CLOCKEVENTS select GENERIC_IRQ_CHIP
arch/arm/mach-prima2/common.c +1 -1
@@ -15,7 +15,7 @@#include <linux/of_platform.h> #include "common.h" -void __init sirfsoc_init_late (void ) +static void __init sirfsoc_init_late (void ) {sirfsoc_pm_init (); }
arch/arm/mach-prima2/rstc.c +59 -34
131 lines not on this page · raw message
Signature · 1 line
1.7.5.4