Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Masahiro Yamada | 2aa4b5b | 2016-10-08 13:25:31 +0900 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2016 Socionext Inc. |
| 4 | * Author: Masahiro Yamada <yamada.masahiro@socionext.com> |
Kunihiko Hayashi | 91e7fd3 | 2023-02-20 14:50:30 +0900 | [diff] [blame] | 5 | * Author: Kunihiko Hayashi <hayashi.kunihiko@socionext.com> |
Masahiro Yamada | 2aa4b5b | 2016-10-08 13:25:31 +0900 | [diff] [blame] | 6 | */ |
| 7 | |
Simon Glass | 11c89f3 | 2017-05-17 17:18:03 -0600 | [diff] [blame] | 8 | #include <dm.h> |
Simon Glass | 0f2af88 | 2020-05-10 11:40:05 -0600 | [diff] [blame] | 9 | #include <log.h> |
Simon Glass | 9bc1564 | 2020-02-03 07:36:16 -0700 | [diff] [blame] | 10 | #include <malloc.h> |
Masahiro Yamada | 2aa4b5b | 2016-10-08 13:25:31 +0900 | [diff] [blame] | 11 | #include <reset-uclass.h> |
Kunihiko Hayashi | 91e7fd3 | 2023-02-20 14:50:30 +0900 | [diff] [blame] | 12 | #include <clk.h> |
| 13 | #include <reset.h> |
Simon Glass | 9bc1564 | 2020-02-03 07:36:16 -0700 | [diff] [blame] | 14 | #include <dm/device_compat.h> |
Masahiro Yamada | 2aa4b5b | 2016-10-08 13:25:31 +0900 | [diff] [blame] | 15 | #include <linux/bitops.h> |
| 16 | #include <linux/io.h> |
| 17 | #include <linux/sizes.h> |
| 18 | |
| 19 | struct uniphier_reset_data { |
| 20 | unsigned int id; |
| 21 | unsigned int reg; |
| 22 | unsigned int bit; |
| 23 | unsigned int flags; |
| 24 | #define UNIPHIER_RESET_ACTIVE_LOW BIT(0) |
| 25 | }; |
| 26 | |
| 27 | #define UNIPHIER_RESET_ID_END (unsigned int)(-1) |
| 28 | |
| 29 | #define UNIPHIER_RESET_END \ |
| 30 | { .id = UNIPHIER_RESET_ID_END } |
| 31 | |
| 32 | #define UNIPHIER_RESET(_id, _reg, _bit) \ |
| 33 | { \ |
| 34 | .id = (_id), \ |
| 35 | .reg = (_reg), \ |
| 36 | .bit = (_bit), \ |
| 37 | } |
| 38 | |
| 39 | #define UNIPHIER_RESETX(_id, _reg, _bit) \ |
| 40 | { \ |
| 41 | .id = (_id), \ |
| 42 | .reg = (_reg), \ |
| 43 | .bit = (_bit), \ |
| 44 | .flags = UNIPHIER_RESET_ACTIVE_LOW, \ |
| 45 | } |
| 46 | |
| 47 | /* System reset data */ |
Masahiro Yamada | 5e05c4d | 2017-06-22 16:42:04 +0900 | [diff] [blame] | 48 | static const struct uniphier_reset_data uniphier_pro4_sys_reset_data[] = { |
Masahiro Yamada | 0eb2cec | 2017-08-13 09:01:16 +0900 | [diff] [blame] | 49 | UNIPHIER_RESETX(2, 0x2000, 2), /* NAND */ |
Kunihiko Hayashi | 6cce837 | 2018-04-18 10:06:07 +0900 | [diff] [blame] | 50 | UNIPHIER_RESETX(6, 0x2000, 12), /* ETHER */ |
Masahiro Yamada | 0eb2cec | 2017-08-13 09:01:16 +0900 | [diff] [blame] | 51 | UNIPHIER_RESETX(8, 0x2000, 10), /* STDMAC */ |
| 52 | UNIPHIER_RESETX(12, 0x2000, 6), /* GIO */ |
| 53 | UNIPHIER_RESETX(14, 0x2000, 17), /* USB30 */ |
| 54 | UNIPHIER_RESETX(15, 0x2004, 17), /* USB31 */ |
Kunihiko Hayashi | 2dcb469 | 2021-07-06 19:01:07 +0900 | [diff] [blame] | 55 | UNIPHIER_RESETX(24, 0x2008, 2), /* PCIE */ |
Masahiro Yamada | 2aa4b5b | 2016-10-08 13:25:31 +0900 | [diff] [blame] | 56 | UNIPHIER_RESET_END, |
| 57 | }; |
| 58 | |
Masahiro Yamada | 5e05c4d | 2017-06-22 16:42:04 +0900 | [diff] [blame] | 59 | static const struct uniphier_reset_data uniphier_pxs2_sys_reset_data[] = { |
Masahiro Yamada | 0eb2cec | 2017-08-13 09:01:16 +0900 | [diff] [blame] | 60 | UNIPHIER_RESETX(2, 0x2000, 2), /* NAND */ |
Kunihiko Hayashi | 6cce837 | 2018-04-18 10:06:07 +0900 | [diff] [blame] | 61 | UNIPHIER_RESETX(6, 0x2000, 12), /* ETHER */ |
Masahiro Yamada | 0eb2cec | 2017-08-13 09:01:16 +0900 | [diff] [blame] | 62 | UNIPHIER_RESETX(8, 0x2000, 10), /* STDMAC */ |
| 63 | UNIPHIER_RESETX(14, 0x2000, 17), /* USB30 */ |
| 64 | UNIPHIER_RESETX(15, 0x2004, 17), /* USB31 */ |
Masahiro Yamada | 2aa4b5b | 2016-10-08 13:25:31 +0900 | [diff] [blame] | 65 | UNIPHIER_RESETX(16, 0x2014, 4), /* USB30-PHY0 */ |
| 66 | UNIPHIER_RESETX(17, 0x2014, 0), /* USB30-PHY1 */ |
| 67 | UNIPHIER_RESETX(18, 0x2014, 2), /* USB30-PHY2 */ |
| 68 | UNIPHIER_RESETX(20, 0x2014, 5), /* USB31-PHY0 */ |
| 69 | UNIPHIER_RESETX(21, 0x2014, 1), /* USB31-PHY1 */ |
| 70 | UNIPHIER_RESETX(28, 0x2014, 12), /* SATA */ |
| 71 | UNIPHIER_RESET(29, 0x2014, 8), /* SATA-PHY (active high) */ |
| 72 | UNIPHIER_RESET_END, |
| 73 | }; |
| 74 | |
Masahiro Yamada | 5e05c4d | 2017-06-22 16:42:04 +0900 | [diff] [blame] | 75 | static const struct uniphier_reset_data uniphier_ld20_sys_reset_data[] = { |
Masahiro Yamada | 0eb2cec | 2017-08-13 09:01:16 +0900 | [diff] [blame] | 76 | UNIPHIER_RESETX(2, 0x200c, 0), /* NAND */ |
| 77 | UNIPHIER_RESETX(4, 0x200c, 2), /* eMMC */ |
Kunihiko Hayashi | 6cce837 | 2018-04-18 10:06:07 +0900 | [diff] [blame] | 78 | UNIPHIER_RESETX(6, 0x200c, 6), /* ETHER */ |
Masahiro Yamada | 0eb2cec | 2017-08-13 09:01:16 +0900 | [diff] [blame] | 79 | UNIPHIER_RESETX(8, 0x200c, 8), /* STDMAC */ |
Masahiro Yamada | 096c466 | 2018-06-19 16:11:43 +0900 | [diff] [blame] | 80 | UNIPHIER_RESETX(14, 0x200c, 5), /* USB30 */ |
Masahiro Yamada | 2aa4b5b | 2016-10-08 13:25:31 +0900 | [diff] [blame] | 81 | UNIPHIER_RESETX(16, 0x200c, 12), /* USB30-PHY0 */ |
| 82 | UNIPHIER_RESETX(17, 0x200c, 13), /* USB30-PHY1 */ |
| 83 | UNIPHIER_RESETX(18, 0x200c, 14), /* USB30-PHY2 */ |
| 84 | UNIPHIER_RESETX(19, 0x200c, 15), /* USB30-PHY3 */ |
Kunihiko Hayashi | 2dcb469 | 2021-07-06 19:01:07 +0900 | [diff] [blame] | 85 | UNIPHIER_RESETX(24, 0x200c, 4), /* PCIE */ |
Masahiro Yamada | 2aa4b5b | 2016-10-08 13:25:31 +0900 | [diff] [blame] | 86 | UNIPHIER_RESET_END, |
| 87 | }; |
| 88 | |
Masahiro Yamada | 8eb6a1c | 2017-08-29 12:20:51 +0900 | [diff] [blame] | 89 | static const struct uniphier_reset_data uniphier_pxs3_sys_reset_data[] = { |
| 90 | UNIPHIER_RESETX(2, 0x200c, 0), /* NAND */ |
| 91 | UNIPHIER_RESETX(4, 0x200c, 2), /* eMMC */ |
Kunihiko Hayashi | 6cce837 | 2018-04-18 10:06:07 +0900 | [diff] [blame] | 92 | UNIPHIER_RESETX(6, 0x200c, 9), /* ETHER0 */ |
| 93 | UNIPHIER_RESETX(7, 0x200c, 10), /* ETHER1 */ |
Masahiro Yamada | 8eb6a1c | 2017-08-29 12:20:51 +0900 | [diff] [blame] | 94 | UNIPHIER_RESETX(8, 0x200c, 12), /* STDMAC */ |
Masahiro Yamada | 096c466 | 2018-06-19 16:11:43 +0900 | [diff] [blame] | 95 | UNIPHIER_RESETX(12, 0x200c, 4), /* USB30 link */ |
| 96 | UNIPHIER_RESETX(13, 0x200c, 5), /* USB31 link */ |
| 97 | UNIPHIER_RESETX(16, 0x200c, 16), /* USB30-PHY0 */ |
| 98 | UNIPHIER_RESETX(17, 0x200c, 18), /* USB30-PHY1 */ |
| 99 | UNIPHIER_RESETX(18, 0x200c, 20), /* USB30-PHY2 */ |
| 100 | UNIPHIER_RESETX(20, 0x200c, 17), /* USB31-PHY0 */ |
| 101 | UNIPHIER_RESETX(21, 0x200c, 19), /* USB31-PHY1 */ |
Kunihiko Hayashi | 2dcb469 | 2021-07-06 19:01:07 +0900 | [diff] [blame] | 102 | UNIPHIER_RESETX(24, 0x200c, 3), /* PCIE */ |
Masahiro Yamada | 8eb6a1c | 2017-08-29 12:20:51 +0900 | [diff] [blame] | 103 | UNIPHIER_RESET_END, |
| 104 | }; |
| 105 | |
Masahiro Yamada | 2aa4b5b | 2016-10-08 13:25:31 +0900 | [diff] [blame] | 106 | /* Media I/O reset data */ |
| 107 | #define UNIPHIER_MIO_RESET_SD(id, ch) \ |
| 108 | UNIPHIER_RESETX((id), 0x110 + 0x200 * (ch), 0) |
| 109 | |
| 110 | #define UNIPHIER_MIO_RESET_SD_BRIDGE(id, ch) \ |
| 111 | UNIPHIER_RESETX((id), 0x110 + 0x200 * (ch), 26) |
| 112 | |
| 113 | #define UNIPHIER_MIO_RESET_EMMC_HW_RESET(id, ch) \ |
| 114 | UNIPHIER_RESETX((id), 0x80 + 0x200 * (ch), 0) |
| 115 | |
| 116 | #define UNIPHIER_MIO_RESET_USB2(id, ch) \ |
| 117 | UNIPHIER_RESETX((id), 0x114 + 0x200 * (ch), 0) |
| 118 | |
| 119 | #define UNIPHIER_MIO_RESET_USB2_BRIDGE(id, ch) \ |
| 120 | UNIPHIER_RESETX((id), 0x110 + 0x200 * (ch), 24) |
| 121 | |
| 122 | #define UNIPHIER_MIO_RESET_DMAC(id) \ |
| 123 | UNIPHIER_RESETX((id), 0x110, 17) |
| 124 | |
Masahiro Yamada | 5e05c4d | 2017-06-22 16:42:04 +0900 | [diff] [blame] | 125 | static const struct uniphier_reset_data uniphier_mio_reset_data[] = { |
Masahiro Yamada | 2aa4b5b | 2016-10-08 13:25:31 +0900 | [diff] [blame] | 126 | UNIPHIER_MIO_RESET_SD(0, 0), |
| 127 | UNIPHIER_MIO_RESET_SD(1, 1), |
| 128 | UNIPHIER_MIO_RESET_SD(2, 2), |
| 129 | UNIPHIER_MIO_RESET_SD_BRIDGE(3, 0), |
| 130 | UNIPHIER_MIO_RESET_SD_BRIDGE(4, 1), |
| 131 | UNIPHIER_MIO_RESET_SD_BRIDGE(5, 2), |
| 132 | UNIPHIER_MIO_RESET_EMMC_HW_RESET(6, 1), |
| 133 | UNIPHIER_MIO_RESET_DMAC(7), |
| 134 | UNIPHIER_MIO_RESET_USB2(8, 0), |
| 135 | UNIPHIER_MIO_RESET_USB2(9, 1), |
| 136 | UNIPHIER_MIO_RESET_USB2(10, 2), |
| 137 | UNIPHIER_MIO_RESET_USB2(11, 3), |
| 138 | UNIPHIER_MIO_RESET_USB2_BRIDGE(12, 0), |
| 139 | UNIPHIER_MIO_RESET_USB2_BRIDGE(13, 1), |
| 140 | UNIPHIER_MIO_RESET_USB2_BRIDGE(14, 2), |
| 141 | UNIPHIER_MIO_RESET_USB2_BRIDGE(15, 3), |
| 142 | UNIPHIER_RESET_END, |
| 143 | }; |
| 144 | |
| 145 | /* Peripheral reset data */ |
| 146 | #define UNIPHIER_PERI_RESET_UART(id, ch) \ |
| 147 | UNIPHIER_RESETX((id), 0x114, 19 + (ch)) |
| 148 | |
| 149 | #define UNIPHIER_PERI_RESET_I2C(id, ch) \ |
| 150 | UNIPHIER_RESETX((id), 0x114, 5 + (ch)) |
| 151 | |
| 152 | #define UNIPHIER_PERI_RESET_FI2C(id, ch) \ |
| 153 | UNIPHIER_RESETX((id), 0x114, 24 + (ch)) |
| 154 | |
Masahiro Yamada | 5e05c4d | 2017-06-22 16:42:04 +0900 | [diff] [blame] | 155 | static const struct uniphier_reset_data uniphier_ld4_peri_reset_data[] = { |
Masahiro Yamada | 2aa4b5b | 2016-10-08 13:25:31 +0900 | [diff] [blame] | 156 | UNIPHIER_PERI_RESET_UART(0, 0), |
| 157 | UNIPHIER_PERI_RESET_UART(1, 1), |
| 158 | UNIPHIER_PERI_RESET_UART(2, 2), |
| 159 | UNIPHIER_PERI_RESET_UART(3, 3), |
| 160 | UNIPHIER_PERI_RESET_I2C(4, 0), |
| 161 | UNIPHIER_PERI_RESET_I2C(5, 1), |
| 162 | UNIPHIER_PERI_RESET_I2C(6, 2), |
| 163 | UNIPHIER_PERI_RESET_I2C(7, 3), |
| 164 | UNIPHIER_PERI_RESET_I2C(8, 4), |
| 165 | UNIPHIER_RESET_END, |
| 166 | }; |
| 167 | |
Masahiro Yamada | 5e05c4d | 2017-06-22 16:42:04 +0900 | [diff] [blame] | 168 | static const struct uniphier_reset_data uniphier_pro4_peri_reset_data[] = { |
Masahiro Yamada | 2aa4b5b | 2016-10-08 13:25:31 +0900 | [diff] [blame] | 169 | UNIPHIER_PERI_RESET_UART(0, 0), |
| 170 | UNIPHIER_PERI_RESET_UART(1, 1), |
| 171 | UNIPHIER_PERI_RESET_UART(2, 2), |
| 172 | UNIPHIER_PERI_RESET_UART(3, 3), |
| 173 | UNIPHIER_PERI_RESET_FI2C(4, 0), |
| 174 | UNIPHIER_PERI_RESET_FI2C(5, 1), |
| 175 | UNIPHIER_PERI_RESET_FI2C(6, 2), |
| 176 | UNIPHIER_PERI_RESET_FI2C(7, 3), |
| 177 | UNIPHIER_PERI_RESET_FI2C(8, 4), |
| 178 | UNIPHIER_PERI_RESET_FI2C(9, 5), |
| 179 | UNIPHIER_PERI_RESET_FI2C(10, 6), |
| 180 | UNIPHIER_RESET_END, |
| 181 | }; |
| 182 | |
Kunihiko Hayashi | 91e7fd3 | 2023-02-20 14:50:30 +0900 | [diff] [blame] | 183 | /* Glue reset data */ |
| 184 | static const struct uniphier_reset_data uniphier_pro4_usb3_reset_data[] = { |
| 185 | UNIPHIER_RESETX(15, 0, 15) |
| 186 | }; |
| 187 | |
Masahiro Yamada | 2aa4b5b | 2016-10-08 13:25:31 +0900 | [diff] [blame] | 188 | /* core implementaton */ |
| 189 | struct uniphier_reset_priv { |
| 190 | void __iomem *base; |
| 191 | const struct uniphier_reset_data *data; |
Kunihiko Hayashi | 91e7fd3 | 2023-02-20 14:50:30 +0900 | [diff] [blame] | 192 | struct clk_bulk clks; |
| 193 | struct reset_ctl_bulk rsts; |
Masahiro Yamada | 2aa4b5b | 2016-10-08 13:25:31 +0900 | [diff] [blame] | 194 | }; |
| 195 | |
Masahiro Yamada | 2aa4b5b | 2016-10-08 13:25:31 +0900 | [diff] [blame] | 196 | static int uniphier_reset_update(struct reset_ctl *reset_ctl, int assert) |
| 197 | { |
| 198 | struct uniphier_reset_priv *priv = dev_get_priv(reset_ctl->dev); |
| 199 | unsigned long id = reset_ctl->id; |
| 200 | const struct uniphier_reset_data *p; |
| 201 | |
| 202 | for (p = priv->data; p->id != UNIPHIER_RESET_ID_END; p++) { |
| 203 | u32 mask, val; |
| 204 | |
| 205 | if (p->id != id) |
| 206 | continue; |
| 207 | |
| 208 | val = readl(priv->base + p->reg); |
| 209 | |
| 210 | if (p->flags & UNIPHIER_RESET_ACTIVE_LOW) |
| 211 | assert = !assert; |
| 212 | |
| 213 | mask = BIT(p->bit); |
| 214 | |
| 215 | if (assert) |
| 216 | val |= mask; |
| 217 | else |
| 218 | val &= ~mask; |
| 219 | |
| 220 | writel(val, priv->base + p->reg); |
| 221 | |
| 222 | return 0; |
| 223 | } |
| 224 | |
Masahiro Yamada | 63f42e3 | 2017-10-13 19:22:02 +0900 | [diff] [blame] | 225 | dev_err(reset_ctl->dev, "reset_id=%lu was not handled\n", id); |
| 226 | |
Masahiro Yamada | 2aa4b5b | 2016-10-08 13:25:31 +0900 | [diff] [blame] | 227 | return -EINVAL; |
| 228 | } |
| 229 | |
| 230 | static int uniphier_reset_assert(struct reset_ctl *reset_ctl) |
| 231 | { |
| 232 | return uniphier_reset_update(reset_ctl, 1); |
| 233 | } |
| 234 | |
| 235 | static int uniphier_reset_deassert(struct reset_ctl *reset_ctl) |
| 236 | { |
| 237 | return uniphier_reset_update(reset_ctl, 0); |
| 238 | } |
| 239 | |
| 240 | static const struct reset_ops uniphier_reset_ops = { |
Masahiro Yamada | 2aa4b5b | 2016-10-08 13:25:31 +0900 | [diff] [blame] | 241 | .rst_assert = uniphier_reset_assert, |
| 242 | .rst_deassert = uniphier_reset_deassert, |
| 243 | }; |
| 244 | |
Kunihiko Hayashi | 91e7fd3 | 2023-02-20 14:50:30 +0900 | [diff] [blame] | 245 | static int uniphier_reset_rst_init(struct udevice *dev) |
| 246 | { |
| 247 | struct uniphier_reset_priv *priv = dev_get_priv(dev); |
| 248 | int ret; |
| 249 | |
| 250 | ret = reset_get_bulk(dev, &priv->rsts); |
| 251 | if (ret == -ENOSYS || ret == -ENOENT) |
| 252 | return 0; |
| 253 | else if (ret) |
| 254 | return ret; |
| 255 | |
| 256 | ret = reset_deassert_bulk(&priv->rsts); |
| 257 | if (ret) |
| 258 | reset_release_bulk(&priv->rsts); |
| 259 | |
| 260 | return ret; |
| 261 | } |
| 262 | |
| 263 | static int uniphier_reset_clk_init(struct udevice *dev) |
| 264 | { |
| 265 | struct uniphier_reset_priv *priv = dev_get_priv(dev); |
| 266 | int ret; |
| 267 | |
| 268 | ret = clk_get_bulk(dev, &priv->clks); |
| 269 | if (ret == -ENOSYS || ret == -ENOENT) |
| 270 | return 0; |
| 271 | if (ret) |
| 272 | return ret; |
| 273 | |
| 274 | ret = clk_enable_bulk(&priv->clks); |
| 275 | if (ret) |
| 276 | clk_release_bulk(&priv->clks); |
| 277 | |
| 278 | return ret; |
| 279 | } |
| 280 | |
Masahiro Yamada | 2aa4b5b | 2016-10-08 13:25:31 +0900 | [diff] [blame] | 281 | static int uniphier_reset_probe(struct udevice *dev) |
| 282 | { |
| 283 | struct uniphier_reset_priv *priv = dev_get_priv(dev); |
| 284 | fdt_addr_t addr; |
Kunihiko Hayashi | 91e7fd3 | 2023-02-20 14:50:30 +0900 | [diff] [blame] | 285 | int ret; |
Masahiro Yamada | 2aa4b5b | 2016-10-08 13:25:31 +0900 | [diff] [blame] | 286 | |
Masahiro Yamada | a89b4de | 2020-07-17 14:36:48 +0900 | [diff] [blame] | 287 | addr = dev_read_addr(dev->parent); |
Masahiro Yamada | 2aa4b5b | 2016-10-08 13:25:31 +0900 | [diff] [blame] | 288 | if (addr == FDT_ADDR_T_NONE) |
| 289 | return -EINVAL; |
| 290 | |
| 291 | priv->base = devm_ioremap(dev, addr, SZ_4K); |
| 292 | if (!priv->base) |
| 293 | return -ENOMEM; |
| 294 | |
| 295 | priv->data = (void *)dev_get_driver_data(dev); |
| 296 | |
Kunihiko Hayashi | 91e7fd3 | 2023-02-20 14:50:30 +0900 | [diff] [blame] | 297 | ret = uniphier_reset_clk_init(dev); |
| 298 | if (ret) |
| 299 | return ret; |
| 300 | |
| 301 | return uniphier_reset_rst_init(dev); |
Masahiro Yamada | 2aa4b5b | 2016-10-08 13:25:31 +0900 | [diff] [blame] | 302 | } |
| 303 | |
| 304 | static const struct udevice_id uniphier_reset_match[] = { |
| 305 | /* System reset */ |
| 306 | { |
Masahiro Yamada | 2aa4b5b | 2016-10-08 13:25:31 +0900 | [diff] [blame] | 307 | .compatible = "socionext,uniphier-ld4-reset", |
Masahiro Yamada | 0eb2cec | 2017-08-13 09:01:16 +0900 | [diff] [blame] | 308 | .data = (ulong)uniphier_pro4_sys_reset_data, |
Masahiro Yamada | 2aa4b5b | 2016-10-08 13:25:31 +0900 | [diff] [blame] | 309 | }, |
| 310 | { |
| 311 | .compatible = "socionext,uniphier-pro4-reset", |
| 312 | .data = (ulong)uniphier_pro4_sys_reset_data, |
| 313 | }, |
| 314 | { |
| 315 | .compatible = "socionext,uniphier-sld8-reset", |
Masahiro Yamada | 0eb2cec | 2017-08-13 09:01:16 +0900 | [diff] [blame] | 316 | .data = (ulong)uniphier_pro4_sys_reset_data, |
Masahiro Yamada | 2aa4b5b | 2016-10-08 13:25:31 +0900 | [diff] [blame] | 317 | }, |
| 318 | { |
| 319 | .compatible = "socionext,uniphier-pro5-reset", |
Masahiro Yamada | 0eb2cec | 2017-08-13 09:01:16 +0900 | [diff] [blame] | 320 | .data = (ulong)uniphier_pro4_sys_reset_data, |
Masahiro Yamada | 2aa4b5b | 2016-10-08 13:25:31 +0900 | [diff] [blame] | 321 | }, |
| 322 | { |
| 323 | .compatible = "socionext,uniphier-pxs2-reset", |
| 324 | .data = (ulong)uniphier_pxs2_sys_reset_data, |
| 325 | }, |
| 326 | { |
| 327 | .compatible = "socionext,uniphier-ld11-reset", |
Masahiro Yamada | 0eb2cec | 2017-08-13 09:01:16 +0900 | [diff] [blame] | 328 | .data = (ulong)uniphier_ld20_sys_reset_data, |
Masahiro Yamada | 2aa4b5b | 2016-10-08 13:25:31 +0900 | [diff] [blame] | 329 | }, |
| 330 | { |
| 331 | .compatible = "socionext,uniphier-ld20-reset", |
| 332 | .data = (ulong)uniphier_ld20_sys_reset_data, |
| 333 | }, |
Masahiro Yamada | 8eb6a1c | 2017-08-29 12:20:51 +0900 | [diff] [blame] | 334 | { |
| 335 | .compatible = "socionext,uniphier-pxs3-reset", |
| 336 | .data = (ulong)uniphier_pxs3_sys_reset_data, |
| 337 | }, |
Masahiro Yamada | 2aa4b5b | 2016-10-08 13:25:31 +0900 | [diff] [blame] | 338 | /* Media I/O reset */ |
| 339 | { |
Masahiro Yamada | 2aa4b5b | 2016-10-08 13:25:31 +0900 | [diff] [blame] | 340 | .compatible = "socionext,uniphier-ld4-mio-reset", |
| 341 | .data = (ulong)uniphier_mio_reset_data, |
| 342 | }, |
| 343 | { |
| 344 | .compatible = "socionext,uniphier-pro4-mio-reset", |
| 345 | .data = (ulong)uniphier_mio_reset_data, |
| 346 | }, |
| 347 | { |
| 348 | .compatible = "socionext,uniphier-sld8-mio-reset", |
| 349 | .data = (ulong)uniphier_mio_reset_data, |
| 350 | }, |
| 351 | { |
| 352 | .compatible = "socionext,uniphier-pro5-mio-reset", |
| 353 | .data = (ulong)uniphier_mio_reset_data, |
| 354 | }, |
| 355 | { |
| 356 | .compatible = "socionext,uniphier-pxs2-mio-reset", |
| 357 | .data = (ulong)uniphier_mio_reset_data, |
| 358 | }, |
| 359 | { |
| 360 | .compatible = "socionext,uniphier-ld11-mio-reset", |
| 361 | .data = (ulong)uniphier_mio_reset_data, |
| 362 | }, |
| 363 | { |
Masahiro Yamada | 68199a2 | 2017-08-29 12:20:50 +0900 | [diff] [blame] | 364 | .compatible = "socionext,uniphier-ld11-sd-reset", |
| 365 | .data = (ulong)uniphier_mio_reset_data, |
| 366 | }, |
| 367 | { |
| 368 | .compatible = "socionext,uniphier-ld20-sd-reset", |
Masahiro Yamada | 2aa4b5b | 2016-10-08 13:25:31 +0900 | [diff] [blame] | 369 | .data = (ulong)uniphier_mio_reset_data, |
| 370 | }, |
Masahiro Yamada | 8eb6a1c | 2017-08-29 12:20:51 +0900 | [diff] [blame] | 371 | { |
| 372 | .compatible = "socionext,uniphier-pxs3-sd-reset", |
| 373 | .data = (ulong)uniphier_mio_reset_data, |
| 374 | }, |
Masahiro Yamada | 2aa4b5b | 2016-10-08 13:25:31 +0900 | [diff] [blame] | 375 | /* Peripheral reset */ |
| 376 | { |
| 377 | .compatible = "socionext,uniphier-ld4-peri-reset", |
| 378 | .data = (ulong)uniphier_ld4_peri_reset_data, |
| 379 | }, |
| 380 | { |
| 381 | .compatible = "socionext,uniphier-pro4-peri-reset", |
| 382 | .data = (ulong)uniphier_pro4_peri_reset_data, |
| 383 | }, |
| 384 | { |
| 385 | .compatible = "socionext,uniphier-sld8-peri-reset", |
| 386 | .data = (ulong)uniphier_ld4_peri_reset_data, |
| 387 | }, |
| 388 | { |
| 389 | .compatible = "socionext,uniphier-pro5-peri-reset", |
| 390 | .data = (ulong)uniphier_pro4_peri_reset_data, |
| 391 | }, |
| 392 | { |
| 393 | .compatible = "socionext,uniphier-pxs2-peri-reset", |
| 394 | .data = (ulong)uniphier_pro4_peri_reset_data, |
| 395 | }, |
| 396 | { |
| 397 | .compatible = "socionext,uniphier-ld11-peri-reset", |
| 398 | .data = (ulong)uniphier_pro4_peri_reset_data, |
| 399 | }, |
| 400 | { |
| 401 | .compatible = "socionext,uniphier-ld20-peri-reset", |
| 402 | .data = (ulong)uniphier_pro4_peri_reset_data, |
| 403 | }, |
Masahiro Yamada | 8eb6a1c | 2017-08-29 12:20:51 +0900 | [diff] [blame] | 404 | { |
| 405 | .compatible = "socionext,uniphier-pxs3-peri-reset", |
| 406 | .data = (ulong)uniphier_pro4_peri_reset_data, |
| 407 | }, |
Kunihiko Hayashi | 91e7fd3 | 2023-02-20 14:50:30 +0900 | [diff] [blame] | 408 | /* USB glue reset */ |
| 409 | { |
| 410 | .compatible = "socionext,uniphier-pro4-usb3-reset", |
| 411 | .data = (ulong)uniphier_pro4_usb3_reset_data, |
| 412 | }, |
| 413 | { |
| 414 | .compatible = "socionext,uniphier-pro5-usb3-reset", |
| 415 | .data = (ulong)uniphier_pro4_usb3_reset_data, |
| 416 | }, |
| 417 | { |
| 418 | .compatible = "socionext,uniphier-pxs2-usb3-reset", |
| 419 | .data = (ulong)uniphier_pro4_usb3_reset_data, |
| 420 | }, |
| 421 | { |
| 422 | .compatible = "socionext,uniphier-ld20-usb3-reset", |
| 423 | .data = (ulong)uniphier_pro4_usb3_reset_data, |
| 424 | }, |
| 425 | { |
| 426 | .compatible = "socionext,uniphier-pxs3-usb3-reset", |
| 427 | .data = (ulong)uniphier_pro4_usb3_reset_data, |
| 428 | }, |
| 429 | { |
| 430 | .compatible = "socionext,uniphier-nx1-usb3-reset", |
| 431 | .data = (ulong)uniphier_pro4_usb3_reset_data, |
| 432 | }, |
Masahiro Yamada | 2aa4b5b | 2016-10-08 13:25:31 +0900 | [diff] [blame] | 433 | { /* sentinel */ } |
| 434 | }; |
| 435 | |
| 436 | U_BOOT_DRIVER(uniphier_reset) = { |
| 437 | .name = "uniphier-reset", |
| 438 | .id = UCLASS_RESET, |
| 439 | .of_match = uniphier_reset_match, |
| 440 | .probe = uniphier_reset_probe, |
Simon Glass | 8a2b47f | 2020-12-03 16:55:17 -0700 | [diff] [blame] | 441 | .priv_auto = sizeof(struct uniphier_reset_priv), |
Masahiro Yamada | 2aa4b5b | 2016-10-08 13:25:31 +0900 | [diff] [blame] | 442 | .ops = &uniphier_reset_ops, |
| 443 | }; |