blob: d044b717fe494c66a9401e3f183d4cb424149923 [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 */
Katsuhiro Suzukib06b6312018-03-08 17:09:29 +090066 UNIPHIER_RESETX(40, 0x2000, 13), /* AIO */
Masahiro Yamada54e991b2016-08-02 13:18:29 +090067 UNIPHIER_RESET_END,
68};
69
Wei Yongjun716adfe2017-02-08 15:56:20 +000070static const struct uniphier_reset_data uniphier_pro5_sys_reset_data[] = {
Masahiro Yamada52810362017-08-06 11:44:01 +090071 UNIPHIER_RESETX(2, 0x2000, 2), /* NAND */
72 UNIPHIER_RESETX(8, 0x2000, 10), /* STDMAC (HSC) */
Masahiro Yamadadec173c2017-08-06 11:44:02 +090073 UNIPHIER_RESETX(12, 0x2000, 6), /* GIO (PCIe, USB3) */
74 UNIPHIER_RESETX(14, 0x2000, 17), /* USB30 */
75 UNIPHIER_RESETX(15, 0x2004, 17), /* USB31 */
Kunihiko Hayashifdc0f232018-03-30 18:44:43 +090076 UNIPHIER_RESETX(24, 0x2008, 2), /* PCIe */
Katsuhiro Suzukib06b6312018-03-08 17:09:29 +090077 UNIPHIER_RESETX(40, 0x2000, 13), /* AIO */
Masahiro Yamada54e991b2016-08-02 13:18:29 +090078 UNIPHIER_RESET_END,
79};
80
Wei Yongjun716adfe2017-02-08 15:56:20 +000081static const struct uniphier_reset_data uniphier_pxs2_sys_reset_data[] = {
Masahiro Yamada52810362017-08-06 11:44:01 +090082 UNIPHIER_RESETX(2, 0x2000, 2), /* NAND */
Kunihiko Hayashi4c05c4a2017-08-28 18:59:38 +090083 UNIPHIER_RESETX(6, 0x2000, 12), /* Ether */
Masahiro Yamada52810362017-08-06 11:44:01 +090084 UNIPHIER_RESETX(8, 0x2000, 10), /* STDMAC (HSC, RLE) */
Masahiro Yamadadec173c2017-08-06 11:44:02 +090085 UNIPHIER_RESETX(14, 0x2000, 17), /* USB30 */
86 UNIPHIER_RESETX(15, 0x2004, 17), /* USB31 */
Masahiro Yamada54e991b2016-08-02 13:18:29 +090087 UNIPHIER_RESETX(16, 0x2014, 4), /* USB30-PHY0 */
88 UNIPHIER_RESETX(17, 0x2014, 0), /* USB30-PHY1 */
89 UNIPHIER_RESETX(18, 0x2014, 2), /* USB30-PHY2 */
90 UNIPHIER_RESETX(20, 0x2014, 5), /* USB31-PHY0 */
91 UNIPHIER_RESETX(21, 0x2014, 1), /* USB31-PHY1 */
92 UNIPHIER_RESETX(28, 0x2014, 12), /* SATA */
93 UNIPHIER_RESET(29, 0x2014, 8), /* SATA-PHY (active high) */
Katsuhiro Suzukib06b6312018-03-08 17:09:29 +090094 UNIPHIER_RESETX(40, 0x2000, 13), /* AIO */
Masahiro Yamada54e991b2016-08-02 13:18:29 +090095 UNIPHIER_RESET_END,
96};
97
Wei Yongjun716adfe2017-02-08 15:56:20 +000098static const struct uniphier_reset_data uniphier_ld11_sys_reset_data[] = {
Masahiro Yamadadec173c2017-08-06 11:44:02 +090099 UNIPHIER_RESETX(2, 0x200c, 0), /* NAND */
100 UNIPHIER_RESETX(4, 0x200c, 2), /* eMMC */
Kunihiko Hayashi4c05c4a2017-08-28 18:59:38 +0900101 UNIPHIER_RESETX(6, 0x200c, 6), /* Ether */
Masahiro Yamadadec173c2017-08-06 11:44:02 +0900102 UNIPHIER_RESETX(8, 0x200c, 8), /* STDMAC (HSC, MIO) */
Katsuhiro Suzuki94e10c22017-08-13 18:00:41 +0900103 UNIPHIER_RESETX(40, 0x2008, 0), /* AIO */
104 UNIPHIER_RESETX(41, 0x2008, 1), /* EVEA */
Katsuhiro Suzuki0f195432017-08-13 18:00:42 +0900105 UNIPHIER_RESETX(42, 0x2010, 2), /* EXIV */
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900106 UNIPHIER_RESET_END,
107};
108
Wei Yongjun716adfe2017-02-08 15:56:20 +0000109static const struct uniphier_reset_data uniphier_ld20_sys_reset_data[] = {
Masahiro Yamadadec173c2017-08-06 11:44:02 +0900110 UNIPHIER_RESETX(2, 0x200c, 0), /* NAND */
111 UNIPHIER_RESETX(4, 0x200c, 2), /* eMMC */
Kunihiko Hayashi4c05c4a2017-08-28 18:59:38 +0900112 UNIPHIER_RESETX(6, 0x200c, 6), /* Ether */
Masahiro Yamadadec173c2017-08-06 11:44:02 +0900113 UNIPHIER_RESETX(8, 0x200c, 8), /* STDMAC (HSC) */
Masahiro Yamadae6914362018-04-12 11:16:10 +0900114 UNIPHIER_RESETX(14, 0x200c, 5), /* USB30 */
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900115 UNIPHIER_RESETX(16, 0x200c, 12), /* USB30-PHY0 */
116 UNIPHIER_RESETX(17, 0x200c, 13), /* USB30-PHY1 */
117 UNIPHIER_RESETX(18, 0x200c, 14), /* USB30-PHY2 */
118 UNIPHIER_RESETX(19, 0x200c, 15), /* USB30-PHY3 */
Kunihiko Hayashifdc0f232018-03-30 18:44:43 +0900119 UNIPHIER_RESETX(24, 0x200c, 4), /* PCIe */
Katsuhiro Suzuki94e10c22017-08-13 18:00:41 +0900120 UNIPHIER_RESETX(40, 0x2008, 0), /* AIO */
121 UNIPHIER_RESETX(41, 0x2008, 1), /* EVEA */
Katsuhiro Suzuki0f195432017-08-13 18:00:42 +0900122 UNIPHIER_RESETX(42, 0x2010, 2), /* EXIV */
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900123 UNIPHIER_RESET_END,
124};
125
Masahiro Yamada2a158f82017-10-05 11:30:57 +0900126static const struct uniphier_reset_data uniphier_pxs3_sys_reset_data[] = {
127 UNIPHIER_RESETX(2, 0x200c, 0), /* NAND */
128 UNIPHIER_RESETX(4, 0x200c, 2), /* eMMC */
Kunihiko Hayashi5573fe82018-03-23 14:12:34 +0900129 UNIPHIER_RESETX(6, 0x200c, 9), /* Ether0 */
130 UNIPHIER_RESETX(7, 0x200c, 10), /* Ether1 */
Masahiro Yamada2a158f82017-10-05 11:30:57 +0900131 UNIPHIER_RESETX(8, 0x200c, 12), /* STDMAC */
Masahiro Yamadae6914362018-04-12 11:16:10 +0900132 UNIPHIER_RESETX(12, 0x200c, 4), /* USB30 link */
133 UNIPHIER_RESETX(13, 0x200c, 5), /* USB31 link */
Masahiro Yamada2a158f82017-10-05 11:30:57 +0900134 UNIPHIER_RESETX(16, 0x200c, 16), /* USB30-PHY0 */
135 UNIPHIER_RESETX(17, 0x200c, 18), /* USB30-PHY1 */
136 UNIPHIER_RESETX(18, 0x200c, 20), /* USB30-PHY2 */
137 UNIPHIER_RESETX(20, 0x200c, 17), /* USB31-PHY0 */
138 UNIPHIER_RESETX(21, 0x200c, 19), /* USB31-PHY1 */
Kunihiko Hayashifdc0f232018-03-30 18:44:43 +0900139 UNIPHIER_RESETX(24, 0x200c, 3), /* PCIe */
Masahiro Yamada2a158f82017-10-05 11:30:57 +0900140 UNIPHIER_RESET_END,
141};
142
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900143/* Media I/O reset data */
144#define UNIPHIER_MIO_RESET_SD(id, ch) \
145 UNIPHIER_RESETX((id), 0x110 + 0x200 * (ch), 0)
146
147#define UNIPHIER_MIO_RESET_SD_BRIDGE(id, ch) \
148 UNIPHIER_RESETX((id), 0x110 + 0x200 * (ch), 26)
149
150#define UNIPHIER_MIO_RESET_EMMC_HW_RESET(id, ch) \
151 UNIPHIER_RESETX((id), 0x80 + 0x200 * (ch), 0)
152
153#define UNIPHIER_MIO_RESET_USB2(id, ch) \
154 UNIPHIER_RESETX((id), 0x114 + 0x200 * (ch), 0)
155
156#define UNIPHIER_MIO_RESET_USB2_BRIDGE(id, ch) \
157 UNIPHIER_RESETX((id), 0x110 + 0x200 * (ch), 24)
158
159#define UNIPHIER_MIO_RESET_DMAC(id) \
160 UNIPHIER_RESETX((id), 0x110, 17)
161
Masahiro Yamada52810362017-08-06 11:44:01 +0900162static const struct uniphier_reset_data uniphier_ld4_mio_reset_data[] = {
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900163 UNIPHIER_MIO_RESET_SD(0, 0),
164 UNIPHIER_MIO_RESET_SD(1, 1),
165 UNIPHIER_MIO_RESET_SD(2, 2),
166 UNIPHIER_MIO_RESET_SD_BRIDGE(3, 0),
167 UNIPHIER_MIO_RESET_SD_BRIDGE(4, 1),
168 UNIPHIER_MIO_RESET_SD_BRIDGE(5, 2),
169 UNIPHIER_MIO_RESET_EMMC_HW_RESET(6, 1),
170 UNIPHIER_MIO_RESET_DMAC(7),
171 UNIPHIER_MIO_RESET_USB2(8, 0),
172 UNIPHIER_MIO_RESET_USB2(9, 1),
173 UNIPHIER_MIO_RESET_USB2(10, 2),
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900174 UNIPHIER_MIO_RESET_USB2_BRIDGE(12, 0),
175 UNIPHIER_MIO_RESET_USB2_BRIDGE(13, 1),
176 UNIPHIER_MIO_RESET_USB2_BRIDGE(14, 2),
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900177 UNIPHIER_RESET_END,
178};
179
Wei Yongjun716adfe2017-02-08 15:56:20 +0000180static const struct uniphier_reset_data uniphier_pro5_sd_reset_data[] = {
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900181 UNIPHIER_MIO_RESET_SD(0, 0),
182 UNIPHIER_MIO_RESET_SD(1, 1),
183 UNIPHIER_MIO_RESET_EMMC_HW_RESET(6, 1),
184 UNIPHIER_RESET_END,
185};
186
187/* Peripheral reset data */
188#define UNIPHIER_PERI_RESET_UART(id, ch) \
189 UNIPHIER_RESETX((id), 0x114, 19 + (ch))
190
191#define UNIPHIER_PERI_RESET_I2C(id, ch) \
192 UNIPHIER_RESETX((id), 0x114, 5 + (ch))
193
194#define UNIPHIER_PERI_RESET_FI2C(id, ch) \
195 UNIPHIER_RESETX((id), 0x114, 24 + (ch))
196
Wei Yongjun716adfe2017-02-08 15:56:20 +0000197static const struct uniphier_reset_data uniphier_ld4_peri_reset_data[] = {
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900198 UNIPHIER_PERI_RESET_UART(0, 0),
199 UNIPHIER_PERI_RESET_UART(1, 1),
200 UNIPHIER_PERI_RESET_UART(2, 2),
201 UNIPHIER_PERI_RESET_UART(3, 3),
202 UNIPHIER_PERI_RESET_I2C(4, 0),
203 UNIPHIER_PERI_RESET_I2C(5, 1),
204 UNIPHIER_PERI_RESET_I2C(6, 2),
205 UNIPHIER_PERI_RESET_I2C(7, 3),
206 UNIPHIER_PERI_RESET_I2C(8, 4),
207 UNIPHIER_RESET_END,
208};
209
Wei Yongjun716adfe2017-02-08 15:56:20 +0000210static const struct uniphier_reset_data uniphier_pro4_peri_reset_data[] = {
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900211 UNIPHIER_PERI_RESET_UART(0, 0),
212 UNIPHIER_PERI_RESET_UART(1, 1),
213 UNIPHIER_PERI_RESET_UART(2, 2),
214 UNIPHIER_PERI_RESET_UART(3, 3),
215 UNIPHIER_PERI_RESET_FI2C(4, 0),
216 UNIPHIER_PERI_RESET_FI2C(5, 1),
217 UNIPHIER_PERI_RESET_FI2C(6, 2),
218 UNIPHIER_PERI_RESET_FI2C(7, 3),
219 UNIPHIER_PERI_RESET_FI2C(8, 4),
220 UNIPHIER_PERI_RESET_FI2C(9, 5),
221 UNIPHIER_PERI_RESET_FI2C(10, 6),
222 UNIPHIER_RESET_END,
223};
224
Katsuhiro Suzukiac0c7352017-08-13 18:00:43 +0900225/* Analog signal amplifiers reset data */
226static const struct uniphier_reset_data uniphier_ld11_adamv_reset_data[] = {
227 UNIPHIER_RESETX(0, 0x10, 6), /* EVEA */
228 UNIPHIER_RESET_END,
229};
230
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900231/* core implementaton */
232struct uniphier_reset_priv {
233 struct reset_controller_dev rcdev;
234 struct device *dev;
235 struct regmap *regmap;
236 const struct uniphier_reset_data *data;
237};
238
239#define to_uniphier_reset_priv(_rcdev) \
240 container_of(_rcdev, struct uniphier_reset_priv, rcdev)
241
242static int uniphier_reset_update(struct reset_controller_dev *rcdev,
243 unsigned long id, int assert)
244{
245 struct uniphier_reset_priv *priv = to_uniphier_reset_priv(rcdev);
246 const struct uniphier_reset_data *p;
247
248 for (p = priv->data; p->id != UNIPHIER_RESET_ID_END; p++) {
249 unsigned int mask, val;
250
251 if (p->id != id)
252 continue;
253
254 mask = BIT(p->bit);
255
256 if (assert)
257 val = mask;
258 else
259 val = ~mask;
260
261 if (p->flags & UNIPHIER_RESET_ACTIVE_LOW)
262 val = ~val;
263
264 return regmap_write_bits(priv->regmap, p->reg, mask, val);
265 }
266
267 dev_err(priv->dev, "reset_id=%lu was not handled\n", id);
268 return -EINVAL;
269}
270
271static int uniphier_reset_assert(struct reset_controller_dev *rcdev,
272 unsigned long id)
273{
274 return uniphier_reset_update(rcdev, id, 1);
275}
276
277static int uniphier_reset_deassert(struct reset_controller_dev *rcdev,
278 unsigned long id)
279{
280 return uniphier_reset_update(rcdev, id, 0);
281}
282
283static int uniphier_reset_status(struct reset_controller_dev *rcdev,
284 unsigned long id)
285{
286 struct uniphier_reset_priv *priv = to_uniphier_reset_priv(rcdev);
287 const struct uniphier_reset_data *p;
288
289 for (p = priv->data; p->id != UNIPHIER_RESET_ID_END; p++) {
290 unsigned int val;
291 int ret, asserted;
292
293 if (p->id != id)
294 continue;
295
296 ret = regmap_read(priv->regmap, p->reg, &val);
297 if (ret)
298 return ret;
299
300 asserted = !!(val & BIT(p->bit));
301
302 if (p->flags & UNIPHIER_RESET_ACTIVE_LOW)
303 asserted = !asserted;
304
305 return asserted;
306 }
307
308 dev_err(priv->dev, "reset_id=%lu was not found\n", id);
309 return -EINVAL;
310}
311
312static const struct reset_control_ops uniphier_reset_ops = {
313 .assert = uniphier_reset_assert,
314 .deassert = uniphier_reset_deassert,
315 .status = uniphier_reset_status,
316};
317
318static int uniphier_reset_probe(struct platform_device *pdev)
319{
320 struct device *dev = &pdev->dev;
321 struct uniphier_reset_priv *priv;
322 const struct uniphier_reset_data *p, *data;
323 struct regmap *regmap;
324 struct device_node *parent;
325 unsigned int nr_resets = 0;
326
327 data = of_device_get_match_data(dev);
328 if (WARN_ON(!data))
329 return -EINVAL;
330
331 parent = of_get_parent(dev->of_node); /* parent should be syscon node */
332 regmap = syscon_node_to_regmap(parent);
333 of_node_put(parent);
334 if (IS_ERR(regmap)) {
335 dev_err(dev, "failed to get regmap (error %ld)\n",
336 PTR_ERR(regmap));
337 return PTR_ERR(regmap);
338 }
339
340 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
341 if (!priv)
342 return -ENOMEM;
343
344 for (p = data; p->id != UNIPHIER_RESET_ID_END; p++)
345 nr_resets = max(nr_resets, p->id + 1);
346
347 priv->rcdev.ops = &uniphier_reset_ops;
348 priv->rcdev.owner = dev->driver->owner;
349 priv->rcdev.of_node = dev->of_node;
350 priv->rcdev.nr_resets = nr_resets;
351 priv->dev = dev;
352 priv->regmap = regmap;
353 priv->data = data;
354
355 return devm_reset_controller_register(&pdev->dev, &priv->rcdev);
356}
357
358static const struct of_device_id uniphier_reset_match[] = {
359 /* System reset */
360 {
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900361 .compatible = "socionext,uniphier-ld4-reset",
Masahiro Yamada52810362017-08-06 11:44:01 +0900362 .data = uniphier_ld4_sys_reset_data,
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900363 },
364 {
365 .compatible = "socionext,uniphier-pro4-reset",
366 .data = uniphier_pro4_sys_reset_data,
367 },
368 {
369 .compatible = "socionext,uniphier-sld8-reset",
Masahiro Yamada52810362017-08-06 11:44:01 +0900370 .data = uniphier_ld4_sys_reset_data,
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900371 },
372 {
373 .compatible = "socionext,uniphier-pro5-reset",
374 .data = uniphier_pro5_sys_reset_data,
375 },
376 {
377 .compatible = "socionext,uniphier-pxs2-reset",
378 .data = uniphier_pxs2_sys_reset_data,
379 },
380 {
381 .compatible = "socionext,uniphier-ld11-reset",
382 .data = uniphier_ld11_sys_reset_data,
383 },
384 {
385 .compatible = "socionext,uniphier-ld20-reset",
386 .data = uniphier_ld20_sys_reset_data,
387 },
Masahiro Yamada2a158f82017-10-05 11:30:57 +0900388 {
389 .compatible = "socionext,uniphier-pxs3-reset",
390 .data = uniphier_pxs3_sys_reset_data,
391 },
Masahiro Yamada19eb4a42016-10-19 17:23:49 +0900392 /* Media I/O reset, SD reset */
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900393 {
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900394 .compatible = "socionext,uniphier-ld4-mio-reset",
Masahiro Yamada52810362017-08-06 11:44:01 +0900395 .data = uniphier_ld4_mio_reset_data,
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900396 },
397 {
398 .compatible = "socionext,uniphier-pro4-mio-reset",
Masahiro Yamada52810362017-08-06 11:44:01 +0900399 .data = uniphier_ld4_mio_reset_data,
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900400 },
401 {
402 .compatible = "socionext,uniphier-sld8-mio-reset",
Masahiro Yamada52810362017-08-06 11:44:01 +0900403 .data = uniphier_ld4_mio_reset_data,
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900404 },
405 {
Masahiro Yamada19eb4a42016-10-19 17:23:49 +0900406 .compatible = "socionext,uniphier-pro5-sd-reset",
407 .data = uniphier_pro5_sd_reset_data,
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900408 },
409 {
Masahiro Yamada19eb4a42016-10-19 17:23:49 +0900410 .compatible = "socionext,uniphier-pxs2-sd-reset",
411 .data = uniphier_pro5_sd_reset_data,
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900412 },
413 {
414 .compatible = "socionext,uniphier-ld11-mio-reset",
Masahiro Yamada52810362017-08-06 11:44:01 +0900415 .data = uniphier_ld4_mio_reset_data,
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900416 },
417 {
Masahiro Yamada88a7f522017-01-15 04:04:46 +0900418 .compatible = "socionext,uniphier-ld11-sd-reset",
419 .data = uniphier_pro5_sd_reset_data,
420 },
421 {
Masahiro Yamada19eb4a42016-10-19 17:23:49 +0900422 .compatible = "socionext,uniphier-ld20-sd-reset",
423 .data = uniphier_pro5_sd_reset_data,
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900424 },
Masahiro Yamada2a158f82017-10-05 11:30:57 +0900425 {
426 .compatible = "socionext,uniphier-pxs3-sd-reset",
427 .data = uniphier_pro5_sd_reset_data,
428 },
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900429 /* Peripheral reset */
430 {
431 .compatible = "socionext,uniphier-ld4-peri-reset",
432 .data = uniphier_ld4_peri_reset_data,
433 },
434 {
435 .compatible = "socionext,uniphier-pro4-peri-reset",
436 .data = uniphier_pro4_peri_reset_data,
437 },
438 {
439 .compatible = "socionext,uniphier-sld8-peri-reset",
440 .data = uniphier_ld4_peri_reset_data,
441 },
442 {
443 .compatible = "socionext,uniphier-pro5-peri-reset",
444 .data = uniphier_pro4_peri_reset_data,
445 },
446 {
447 .compatible = "socionext,uniphier-pxs2-peri-reset",
448 .data = uniphier_pro4_peri_reset_data,
449 },
450 {
451 .compatible = "socionext,uniphier-ld11-peri-reset",
452 .data = uniphier_pro4_peri_reset_data,
453 },
454 {
455 .compatible = "socionext,uniphier-ld20-peri-reset",
456 .data = uniphier_pro4_peri_reset_data,
457 },
Masahiro Yamada2a158f82017-10-05 11:30:57 +0900458 {
459 .compatible = "socionext,uniphier-pxs3-peri-reset",
460 .data = uniphier_pro4_peri_reset_data,
461 },
Katsuhiro Suzukiac0c7352017-08-13 18:00:43 +0900462 /* Analog signal amplifiers reset */
463 {
464 .compatible = "socionext,uniphier-ld11-adamv-reset",
465 .data = uniphier_ld11_adamv_reset_data,
466 },
467 {
468 .compatible = "socionext,uniphier-ld20-adamv-reset",
469 .data = uniphier_ld11_adamv_reset_data,
470 },
Masahiro Yamada54e991b2016-08-02 13:18:29 +0900471 { /* sentinel */ }
472};
473MODULE_DEVICE_TABLE(of, uniphier_reset_match);
474
475static struct platform_driver uniphier_reset_driver = {
476 .probe = uniphier_reset_probe,
477 .driver = {
478 .name = "uniphier-reset",
479 .of_match_table = uniphier_reset_match,
480 },
481};
482module_platform_driver(uniphier_reset_driver);
483
484MODULE_AUTHOR("Masahiro Yamada <yamada.masahiro@socionext.com>");
485MODULE_DESCRIPTION("UniPhier Reset Controller Driver");
486MODULE_LICENSE("GPL");