|
@@ -4090,3 +4090,61 @@ int omap_hwmod_pad_route_irq(struct omap_hwmod *oh, int pad_idx, int irq_idx)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * omap_hwmod_init - initialize the hwmod code
|
|
|
+ *
|
|
|
+ * Sets up some function pointers needed by the hwmod code to operate on the
|
|
|
+ * currently-booted SoC. Intended to be called once during kernel init
|
|
|
+ * before any hwmods are registered. No return value.
|
|
|
+ */
|
|
|
+void __init omap_hwmod_init(void)
|
|
|
+{
|
|
|
+ if (cpu_is_omap24xx()) {
|
|
|
+ soc_ops.wait_target_ready = _omap2xxx_wait_target_ready;
|
|
|
+ soc_ops.assert_hardreset = _omap2_assert_hardreset;
|
|
|
+ soc_ops.deassert_hardreset = _omap2_deassert_hardreset;
|
|
|
+ soc_ops.is_hardreset_asserted = _omap2_is_hardreset_asserted;
|
|
|
+ } else if (cpu_is_omap34xx()) {
|
|
|
+ soc_ops.wait_target_ready = _omap3xxx_wait_target_ready;
|
|
|
+ soc_ops.assert_hardreset = _omap2_assert_hardreset;
|
|
|
+ soc_ops.deassert_hardreset = _omap2_deassert_hardreset;
|
|
|
+ soc_ops.is_hardreset_asserted = _omap2_is_hardreset_asserted;
|
|
|
+ } else if (cpu_is_omap44xx() || soc_is_omap54xx()) {
|
|
|
+ soc_ops.enable_module = _omap4_enable_module;
|
|
|
+ soc_ops.disable_module = _omap4_disable_module;
|
|
|
+ soc_ops.wait_target_ready = _omap4_wait_target_ready;
|
|
|
+ soc_ops.assert_hardreset = _omap4_assert_hardreset;
|
|
|
+ soc_ops.deassert_hardreset = _omap4_deassert_hardreset;
|
|
|
+ soc_ops.is_hardreset_asserted = _omap4_is_hardreset_asserted;
|
|
|
+ soc_ops.init_clkdm = _init_clkdm;
|
|
|
+ soc_ops.update_context_lost = _omap4_update_context_lost;
|
|
|
+ soc_ops.get_context_lost = _omap4_get_context_lost;
|
|
|
+ } else if (soc_is_am33xx()) {
|
|
|
+ soc_ops.enable_module = _am33xx_enable_module;
|
|
|
+ soc_ops.disable_module = _am33xx_disable_module;
|
|
|
+ soc_ops.wait_target_ready = _am33xx_wait_target_ready;
|
|
|
+ soc_ops.assert_hardreset = _am33xx_assert_hardreset;
|
|
|
+ soc_ops.deassert_hardreset = _am33xx_deassert_hardreset;
|
|
|
+ soc_ops.is_hardreset_asserted = _am33xx_is_hardreset_asserted;
|
|
|
+ soc_ops.init_clkdm = _init_clkdm;
|
|
|
+ } else {
|
|
|
+ WARN(1, "omap_hwmod: unknown SoC type\n");
|
|
|
+ }
|
|
|
+
|
|
|
+ inited = true;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * omap_hwmod_get_main_clk - get pointer to main clock name
|
|
|
+ * @oh: struct omap_hwmod *
|
|
|
+ *
|
|
|
+ * Returns the main clock name assocated with @oh upon success,
|
|
|
+ * or NULL if @oh is NULL.
|
|
|
+ */
|
|
|
+const char *omap_hwmod_get_main_clk(struct omap_hwmod *oh)
|
|
|
+{
|
|
|
+ if (!oh)
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ return oh->main_clk;
|
|
|
+}
|