|
@@ -3017,3 +3017,80 @@ static int _omap4_is_hardreset_asserted(struct omap_hwmod *oh,
|
|
|
* function is scheduled for removal when the PRM code is moved into
|
|
|
* drivers/.
|
|
|
*/
|
|
|
+static int _am33xx_assert_hardreset(struct omap_hwmod *oh,
|
|
|
+ struct omap_hwmod_rst_info *ohri)
|
|
|
+
|
|
|
+{
|
|
|
+ return am33xx_prm_assert_hardreset(ohri->rst_shift,
|
|
|
+ oh->clkdm->pwrdm.ptr->prcm_offs,
|
|
|
+ oh->prcm.omap4.rstctrl_offs);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * _am33xx_deassert_hardreset - call AM33XX PRM hardreset fn with hwmod args
|
|
|
+ * @oh: struct omap_hwmod * to deassert hardreset
|
|
|
+ * @ohri: hardreset line data
|
|
|
+ *
|
|
|
+ * Call am33xx_prminst_deassert_hardreset() with parameters extracted
|
|
|
+ * from the hwmod @oh and the hardreset line data @ohri. Only
|
|
|
+ * intended for use as an soc_ops function pointer. Passes along the
|
|
|
+ * return value from am33xx_prminst_deassert_hardreset(). XXX This
|
|
|
+ * function is scheduled for removal when the PRM code is moved into
|
|
|
+ * drivers/.
|
|
|
+ */
|
|
|
+static int _am33xx_deassert_hardreset(struct omap_hwmod *oh,
|
|
|
+ struct omap_hwmod_rst_info *ohri)
|
|
|
+{
|
|
|
+ if (ohri->st_shift)
|
|
|
+ pr_err("omap_hwmod: %s: %s: hwmod data error: OMAP4 does not support st_shift\n",
|
|
|
+ oh->name, ohri->name);
|
|
|
+
|
|
|
+ return am33xx_prm_deassert_hardreset(ohri->rst_shift,
|
|
|
+ oh->clkdm->pwrdm.ptr->prcm_offs,
|
|
|
+ oh->prcm.omap4.rstctrl_offs,
|
|
|
+ oh->prcm.omap4.rstst_offs);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * _am33xx_is_hardreset_asserted - call AM33XX PRM hardreset fn with hwmod args
|
|
|
+ * @oh: struct omap_hwmod * to test hardreset
|
|
|
+ * @ohri: hardreset line data
|
|
|
+ *
|
|
|
+ * Call am33xx_prminst_is_hardreset_asserted() with parameters
|
|
|
+ * extracted from the hwmod @oh and the hardreset line data @ohri.
|
|
|
+ * Only intended for use as an soc_ops function pointer. Passes along
|
|
|
+ * the return value from am33xx_prminst_is_hardreset_asserted(). XXX
|
|
|
+ * This function is scheduled for removal when the PRM code is moved
|
|
|
+ * into drivers/.
|
|
|
+ */
|
|
|
+static int _am33xx_is_hardreset_asserted(struct omap_hwmod *oh,
|
|
|
+ struct omap_hwmod_rst_info *ohri)
|
|
|
+{
|
|
|
+ return am33xx_prm_is_hardreset_asserted(ohri->rst_shift,
|
|
|
+ oh->clkdm->pwrdm.ptr->prcm_offs,
|
|
|
+ oh->prcm.omap4.rstctrl_offs);
|
|
|
+}
|
|
|
+
|
|
|
+/* Public functions */
|
|
|
+
|
|
|
+u32 omap_hwmod_read(struct omap_hwmod *oh, u16 reg_offs)
|
|
|
+{
|
|
|
+ if (oh->flags & HWMOD_16BIT_REG)
|
|
|
+ return __raw_readw(oh->_mpu_rt_va + reg_offs);
|
|
|
+ else
|
|
|
+ return __raw_readl(oh->_mpu_rt_va + reg_offs);
|
|
|
+}
|
|
|
+
|
|
|
+void omap_hwmod_write(u32 v, struct omap_hwmod *oh, u16 reg_offs)
|
|
|
+{
|
|
|
+ if (oh->flags & HWMOD_16BIT_REG)
|
|
|
+ __raw_writew(v, oh->_mpu_rt_va + reg_offs);
|
|
|
+ else
|
|
|
+ __raw_writel(v, oh->_mpu_rt_va + reg_offs);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * omap_hwmod_softreset - reset a module via SYSCONFIG.SOFTRESET bit
|
|
|
+ * @oh: struct omap_hwmod *
|
|
|
+ *
|
|
|
+ * This is a public function exposed to drivers. Some drivers may need to do
|