|
@@ -299,3 +299,189 @@ void __init omap243x_map_io(void)
|
|
#ifdef CONFIG_ARCH_OMAP3
|
|
#ifdef CONFIG_ARCH_OMAP3
|
|
void __init omap3_map_io(void)
|
|
void __init omap3_map_io(void)
|
|
{
|
|
{
|
|
|
|
+ iotable_init(omap34xx_io_desc, ARRAY_SIZE(omap34xx_io_desc));
|
|
|
|
+}
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
+#ifdef CONFIG_SOC_TI81XX
|
|
|
|
+void __init ti81xx_map_io(void)
|
|
|
|
+{
|
|
|
|
+ iotable_init(omapti81xx_io_desc, ARRAY_SIZE(omapti81xx_io_desc));
|
|
|
|
+}
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
+#ifdef CONFIG_SOC_AM33XX
|
|
|
|
+void __init am33xx_map_io(void)
|
|
|
|
+{
|
|
|
|
+ iotable_init(omapam33xx_io_desc, ARRAY_SIZE(omapam33xx_io_desc));
|
|
|
|
+}
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
+#ifdef CONFIG_ARCH_OMAP4
|
|
|
|
+void __init omap4_map_io(void)
|
|
|
|
+{
|
|
|
|
+ iotable_init(omap44xx_io_desc, ARRAY_SIZE(omap44xx_io_desc));
|
|
|
|
+ omap_barriers_init();
|
|
|
|
+}
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
+#ifdef CONFIG_SOC_OMAP5
|
|
|
|
+void __init omap5_map_io(void)
|
|
|
|
+{
|
|
|
|
+ iotable_init(omap54xx_io_desc, ARRAY_SIZE(omap54xx_io_desc));
|
|
|
|
+}
|
|
|
|
+#endif
|
|
|
|
+/*
|
|
|
|
+ * omap2_init_reprogram_sdrc - reprogram SDRC timing parameters
|
|
|
|
+ *
|
|
|
|
+ * Sets the CORE DPLL3 M2 divider to the same value that it's at
|
|
|
|
+ * currently. This has the effect of setting the SDRC SDRAM AC timing
|
|
|
|
+ * registers to the values currently defined by the kernel. Currently
|
|
|
|
+ * only defined for OMAP3; will return 0 if called on OMAP2. Returns
|
|
|
|
+ * -EINVAL if the dpll3_m2_ck cannot be found, 0 if called on OMAP2,
|
|
|
|
+ * or passes along the return value of clk_set_rate().
|
|
|
|
+ */
|
|
|
|
+static int __init _omap2_init_reprogram_sdrc(void)
|
|
|
|
+{
|
|
|
|
+ struct clk *dpll3_m2_ck;
|
|
|
|
+ int v = -EINVAL;
|
|
|
|
+ long rate;
|
|
|
|
+
|
|
|
|
+ if (!cpu_is_omap34xx())
|
|
|
|
+ return 0;
|
|
|
|
+
|
|
|
|
+ dpll3_m2_ck = clk_get(NULL, "dpll3_m2_ck");
|
|
|
|
+ if (IS_ERR(dpll3_m2_ck))
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
|
|
+ rate = clk_get_rate(dpll3_m2_ck);
|
|
|
|
+ pr_info("Reprogramming SDRC clock to %ld Hz\n", rate);
|
|
|
|
+ v = clk_set_rate(dpll3_m2_ck, rate);
|
|
|
|
+ if (v)
|
|
|
|
+ pr_err("dpll3_m2_clk rate change failed: %d\n", v);
|
|
|
|
+
|
|
|
|
+ clk_put(dpll3_m2_ck);
|
|
|
|
+
|
|
|
|
+ return v;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static int _set_hwmod_postsetup_state(struct omap_hwmod *oh, void *data)
|
|
|
|
+{
|
|
|
|
+ return omap_hwmod_set_postsetup_state(oh, *(u8 *)data);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static void __init omap_hwmod_init_postsetup(void)
|
|
|
|
+{
|
|
|
|
+ u8 postsetup_state;
|
|
|
|
+
|
|
|
|
+ /* Set the default postsetup state for all hwmods */
|
|
|
|
+#ifdef CONFIG_PM_RUNTIME
|
|
|
|
+ postsetup_state = _HWMOD_STATE_IDLE;
|
|
|
|
+#else
|
|
|
|
+ postsetup_state = _HWMOD_STATE_ENABLED;
|
|
|
|
+#endif
|
|
|
|
+ omap_hwmod_for_each(_set_hwmod_postsetup_state, &postsetup_state);
|
|
|
|
+
|
|
|
|
+ omap_pm_if_early_init();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+#ifdef CONFIG_SOC_OMAP2420
|
|
|
|
+void __init omap2420_init_early(void)
|
|
|
|
+{
|
|
|
|
+ omap2_set_globals_tap(OMAP242X_CLASS, OMAP2_L4_IO_ADDRESS(0x48014000));
|
|
|
|
+ omap2_set_globals_sdrc(OMAP2_L3_IO_ADDRESS(OMAP2420_SDRC_BASE),
|
|
|
|
+ OMAP2_L3_IO_ADDRESS(OMAP2420_SMS_BASE));
|
|
|
|
+ omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(OMAP242X_CTRL_BASE),
|
|
|
|
+ NULL);
|
|
|
|
+ omap2_set_globals_prm(OMAP2_L4_IO_ADDRESS(OMAP2420_PRM_BASE));
|
|
|
|
+ omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(OMAP2420_CM_BASE), NULL);
|
|
|
|
+ omap2xxx_check_revision();
|
|
|
|
+ omap2xxx_prm_init();
|
|
|
|
+ omap2xxx_cm_init();
|
|
|
|
+ omap2xxx_voltagedomains_init();
|
|
|
|
+ omap242x_powerdomains_init();
|
|
|
|
+ omap242x_clockdomains_init();
|
|
|
|
+ omap2420_hwmod_init();
|
|
|
|
+ omap_hwmod_init_postsetup();
|
|
|
|
+ omap_clk_init = omap2420_clk_init;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void __init omap2420_init_late(void)
|
|
|
|
+{
|
|
|
|
+ omap_mux_late_init();
|
|
|
|
+ omap2_common_pm_late_init();
|
|
|
|
+ omap2_pm_init();
|
|
|
|
+ omap2_clk_enable_autoidle_all();
|
|
|
|
+}
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
+#ifdef CONFIG_SOC_OMAP2430
|
|
|
|
+void __init omap2430_init_early(void)
|
|
|
|
+{
|
|
|
|
+ omap2_set_globals_tap(OMAP243X_CLASS, OMAP2_L4_IO_ADDRESS(0x4900a000));
|
|
|
|
+ omap2_set_globals_sdrc(OMAP2_L3_IO_ADDRESS(OMAP243X_SDRC_BASE),
|
|
|
|
+ OMAP2_L3_IO_ADDRESS(OMAP243X_SMS_BASE));
|
|
|
|
+ omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(OMAP243X_CTRL_BASE),
|
|
|
|
+ NULL);
|
|
|
|
+ omap2_set_globals_prm(OMAP2_L4_IO_ADDRESS(OMAP2430_PRM_BASE));
|
|
|
|
+ omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(OMAP2430_CM_BASE), NULL);
|
|
|
|
+ omap2xxx_check_revision();
|
|
|
|
+ omap2xxx_prm_init();
|
|
|
|
+ omap2xxx_cm_init();
|
|
|
|
+ omap2xxx_voltagedomains_init();
|
|
|
|
+ omap243x_powerdomains_init();
|
|
|
|
+ omap243x_clockdomains_init();
|
|
|
|
+ omap2430_hwmod_init();
|
|
|
|
+ omap_hwmod_init_postsetup();
|
|
|
|
+ omap_clk_init = omap2430_clk_init;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void __init omap2430_init_late(void)
|
|
|
|
+{
|
|
|
|
+ omap_mux_late_init();
|
|
|
|
+ omap2_common_pm_late_init();
|
|
|
|
+ omap2_pm_init();
|
|
|
|
+ omap2_clk_enable_autoidle_all();
|
|
|
|
+}
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+ * Currently only board-omap3beagle.c should call this because of the
|
|
|
|
+ * same machine_id for 34xx and 36xx beagle.. Will get fixed with DT.
|
|
|
|
+ */
|
|
|
|
+#ifdef CONFIG_ARCH_OMAP3
|
|
|
|
+void __init omap3_init_early(void)
|
|
|
|
+{
|
|
|
|
+ omap2_set_globals_tap(OMAP343X_CLASS, OMAP2_L4_IO_ADDRESS(0x4830A000));
|
|
|
|
+ omap2_set_globals_sdrc(OMAP2_L3_IO_ADDRESS(OMAP343X_SDRC_BASE),
|
|
|
|
+ OMAP2_L3_IO_ADDRESS(OMAP343X_SMS_BASE));
|
|
|
|
+ omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(OMAP343X_CTRL_BASE),
|
|
|
|
+ NULL);
|
|
|
|
+ omap2_set_globals_prm(OMAP2_L4_IO_ADDRESS(OMAP3430_PRM_BASE));
|
|
|
|
+ omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(OMAP3430_CM_BASE), NULL);
|
|
|
|
+ omap3xxx_check_revision();
|
|
|
|
+ omap3xxx_check_features();
|
|
|
|
+ omap3xxx_prm_init();
|
|
|
|
+ omap3xxx_cm_init();
|
|
|
|
+ omap3xxx_voltagedomains_init();
|
|
|
|
+ omap3xxx_powerdomains_init();
|
|
|
|
+ omap3xxx_clockdomains_init();
|
|
|
|
+ omap3xxx_hwmod_init();
|
|
|
|
+ omap_hwmod_init_postsetup();
|
|
|
|
+ omap_clk_init = omap3xxx_clk_init;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void __init omap3430_init_early(void)
|
|
|
|
+{
|
|
|
|
+ omap3_init_early();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void __init omap35xx_init_early(void)
|
|
|
|
+{
|
|
|
|
+ omap3_init_early();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void __init omap3630_init_early(void)
|
|
|
|
+{
|
|
|
|
+ omap3_init_early();
|
|
|
|
+}
|