This source file includes following definitions.
- omap3430_clk_legacy_init
- omap3430es1_clk_legacy_init
- omap36xx_clk_legacy_init
- am35xx_clk_legacy_init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 #ifndef __LINUX_CLK_TI_H__
16 #define __LINUX_CLK_TI_H__
17
18 #include <linux/clk-provider.h>
19 #include <linux/clkdev.h>
20
21
22
23
24
25
26 struct clk_omap_reg {
27 void __iomem *ptr;
28 u16 offset;
29 u8 index;
30 u8 flags;
31 };
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81 struct dpll_data {
82 struct clk_omap_reg mult_div1_reg;
83 u32 mult_mask;
84 u32 div1_mask;
85 struct clk_hw *clk_bypass;
86 struct clk_hw *clk_ref;
87 struct clk_omap_reg control_reg;
88 u32 enable_mask;
89 unsigned long last_rounded_rate;
90 u16 last_rounded_m;
91 u8 last_rounded_m4xen;
92 u8 last_rounded_lpmode;
93 u16 max_multiplier;
94 u8 last_rounded_n;
95 u8 min_divider;
96 u16 max_divider;
97 unsigned long max_rate;
98 u8 modes;
99 struct clk_omap_reg autoidle_reg;
100 struct clk_omap_reg idlest_reg;
101 u32 autoidle_mask;
102 u32 freqsel_mask;
103 u32 idlest_mask;
104 u32 dco_mask;
105 u32 sddiv_mask;
106 u32 dcc_mask;
107 unsigned long dcc_rate;
108 u32 lpmode_mask;
109 u32 m4xen_mask;
110 u8 auto_recal_bit;
111 u8 recal_en_bit;
112 u8 recal_st_bit;
113 u8 flags;
114 };
115
116 struct clk_hw_omap;
117
118
119
120
121
122
123
124
125
126 struct clk_hw_omap_ops {
127 void (*find_idlest)(struct clk_hw_omap *oclk,
128 struct clk_omap_reg *idlest_reg,
129 u8 *idlest_bit, u8 *idlest_val);
130 void (*find_companion)(struct clk_hw_omap *oclk,
131 struct clk_omap_reg *other_reg,
132 u8 *other_bit);
133 void (*allow_idle)(struct clk_hw_omap *oclk);
134 void (*deny_idle)(struct clk_hw_omap *oclk);
135 };
136
137
138
139
140
141
142
143
144
145
146
147
148
149 struct clk_hw_omap {
150 struct clk_hw hw;
151 struct list_head node;
152 unsigned long fixed_rate;
153 u8 fixed_div;
154 struct clk_omap_reg enable_reg;
155 u8 enable_bit;
156 u8 flags;
157 struct clk_omap_reg clksel_reg;
158 struct dpll_data *dpll_data;
159 const char *clkdm_name;
160 struct clockdomain *clkdm;
161 const struct clk_hw_omap_ops *ops;
162 u32 context;
163 int autoidle_count;
164 };
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186 #define ENABLE_REG_32BIT (1 << 0)
187 #define CLOCK_IDLE_CONTROL (1 << 1)
188 #define CLOCK_NO_IDLE_PARENT (1 << 2)
189 #define ENABLE_ON_INIT (1 << 3)
190 #define INVERT_ENABLE (1 << 4)
191 #define CLOCK_CLKOUTX2 (1 << 5)
192
193
194 #define DPLL_LOW_POWER_STOP 0x1
195 #define DPLL_LOW_POWER_BYPASS 0x5
196 #define DPLL_LOCKED 0x7
197
198
199 #define DPLL_J_TYPE 0x1
200
201
202 enum {
203 TI_CLKM_CM = 0,
204 TI_CLKM_CM2,
205 TI_CLKM_PRM,
206 TI_CLKM_SCRM,
207 TI_CLKM_CTRL,
208 TI_CLKM_CTRL_AUX,
209 TI_CLKM_PLLSS,
210 CLK_MAX_MEMMAPS
211 };
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230 struct ti_clk_ll_ops {
231 u32 (*clk_readl)(const struct clk_omap_reg *reg);
232 void (*clk_writel)(u32 val, const struct clk_omap_reg *reg);
233 void (*clk_rmw)(u32 val, u32 mask, const struct clk_omap_reg *reg);
234 int (*clkdm_clk_enable)(struct clockdomain *clkdm, struct clk *clk);
235 int (*clkdm_clk_disable)(struct clockdomain *clkdm,
236 struct clk *clk);
237 struct clockdomain * (*clkdm_lookup)(const char *name);
238 int (*cm_wait_module_ready)(u8 part, s16 prcm_mod, u16 idlest_reg,
239 u8 idlest_shift);
240 int (*cm_split_idlest_reg)(struct clk_omap_reg *idlest_reg,
241 s16 *prcm_inst, u8 *idlest_reg_id);
242 };
243
244 #define to_clk_hw_omap(_hw) container_of(_hw, struct clk_hw_omap, hw)
245
246 bool omap2_clk_is_hw_omap(struct clk_hw *hw);
247 int omap2_clk_disable_autoidle_all(void);
248 int omap2_clk_enable_autoidle_all(void);
249 int omap2_clk_allow_idle(struct clk *clk);
250 int omap2_clk_deny_idle(struct clk *clk);
251 unsigned long omap2_dpllcore_recalc(struct clk_hw *hw,
252 unsigned long parent_rate);
253 int omap2_reprogram_dpllcore(struct clk_hw *clk, unsigned long rate,
254 unsigned long parent_rate);
255 void omap2xxx_clkt_dpllcore_init(struct clk_hw *hw);
256 void omap2xxx_clkt_vps_init(void);
257 unsigned long omap2_get_dpll_rate(struct clk_hw_omap *clk);
258
259 void ti_dt_clk_init_retry_clks(void);
260 void ti_dt_clockdomains_setup(void);
261 int ti_clk_setup_ll_ops(struct ti_clk_ll_ops *ops);
262
263 struct regmap;
264
265 int omap2_clk_provider_init(struct device_node *parent, int index,
266 struct regmap *syscon, void __iomem *mem);
267 void omap2_clk_legacy_provider_init(int index, void __iomem *mem);
268
269 int omap3430_dt_clk_init(void);
270 int omap3630_dt_clk_init(void);
271 int am35xx_dt_clk_init(void);
272 int dm814x_dt_clk_init(void);
273 int dm816x_dt_clk_init(void);
274 int omap4xxx_dt_clk_init(void);
275 int omap5xxx_dt_clk_init(void);
276 int dra7xx_dt_clk_init(void);
277 int am33xx_dt_clk_init(void);
278 int am43xx_dt_clk_init(void);
279 int omap2420_dt_clk_init(void);
280 int omap2430_dt_clk_init(void);
281
282 struct ti_clk_features {
283 u32 flags;
284 long fint_min;
285 long fint_max;
286 long fint_band1_max;
287 long fint_band2_min;
288 u8 dpll_bypass_vals;
289 u8 cm_idlest_val;
290 };
291
292 #define TI_CLK_DPLL_HAS_FREQSEL BIT(0)
293 #define TI_CLK_DPLL4_DENY_REPROGRAM BIT(1)
294 #define TI_CLK_DISABLE_CLKDM_CONTROL BIT(2)
295 #define TI_CLK_ERRATA_I810 BIT(3)
296 #define TI_CLK_CLKCTRL_COMPAT BIT(4)
297 #define TI_CLK_DEVICE_TYPE_GP BIT(5)
298
299 void ti_clk_setup_features(struct ti_clk_features *features);
300 const struct ti_clk_features *ti_clk_get_features(void);
301 int omap3_noncore_dpll_save_context(struct clk_hw *hw);
302 void omap3_noncore_dpll_restore_context(struct clk_hw *hw);
303
304 int omap3_core_dpll_save_context(struct clk_hw *hw);
305 void omap3_core_dpll_restore_context(struct clk_hw *hw);
306
307 extern const struct clk_hw_omap_ops clkhwops_omap2xxx_dpll;
308
309 #ifdef CONFIG_ATAGS
310 int omap3430_clk_legacy_init(void);
311 int omap3430es1_clk_legacy_init(void);
312 int omap36xx_clk_legacy_init(void);
313 int am35xx_clk_legacy_init(void);
314 #else
315 static inline int omap3430_clk_legacy_init(void) { return -ENXIO; }
316 static inline int omap3430es1_clk_legacy_init(void) { return -ENXIO; }
317 static inline int omap36xx_clk_legacy_init(void) { return -ENXIO; }
318 static inline int am35xx_clk_legacy_init(void) { return -ENXIO; }
319 #endif
320
321
322 #endif