blob: 55821846672b08b82fc6409812aa6ea3a801753f [file] [log] [blame]
Masahiro Yamada54e991b2016-08-02 13:18:29 +09001/*
2 * Copyright (C) 2016 Socionext Inc.
3 * Author: Masahiro Yamada <yamada.masahiro@socionext.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#include <linux/mfd/syscon.h>
17#include <linux/module.h>
18#include <linux/of.h>
19#include <linux/of_device.h>
20#include <linux/platform_device.h>
21#include <linux/regmap.h>
22#include <linux/reset-controller.h>
23
24struct uniphier_reset_data {
25 unsigned int id;
26 unsigned int reg;
27 unsigned int bit;
28 unsigned int flags;
29#define UNIPHIER_RESET_ACTIVE_LOW BIT(0)
30};
31
32#define UNIPHIER_RESET_ID_END (unsigned int)(-1)
33
34#define UNIPHIER_RESET_END \
35 { .id = UNIPHIER_RESET_ID_END }
36
37#define UNIPHIER_RESET(_id, _reg, _bit) \
38 { \
39 .id = (_id), \
40 .reg = (_reg), \
41 .bit = (_bit), \
42 }
43
44#define UNIPHIER_RESETX(_id, _reg, _bit) \
45 { \
46 .id = (_id), \
47 .reg = (_reg), \
48 .bit = (_bit), \
49 .flags = UNIPHIER_RESET_ACTIVE_LOW, \
50 }
51
52/* System reset data */
Masahiro Yamada52810362017-08-06 11:44:01 +090053static const struct uniphier_reset_data uniphier_ld4_sys_reset_data[] = {
54 UNIPHIER_RESETX(2, 0x2000, 2), /* NAND */
55 UNIPHIER_RESETX(8, 0x2000, 10), /* STDMAC (Ether, HSC, MIO) */
Masahiro Yamada54e991b2016-08-02 13:18:29 +090056 UNIPHIER_RESET_END,
57};
58
Wei Yongjun716adfe2017-02-08 15:56:20 +000059static const struct uniphier_reset_data uniphier_pro4_sys_reset_data[] = {
Masahiro Yamada52810362017-08-06 11:44:01 +090060 UNIPHIER_RESETX(2, 0x2000, 2), /* NAND */
Kunihiko Hayashi4c05c4a2017-08-28 18:59:38 +090061 UNIPHIER_RESETX(6, 0x2000, 12), /* Ether */
Masahiro Yamada52810362017-08-06 11:44:01 +090062 UNIPHIER_RESETX(8, 0x2000, 10), /* STDMAC (HSC, MIO, RLE) */
Masahiro Yamadadec173c2017-08-06 11:44:02 +090063 UNIPHIER_RESETX(12, 0x2000, 6), /* GIO (Ether, SATA, USB3) */
64 UNIPHIER_RESETX(14, 0x2000, 17), /* USB30 */
65 UNIPHIER_RESETX(15, 0x2004, 17), /* USB31 */
Kunihiko Hayashi78636712018-03-30 18:44:44 +090066 UNIPHIER_RESETX(28, 0x2000, 18), /* SATA0 */
67 UNIPHIER_RESETX(29, 0x2004, 18), /* SATA1 */
68 UNIPHIER_RESETX(30, 0x2000, 19), /* SATA-PHY */
Katsuhiro Suzukib06b6312018-03-08 17:09:29 +090069 UNIPHIER_RESETX(40, 0x2000, 13), /* AIO */
Masahiro Yamada54e991b2016-08-02 13:18:29 +090070 UNIPHIER_RESET_END,
71};
72
Wei Yongjun716adfe2017-02-08 15:56:20 +000073static const struct uniphier_reset_data uniphier_pro5_sys_reset_data[] = {
Masahiro Yamada52810362017-08-06 11:44:01 +090074 UNIPHIER_RESETX(2, 0x2000, 2), /* NAND */
75 UNIPHIER_RESETX(8, 0x2000, 10), /* STDMAC (HSC) */
Masahiro Yamadadec173c2017-08-06 11:44:02 +090076 UNIPHIER_RESETX(12, 0x2000, 6), /* GIO (PCIe, USB3) */
77 UNIPHIER_RESETX(14, 0x2000, 17), /* USB30 */
78 UNIPHIER_RESETX(15, 0x2004, 17), /* USB31 */
Kunihiko Hayashifdc0f232018-03-30 18:44:43 +090079 UNIPHIER_RESETX(24, 0x2008, 2), /* PCIe */
Katsuhiro Suzukib06b6312018-03-08 17:09:29 +090080 UNIPHIER_RESETX(40, 0x2000, 13), /* AIO */
Masahiro Yamada54e991b2016-08-02 13:18:29 +090081 UNIPHIER_RESET_END,
82};
83
Wei Yongjun716adfe2017-02-08 15:56:20 +000084static const struct uniphier_reset_data uniphier_pxs2_sys_reset_data[] = {
Masahiro Yamada52810362017-08-06 11:44:01 +090085 UNIPHIER_RESETX(2, 0x2000, 2), /* NAND */
Kunihiko Hayashi4c05c4a2017-08-28 18:59:38 +090086 UNIPHIER_RESETX(6, 0x2000, 12), /* Ether */
Masahiro Yamada52810362017-08-06 11:44:01 +090087 UNIPHIER_RESETX(8, 0x2000, 10), /* STDMAC (HSC, RLE) */
Masahiro Yamadadec173c2017-08-06 11:44:02 +090088 UNIPHIER_RESETX(14, 0x2000, 17), /* USB30 */
89 UNIPHIER_RESETX(15, 0x2004, 17), /* USB31 */
Masahiro Yamada54e991b2016-08-02 13:18:29 +090090 UNIPHIER_RESETX(16, 0x2014, 4), /* USB30-PHY0 */
91 UNIPHIER_RESETX(17, 0x2014, 0), /* USB30-PHY1 */
92 UNIPHIER_RESETX(18, 0x2014, 2), /* USB30-PHY2 */
93 UNIPHIER_RESETX(20, 0x2014, 5), /* USB31-PHY0 */
94 UNIPHIER_RESETX(21, 0x2014, 1), /* USB31-PHY1 */
95 UNIPHIER_RESETX(28, 0x2014, 12), /* SATA */
Kunihiko Hayashi78636712018-03-30 18:44:44 +090096 UNIPHIER_RESET(30, 0x2014, 8), /* SATA-PHY (active high) */
Katsuhiro Suzukib06b6312018-03-08 17:09:29 +090097 UNIPHIER_RESETX(40, 0x2000, 13), /* AIO */
Masahiro Yamada54e991b2016-08-02 13:18:29 +090098 UNIPHIER_RESET_END,
99};
100
Wei Yongjun716adfe2017-02-08 15:56:20 +0000101static const struct uniphier_reset_data uniphier_ld11_sys_reset_data[] = {
Masahiro Yamadadec173c2017-08-06 11:44:02 +0900102 UNIPHIER_RESETX(2, 0x200c, 0), /* NAND */
103 UNIPHIER_RESETX(4, 0x200c, 2), /* eMMC */
Kunihiko Hayashi4c05c4a2017-08-28 18:59:38 +0900104 UNIPHIER_RESETX(6, 0x200c, 6), /* Ether */
Masahiro Yamadadec173c2017-08-06 11:44:02 +0900105 UNIPHIER_RESETX(8, 0x200c, 8), /* STDMAC (HSC, MIO) */
Katsuhiro Suzuki94e10c22017-08-13 18:00:41 +0900106 UNIPHIER_RESETX(40, 0x2008, 0), /* AIO */
107 UNIPHIER_RESETX(41, 0x2008, 1), /* EVEA */
Katsuhiro Suzuki0f195432017-08-13 18:00:42 +0900108 UNIPHIER_RESETX(42, 0x2010, 2), /* EXIV */
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900109 UNIPHIER_RESET_END,
110};
111
Wei Yongjun716adfe2017-02-08 15:56:20 +0000112static const struct uniphier_reset_data uniphier_ld20_sys_reset_data[] = {
Masahiro Yamadadec173c2017-08-06 11:44:02 +0900113 UNIPHIER_RESETX(2, 0x200c, 0), /* NAND */
114 UNIPHIER_RESETX(4, 0x200c, 2), /* eMMC */
Kunihiko Hayashi4c05c4a2017-08-28 18:59:38 +0900115 UNIPHIER_RESETX(6, 0x200c, 6), /* Ether */
Masahiro Yamadadec173c2017-08-06 11:44:02 +0900116 UNIPHIER_RESETX(8, 0x200c, 8), /* STDMAC (HSC) */
Masahiro Yamadae6914362018-04-12 11:16:10 +0900117 UNIPHIER_RESETX(14, 0x200c, 5), /* USB30 */
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900118 UNIPHIER_RESETX(16, 0x200c, 12), /* USB30-PHY0 */
119 UNIPHIER_RESETX(17, 0x200c, 13), /* USB30-PHY1 */
120 UNIPHIER_RESETX(18, 0x200c, 14), /* USB30-PHY2 */
121 UNIPHIER_RESETX(19, 0x200c, 15), /* USB30-PHY3 */
Kunihiko Hayashifdc0f232018-03-30 18:44:43 +0900122 UNIPHIER_RESETX(24, 0x200c, 4), /* PCIe */
Katsuhiro Suzuki94e10c22017-08-13 18:00:41 +0900123 UNIPHIER_RESETX(40, 0x2008, 0), /* AIO */
124 UNIPHIER_RESETX(41, 0x2008, 1), /* EVEA */
Katsuhiro Suzuki0f195432017-08-13 18:00:42 +0900125 UNIPHIER_RESETX(42, 0x2010, 2), /* EXIV */
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900126 UNIPHIER_RESET_END,
127};
128
Masahiro Yamada2a158f82017-10-05 11:30:57 +0900129static const struct uniphier_reset_data uniphier_pxs3_sys_reset_data[] = {
130 UNIPHIER_RESETX(2, 0x200c, 0), /* NAND */
131 UNIPHIER_RESETX(4, 0x200c, 2), /* eMMC */
Kunihiko Hayashi5573fe82018-03-23 14:12:34 +0900132 UNIPHIER_RESETX(6, 0x200c, 9), /* Ether0 */
133 UNIPHIER_RESETX(7, 0x200c, 10), /* Ether1 */
Masahiro Yamada2a158f82017-10-05 11:30:57 +0900134 UNIPHIER_RESETX(8, 0x200c, 12), /* STDMAC */
Masahiro Yamadae6914362018-04-12 11:16:10 +0900135 UNIPHIER_RESETX(12, 0x200c, 4), /* USB30 link */
136 UNIPHIER_RESETX(13, 0x200c, 5), /* USB31 link */
Masahiro Yamada2a158f82017-10-05 11:30:57 +0900137 UNIPHIER_RESETX(16, 0x200c, 16), /* USB30-PHY0 */
138 UNIPHIER_RESETX(17, 0x200c, 18), /* USB30-PHY1 */
139 UNIPHIER_RESETX(18, 0x200c, 20), /* USB30-PHY2 */
140 UNIPHIER_RESETX(20, 0x200c, 17), /* USB31-PHY0 */
141 UNIPHIER_RESETX(21, 0x200c, 19), /* USB31-PHY1 */
Kunihiko Hayashifdc0f232018-03-30 18:44:43 +0900142 UNIPHIER_RESETX(24, 0x200c, 3), /* PCIe */
Kunihiko Hayashi78636712018-03-30 18:44:44 +0900143 UNIPHIER_RESETX(28, 0x200c, 7), /* SATA0 */
144 UNIPHIER_RESETX(29, 0x200c, 8), /* SATA1 */
145 UNIPHIER_RESETX(30, 0x200c, 21), /* SATA-PHY */
Masahiro Yamada2a158f82017-10-05 11:30:57 +0900146 UNIPHIER_RESET_END,
147};
148
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900149/* Media I/O reset data */
150#define UNIPHIER_MIO_RESET_SD(id, ch) \
151 UNIPHIER_RESETX((id), 0x110 + 0x200 * (ch), 0)
152
153#define UNIPHIER_MIO_RESET_SD_BRIDGE(id, ch) \
154 UNIPHIER_RESETX((id), 0x110 + 0x200 * (ch), 26)
155
156#define UNIPHIER_MIO_RESET_EMMC_HW_RESET(id, ch) \
157 UNIPHIER_RESETX((id), 0x80 + 0x200 * (ch), 0)
158
159#define UNIPHIER_MIO_RESET_USB2(id, ch) \
160 UNIPHIER_RESETX((id), 0x114 + 0x200 * (ch), 0)
161
162#define UNIPHIER_MIO_RESET_USB2_BRIDGE(id, ch) \
163 UNIPHIER_RESETX((id), 0x110 + 0x200 * (ch), 24)
164
165#define UNIPHIER_MIO_RESET_DMAC(id) \
166 UNIPHIER_RESETX((id), 0x110, 17)
167
Masahiro Yamada52810362017-08-06 11:44:01 +0900168static const struct uniphier_reset_data uniphier_ld4_mio_reset_data[] = {
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900169 UNIPHIER_MIO_RESET_SD(0, 0),
170 UNIPHIER_MIO_RESET_SD(1, 1),
171 UNIPHIER_MIO_RESET_SD(2, 2),
172 UNIPHIER_MIO_RESET_SD_BRIDGE(3, 0),
173 UNIPHIER_MIO_RESET_SD_BRIDGE(4, 1),
174 UNIPHIER_MIO_RESET_SD_BRIDGE(5, 2),
175 UNIPHIER_MIO_RESET_EMMC_HW_RESET(6, 1),
176 UNIPHIER_MIO_RESET_DMAC(7),
177 UNIPHIER_MIO_RESET_USB2(8, 0),
178 UNIPHIER_MIO_RESET_USB2(9, 1),
179 UNIPHIER_MIO_RESET_USB2(10, 2),
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900180 UNIPHIER_MIO_RESET_USB2_BRIDGE(12, 0),
181 UNIPHIER_MIO_RESET_USB2_BRIDGE(13, 1),
182 UNIPHIER_MIO_RESET_USB2_BRIDGE(14, 2),
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900183 UNIPHIER_RESET_END,
184};
185
Wei Yongjun716adfe2017-02-08 15:56:20 +0000186static const struct uniphier_reset_data uniphier_pro5_sd_reset_data[] = {
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900187 UNIPHIER_MIO_RESET_SD(0, 0),
188 UNIPHIER_MIO_RESET_SD(1, 1),
189 UNIPHIER_MIO_RESET_EMMC_HW_RESET(6, 1),
190 UNIPHIER_RESET_END,
191};
192
193/* Peripheral reset data */
194#define UNIPHIER_PERI_RESET_UART(id, ch) \
195 UNIPHIER_RESETX((id), 0x114, 19 + (ch))
196
197#define UNIPHIER_PERI_RESET_I2C(id, ch) \
198 UNIPHIER_RESETX((id), 0x114, 5 + (ch))
199
200#define UNIPHIER_PERI_RESET_FI2C(id, ch) \
201 UNIPHIER_RESETX((id), 0x114, 24 + (ch))
202
Wei Yongjun716adfe2017-02-08 15:56:20 +0000203static const struct uniphier_reset_data uniphier_ld4_peri_reset_data[] = {
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900204 UNIPHIER_PERI_RESET_UART(0, 0),
205 UNIPHIER_PERI_RESET_UART(1, 1),
206 UNIPHIER_PERI_RESET_UART(2, 2),
207 UNIPHIER_PERI_RESET_UART(3, 3),
208 UNIPHIER_PERI_RESET_I2C(4, 0),
209 UNIPHIER_PERI_RESET_I2C(5, 1),
210 UNIPHIER_PERI_RESET_I2C(6, 2),
211 UNIPHIER_PERI_RESET_I2C(7, 3),
212 UNIPHIER_PERI_RESET_I2C(8, 4),
213 UNIPHIER_RESET_END,
214};
215
Wei Yongjun716adfe2017-02-08 15:56:20 +0000216static const struct uniphier_reset_data uniphier_pro4_peri_reset_data[] = {
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900217 UNIPHIER_PERI_RESET_UART(0, 0),
218 UNIPHIER_PERI_RESET_UART(1, 1),
219 UNIPHIER_PERI_RESET_UART(2, 2),
220 UNIPHIER_PERI_RESET_UART(3, 3),
221 UNIPHIER_PERI_RESET_FI2C(4, 0),
222 UNIPHIER_PERI_RESET_FI2C(5, 1),
223 UNIPHIER_PERI_RESET_FI2C(6, 2),
224 UNIPHIER_PERI_RESET_FI2C(7, 3),
225 UNIPHIER_PERI_RESET_FI2C(8, 4),
226 UNIPHIER_PERI_RESET_FI2C(9, 5),
227 UNIPHIER_PERI_RESET_FI2C(10, 6),
228 UNIPHIER_RESET_END,
229};
230
Katsuhiro Suzukiac0c7352017-08-13 18:00:43 +0900231/* Analog signal amplifiers reset data */
232static const struct uniphier_reset_data uniphier_ld11_adamv_reset_data[] = {
233 UNIPHIER_RESETX(0, 0x10, 6), /* EVEA */
234 UNIPHIER_RESET_END,
235};
236
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900237/* core implementaton */
238struct uniphier_reset_priv {
239 struct reset_controller_dev rcdev;
240 struct device *dev;
241 struct regmap *regmap;
242 const struct uniphier_reset_data *data;
243};
244
245#define to_uniphier_reset_priv(_rcdev) \
246 container_of(_rcdev, struct uniphier_reset_priv, rcdev)
247
248static int uniphier_reset_update(struct reset_controller_dev *rcdev,
249 unsigned long id, int assert)
250{
251 struct uniphier_reset_priv *priv = to_uniphier_reset_priv(rcdev);
252 const struct uniphier_reset_data *p;
253
254 for (p = priv->data; p->id != UNIPHIER_RESET_ID_END; p++) {
255 unsigned int mask, val;
256
257 if (p->id != id)
258 continue;
259
260 mask = BIT(p->bit);
261
262 if (assert)
263 val = mask;
264 else
265 val = ~mask;
266
267 if (p->flags & UNIPHIER_RESET_ACTIVE_LOW)
268 val = ~val;
269
270 return regmap_write_bits(priv->regmap, p->reg, mask, val);
271 }
272
273 dev_err(priv->dev, "reset_id=%lu was not handled\n", id);
274 return -EINVAL;
275}
276
277static int uniphier_reset_assert(struct reset_controller_dev *rcdev,
278 unsigned long id)
279{
280 return uniphier_reset_update(rcdev, id, 1);
281}
282
283static int uniphier_reset_deassert(struct reset_controller_dev *rcdev,
284 unsigned long id)
285{
286 return uniphier_reset_update(rcdev, id, 0);
287}
288
289static int uniphier_reset_status(struct reset_controller_dev *rcdev,
290 unsigned long id)
291{
292 struct uniphier_reset_priv *priv = to_uniphier_reset_priv(rcdev);
293 const struct uniphier_reset_data *p;
294
295 for (p = priv->data; p->id != UNIPHIER_RESET_ID_END; p++) {
296 unsigned int val;
297 int ret, asserted;
298
299 if (p->id != id)
300 continue;
301
302 ret = regmap_read(priv->regmap, p->reg, &val);
303 if (ret)
304 return ret;
305
306 asserted = !!(val & BIT(p->bit));
307
308 if (p->flags & UNIPHIER_RESET_ACTIVE_LOW)
309 asserted = !asserted;
310
311 return asserted;
312 }
313
314 dev_err(priv->dev, "reset_id=%lu was not found\n", id);
315 return -EINVAL;
316}
317
318static const struct reset_control_ops uniphier_reset_ops = {
319 .assert = uniphier_reset_assert,
320 .deassert = uniphier_reset_deassert,
321 .status = uniphier_reset_status,
322};
323
324static int uniphier_reset_probe(struct platform_device *pdev)
325{
326 struct device *dev = &pdev->dev;
327 struct uniphier_reset_priv *priv;
328 const struct uniphier_reset_data *p, *data;
329 struct regmap *regmap;
330 struct device_node *parent;
331 unsigned int nr_resets = 0;
332
333 data = of_device_get_match_data(dev);
334 if (WARN_ON(!data))
335 return -EINVAL;
336
337 parent = of_get_parent(dev->of_node); /* parent should be syscon node */
338 regmap = syscon_node_to_regmap(parent);
339 of_node_put(parent);
340 if (IS_ERR(regmap)) {
341 dev_err(dev, "failed to get regmap (error %ld)\n",
342 PTR_ERR(regmap));
343 return PTR_ERR(regmap);
344 }
345
346 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
347 if (!priv)
348 return -ENOMEM;
349
350 for (p = data; p->id != UNIPHIER_RESET_ID_END; p++)
351 nr_resets = max(nr_resets, p->id + 1);
352
353 priv->rcdev.ops = &uniphier_reset_ops;
354 priv->rcdev.owner = dev->driver->owner;
355 priv->rcdev.of_node = dev->of_node;
356 priv->rcdev.nr_resets = nr_resets;
357 priv->dev = dev;
358 priv->regmap = regmap;
359 priv->data = data;
360
361 return devm_reset_controller_register(&pdev->dev, &priv->rcdev);
362}
363
364static const struct of_device_id uniphier_reset_match[] = {
365 /* System reset */
366 {
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900367 .compatible = "socionext,uniphier-ld4-reset",
Masahiro Yamada52810362017-08-06 11:44:01 +0900368 .data = uniphier_ld4_sys_reset_data,
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900369 },
370 {
371 .compatible = "socionext,uniphier-pro4-reset",
372 .data = uniphier_pro4_sys_reset_data,
373 },
374 {
375 .compatible = "socionext,uniphier-sld8-reset",
Masahiro Yamada52810362017-08-06 11:44:01 +0900376 .data = uniphier_ld4_sys_reset_data,
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900377 },
378 {
379 .compatible = "socionext,uniphier-pro5-reset",
380 .data = uniphier_pro5_sys_reset_data,
381 },
382 {
383 .compatible = "socionext,uniphier-pxs2-reset",
384 .data = uniphier_pxs2_sys_reset_data,
385 },
386 {
387 .compatible = "socionext,uniphier-ld11-reset",
388 .data = uniphier_ld11_sys_reset_data,
389 },
390 {
391 .compatible = "socionext,uniphier-ld20-reset",
392 .data = uniphier_ld20_sys_reset_data,
393 },
Masahiro Yamada2a158f82017-10-05 11:30:57 +0900394 {
395 .compatible = "socionext,uniphier-pxs3-reset",
396 .data = uniphier_pxs3_sys_reset_data,
397 },
Masahiro Yamada19eb4a42016-10-19 17:23:49 +0900398 /* Media I/O reset, SD reset */
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900399 {
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900400 .compatible = "socionext,uniphier-ld4-mio-reset",
Masahiro Yamada52810362017-08-06 11:44:01 +0900401 .data = uniphier_ld4_mio_reset_data,
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900402 },
403 {
404 .compatible = "socionext,uniphier-pro4-mio-reset",
Masahiro Yamada52810362017-08-06 11:44:01 +0900405 .data = uniphier_ld4_mio_reset_data,
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900406 },
407 {
408 .compatible = "socionext,uniphier-sld8-mio-reset",
Masahiro Yamada52810362017-08-06 11:44:01 +0900409 .data = uniphier_ld4_mio_reset_data,
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900410 },
411 {
Masahiro Yamada19eb4a42016-10-19 17:23:49 +0900412 .compatible = "socionext,uniphier-pro5-sd-reset",
413 .data = uniphier_pro5_sd_reset_data,
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900414 },
415 {
Masahiro Yamada19eb4a42016-10-19 17:23:49 +0900416 .compatible = "socionext,uniphier-pxs2-sd-reset",
417 .data = uniphier_pro5_sd_reset_data,
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900418 },
419 {
420 .compatible = "socionext,uniphier-ld11-mio-reset",
Masahiro Yamada52810362017-08-06 11:44:01 +0900421 .data = uniphier_ld4_mio_reset_data,
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900422 },
423 {
Masahiro Yamada88a7f522017-01-15 04:04:46 +0900424 .compatible = "socionext,uniphier-ld11-sd-reset",
425 .data = uniphier_pro5_sd_reset_data,
426 },
427 {
Masahiro Yamada19eb4a42016-10-19 17:23:49 +0900428 .compatible = "socionext,uniphier-ld20-sd-reset",
429 .data = uniphier_pro5_sd_reset_data,
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900430 },
Masahiro Yamada2a158f82017-10-05 11:30:57 +0900431 {
432 .compatible = "socionext,uniphier-pxs3-sd-reset",
433 .data = uniphier_pro5_sd_reset_data,
434 },
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900435 /* Peripheral reset */
436 {
437 .compatible = "socionext,uniphier-ld4-peri-reset",
438 .data = uniphier_ld4_peri_reset_data,
439 },
440 {
441 .compatible = "socionext,uniphier-pro4-peri-reset",
442 .data = uniphier_pro4_peri_reset_data,
443 },
444 {
445 .compatible = "socionext,uniphier-sld8-peri-reset",
446 .data = uniphier_ld4_peri_reset_data,
447 },
448 {
449 .compatible = "socionext,uniphier-pro5-peri-reset",
450 .data = uniphier_pro4_peri_reset_data,
451 },
452 {
453 .compatible = "socionext,uniphier-pxs2-peri-reset",
454 .data = uniphier_pro4_peri_reset_data,
455 },
456 {
457 .compatible = "socionext,uniphier-ld11-peri-reset",
458 .data = uniphier_pro4_peri_reset_data,
459 },
460 {
461 .compatible = "socionext,uniphier-ld20-peri-reset",
462 .data = uniphier_pro4_peri_reset_data,
463 },
Masahiro Yamada2a158f82017-10-05 11:30:57 +0900464 {
465 .compatible = "socionext,uniphier-pxs3-peri-reset",
466 .data = uniphier_pro4_peri_reset_data,
467 },
Katsuhiro Suzukiac0c7352017-08-13 18:00:43 +0900468 /* Analog signal amplifiers reset */
469 {
470 .compatible = "socionext,uniphier-ld11-adamv-reset",
471 .data = uniphier_ld11_adamv_reset_data,
472 },
473 {
474 .compatible = "socionext,uniphier-ld20-adamv-reset",
475 .data = uniphier_ld11_adamv_reset_data,
476 },
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900477 { /* sentinel */ }
478};
479MODULE_DEVICE_TABLE(of, uniphier_reset_match);
480
481static struct platform_driver uniphier_reset_driver = {
482 .probe = uniphier_reset_probe,
483 .driver = {
484 .name = "uniphier-reset",
485 .of_match_table = uniphier_reset_match,
486 },
487};
488module_platform_driver(uniphier_reset_driver);
489
490MODULE_AUTHOR("Masahiro Yamada <yamada.masahiro@socionext.com>");
491MODULE_DESCRIPTION("UniPhier Reset Controller Driver");
492MODULE_LICENSE("GPL");