Skip to contentSkip to conversation

OMAP clock/hwmod fixes for 2.6.34-rc

PATCH New Paul Walmsley 1 participant 5 messages Mar 30, 2010

Subsystems (5)
lore
Share & tools
lore

Paul Walmsley

author maintainer
#0 lore raw

cover OMAP clock/hwmod fixes for 2.6.34-rc

Hi,

here are some OMAP clock and hwmod fix patches that we're planning to send upstream soon; comments welcome.

- Paul

---

Rajendra Nayak (1):
OMAP4: prcm: Use logical OR instead of bitwise OR

Ranjith Lohithakshan (1):
OMAP3: clock: fix enable bit used for dpll4_m4x2 clock

Thara Gopinath (2):
OMAP: HWMOD: Adding clockdomain check
OMAP: HWMOD: Bug fixes in hwmod structure definitions

 arch/arm/mach-omap2/clock3xxx_data.c         |    2 +-
 arch/arm/mach-omap2/clockdomain.c            |    6 +++---
 arch/arm/mach-omap2/omap_hwmod.c             |    3 +++
 arch/arm/mach-omap2/powerdomain.c            |    2 +-
 arch/arm/mach-omap2/prcm.c                   |    4 ++--
 arch/arm/plat-omap/include/plat/omap_hwmod.h |    2 +-
 6 files changed, 11 insertions(+), 8 deletions(-)
author maintainer
#1 lore raw

PATCH 1/4 OMAP: HWMOD: Adding clockdomain check

From: Thara Gopinath <[email protected]>

This patch adds check for presence of clockdomain structure in the API omap_hwmod_get_pwrdm before trying to access the powerdomain structure. This will prevent unnecessary crashing of the system in case of a clock node with out an associated clockdomain.

---
 arch/arm/mach-omap2/omap_hwmod.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/omap_hwmod.c +3 -0
index c664947..e436dcb 100644
@@ -1511,6 +1511,9 @@ struct powerdomain *omap_hwmod_get_pwrdm(struct omap_hwmod *oh)
 		c = oh->slaves[oh->_mpu_port_index]->_clk;
 	}
 
+	if (!c->clkdm)
+		return NULL;
+
 	return c->clkdm->pwrdm.ptr;
 
 }
author maintainer
#2 lore raw

PATCH 2/4 OMAP: HWMOD: Bug fixes in hwmod structure definitions

In reply to Paul Walmsley

From: Thara Gopinath <[email protected]>

This patch corrects the width of sysc_flags in hwmod sysconfig structure where the values to be stored to this variable exceed the current field width.

[paul at pwsan.com: edited to apply; rearranged structure members to pack]
---
 arch/arm/plat-omap/include/plat/omap_hwmod.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/plat-omap/include/plat/omap_hwmod.h +1 -1
index 440b416..36d6ea5 100644
@@ -294,8 +294,8 @@ struct omap_hwmod_class_sysconfig {
 	u16 rev_offs;
 	u16 sysc_offs;
 	u16 syss_offs;
+	u16 sysc_flags;
 	u8 idlemodes;
-	u8 sysc_flags;
 	u8 clockact;
 	struct omap_hwmod_sysc_fields *sysc_fields;
 };
author maintainer
#3 lore raw

PATCH 3/4 OMAP4: prcm: Use logical OR instead of bitwise OR

In reply to Paul Walmsley

From: Rajendra Nayak <[email protected]>

This patch fixes usage of bitwise OR in if conditions, and instead uses logical OR.

---
 arch/arm/mach-omap2/clockdomain.c |    6 +++---
 arch/arm/mach-omap2/powerdomain.c |    2 +-
 arch/arm/mach-omap2/prcm.c        |    4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)
arch/arm/mach-omap2/clockdomain.c +3 -3
index b87ad66..6e568ec 100644
@@ -240,7 +240,7 @@ static void _omap2_clkdm_set_hwsup(struct clockdomain *clkdm, int enable)
 			bits = OMAP24XX_CLKSTCTRL_ENABLE_AUTO;
 		else
 			bits = OMAP24XX_CLKSTCTRL_DISABLE_AUTO;
-	} else if (cpu_is_omap34xx() | cpu_is_omap44xx()) {
+	} else if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
 		if (enable)
 			bits = OMAP34XX_CLKSTCTRL_ENABLE_AUTO;
 		else
@@ -812,7 +812,7 @@ int omap2_clkdm_sleep(struct clockdomain *clkdm)
 		cm_set_mod_reg_bits(OMAP24XX_FORCESTATE,
 			    clkdm->pwrdm.ptr->prcm_offs, OMAP2_PM_PWSTCTRL);
 
-	} else if (cpu_is_omap34xx() | cpu_is_omap44xx()) {
+	} else if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
 
 		u32 bits = (OMAP34XX_CLKSTCTRL_FORCE_SLEEP <<
 			 __ffs(clkdm->clktrctrl_mask));
@@ -856,7 +856,7 @@ int omap2_clkdm_wakeup(struct clockdomain *clkdm)
 		cm_clear_mod_reg_bits(OMAP24XX_FORCESTATE,
 			      clkdm->pwrdm.ptr->prcm_offs, OMAP2_PM_PWSTCTRL);
 
-	} else if (cpu_is_omap34xx() | cpu_is_omap44xx()) {
+	} else if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
 
 		u32 bits = (OMAP34XX_CLKSTCTRL_FORCE_WAKEUP <<
 			 __ffs(clkdm->clktrctrl_mask));
arch/arm/mach-omap2/powerdomain.c +1 -1
index 9a0fb38..ebfce7d 100644
@@ -222,7 +222,7 @@ void pwrdm_init(struct powerdomain **pwrdm_list)
 {
 	struct powerdomain **p = NULL;
 
-	if (cpu_is_omap24xx() | cpu_is_omap34xx()) {
+	if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
 		pwrstctrl_reg_offs = OMAP2_PM_PWSTCTRL;
 		pwrstst_reg_offs = OMAP2_PM_PWSTST;
 	} else if (cpu_is_omap44xx()) {
arch/arm/mach-omap2/prcm.c +2 -2
index 81872aa..fc3fd38 100644
@@ -123,7 +123,7 @@ struct omap3_prcm_regs prcm_context;
 u32 omap_prcm_get_reset_sources(void)
 {
 	/* XXX This presumably needs modification for 34XX */
-	if (cpu_is_omap24xx() | cpu_is_omap34xx())
+	if (cpu_is_omap24xx() || cpu_is_omap34xx())
 		return prm_read_mod_reg(WKUP_MOD, OMAP2_RM_RSTST) & 0x7f;
 	if (cpu_is_omap44xx())
 		return prm_read_mod_reg(WKUP_MOD, OMAP4_RM_RSTST) & 0x7f;
@@ -157,7 +157,7 @@ void omap_prcm_arch_reset(char mode)
 	else
 		WARN_ON(1);
 
-	if (cpu_is_omap24xx() | cpu_is_omap34xx())
+	if (cpu_is_omap24xx() || cpu_is_omap34xx())
 		prm_set_mod_reg_bits(OMAP_RST_DPLL3, prcm_offs,
 						 OMAP2_RM_RSTCTRL);
 	if (cpu_is_omap44xx())
author maintainer
#4 lore raw

PATCH 4/4 OMAP3: clock: fix enable bit used for dpll4_m4x2 clock

In reply to Paul Walmsley

From: Ranjith Lohithakshan <[email protected]>

The enable bit for dpll4_m4x2 clock should be OMAP3430_PWRDN_DSS1_SHIFT. The code erroneously uses OMAP3430_PWRDN_CAM_SHIFT which is meant for dpll4_m5x2 clock.

This came into notice during a recent review of the clock tree.

---
 arch/arm/mach-omap2/clock3xxx_data.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/clock3xxx_data.c +1 -1
index d5153b6..9cba556 100644
@@ -895,7 +895,7 @@ static struct clk dpll4_m4x2_ck = {
 	.ops		= &clkops_omap2_dflt_wait,
 	.parent		= &dpll4_m4_ck,
 	.enable_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
-	.enable_bit	= OMAP3430_PWRDN_CAM_SHIFT,
+	.enable_bit	= OMAP3430_PWRDN_DSS1_SHIFT,
 	.flags		= INVERT_ENABLE,
 	.clkdm_name	= "dpll4_clkdm",
 	.recalc		= &omap3_clkoutx2_recalc,