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