Lines Matching +full:per +full:- +full:soc
1 // SPDX-License-Identifier: GPL-2.0-only
25 * cm_ll_data: function pointers to SoC-specific implementations of
41 * omap2_set_globals_cm - set the CM/CM2 base addresses (for early use)
43 * @cm2: CM2 base virtual address (if present on the booted SoC)
54 * cm_split_idlest_reg - split CM_IDLEST reg addr into its components
61 * via the @prcm_inst and @idlest_reg_id. Returns -EINVAL upon error,
69 if (!cm_ll_data->split_idlest_reg) { in cm_split_idlest_reg()
70 WARN_ONCE(1, "cm: %s: no low-level function defined\n", in cm_split_idlest_reg()
72 return -EINVAL; in cm_split_idlest_reg()
75 ret = cm_ll_data->split_idlest_reg(idlest_reg, prcm_inst, in cm_split_idlest_reg()
77 *prcm_inst -= cm_base.offset; in cm_split_idlest_reg()
82 * omap_cm_wait_module_ready - wait for a module to leave idle or standby
90 * success, -EBUSY if the module doesn't enable in time, or -EINVAL if
91 * no per-SoC wait_module_ready() function pointer has been registered
92 * or if the idlest register is unknown on the SoC.
97 if (!cm_ll_data->wait_module_ready) { in omap_cm_wait_module_ready()
98 WARN_ONCE(1, "cm: %s: no low-level function defined\n", in omap_cm_wait_module_ready()
100 return -EINVAL; in omap_cm_wait_module_ready()
103 return cm_ll_data->wait_module_ready(part, prcm_mod, idlest_reg, in omap_cm_wait_module_ready()
108 * omap_cm_wait_module_idle - wait for a module to enter idle or standby
116 * 0 upon success, -EBUSY if the module doesn't enable in time, or
117 * -EINVAL if no per-SoC wait_module_idle() function pointer has been
118 * registered or if the idlest register is unknown on the SoC.
123 if (!cm_ll_data->wait_module_idle) { in omap_cm_wait_module_idle()
124 WARN_ONCE(1, "cm: %s: no low-level function defined\n", in omap_cm_wait_module_idle()
126 return -EINVAL; in omap_cm_wait_module_idle()
129 return cm_ll_data->wait_module_idle(part, prcm_mod, idlest_reg, in omap_cm_wait_module_idle()
134 * omap_cm_module_enable - enable a module
141 * making its IO space accessible. Return 0 upon success, -EINVAL if no
142 * per-SoC module_enable() function pointer has been registered.
146 if (!cm_ll_data->module_enable) { in omap_cm_module_enable()
147 WARN_ONCE(1, "cm: %s: no low-level function defined\n", in omap_cm_module_enable()
149 return -EINVAL; in omap_cm_module_enable()
152 cm_ll_data->module_enable(mode, part, inst, clkctrl_offs); in omap_cm_module_enable()
157 * omap_cm_module_disable - disable a module
163 * makings its IO space inaccessible. Return 0 upon success, -EINVAL if
164 * no per-SoC module_disable() function pointer has been registered.
168 if (!cm_ll_data->module_disable) { in omap_cm_module_disable()
169 WARN_ONCE(1, "cm: %s: no low-level function defined\n", in omap_cm_module_disable()
171 return -EINVAL; in omap_cm_module_disable()
174 cm_ll_data->module_disable(part, inst, clkctrl_offs); in omap_cm_module_disable()
180 if (!cm_ll_data->xlate_clkctrl) { in omap_cm_xlate_clkctrl()
181 WARN_ONCE(1, "cm: %s: no low-level function defined\n", in omap_cm_xlate_clkctrl()
185 return cm_ll_data->xlate_clkctrl(part, inst, clkctrl_offs); in omap_cm_xlate_clkctrl()
189 * cm_register - register per-SoC low-level data with the CM
190 * @cld: low-level per-SoC OMAP CM data & function pointers to register
192 * Register per-SoC low-level OMAP CM data and function pointers with
195 * it returns successfully. Returns 0 upon success, -EINVAL if @cld
196 * is NULL, or -EEXIST if cm_register() has already been called
202 return -EINVAL; in cm_register()
205 return -EEXIST; in cm_register()
213 * cm_unregister - unregister per-SoC low-level data & function pointers
214 * @cld: low-level per-SoC OMAP CM data & function pointers to unregister
216 * Unregister per-SoC low-level OMAP CM data and function pointers
220 * -EINVAL if @cld is NULL or if @cld does not match the struct
226 return -EINVAL; in cm_unregister()
264 .offset = -OMAP3430_IVA2_MOD,
286 { .compatible = "ti,omap2-prcm", .data = &omap2_prcm_data },
289 { .compatible = "ti,omap3-cm", .data = &omap3_cm_data },
292 { .compatible = "ti,omap4-cm1", .data = &cm_data },
293 { .compatible = "ti,omap4-cm2", .data = &cm2_data },
296 { .compatible = "ti,omap5-cm-core-aon", .data = &cm_data },
297 { .compatible = "ti,omap5-cm-core", .data = &cm2_data },
300 { .compatible = "ti,dra7-cm-core-aon", .data = &cm_data },
301 { .compatible = "ti,dra7-cm-core", .data = &cm2_data },
304 { .compatible = "ti,am3-prcm", .data = &am3_prcm_data },
307 { .compatible = "ti,am4-prcm", .data = &am4_prcm_data },
310 { .compatible = "ti,dm814-prcm", .data = &am3_prcm_data },
311 { .compatible = "ti,dm816-prcm", .data = &am3_prcm_data },
317 * omap2_cm_base_init - initialize iomappings for the CM drivers
333 data = (struct omap_prcm_init_data *)match->data; in omap2_cm_base_init()
339 if (data->index == TI_CLKM_CM) in omap2_cm_base_init()
342 if (data->index == TI_CLKM_CM2) in omap2_cm_base_init()
345 data->mem = ioremap(res.start, resource_size(&res)); in omap2_cm_base_init()
348 mem->pa = res.start + data->offset; in omap2_cm_base_init()
349 mem->va = data->mem + data->offset; in omap2_cm_base_init()
350 mem->offset = data->offset; in omap2_cm_base_init()
353 data->np = np; in omap2_cm_base_init()
355 if (data->init && (data->flags & CM_SINGLE_INSTANCE || in omap2_cm_base_init()
357 data->init(data); in omap2_cm_base_init()
364 * omap_cm_init - low level init for the CM drivers
377 data = match->data; in omap_cm_init()
379 if (data->flags & CM_NO_CLOCKS) in omap_cm_init()
382 ret = omap2_clk_provider_init(np, data->index, NULL, data->mem); in omap_cm_init()