Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 2 | /* |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 3 | * Copyright (C) 2016-2017 Socionext Inc. |
Masahiro Yamada | fa1f73f | 2016-07-19 21:56:13 +0900 | [diff] [blame] | 4 | * Author: Masahiro Yamada <yamada.masahiro@socionext.com> |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <common.h> |
Masahiro Yamada | 8bdfe0a | 2016-10-17 22:18:01 +0900 | [diff] [blame] | 8 | #include <clk-uclass.h> |
Simon Glass | 11c89f3 | 2017-05-17 17:18:03 -0600 | [diff] [blame] | 9 | #include <dm.h> |
Simon Glass | 9bc1564 | 2020-02-03 07:36:16 -0700 | [diff] [blame] | 10 | #include <dm/device_compat.h> |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 11 | #include <linux/bitops.h> |
Simon Glass | c06c1be | 2020-05-10 11:40:08 -0600 | [diff] [blame] | 12 | #include <linux/bug.h> |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 13 | #include <linux/io.h> |
Masahiro Yamada | 46a624f | 2016-03-24 22:32:39 +0900 | [diff] [blame] | 14 | #include <linux/sizes.h> |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 15 | |
| 16 | #include "clk-uniphier.h" |
| 17 | |
Masahiro Yamada | f18559e | 2016-09-22 07:42:21 +0900 | [diff] [blame] | 18 | /** |
| 19 | * struct uniphier_clk_priv - private data for UniPhier clock driver |
| 20 | * |
| 21 | * @base: base address of the clock provider |
Masahiro Yamada | 8bdfe0a | 2016-10-17 22:18:01 +0900 | [diff] [blame] | 22 | * @data: SoC specific data |
Masahiro Yamada | f18559e | 2016-09-22 07:42:21 +0900 | [diff] [blame] | 23 | */ |
| 24 | struct uniphier_clk_priv { |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 25 | struct udevice *dev; |
Masahiro Yamada | f18559e | 2016-09-22 07:42:21 +0900 | [diff] [blame] | 26 | void __iomem *base; |
Masahiro Yamada | 8bdfe0a | 2016-10-17 22:18:01 +0900 | [diff] [blame] | 27 | const struct uniphier_clk_data *data; |
Masahiro Yamada | f18559e | 2016-09-22 07:42:21 +0900 | [diff] [blame] | 28 | }; |
| 29 | |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 30 | static void uniphier_clk_gate_enable(struct uniphier_clk_priv *priv, |
| 31 | const struct uniphier_clk_gate_data *gate) |
Masahiro Yamada | f18559e | 2016-09-22 07:42:21 +0900 | [diff] [blame] | 32 | { |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 33 | u32 val; |
Masahiro Yamada | f18559e | 2016-09-22 07:42:21 +0900 | [diff] [blame] | 34 | |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 35 | val = readl(priv->base + gate->reg); |
| 36 | val |= BIT(gate->bit); |
| 37 | writel(val, priv->base + gate->reg); |
| 38 | } |
Masahiro Yamada | f18559e | 2016-09-22 07:42:21 +0900 | [diff] [blame] | 39 | |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 40 | static void uniphier_clk_mux_set_parent(struct uniphier_clk_priv *priv, |
| 41 | const struct uniphier_clk_mux_data *mux, |
| 42 | u8 id) |
| 43 | { |
| 44 | u32 val; |
| 45 | int i; |
Masahiro Yamada | f18559e | 2016-09-22 07:42:21 +0900 | [diff] [blame] | 46 | |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 47 | for (i = 0; i < mux->num_parents; i++) { |
| 48 | if (mux->parent_ids[i] != id) |
| 49 | continue; |
Masahiro Yamada | f18559e | 2016-09-22 07:42:21 +0900 | [diff] [blame] | 50 | |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 51 | val = readl(priv->base + mux->reg); |
| 52 | val &= ~mux->masks[i]; |
| 53 | val |= mux->vals[i]; |
| 54 | writel(val, priv->base + mux->reg); |
| 55 | return; |
Masahiro Yamada | 8bdfe0a | 2016-10-17 22:18:01 +0900 | [diff] [blame] | 56 | } |
| 57 | |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 58 | WARN_ON(1); |
Masahiro Yamada | f18559e | 2016-09-22 07:42:21 +0900 | [diff] [blame] | 59 | } |
| 60 | |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 61 | static u8 uniphier_clk_mux_get_parent(struct uniphier_clk_priv *priv, |
| 62 | const struct uniphier_clk_mux_data *mux) |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 63 | { |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 64 | u32 val; |
| 65 | int i; |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 66 | |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 67 | val = readl(priv->base + mux->reg); |
| 68 | |
| 69 | for (i = 0; i < mux->num_parents; i++) |
| 70 | if ((mux->masks[i] & val) == mux->vals[i]) |
| 71 | return mux->parent_ids[i]; |
| 72 | |
| 73 | dev_err(priv->dev, "invalid mux setting\n"); |
| 74 | |
| 75 | return UNIPHIER_CLK_ID_INVALID; |
| 76 | } |
| 77 | |
| 78 | static const struct uniphier_clk_data *uniphier_clk_get_data( |
| 79 | struct uniphier_clk_priv *priv, u8 id) |
| 80 | { |
| 81 | const struct uniphier_clk_data *data; |
| 82 | |
| 83 | for (data = priv->data; data->type != UNIPHIER_CLK_TYPE_END; data++) |
| 84 | if (data->id == id) |
| 85 | return data; |
| 86 | |
| 87 | dev_err(priv->dev, "id=%u not found\n", id); |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 88 | |
Masahiro Yamada | 8bdfe0a | 2016-10-17 22:18:01 +0900 | [diff] [blame] | 89 | return NULL; |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 90 | } |
| 91 | |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 92 | static const struct uniphier_clk_data *uniphier_clk_get_parent_data( |
| 93 | struct uniphier_clk_priv *priv, |
| 94 | const struct uniphier_clk_data *data) |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 95 | { |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 96 | const struct uniphier_clk_data *parent_data; |
| 97 | u8 parent_id = UNIPHIER_CLK_ID_INVALID; |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 98 | |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 99 | switch (data->type) { |
| 100 | case UNIPHIER_CLK_TYPE_GATE: |
| 101 | parent_id = data->data.gate.parent_id; |
| 102 | break; |
| 103 | case UNIPHIER_CLK_TYPE_MUX: |
| 104 | parent_id = uniphier_clk_mux_get_parent(priv, &data->data.mux); |
| 105 | break; |
| 106 | default: |
| 107 | break; |
| 108 | } |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 109 | |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 110 | if (parent_id == UNIPHIER_CLK_ID_INVALID) |
| 111 | return NULL; |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 112 | |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 113 | parent_data = uniphier_clk_get_data(priv, parent_id); |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 114 | |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 115 | WARN_ON(!parent_data); |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 116 | |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 117 | return parent_data; |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 118 | } |
| 119 | |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 120 | static void __uniphier_clk_enable(struct uniphier_clk_priv *priv, |
| 121 | const struct uniphier_clk_data *data) |
| 122 | { |
| 123 | const struct uniphier_clk_data *parent_data; |
| 124 | |
| 125 | if (data->type == UNIPHIER_CLK_TYPE_GATE) |
| 126 | uniphier_clk_gate_enable(priv, &data->data.gate); |
| 127 | |
| 128 | parent_data = uniphier_clk_get_parent_data(priv, data); |
| 129 | if (!parent_data) |
| 130 | return; |
| 131 | |
| 132 | return __uniphier_clk_enable(priv, parent_data); |
| 133 | } |
| 134 | |
| 135 | static int uniphier_clk_enable(struct clk *clk) |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 136 | { |
Stephen Warren | a962243 | 2016-06-17 09:44:00 -0600 | [diff] [blame] | 137 | struct uniphier_clk_priv *priv = dev_get_priv(clk->dev); |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 138 | const struct uniphier_clk_data *data; |
| 139 | |
| 140 | data = uniphier_clk_get_data(priv, clk->id); |
| 141 | if (!data) |
| 142 | return -ENODEV; |
| 143 | |
| 144 | __uniphier_clk_enable(priv, data); |
| 145 | |
| 146 | return 0; |
| 147 | } |
| 148 | |
| 149 | static unsigned long __uniphier_clk_get_rate( |
| 150 | struct uniphier_clk_priv *priv, |
| 151 | const struct uniphier_clk_data *data) |
| 152 | { |
| 153 | const struct uniphier_clk_data *parent_data; |
| 154 | |
| 155 | if (data->type == UNIPHIER_CLK_TYPE_FIXED_RATE) |
| 156 | return data->data.rate.fixed_rate; |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 157 | |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 158 | parent_data = uniphier_clk_get_parent_data(priv, data); |
| 159 | if (!parent_data) |
Masahiro Yamada | 8bdfe0a | 2016-10-17 22:18:01 +0900 | [diff] [blame] | 160 | return 0; |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 161 | |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 162 | return __uniphier_clk_get_rate(priv, parent_data); |
| 163 | } |
| 164 | |
| 165 | static unsigned long uniphier_clk_get_rate(struct clk *clk) |
| 166 | { |
| 167 | struct uniphier_clk_priv *priv = dev_get_priv(clk->dev); |
| 168 | const struct uniphier_clk_data *data; |
| 169 | |
| 170 | data = uniphier_clk_get_data(priv, clk->id); |
| 171 | if (!data) |
| 172 | return -ENODEV; |
| 173 | |
| 174 | return __uniphier_clk_get_rate(priv, data); |
| 175 | } |
| 176 | |
| 177 | static unsigned long __uniphier_clk_set_rate( |
| 178 | struct uniphier_clk_priv *priv, |
| 179 | const struct uniphier_clk_data *data, |
| 180 | unsigned long rate, bool set) |
| 181 | { |
| 182 | const struct uniphier_clk_data *best_parent_data = NULL; |
| 183 | const struct uniphier_clk_data *parent_data; |
| 184 | unsigned long best_rate = 0; |
| 185 | unsigned long parent_rate; |
| 186 | u8 parent_id; |
| 187 | int i; |
| 188 | |
| 189 | if (data->type == UNIPHIER_CLK_TYPE_FIXED_RATE) |
| 190 | return data->data.rate.fixed_rate; |
| 191 | |
| 192 | if (data->type == UNIPHIER_CLK_TYPE_GATE) { |
| 193 | parent_data = uniphier_clk_get_parent_data(priv, data); |
| 194 | if (!parent_data) |
| 195 | return 0; |
| 196 | |
| 197 | return __uniphier_clk_set_rate(priv, parent_data, rate, set); |
| 198 | } |
| 199 | |
| 200 | if (WARN_ON(data->type != UNIPHIER_CLK_TYPE_MUX)) |
| 201 | return -EINVAL; |
| 202 | |
| 203 | for (i = 0; i < data->data.mux.num_parents; i++) { |
| 204 | parent_id = data->data.mux.parent_ids[i]; |
| 205 | parent_data = uniphier_clk_get_data(priv, parent_id); |
| 206 | if (WARN_ON(!parent_data)) |
| 207 | return -EINVAL; |
| 208 | |
| 209 | parent_rate = __uniphier_clk_set_rate(priv, parent_data, rate, |
| 210 | false); |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 211 | |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 212 | if (parent_rate <= rate && best_rate < parent_rate) { |
| 213 | best_rate = parent_rate; |
| 214 | best_parent_data = parent_data; |
Masahiro Yamada | 8bdfe0a | 2016-10-17 22:18:01 +0900 | [diff] [blame] | 215 | } |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 216 | } |
| 217 | |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 218 | dev_dbg(priv->dev, "id=%u, best_rate=%lu\n", data->id, best_rate); |
| 219 | |
| 220 | if (!best_parent_data) |
Masahiro Yamada | 8bdfe0a | 2016-10-17 22:18:01 +0900 | [diff] [blame] | 221 | return -EINVAL; |
| 222 | |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 223 | if (!set) |
| 224 | return best_rate; |
| 225 | |
| 226 | uniphier_clk_mux_set_parent(priv, &data->data.mux, |
| 227 | best_parent_data->id); |
| 228 | |
| 229 | return best_rate = __uniphier_clk_set_rate(priv, best_parent_data, |
| 230 | rate, true); |
| 231 | } |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 232 | |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 233 | static unsigned long uniphier_clk_set_rate(struct clk *clk, ulong rate) |
| 234 | { |
| 235 | struct uniphier_clk_priv *priv = dev_get_priv(clk->dev); |
| 236 | const struct uniphier_clk_data *data; |
| 237 | |
| 238 | data = uniphier_clk_get_data(priv, clk->id); |
| 239 | if (!data) |
| 240 | return -ENODEV; |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 241 | |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 242 | return __uniphier_clk_set_rate(priv, data, rate, true); |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 243 | } |
| 244 | |
Masahiro Yamada | 5e05c4d | 2017-06-22 16:42:04 +0900 | [diff] [blame] | 245 | static const struct clk_ops uniphier_clk_ops = { |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 246 | .enable = uniphier_clk_enable, |
Stephen Warren | a962243 | 2016-06-17 09:44:00 -0600 | [diff] [blame] | 247 | .get_rate = uniphier_clk_get_rate, |
| 248 | .set_rate = uniphier_clk_set_rate, |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 249 | }; |
| 250 | |
Masahiro Yamada | 8bdfe0a | 2016-10-17 22:18:01 +0900 | [diff] [blame] | 251 | static int uniphier_clk_probe(struct udevice *dev) |
| 252 | { |
| 253 | struct uniphier_clk_priv *priv = dev_get_priv(dev); |
| 254 | fdt_addr_t addr; |
| 255 | |
Masahiro Yamada | a89b4de | 2020-07-17 14:36:48 +0900 | [diff] [blame] | 256 | addr = dev_read_addr(dev->parent); |
Masahiro Yamada | 8bdfe0a | 2016-10-17 22:18:01 +0900 | [diff] [blame] | 257 | if (addr == FDT_ADDR_T_NONE) |
| 258 | return -EINVAL; |
| 259 | |
| 260 | priv->base = devm_ioremap(dev, addr, SZ_4K); |
| 261 | if (!priv->base) |
| 262 | return -ENOMEM; |
| 263 | |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 264 | priv->dev = dev; |
Masahiro Yamada | 8bdfe0a | 2016-10-17 22:18:01 +0900 | [diff] [blame] | 265 | priv->data = (void *)dev_get_driver_data(dev); |
| 266 | |
| 267 | return 0; |
| 268 | } |
| 269 | |
Masahiro Yamada | f18559e | 2016-09-22 07:42:21 +0900 | [diff] [blame] | 270 | static const struct udevice_id uniphier_clk_match[] = { |
Masahiro Yamada | 644f5bf | 2017-08-29 01:06:15 +0900 | [diff] [blame] | 271 | /* System clock */ |
| 272 | { |
| 273 | .compatible = "socionext,uniphier-ld4-clock", |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 274 | .data = (ulong)uniphier_pxs2_sys_clk_data, |
Masahiro Yamada | 644f5bf | 2017-08-29 01:06:15 +0900 | [diff] [blame] | 275 | }, |
| 276 | { |
| 277 | .compatible = "socionext,uniphier-pro4-clock", |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 278 | .data = (ulong)uniphier_pxs2_sys_clk_data, |
Masahiro Yamada | 644f5bf | 2017-08-29 01:06:15 +0900 | [diff] [blame] | 279 | }, |
| 280 | { |
| 281 | .compatible = "socionext,uniphier-sld8-clock", |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 282 | .data = (ulong)uniphier_pxs2_sys_clk_data, |
Masahiro Yamada | 644f5bf | 2017-08-29 01:06:15 +0900 | [diff] [blame] | 283 | }, |
| 284 | { |
| 285 | .compatible = "socionext,uniphier-pro5-clock", |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 286 | .data = (ulong)uniphier_pxs2_sys_clk_data, |
Masahiro Yamada | 644f5bf | 2017-08-29 01:06:15 +0900 | [diff] [blame] | 287 | }, |
| 288 | { |
| 289 | .compatible = "socionext,uniphier-pxs2-clock", |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 290 | .data = (ulong)uniphier_pxs2_sys_clk_data, |
Masahiro Yamada | 644f5bf | 2017-08-29 01:06:15 +0900 | [diff] [blame] | 291 | }, |
| 292 | { |
| 293 | .compatible = "socionext,uniphier-ld11-clock", |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 294 | .data = (ulong)uniphier_ld20_sys_clk_data, |
Masahiro Yamada | 644f5bf | 2017-08-29 01:06:15 +0900 | [diff] [blame] | 295 | }, |
| 296 | { |
| 297 | .compatible = "socionext,uniphier-ld20-clock", |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 298 | .data = (ulong)uniphier_ld20_sys_clk_data, |
Masahiro Yamada | 644f5bf | 2017-08-29 01:06:15 +0900 | [diff] [blame] | 299 | }, |
Masahiro Yamada | 52cdec0 | 2017-10-13 19:22:00 +0900 | [diff] [blame] | 300 | { |
| 301 | .compatible = "socionext,uniphier-pxs3-clock", |
| 302 | .data = (ulong)uniphier_pxs3_sys_clk_data, |
| 303 | }, |
Masahiro Yamada | 644f5bf | 2017-08-29 01:06:15 +0900 | [diff] [blame] | 304 | /* Media I/O clock */ |
Masahiro Yamada | f18559e | 2016-09-22 07:42:21 +0900 | [diff] [blame] | 305 | { |
Masahiro Yamada | c3a29fe | 2016-09-22 07:42:22 +0900 | [diff] [blame] | 306 | .compatible = "socionext,uniphier-ld4-mio-clock", |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 307 | .data = (ulong)uniphier_mio_clk_data, |
Masahiro Yamada | f18559e | 2016-09-22 07:42:21 +0900 | [diff] [blame] | 308 | }, |
| 309 | { |
Masahiro Yamada | c3a29fe | 2016-09-22 07:42:22 +0900 | [diff] [blame] | 310 | .compatible = "socionext,uniphier-pro4-mio-clock", |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 311 | .data = (ulong)uniphier_mio_clk_data, |
Masahiro Yamada | f18559e | 2016-09-22 07:42:21 +0900 | [diff] [blame] | 312 | }, |
| 313 | { |
Masahiro Yamada | c3a29fe | 2016-09-22 07:42:22 +0900 | [diff] [blame] | 314 | .compatible = "socionext,uniphier-sld8-mio-clock", |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 315 | .data = (ulong)uniphier_mio_clk_data, |
Masahiro Yamada | f18559e | 2016-09-22 07:42:21 +0900 | [diff] [blame] | 316 | }, |
| 317 | { |
Masahiro Yamada | 9e34de5 | 2017-01-28 06:53:41 +0900 | [diff] [blame] | 318 | .compatible = "socionext,uniphier-pro5-sd-clock", |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 319 | .data = (ulong)uniphier_mio_clk_data, |
Masahiro Yamada | f18559e | 2016-09-22 07:42:21 +0900 | [diff] [blame] | 320 | }, |
| 321 | { |
Masahiro Yamada | 9e34de5 | 2017-01-28 06:53:41 +0900 | [diff] [blame] | 322 | .compatible = "socionext,uniphier-pxs2-sd-clock", |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 323 | .data = (ulong)uniphier_mio_clk_data, |
Masahiro Yamada | f18559e | 2016-09-22 07:42:21 +0900 | [diff] [blame] | 324 | }, |
| 325 | { |
Masahiro Yamada | c3a29fe | 2016-09-22 07:42:22 +0900 | [diff] [blame] | 326 | .compatible = "socionext,uniphier-ld11-mio-clock", |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 327 | .data = (ulong)uniphier_mio_clk_data, |
Masahiro Yamada | f18559e | 2016-09-22 07:42:21 +0900 | [diff] [blame] | 328 | }, |
| 329 | { |
Masahiro Yamada | 9e34de5 | 2017-01-28 06:53:41 +0900 | [diff] [blame] | 330 | .compatible = "socionext,uniphier-ld20-sd-clock", |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 331 | .data = (ulong)uniphier_mio_clk_data, |
Masahiro Yamada | f18559e | 2016-09-22 07:42:21 +0900 | [diff] [blame] | 332 | }, |
Masahiro Yamada | 52cdec0 | 2017-10-13 19:22:00 +0900 | [diff] [blame] | 333 | { |
| 334 | .compatible = "socionext,uniphier-pxs3-sd-clock", |
| 335 | .data = (ulong)uniphier_mio_clk_data, |
| 336 | }, |
Masahiro Yamada | f18559e | 2016-09-22 07:42:21 +0900 | [diff] [blame] | 337 | { /* sentinel */ } |
| 338 | }; |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 339 | |
Masahiro Yamada | f18559e | 2016-09-22 07:42:21 +0900 | [diff] [blame] | 340 | U_BOOT_DRIVER(uniphier_clk) = { |
| 341 | .name = "uniphier-clk", |
| 342 | .id = UCLASS_CLK, |
| 343 | .of_match = uniphier_clk_match, |
| 344 | .probe = uniphier_clk_probe, |
Simon Glass | 8a2b47f | 2020-12-03 16:55:17 -0700 | [diff] [blame] | 345 | .priv_auto = sizeof(struct uniphier_clk_priv), |
Masahiro Yamada | f18559e | 2016-09-22 07:42:21 +0900 | [diff] [blame] | 346 | .ops = &uniphier_clk_ops, |
| 347 | }; |