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