Re: [PATCH v3] reset: uniphier: add reset controller driver for UniPhier SoCs

2016-08-05 Thread Philipp Zabel
Am Dienstag, den 02.08.2016, 13:18 +0900 schrieb Masahiro Yamada:
> This is the initial commit for UniPhier reset controller driver.
> 
> Signed-off-by: Masahiro Yamada 
[...]
> --- a/drivers/reset/Makefile
> +++ b/drivers/reset/Makefile
> @@ -7,6 +7,7 @@ obj-$(CONFIG_ARCH_MESON) += reset-meson.o
>  obj-$(CONFIG_ARCH_SUNXI) += reset-sunxi.o
>  obj-$(CONFIG_ARCH_STI) += sti/
>  obj-$(CONFIG_ARCH_HISI) += hisilicon/
> +obj-$(CONFIG_RESET_UNIPHIER) += reset-uniphier.o
>  obj-$(CONFIG_ARCH_ZYNQ) += reset-zynq.o
>  obj-$(CONFIG_ATH79) += reset-ath79.o
>  obj-$(CONFIG_RESET_OXNAS) += reset-oxnas.o

Thank you, I have applied this patch with one small change: The Makefile
change is moved after TI_SYSCON_RESET, like you did in the Kconfig, to
keep the non-arch symbols in alphabetic order.

regards
Philipp



Re: [PATCH v3] reset: uniphier: add reset controller driver for UniPhier SoCs

2016-08-05 Thread Philipp Zabel
Am Dienstag, den 02.08.2016, 13:18 +0900 schrieb Masahiro Yamada:
> This is the initial commit for UniPhier reset controller driver.
> 
> Signed-off-by: Masahiro Yamada 
[...]
> --- a/drivers/reset/Makefile
> +++ b/drivers/reset/Makefile
> @@ -7,6 +7,7 @@ obj-$(CONFIG_ARCH_MESON) += reset-meson.o
>  obj-$(CONFIG_ARCH_SUNXI) += reset-sunxi.o
>  obj-$(CONFIG_ARCH_STI) += sti/
>  obj-$(CONFIG_ARCH_HISI) += hisilicon/
> +obj-$(CONFIG_RESET_UNIPHIER) += reset-uniphier.o
>  obj-$(CONFIG_ARCH_ZYNQ) += reset-zynq.o
>  obj-$(CONFIG_ATH79) += reset-ath79.o
>  obj-$(CONFIG_RESET_OXNAS) += reset-oxnas.o

Thank you, I have applied this patch with one small change: The Makefile
change is moved after TI_SYSCON_RESET, like you did in the Kconfig, to
keep the non-arch symbols in alphabetic order.

regards
Philipp



Re: [PATCH v3] reset: uniphier: add reset controller driver for UniPhier SoCs

2016-08-04 Thread Rob Herring
On Tue, Aug 02, 2016 at 01:18:29PM +0900, Masahiro Yamada wrote:
> This is the initial commit for UniPhier reset controller driver.
> 
> Signed-off-by: Masahiro Yamada 
> ---
> 
> Changes in v3:
>   - Fix examples in binding document to add specific compatible string
>   - Assign each reset signal with a separate ID
>   - Simplify reset_control operations
>   - Unify to a single file because code is short enough now.
> 
> Changes in v2:
>   Changes suggested by Philipp Zabel:
>   - Unify multiple module_platform_driver() boilerplates into one
>   - Unify tiny driver code and decrease the number of files
>   - Invert the logic of .deassert_val, changing it into .assert_val
>   - Show error code when failed to get regmap
>   - Add a binding document
>   - Support more reset signals
> 
>  .../devicetree/bindings/reset/uniphier-reset.txt   |  93 +

Acked-by: Rob Herring 

>  MAINTAINERS|   1 +
>  drivers/reset/Kconfig  |  10 +
>  drivers/reset/Makefile |   1 +
>  drivers/reset/reset-uniphier.c | 440 
> +
>  5 files changed, 545 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/reset/uniphier-reset.txt
>  create mode 100644 drivers/reset/reset-uniphier.c


Re: [PATCH v3] reset: uniphier: add reset controller driver for UniPhier SoCs

2016-08-04 Thread Rob Herring
On Tue, Aug 02, 2016 at 01:18:29PM +0900, Masahiro Yamada wrote:
> This is the initial commit for UniPhier reset controller driver.
> 
> Signed-off-by: Masahiro Yamada 
> ---
> 
> Changes in v3:
>   - Fix examples in binding document to add specific compatible string
>   - Assign each reset signal with a separate ID
>   - Simplify reset_control operations
>   - Unify to a single file because code is short enough now.
> 
> Changes in v2:
>   Changes suggested by Philipp Zabel:
>   - Unify multiple module_platform_driver() boilerplates into one
>   - Unify tiny driver code and decrease the number of files
>   - Invert the logic of .deassert_val, changing it into .assert_val
>   - Show error code when failed to get regmap
>   - Add a binding document
>   - Support more reset signals
> 
>  .../devicetree/bindings/reset/uniphier-reset.txt   |  93 +

Acked-by: Rob Herring 

>  MAINTAINERS|   1 +
>  drivers/reset/Kconfig  |  10 +
>  drivers/reset/Makefile |   1 +
>  drivers/reset/reset-uniphier.c | 440 
> +
>  5 files changed, 545 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/reset/uniphier-reset.txt
>  create mode 100644 drivers/reset/reset-uniphier.c


[PATCH v3] reset: uniphier: add reset controller driver for UniPhier SoCs

2016-08-01 Thread Masahiro Yamada
This is the initial commit for UniPhier reset controller driver.

Signed-off-by: Masahiro Yamada 
---

Changes in v3:
  - Fix examples in binding document to add specific compatible string
  - Assign each reset signal with a separate ID
  - Simplify reset_control operations
  - Unify to a single file because code is short enough now.

Changes in v2:
  Changes suggested by Philipp Zabel:
  - Unify multiple module_platform_driver() boilerplates into one
  - Unify tiny driver code and decrease the number of files
  - Invert the logic of .deassert_val, changing it into .assert_val
  - Show error code when failed to get regmap
  - Add a binding document
  - Support more reset signals

 .../devicetree/bindings/reset/uniphier-reset.txt   |  93 +
 MAINTAINERS|   1 +
 drivers/reset/Kconfig  |  10 +
 drivers/reset/Makefile |   1 +
 drivers/reset/reset-uniphier.c | 440 +
 5 files changed, 545 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/uniphier-reset.txt
 create mode 100644 drivers/reset/reset-uniphier.c

diff --git a/Documentation/devicetree/bindings/reset/uniphier-reset.txt 
b/Documentation/devicetree/bindings/reset/uniphier-reset.txt
new file mode 100644
index 000..e6bbfcc
--- /dev/null
+++ b/Documentation/devicetree/bindings/reset/uniphier-reset.txt
@@ -0,0 +1,93 @@
+UniPhier reset controller
+
+
+System reset
+
+
+Required properties:
+- compatible: should be one of the following:
+"socionext,uniphier-sld3-reset" - for PH1-sLD3 SoC.
+"socionext,uniphier-ld4-reset"  - for PH1-LD4 SoC.
+"socionext,uniphier-pro4-reset" - for PH1-Pro4 SoC.
+"socionext,uniphier-sld8-reset" - for PH1-sLD8 SoC.
+"socionext,uniphier-pro5-reset" - for PH1-Pro5 SoC.
+"socionext,uniphier-pxs2-reset" - for ProXstream2/PH1-LD6b SoC.
+"socionext,uniphier-ld11-reset" - for PH1-LD11 SoC.
+"socionext,uniphier-ld20-reset" - for PH1-LD20 SoC.
+- #reset-cells: should be 1.
+
+Example:
+
+   sysctrl@6184 {
+   compatible = "socionext,uniphier-ld20-sysctrl",
+"simple-mfd", "syscon";
+   reg = <0x6184 0x4000>;
+
+   reset {
+   compatible = "socionext,uniphier-ld20-reset";
+   #reset-cells = <1>;
+   };
+
+   other nodes ...
+   };
+
+
+Media I/O (MIO) reset
+-
+
+Required properties:
+- compatible: should be one of the following:
+"socionext,uniphier-sld3-mio-reset" - for PH1-sLD3 SoC.
+"socionext,uniphier-ld4-mio-reset"  - for PH1-LD4 SoC.
+"socionext,uniphier-pro4-mio-reset" - for PH1-Pro4 SoC.
+"socionext,uniphier-sld8-mio-reset" - for PH1-sLD8 SoC.
+"socionext,uniphier-pro5-mio-reset" - for PH1-Pro5 SoC.
+"socionext,uniphier-pxs2-mio-reset" - for ProXstream2/PH1-LD6b SoC.
+"socionext,uniphier-ld11-mio-reset" - for PH1-LD11 SoC.
+"socionext,uniphier-ld20-mio-reset" - for PH1-LD20 SoC.
+- #reset-cells: should be 1.
+
+Example:
+
+   mioctrl@5981 {
+   compatible = "socionext,uniphier-ld20-mioctrl",
+"simple-mfd", "syscon";
+   reg = <0x5981 0x800>;
+
+   reset {
+   compatible = "socionext,uniphier-ld20-mio-reset";
+   #reset-cells = <1>;
+   };
+
+   other nodes ...
+   };
+
+
+Peripheral reset
+
+
+Required properties:
+- compatible: should be one of the following:
+"socionext,uniphier-ld4-peri-reset"  - for PH1-LD4 SoC.
+"socionext,uniphier-pro4-peri-reset" - for PH1-Pro4 SoC.
+"socionext,uniphier-sld8-peri-reset" - for PH1-sLD8 SoC.
+"socionext,uniphier-pro5-peri-reset" - for PH1-Pro5 SoC.
+"socionext,uniphier-pxs2-peri-reset" - for ProXstream2/PH1-LD6b SoC.
+"socionext,uniphier-ld11-peri-reset" - for PH1-LD11 SoC.
+"socionext,uniphier-ld20-peri-reset" - for PH1-LD20 SoC.
+- #reset-cells: should be 1.
+
+Example:
+
+   perictrl@5982 {
+   compatible = "socionext,uniphier-ld20-perictrl",
+"simple-mfd", "syscon";
+   reg = <0x5982 0x200>;
+
+   reset {
+   compatible = "socionext,uniphier-ld20-peri-reset";
+   #reset-cells = <1>;
+   };
+
+   other nodes ...
+   };
diff --git a/MAINTAINERS b/MAINTAINERS
index f87eac3..96d4e99 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1825,6 +1825,7 @@ F:drivers/clk/uniphier/
 F: drivers/i2c/busses/i2c-uniphier*
 F: drivers/mmc/host/uniphier-sd.c
 F: drivers/pinctrl/uniphier/
+F: drivers/reset/reset-uniphier.c
 F: drivers/tty/serial/8250/8250_uniphier.c
 N: uniphier
 
diff --git a/drivers/reset/Kconfig 

[PATCH v3] reset: uniphier: add reset controller driver for UniPhier SoCs

2016-08-01 Thread Masahiro Yamada
This is the initial commit for UniPhier reset controller driver.

Signed-off-by: Masahiro Yamada 
---

Changes in v3:
  - Fix examples in binding document to add specific compatible string
  - Assign each reset signal with a separate ID
  - Simplify reset_control operations
  - Unify to a single file because code is short enough now.

Changes in v2:
  Changes suggested by Philipp Zabel:
  - Unify multiple module_platform_driver() boilerplates into one
  - Unify tiny driver code and decrease the number of files
  - Invert the logic of .deassert_val, changing it into .assert_val
  - Show error code when failed to get regmap
  - Add a binding document
  - Support more reset signals

 .../devicetree/bindings/reset/uniphier-reset.txt   |  93 +
 MAINTAINERS|   1 +
 drivers/reset/Kconfig  |  10 +
 drivers/reset/Makefile |   1 +
 drivers/reset/reset-uniphier.c | 440 +
 5 files changed, 545 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/uniphier-reset.txt
 create mode 100644 drivers/reset/reset-uniphier.c

diff --git a/Documentation/devicetree/bindings/reset/uniphier-reset.txt 
b/Documentation/devicetree/bindings/reset/uniphier-reset.txt
new file mode 100644
index 000..e6bbfcc
--- /dev/null
+++ b/Documentation/devicetree/bindings/reset/uniphier-reset.txt
@@ -0,0 +1,93 @@
+UniPhier reset controller
+
+
+System reset
+
+
+Required properties:
+- compatible: should be one of the following:
+"socionext,uniphier-sld3-reset" - for PH1-sLD3 SoC.
+"socionext,uniphier-ld4-reset"  - for PH1-LD4 SoC.
+"socionext,uniphier-pro4-reset" - for PH1-Pro4 SoC.
+"socionext,uniphier-sld8-reset" - for PH1-sLD8 SoC.
+"socionext,uniphier-pro5-reset" - for PH1-Pro5 SoC.
+"socionext,uniphier-pxs2-reset" - for ProXstream2/PH1-LD6b SoC.
+"socionext,uniphier-ld11-reset" - for PH1-LD11 SoC.
+"socionext,uniphier-ld20-reset" - for PH1-LD20 SoC.
+- #reset-cells: should be 1.
+
+Example:
+
+   sysctrl@6184 {
+   compatible = "socionext,uniphier-ld20-sysctrl",
+"simple-mfd", "syscon";
+   reg = <0x6184 0x4000>;
+
+   reset {
+   compatible = "socionext,uniphier-ld20-reset";
+   #reset-cells = <1>;
+   };
+
+   other nodes ...
+   };
+
+
+Media I/O (MIO) reset
+-
+
+Required properties:
+- compatible: should be one of the following:
+"socionext,uniphier-sld3-mio-reset" - for PH1-sLD3 SoC.
+"socionext,uniphier-ld4-mio-reset"  - for PH1-LD4 SoC.
+"socionext,uniphier-pro4-mio-reset" - for PH1-Pro4 SoC.
+"socionext,uniphier-sld8-mio-reset" - for PH1-sLD8 SoC.
+"socionext,uniphier-pro5-mio-reset" - for PH1-Pro5 SoC.
+"socionext,uniphier-pxs2-mio-reset" - for ProXstream2/PH1-LD6b SoC.
+"socionext,uniphier-ld11-mio-reset" - for PH1-LD11 SoC.
+"socionext,uniphier-ld20-mio-reset" - for PH1-LD20 SoC.
+- #reset-cells: should be 1.
+
+Example:
+
+   mioctrl@5981 {
+   compatible = "socionext,uniphier-ld20-mioctrl",
+"simple-mfd", "syscon";
+   reg = <0x5981 0x800>;
+
+   reset {
+   compatible = "socionext,uniphier-ld20-mio-reset";
+   #reset-cells = <1>;
+   };
+
+   other nodes ...
+   };
+
+
+Peripheral reset
+
+
+Required properties:
+- compatible: should be one of the following:
+"socionext,uniphier-ld4-peri-reset"  - for PH1-LD4 SoC.
+"socionext,uniphier-pro4-peri-reset" - for PH1-Pro4 SoC.
+"socionext,uniphier-sld8-peri-reset" - for PH1-sLD8 SoC.
+"socionext,uniphier-pro5-peri-reset" - for PH1-Pro5 SoC.
+"socionext,uniphier-pxs2-peri-reset" - for ProXstream2/PH1-LD6b SoC.
+"socionext,uniphier-ld11-peri-reset" - for PH1-LD11 SoC.
+"socionext,uniphier-ld20-peri-reset" - for PH1-LD20 SoC.
+- #reset-cells: should be 1.
+
+Example:
+
+   perictrl@5982 {
+   compatible = "socionext,uniphier-ld20-perictrl",
+"simple-mfd", "syscon";
+   reg = <0x5982 0x200>;
+
+   reset {
+   compatible = "socionext,uniphier-ld20-peri-reset";
+   #reset-cells = <1>;
+   };
+
+   other nodes ...
+   };
diff --git a/MAINTAINERS b/MAINTAINERS
index f87eac3..96d4e99 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1825,6 +1825,7 @@ F:drivers/clk/uniphier/
 F: drivers/i2c/busses/i2c-uniphier*
 F: drivers/mmc/host/uniphier-sd.c
 F: drivers/pinctrl/uniphier/
+F: drivers/reset/reset-uniphier.c
 F: drivers/tty/serial/8250/8250_uniphier.c
 N: uniphier
 
diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig
index