different bit position than the usual bit positions 8 and 9. This patch
introduces a flag SYSC_CHANGE_CLKACT_OFFSET which if specified the hwmod driver
takes the bit position of clockactivity bits from clockact_offs specified as
part of omap_hwmod_sysconfig. Else the default positions are used.
Signed-off-by: Thara Gopinath <thara@ti.com>
---
arch/arm/mach-omap2/omap_hwmod.c | 14 ++++++++++++--
arch/arm/plat-omap/include/plat/omap_hwmod.h | 26 +++++++++++++++++---------
2 files changed, 29 insertions(+), 11 deletions(-)
@@ -180,12 +180,22 @@ static int _set_slave_idlemode(struct omap_hwmod *oh, u8 idlemode, u32 *v)
*/
static int _set_clockactivity(struct omap_hwmod *oh, u8 clockact, u32 *v)
{
+ u32 clkact_mask;
+ u8 clkact_shift;
+
if (!oh->sysconfig ||
!(oh->sysconfig->sysc_flags & SYSC_HAS_CLOCKACTIVITY))
return -EINVAL;
- *v &= ~SYSC_CLOCKACTIVITY_MASK;
- *v |= clockact << SYSC_CLOCKACTIVITY_SHIFT;
+ if (oh->sysconfig->sysc_flags & SYSC_CHANGE_CLKACT_OFFSET) {
+ clkact_shift = oh->sysconfig->clockact_offs;
+ clkact_mask = (0x3 << clkact_shift);
+ } else {
+ clkact_shift = SYSC_CLOCKACTIVITY_SHIFT;
+ clkact_mask = SYSC_CLOCKACTIVITY_MASK;
+ }
+ *v &= ~clkact_mask;
+ *v |= clockact << clkact_shift;
return 0;
}
@@ -203,14 +203,15 @@ struct omap_hwmod_ocp_if {
#define MSTANDBY_SMART (HWMOD_IDLEMODE_SMART << MASTER_STANDBY_SHIFT)
/* omap_hwmod_sysconfig.sysc_flags capability flags */
-#define SYSC_HAS_AUTOIDLE (1 << 0)
-#define SYSC_HAS_SOFTRESET (1 << 1)
-#define SYSC_HAS_ENAWAKEUP (1 << 2)
-#define SYSC_HAS_EMUFREE (1 << 3)
-#define SYSC_HAS_CLOCKACTIVITY (1 << 4)
-#define SYSC_HAS_SIDLEMODE (1 << 5)
-#define SYSC_HAS_MIDLEMODE (1 << 6)
-#define SYSS_MISSING (1 << 7)
+#define SYSC_HAS_AUTOIDLE (1 << 0)
+#define SYSC_HAS_SOFTRESET (1 << 1)
+#define SYSC_HAS_ENAWAKEUP (1 << 2)
+#define SYSC_HAS_EMUFREE (1 << 3)
+#define SYSC_HAS_CLOCKACTIVITY (1 << 4)
+#define SYSC_HAS_SIDLEMODE (1 << 5)
+#define SYSC_HAS_MIDLEMODE (1 << 6)
+#define SYSS_MISSING (1 << 7)
+#define SYSC_CHANGE_CLKACT_OFFSET (1 << 8)
/* omap_hwmod_sysconfig.clockact flags */
#define CLOCKACT_TEST_BOTH 0x0
@@ -235,14 +236,21 @@ struct omap_hwmod_ocp_if {
* been associated with the clocks marked in @clockact. This field is
* only used if HWMOD_SET_DEFAULT_CLOCKACT is set (see below)
*
+ * @clockact_offs: the position of clock activity bits in this register.
+ * @clockact_offs defines the position of clockactivity bits in the sysconfig
+ * register. Some modules like Smartreflex in 3430 has a different position for
+ * clockactivity bit than the default. This field will be used only if
+ * SYSC_CHANGE_CLKACT_OFFSET is set. Else the default position is assumed for
+ * these bits
*/
struct omap_hwmod_sysconfig {
u16 rev_offs;
u16 sysc_offs;
u16 syss_offs;
u8 idlemodes;
- u8 sysc_flags;
+ u16 sysc_flags;
u8 clockact;
+ u8 clockact_offs;
};
/**