aboutsummaryrefslogtreecommitdiffstats
path: root/meta-rcar-gen3/recipes-kernel/linux/linux-renesas/0016-Revert-hwspinlock-rcar-Add-support-for-R-Car-Gen3-Ha.patch
blob: 7fd5650f4d42f916334ccafaacd2d0ec16dc4e29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
From 90628b9c9b731cff9071a6d587431e0a4b8e5c0a Mon Sep 17 00:00:00 2001
From: Hiroki Negishi <hiroki.negishi.bx@renesas.com>
Date: Mon, 13 Nov 2017 11:57:53 +0900
Subject: [PATCH 16/23] Revert "hwspinlock: rcar: Add support for R-Car Gen3
 Hardware Spinlock"

This reverts commit 18ff508d5241 ("hwspinlock: rcar: Add support
for R-Car Gen3 Hardware Spinlock")

Signed-off-by: Hiroki Negishi <hiroki.negishi.bx@renesas.com>
---
 drivers/hwspinlock/Kconfig           |  13 ---
 drivers/hwspinlock/Makefile          |   1 -
 drivers/hwspinlock/rcar_hwspinlock.c | 162 -----------------------------------
 3 files changed, 176 deletions(-)
 delete mode 100644 drivers/hwspinlock/rcar_hwspinlock.c

diff --git a/drivers/hwspinlock/Kconfig b/drivers/hwspinlock/Kconfig
index f0c0a35..73a4016 100644
--- a/drivers/hwspinlock/Kconfig
+++ b/drivers/hwspinlock/Kconfig
@@ -53,17 +53,4 @@ config HSEM_U8500
 
 	  If unsure, say N.
 
-config HWSPINLOCK_RCAR
-	bool "R-Car Hardware Spinlock functionality"
-	depends on ARCH_RENESAS
-	select HWSPINLOCK
-	default y
-	help
-	  Say y here to support the R-Car Hardware Spinlock functionality, which
-	  provides a synchronisation mechanism for the various processor on the
-	  SoC.
-	  This function is implemented with MFIS device.
-
-	  If unsure, say N.
-
 endmenu
diff --git a/drivers/hwspinlock/Makefile b/drivers/hwspinlock/Makefile
index 4ee4001..6b59cb5a 100644
--- a/drivers/hwspinlock/Makefile
+++ b/drivers/hwspinlock/Makefile
@@ -6,5 +6,4 @@ obj-$(CONFIG_HWSPINLOCK)		+= hwspinlock_core.o
 obj-$(CONFIG_HWSPINLOCK_OMAP)		+= omap_hwspinlock.o
 obj-$(CONFIG_HWSPINLOCK_QCOM)		+= qcom_hwspinlock.o
 obj-$(CONFIG_HWSPINLOCK_SIRF)		+= sirf_hwspinlock.o
-obj-$(CONFIG_HWSPINLOCK_RCAR)		+= rcar_hwspinlock.o
 obj-$(CONFIG_HSEM_U8500)		+= u8500_hsem.o
diff --git a/drivers/hwspinlock/rcar_hwspinlock.c b/drivers/hwspinlock/rcar_hwspinlock.c
deleted file mode 100644
index 8b45c49..0000000
--- a/drivers/hwspinlock/rcar_hwspinlock.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * rcar_hwspinlock.c
- *
- * Copyright (C) 2017 Renesas Electronics Corporation
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation.
- *
- * 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.
- */
-#include <linux/hwspinlock.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/pm_runtime.h>
-#include <linux/of.h>
-#include <linux/of_device.h>
-#include <linux/of_address.h>
-#include <linux/platform_device.h>
-#include <linux/io.h>
-#include <linux/sys_soc.h>
-
-#include "hwspinlock_internal.h"
-
-#define MFISLCKR0_OFFSET	0x000000C0
-#define MFISLCKR8_OFFSET	0x00000724
-#define MFISLCKR_NUM_8		8	/* r8a7795 ES1.*, r8a7796 ES1.* */
-#define MFISLCKR_NUM_64		64
-
-static int rcar_hwspinlock_trylock(struct hwspinlock *lock)
-{
-	void *addr = lock->priv;
-
-	return !ioread32((void __iomem *)addr);
-}
-
-static void rcar_hwspinlock_unlock(struct hwspinlock *lock)
-{
-	void *addr = lock->priv;
-
-	iowrite32(0, (void __iomem *)addr);
-}
-
-static const struct hwspinlock_ops rcar_hwspinlock_ops = {
-	.trylock	= rcar_hwspinlock_trylock,
-	.unlock		= rcar_hwspinlock_unlock,
-};
-
-static const struct soc_device_attribute mfislock_quirks_match[] = {
-	{ .soc_id = "r8a7795", .revision = "ES1.*" },
-	{ .soc_id = "r8a7796", .revision = "ES1.*" },
-	{ /* sentinel */ }
-};
-
-static const struct of_device_id rcar_hwspinlock_of_match[] = {
-	{ .compatible = "renesas,mfis-lock" },
-	{ },
-};
-MODULE_DEVICE_TABLE(of, rcar_hwspinlock_of_match);
-
-static int rcar_hwspinlock_probe(struct platform_device *pdev)
-{
-	int				ch;
-	int				num_locks = MFISLCKR_NUM_64;
-	int				ret = 0;
-	u32 __iomem			*addr;
-	struct resource			*res;
-	struct hwspinlock_device	*bank;
-
-	/* allocate hwspinlock control info */
-	bank = devm_kzalloc(&pdev->dev, sizeof(*bank)
-			    + sizeof(struct hwspinlock) * MFISLCKR_NUM_64,
-			    GFP_KERNEL);
-	if (!bank) {
-		dev_err(&pdev->dev, "Failed to allocate memory.\n");
-		ret = -ENOMEM;
-		goto out;
-	}
-
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-
-	/* map MFIS lock register */
-	addr = (u32 __iomem *)devm_ioremap_nocache(&pdev->dev,
-						   res->start,
-						   resource_size(res));
-	if (!addr) {
-		dev_err(&pdev->dev, "Failed to remap register.\n");
-		ret = PTR_ERR(addr);
-		goto out;
-	}
-
-	/* create lock for MFISLCKR0-7 */
-	for (ch = 0; ch < 8; ch++)
-		bank->lock[ch].priv = (void __force *)addr + MFISLCKR0_OFFSET
-				+ sizeof(u32) * ch;
-
-	/* create lock for MFISLCKR8-63 */
-	for (ch = 8; ch < 64; ch++)
-		bank->lock[ch].priv = (void __force *)addr + MFISLCKR8_OFFSET
-				+ sizeof(u32) * (ch - 8);
-
-	platform_set_drvdata(pdev, bank);
-
-	ret = of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev);
-	if (ret)
-		goto out;
-
-	pm_runtime_enable(&pdev->dev);
-
-	/* register hwspinlock */
-	if (soc_device_match(mfislock_quirks_match))
-		num_locks = MFISLCKR_NUM_8;
-
-	ret = hwspin_lock_register(bank, &pdev->dev, &rcar_hwspinlock_ops,
-				   0, num_locks);
-	if (ret)
-		pm_runtime_disable(&pdev->dev);
-
-out:
-	return ret;
-}
-
-static int rcar_hwspinlock_remove(struct platform_device *pdev)
-{
-	int		ret;
-
-	ret = hwspin_lock_unregister(platform_get_drvdata(pdev));
-	if (ret) {
-		dev_err(&pdev->dev, "%s failed: %d\n", __func__, ret);
-		return ret;
-	}
-
-	pm_runtime_disable(&pdev->dev);
-
-	return 0;
-}
-
-static struct platform_driver rcar_hwspinlock_driver = {
-	.probe		= rcar_hwspinlock_probe,
-	.remove		= rcar_hwspinlock_remove,
-	.driver		= {
-		.name	= "rcar_hwspinlock",
-		.of_match_table = rcar_hwspinlock_of_match,
-	},
-};
-
-static int __init rcar_hwspinlock_init(void)
-{
-	return platform_driver_register(&rcar_hwspinlock_driver);
-}
-core_initcall(rcar_hwspinlock_init);
-
-static void __exit rcar_hwspinlock_exit(void)
-{
-	platform_driver_unregister(&rcar_hwspinlock_driver);
-}
-module_exit(rcar_hwspinlock_exit);
-
-MODULE_LICENSE("GPL v2");
-- 
1.9.1