aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2017-10-03 21:10:12 -0400
committerOlof Johansson <olof@lixom.net>2017-10-03 21:10:12 -0400
commit180eb4f17eab106982ef100787a485974bef4749 (patch)
tree90931a381f883b79d1c363efb5697903d602bf62
parent5f3daa2393889cf1bbcbc8209b292fb2db4a8806 (diff)
parent544e3bf4f0e8278400f19ca7918a3cdf2548b4eb (diff)
Merge tag 'reset-fixes-for-4.14' of git://git.pengutronix.de/git/pza/linux into fixes
Reset controller fixes for v4.14 - Remove misleading HSDK v1 suffix, as there is no v2 planned - Add missing DT binding documentation for HSDK reset driver - Fix HSDK reset driver dependencies * tag 'reset-fixes-for-4.14' of git://git.pengutronix.de/git/pza/linux: reset: Restrict RESET_HSDK to ARC_SOC_HSDK or COMPILE_TEST ARC: reset: remove the misleading v1 suffix all over ARC: reset: add missing DT binding documentation for HSDKv1 reset driver ARC: reset: Only build on archs that have IOMEM Signed-off-by: Olof Johansson <olof@lixom.net>
-rw-r--r--Documentation/devicetree/bindings/reset/snps,hsdk-reset.txt28
-rw-r--r--MAINTAINERS6
-rw-r--r--drivers/reset/Kconfig9
-rw-r--r--drivers/reset/Makefile2
-rw-r--r--drivers/reset/reset-hsdk.c (renamed from drivers/reset/reset-hsdk-v1.c)44
-rw-r--r--include/dt-bindings/reset/snps,hsdk-reset.h17
-rw-r--r--include/dt-bindings/reset/snps,hsdk-v1-reset.h17
7 files changed, 76 insertions, 47 deletions
diff --git a/Documentation/devicetree/bindings/reset/snps,hsdk-reset.txt b/Documentation/devicetree/bindings/reset/snps,hsdk-reset.txt
new file mode 100644
index 000000000000..830069b1c37c
--- /dev/null
+++ b/Documentation/devicetree/bindings/reset/snps,hsdk-reset.txt
@@ -0,0 +1,28 @@
1Binding for the Synopsys HSDK reset controller
2
3This binding uses the common reset binding[1].
4
5[1] Documentation/devicetree/bindings/reset/reset.txt
6
7Required properties:
8- compatible: should be "snps,hsdk-reset".
9- reg: should always contain 2 pairs address - length: first for reset
10 configuration register and second for corresponding SW reset and status bits
11 register.
12- #reset-cells: from common reset binding; Should always be set to 1.
13
14Example:
15 reset: reset@880 {
16 compatible = "snps,hsdk-reset";
17 #reset-cells = <1>;
18 reg = <0x8A0 0x4>, <0xFF0 0x4>;
19 };
20
21Specifying reset lines connected to IP modules:
22 ethernet@.... {
23 ....
24 resets = <&reset HSDK_V1_ETH_RESET>;
25 ....
26 };
27
28The index could be found in <dt-bindings/reset/snps,hsdk-reset.h>
diff --git a/MAINTAINERS b/MAINTAINERS
index 65b0c88d5ee0..60be46dc3fa8 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -12931,9 +12931,9 @@ F: drivers/mmc/host/dw_mmc*
12931SYNOPSYS HSDK RESET CONTROLLER DRIVER 12931SYNOPSYS HSDK RESET CONTROLLER DRIVER
12932M: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> 12932M: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
12933S: Supported 12933S: Supported
12934F: drivers/reset/reset-hsdk-v1.c 12934F: drivers/reset/reset-hsdk.c
12935F: include/dt-bindings/reset/snps,hsdk-v1-reset.h 12935F: include/dt-bindings/reset/snps,hsdk-reset.h
12936F: Documentation/devicetree/bindings/reset/snps,hsdk-v1-reset.txt 12936F: Documentation/devicetree/bindings/reset/snps,hsdk-reset.txt
12937 12937
12938SYSTEM CONFIGURATION (SYSCON) 12938SYSTEM CONFIGURATION (SYSCON)
12939M: Lee Jones <lee.jones@linaro.org> 12939M: Lee Jones <lee.jones@linaro.org>
diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig
index e0c393214264..e2baecbb9dd3 100644
--- a/drivers/reset/Kconfig
+++ b/drivers/reset/Kconfig
@@ -34,11 +34,12 @@ config RESET_BERLIN
34 help 34 help
35 This enables the reset controller driver for Marvell Berlin SoCs. 35 This enables the reset controller driver for Marvell Berlin SoCs.
36 36
37config RESET_HSDK_V1 37config RESET_HSDK
38 bool "HSDK v1 Reset Driver" 38 bool "Synopsys HSDK Reset Driver"
39 default n 39 depends on HAS_IOMEM
40 depends on ARC_SOC_HSDK || COMPILE_TEST
40 help 41 help
41 This enables the reset controller driver for HSDK v1. 42 This enables the reset controller driver for HSDK board.
42 43
43config RESET_IMX7 44config RESET_IMX7
44 bool "i.MX7 Reset Driver" if COMPILE_TEST 45 bool "i.MX7 Reset Driver" if COMPILE_TEST
diff --git a/drivers/reset/Makefile b/drivers/reset/Makefile
index d368367110e5..af1c15c330b3 100644
--- a/drivers/reset/Makefile
+++ b/drivers/reset/Makefile
@@ -5,7 +5,7 @@ obj-$(CONFIG_ARCH_TEGRA) += tegra/
5obj-$(CONFIG_RESET_A10SR) += reset-a10sr.o 5obj-$(CONFIG_RESET_A10SR) += reset-a10sr.o
6obj-$(CONFIG_RESET_ATH79) += reset-ath79.o 6obj-$(CONFIG_RESET_ATH79) += reset-ath79.o
7obj-$(CONFIG_RESET_BERLIN) += reset-berlin.o 7obj-$(CONFIG_RESET_BERLIN) += reset-berlin.o
8obj-$(CONFIG_RESET_HSDK_V1) += reset-hsdk-v1.o 8obj-$(CONFIG_RESET_HSDK) += reset-hsdk.o
9obj-$(CONFIG_RESET_IMX7) += reset-imx7.o 9obj-$(CONFIG_RESET_IMX7) += reset-imx7.o
10obj-$(CONFIG_RESET_LANTIQ) += reset-lantiq.o 10obj-$(CONFIG_RESET_LANTIQ) += reset-lantiq.o
11obj-$(CONFIG_RESET_LPC18XX) += reset-lpc18xx.o 11obj-$(CONFIG_RESET_LPC18XX) += reset-lpc18xx.o
diff --git a/drivers/reset/reset-hsdk-v1.c b/drivers/reset/reset-hsdk.c
index bca13e4bf622..8bce391c6943 100644
--- a/drivers/reset/reset-hsdk-v1.c
+++ b/drivers/reset/reset-hsdk.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Copyright (C) 2017 Synopsys. 2 * Copyright (C) 2017 Synopsys.
3 * 3 *
4 * Synopsys HSDKv1 SDP reset driver. 4 * Synopsys HSDK Development platform reset driver.
5 * 5 *
6 * This file is licensed under the terms of the GNU General Public 6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any 7 * License version 2. This program is licensed "as is" without any
@@ -18,9 +18,9 @@
18#include <linux/slab.h> 18#include <linux/slab.h>
19#include <linux/types.h> 19#include <linux/types.h>
20 20
21#define to_hsdkv1_rst(p) container_of((p), struct hsdkv1_rst, rcdev) 21#define to_hsdk_rst(p) container_of((p), struct hsdk_rst, rcdev)
22 22
23struct hsdkv1_rst { 23struct hsdk_rst {
24 void __iomem *regs_ctl; 24 void __iomem *regs_ctl;
25 void __iomem *regs_rst; 25 void __iomem *regs_rst;
26 spinlock_t lock; 26 spinlock_t lock;
@@ -49,12 +49,12 @@ static const u32 rst_map[] = {
49#define CGU_IP_SW_RESET_RESET BIT(0) 49#define CGU_IP_SW_RESET_RESET BIT(0)
50#define SW_RESET_TIMEOUT 10000 50#define SW_RESET_TIMEOUT 10000
51 51
52static void hsdkv1_reset_config(struct hsdkv1_rst *rst, unsigned long id) 52static void hsdk_reset_config(struct hsdk_rst *rst, unsigned long id)
53{ 53{
54 writel(rst_map[id], rst->regs_ctl + CGU_SYS_RST_CTRL); 54 writel(rst_map[id], rst->regs_ctl + CGU_SYS_RST_CTRL);
55} 55}
56 56
57static int hsdkv1_reset_do(struct hsdkv1_rst *rst) 57static int hsdk_reset_do(struct hsdk_rst *rst)
58{ 58{
59 u32 reg; 59 u32 reg;
60 60
@@ -69,28 +69,28 @@ static int hsdkv1_reset_do(struct hsdkv1_rst *rst)
69 !(reg & CGU_IP_SW_RESET_RESET), 5, SW_RESET_TIMEOUT); 69 !(reg & CGU_IP_SW_RESET_RESET), 5, SW_RESET_TIMEOUT);
70} 70}
71 71
72static int hsdkv1_reset_reset(struct reset_controller_dev *rcdev, 72static int hsdk_reset_reset(struct reset_controller_dev *rcdev,
73 unsigned long id) 73 unsigned long id)
74{ 74{
75 struct hsdkv1_rst *rst = to_hsdkv1_rst(rcdev); 75 struct hsdk_rst *rst = to_hsdk_rst(rcdev);
76 unsigned long flags; 76 unsigned long flags;
77 int ret; 77 int ret;
78 78
79 spin_lock_irqsave(&rst->lock, flags); 79 spin_lock_irqsave(&rst->lock, flags);
80 hsdkv1_reset_config(rst, id); 80 hsdk_reset_config(rst, id);
81 ret = hsdkv1_reset_do(rst); 81 ret = hsdk_reset_do(rst);
82 spin_unlock_irqrestore(&rst->lock, flags); 82 spin_unlock_irqrestore(&rst->lock, flags);
83 83
84 return ret; 84 return ret;
85} 85}
86 86
87static const struct reset_control_ops hsdkv1_reset_ops = { 87static const struct reset_control_ops hsdk_reset_ops = {
88 .reset = hsdkv1_reset_reset, 88 .reset = hsdk_reset_reset,
89}; 89};
90 90
91static int hsdkv1_reset_probe(struct platform_device *pdev) 91static int hsdk_reset_probe(struct platform_device *pdev)
92{ 92{
93 struct hsdkv1_rst *rst; 93 struct hsdk_rst *rst;
94 struct resource *mem; 94 struct resource *mem;
95 95
96 rst = devm_kzalloc(&pdev->dev, sizeof(*rst), GFP_KERNEL); 96 rst = devm_kzalloc(&pdev->dev, sizeof(*rst), GFP_KERNEL);
@@ -110,7 +110,7 @@ static int hsdkv1_reset_probe(struct platform_device *pdev)
110 spin_lock_init(&rst->lock); 110 spin_lock_init(&rst->lock);
111 111
112 rst->rcdev.owner = THIS_MODULE; 112 rst->rcdev.owner = THIS_MODULE;
113 rst->rcdev.ops = &hsdkv1_reset_ops; 113 rst->rcdev.ops = &hsdk_reset_ops;
114 rst->rcdev.of_node = pdev->dev.of_node; 114 rst->rcdev.of_node = pdev->dev.of_node;
115 rst->rcdev.nr_resets = HSDK_MAX_RESETS; 115 rst->rcdev.nr_resets = HSDK_MAX_RESETS;
116 rst->rcdev.of_reset_n_cells = 1; 116 rst->rcdev.of_reset_n_cells = 1;
@@ -118,20 +118,20 @@ static int hsdkv1_reset_probe(struct platform_device *pdev)
118 return reset_controller_register(&rst->rcdev); 118 return reset_controller_register(&rst->rcdev);
119} 119}
120 120
121static const struct of_device_id hsdkv1_reset_dt_match[] = { 121static const struct of_device_id hsdk_reset_dt_match[] = {
122 { .compatible = "snps,hsdk-v1.0-reset" }, 122 { .compatible = "snps,hsdk-reset" },
123 { }, 123 { },
124}; 124};